Skip to end of metadata
Go to start of metadata

Here are some notes to help with the installation process of glpk-java on a new Mac Mini with Mac OS 10.7.4 (Lion)

Helpful links include:

Installation Procedure

  1. From the Mac Developers Site, install Xcode
    • Version used here is Xcode 4.3.2 for Lion
  2. From the Mac Developers Site, install Command Line Tools
    • Version used here is Command Line Tools for Xcode - Late March 2012
  3. Install Macports
    • Follow instructions here – I recommend use of the .pkg package installation method
    • You'll need Macports to install glpk and swig and swig-java
  4. Install necessary packages
    • $ sudo port install glpk
    • $ sudo port install swig
    • $ sudo port install swig-java
      • For java.swg
  5. Download and unzip glpk-java (web site, download link)
    • Version as of this writing is libglpk-java-1.0.21
  6. Make sure the JAVA_HOME environment variable is appropriately set in ~/.profile
    • # Setting JAVA_HOME
      export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
  7. Make sure the additional flags (in environment variables) are also set in ~/.profile
    • # Setting compiler and swig flags
      export CPPFLAGS="-I/System/Library/Frameworks/JavaVM.framework/Headers -I/opt/local/include"
      export SWIGFLAGS="-I/System/Library/Frameworks/JavaVM.framework/Headers -I/opt/local/include $SWIGFLAGS"
      • If this doesn't work, you can put these flags in configure.ac in the glpk-java source and re-run autoconf (some helpful notes here) to generate the configure script
  8. Run configure in the glpk-java source directory
    • $ ./configure
      • Check for potential warnings
      • For trouble spots, see the Troubleshooting section
  9. Run make
    • $ make
      • Need to be connected to the net (to download some maven repository/dependency files)
      • For trouble spots, see the Troubleshooting section
  10. Run make check and look for errors
  11. Run $ sudo make install
  12. Use the Test.java example program to test your installation.

Troubleshooting

  • Problem: Unable to find glpk.h during configure step
    • Solution:
      • Check that the CPPFLAGS contains the path to the correct location, i.e., /opt/local/include
  • Problem: Unable to find jni.h during configure step
    • Solution:
      • Check that the CPPFLAGS contains the path to the correct location, i.e., /System/Library/Frameworks/JavaVM.framework/Headers
  • Problem: Unable to find java.swg
    • Solution:
      • Need to install swig-java, which you can do via Macports (i.e., $ sudo port install swig-java)
  • Problem: SVN certificate authentication error during make step, including the following error message (full message snippet here):
    ERROR svn: OPTIONS of 'https://glpk-java.svn.sourceforge.net/svnroot/glpk-java': Server certificate verification failed: issuer is not trusted (https://glpk-java.svn.sourceforge.net)
  • Problem: Maven download of doxia-site-renderer fails during make step (full error message snippet here)
    • Solution:
      • Need to go into /swig/pom.xml and change the version number from
        <version>1.3-SNAPSHOT</version> to <version>1.1.4</version>
      • I think this is the latest version or so, but even if not, this seemed to work.
  • No labels