Skip to content

Commit

Permalink
Bumped GLPK version to 4.47 (closes #932)
Browse files Browse the repository at this point in the history
After this commit:
 1) call make in the main julia dir
 2) remove extras/glpk_h.jl
 3) call make in extras/
  • Loading branch information
carlobaldassi committed Jul 3, 2012
1 parent 69138a5 commit ee9933f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CLP_VER = 1.14.5
UNWIND_VER = 1.0.1
LIGHTTPD_VER = 1.4.29
GMP_VER=5.0.5
GLPK_VER = 4.43
GLPK_VER = 4.47

## high-level setup ##

Expand Down
28 changes: 22 additions & 6 deletions doc/stdlib/glpk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ It is designed for making it easy to port C code to Julia, while at the same tim
benefits of the higher level language features of Julia, like the automatic management of memory, the possibility
of returning tuples/strings/vectors etc.

It's currently based on GLPK version 4.47.

.. contents::
:local:

Expand All @@ -19,6 +21,8 @@ Preamble

Almost all GLPK functions can be called in Julia with the same syntax as in the original C library,
with some simple translation rules (with very :ref:`few exceptions <glpk-different-than-C>`).
Some functionality is still missing (see :ref:`this list <glpk-not-available>`); most of it will be
added in the future.

Let's start with an example. This is an excerpt from the beginning of the :file:`sample.c` example program
which ships with GLPK:
Expand Down Expand Up @@ -205,10 +209,11 @@ over to the library, so that all errors could be catched via a ``try ... catch``
in practice, it is likely that some conditions exist which will leak to the C API and break Julia: this should be
considered as a bug (and reported as such).

.. _glpk-not-available:

-----------------------------------------------
GLPK functions which are not avaliable in Julia
-----------------------------------------------
---------------------------------------------------
GLPK functions which are not avaliable yet in Julia
---------------------------------------------------

In general, all parts of the GLPK API which rely on callback functions are not avaliable in Julia.
In particular, you should not set the callback fields (``cb_func`` and ``cb_info``) in the ``GLPIntoptParam``
Expand All @@ -221,7 +226,17 @@ There are 4 groups of functions which are not wrapped:

* ``glp_ios_*``

2. Some misc functions which either have a variable argument list or involve callbacks (see section 6.1 in the GLPK
2. All graph and network routines (anything involving ``glp_graph`` objects); these will be added in the future)

3. All CNF-related routines; these will be added in the future:

* ``glp_read_cnfsat``
* ``glp_check_cnfsat``
* ``glp_write_cnfsat``
* ``glp_minisat1``
* ``glp_intfeas1``

4. Some misc functions which either have a variable argument list or involve callbacks (see section 6.1 in the GLPK
manual):

* ``glp_printf``
Expand All @@ -231,13 +246,14 @@ There are 4 groups of functions which are not wrapped:
* ``glp_assert``
* ``glp_error_hook``

3. Some plain data file reading routines which involve long jumps / varargs (see section 6.2 in the GLPK manual):
5. Some plain data file reading routines which involve long jumps / varargs (see section 6.2 in the GLPK manual):

* ``glp_sdf_set_jump``
* ``glp_sdf_error``
* ``glp_sdf_warning``

4. One additional routine, which may be included in the future:

6. One additional routine, which may be included in the future:

* ``lpx_check_kkt``

Expand Down
6 changes: 3 additions & 3 deletions extras/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include $(JULIAHOME)/Make.inc

all: glpk_h.jl julia_message_types_h.jl

GLPK_VER = 4.43
GLPK_VER = 4.47

GLPK_CONST = 0x[0-9a-fA-F]+|[-+]?\s*[0-9]+

Expand All @@ -14,10 +14,10 @@ GLPK_PREFIX = $(JULIAHOME)/deps/glpk-$(GLPK_VER)/
endif

glpk_h.jl:
$(QUIET_PERL) cpp -dM $(GLPK_PREFIX)/include/glpk.h | perl -nle '/^\s*#define\s+(GLP\w*)\s*\(?($(GLPK_CONST))\)?\s*$$/ and print "const $$1 = int32($$2)"' | sort > $@
$(QUIET_PERL) cpp -dM $(GLPK_PREFIX)/src/glpk.h | perl -nle '/^\s*#define\s+(GLP\w*)\s*\(?($(GLPK_CONST))\)?\s*$$/ and print "const $$1 = int32($$2)"' | sort > $@

julia_message_types_h.jl:
$(QUIET_PERL) cpp -Dnotdefined ../ui/webserver/message_types.h > $@

clean:
rm -f glpk_h.jl julia_message_types_h.jl
rm -f glpk_h.jl julia_message_types_h.jl

3 comments on commit ee9933f

@carlobaldassi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops, it should have closed #923

@ViralBShah
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build fails with:


glpk_wrapper.c:3:10: fatal error: 'glpk.h' file not found
#include <glpk.h>
         ^
1 error generated.
make[2]: *** [/Users/viral/julia-branches/usr/lib/libglpk_wrapper.dylib] Error 1

@carlobaldassi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Please sign in to comment.