Mac OS X linking .so file to dynamic library
<p>I'm trying to build a python package that is dependent on several libraries including boost, boost-python, and fftw. I am able to compile the package without any errors, but when I try to run the program with the <code>steme --help</code> command, I get an error:</p>

<pre><code>2016-08-11 15:07:55,571:ERROR: ImportError: dlopen(/Users/&lt;&gt;/.ENV/lib/python2.7/site-packages/STEME-1.9.1-py2.7-macosx-10.11-intel.egg/stempy/_release_build/_index.so, 2): Symbol not found: __ZN5boost6python6detail13current_scopeE
  Referenced from: /Users/&lt;&gt;/.ENV/lib/python2.7/site-packages/STEME-1.9.1-py2.7-macosx-10.11-intel.egg/stempy/_release_build/_index.so
  Expected in: flat namespace
 in /Users/&lt;&gt;/.ENV/lib/python2.7/site-packages/STEME-1.9.1-py2.7-macosx-10.11-intel.egg/stempy/_release_build/_index.so
</code></pre>

<p>My understanding is the the file <code>_index.so</code> is looking for the symbol <code>__ZN5boost6python6detail13current_scopeE</code> but can't find it. Next I checked what libraries are linked to the <code>_index.so</code> file using <code>otool -L</code>:</p>

<pre><code>/Users/&lt;&gt;/.ENV/lib/python2.7/site-packages/STEME-1.9.1-py2.7-macosx-10.11-intel.egg/stempy/_release_build/_index.so:
    /usr/local/opt/fftw/lib/libfftw3.3.dylib (compatibility version 8.0.0, current version 8.4.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
</code></pre>

<p>Based on this, what I think is happening is that the <code>boost-python</code> dynamic library was not properly linked to <code>_index.so</code> during compilation. To check that I ran <code>nm -g</code> on the <code>boost-python</code> dylibs (which were installed using <code>brew</code>, along with the other mentioned dependencies). The missing symbol was found in the <code>libboost_python.dylib</code> file:</p>

<p><code>0000000000031d08 S __ZN5boost6python6detail13current_scopeE</code></p>

<p>So, my next question is, how do I link the <code>libboost_python.dylib</code> file (located at <code>/usr/local/Cellar/boost-python/1.61.0/lib</code>) to the <code>_index.so</code> file? Will that even fix the problem? Is there some compiler flag that I need to set to make sure the build is properly linked?</p>