title: Install third-party C library on Mac OS X
body: <p>I'd like to install a third-party C library (<a href="http://cgm.cs.mcgill.ca/~avis/C/lrs.html" rel="nofollow">http://cgm.cs.mcgill.ca/~avis/C/lrs.html</a>) on a Mac OS X. However, the binaries won't seem to install on a Mac OS X (10.9.5). The library is intended for Unix/Linux platforms.</p>
  
  <p>Here are a couple example of errors I get when trying to install the <code>make</code> file. First, here's the error when running <code>make all</code> out of the box (for some reason, running <code>make all64</code> does nothing):</p>
  
  <pre><code>ld: library not found for -lgmp
  </code></pre>
  
  <p>I installed the GMP library (<a href="https://gmplib.org/" rel="nofollow">https://gmplib.org/</a>) via MacPorts in <code>/opt/local</code>. However, the library does not appear to be found:</p>
  
  <pre><code>cc 2nash-GMP.o -L. -llrsgmp -L/opt/local/include  -lgmp -o 2nash
  ld: library not found for -lgmp
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make: *** [2nash] Error 1
  rm 2nash-GMP.o
  </code></pre>
  
  <p>How can I get around all this and install on a Mac?</p>
  
  <p>I'll mention that I intend to call a function from this C library many, many times within functions from some (Matlab) code I've written. I'd prefer any potential solution to allow for this. </p>
  
  <p><strong>Update #1:</strong>
  I've since done the following: </p>
  
  <ul>
  <li>In the makefile, changed <code>LIBDIR</code> from <code>/usr/lib</code> to <code>/opt/local/lib</code></li>
  <li>In the makefile, changed <code>INCLUDEDIR</code> from  <code>/usr/include</code> to <code>/opt/local/include</code></li>
  <li>Copied <code>gmp.h</code> file from <code>/opt/local/include</code> to <code>/usr/include</code></li>
  <li>In the makefile, changed <code>RANLIB ?= /bin/true</code> to <code>RANLIB ?= /usr/bin/true</code></li>
  </ul>
  
  <p>Now, when I run <code>make all</code>, I get the following message:</p>
  
  <pre><code>make: Nothing to be done for `all'.
  </code></pre>
  
  <p>What other steps should be taken?</p>