Skip to content

Instantly share code, notes, and snippets.

@wooters
Last active December 14, 2015 13:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wooters/5095712 to your computer and use it in GitHub Desktop.
Save wooters/5095712 to your computer and use it in GitHub Desktop.
Compiling LBFGS on Mac OSX (10.8.2). Also includes some info about how to integrate the library with the SRI LM Toolkit.

Installing libLBFGS on Mac OSX 10.8.2

(Note: this assumes that you have XCode and the XCode command line tools installed.)

Download

The libLBFGS source code can be found here.

Unpack

$ cd ~/src
$ tar zxvf ~/Downloads/liblbfgs-1.10.tar.gz
$ cd liblbfgs-1.10

Build

$ ./configure
$ make
$ sudo make install

The library should now be installed in /usr/local/lib

Using LBFGS with SRI LM Toolkit

If you are installing LBFGS to use with the SRI LM Toolkit, then you should add the following line to common/Makefile.site.macosx (located in the top-level srilm dir) prior to compiling the SRI LM Toolkit:

HAVE_LIBLBFGS=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment