Installing GLPK on a Mac

programming

So you want copy-paste instructions to install GLPK on your Macbook? Here are the steps:

  1. Download the latest version of GLPK from http://www.gnu.org/software/glpk/#downloading
  2. Optional: Follow the instructions to verify the download (you might need to get GNU Privacy Guard or gpg for this. You can get it at http://gnupg.org)
  3. Say it’s downloaded to your “Downloads” directory, go there and execute the following commands (using the terminal)
    cd ~/Downloads
    tar -xzf glpk-4.43.tar.gz
    ./configure --prefix=/usr/local # see note [1]
    make
    sudo make install
        
  4. At this point, you should have GLPK installed. Verify it:
    which glpsol
    /usr/local/bin/glpsol
        
  5. … and try help:
    glpsol --help
        

Now that you are all set-up, read up this excellent introduction using GLPK: http://www.ibm.com/developerworks/linux/library/l-glpk1

Notes:
[1]: HiveLogic article on why using /usr/local is better
[2] If you want MySQL support (or something “extra”) check out the INSTALL file in the package

2 Comments

2 Comments

  1. Ali Rizvi  •  Feb 26, 2010 @18:47

    I am glad you did not have to do darwin ports for this.

  2. Arnab  •  Mar 2, 2010 @10:41

    Yeah – all the top links that come up on Google for “glpk on mac” point to using Ports – and those processes don’t even work anymore. So wrote this up – hope it helps someone in the future.

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>