Linking glpk with or-tools on unix

Following the change on SCIP, here is the new procedure to compile and link GLPK with or-tools

This currently applies to unix only:

First download the latest glpk archive (4.61 at the time of this post).

Untar, cd into the glpk directory

on linux:
  ./configure --prefix=<install_path> --with-pic
  make install

on mac OS X:
  ./configure --prefix=<install_path>
  make CFLAGS='--mmacosx-version-min=10.8'
  make install
then add:
  UNIX_GLPK_DIR=<install_path> in or-tools/Makefile.local

recompile or-tools:
  make clean
  make cc

test it:
  run bin/integer_programming and bin/linear_programming. Both must display glpk runs.

I have no easy solution for glpk on windows currently, still investigating.


  1. Step 2 on macOS Sierra gives me an error, this is the output:
    /Library/Developer/CommandLineTools/usr/bin/make all-recursive
    Making all in src
    /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I./amd -I./api -I./bflib -I./cglib -I./colamd -I./env -I./minisat -I./misc -I./mpl -I./proxy -I./simplex -I./zlib --mmacosx-version-min=10.8 -MT libglpk_la-bfd.lo -MD -MP -MF .deps/libglpk_la-bfd.Tpo -c -o libglpk_la-bfd.lo `test -f 'bfd.c' || echo './'`bfd.c
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I./amd -I./api -I./bflib -I./cglib -I./colamd -I./env -I./minisat -I./misc -I./mpl -I./proxy -I./simplex -I./zlib --mmacosx-version-min=10.8 -MT libglpk_la-bfd.lo -MD -MP -MF .deps/libglpk_la-bfd.Tpo -c bfd.c -fno-common -DPIC -o .libs/libglpk_la-bfd.o
    clang: error: unsupported option '--mmacosx-version-min=10.8'
    make[2]: *** [libglpk_la-bfd.lo] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2

    1. Solved! The error is in your command above: the correct option is '-mmacos-version-min' with only one '-' and not '--mmacos-version-min'.



Post a Comment

Popular posts from this blog

Heads up, upcoming incompatibility in the CP/Routing library

Documentation: new examples and reference manual

Changes in the last month - on windows this time