What is libpython3.so compared with libpython3.5m.so built from python 3.5.2 source?
<p>In my application, I use boost_python and python 3.5.2. All built from source in Ubuntu 14.</p>

<p>When I built Python 3.5.2 from source with <code>--with-shared</code> options in Ubuntu, I got <code>libpython3.so</code> (7.6kB) and <code>libpython3.5m.so</code> (12MB). I assume the big one is the real one and the small one might be something forwarding calls to the real interfaces.</p>

<p>As boost_python might assume the client to link against python (<a href="https://svn.boost.org/trac/boost/ticket/2615" rel="noreferrer">https://svn.boost.org/trac/boost/ticket/2615</a>), I linked <code>libpython3.so</code> with my application. But when I run it, I got the unresolved symbols error.</p>

<p><code>ldd -r myapp</code> or <code>ldd -r libboost_python.so</code> both listed all python symbols unresolved which could be found in <code>nm -D libpython3.5m.so</code>.</p>

<pre><code># ldd -r lib/libboost_python3.so
    linux-vdso.so.1 =&gt; (0x00007ffe767fb000)
    libstdc+.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libstdc+.so.6 (0x00007f130a7a3000)
    libgcc_s.so.1 =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f130a58d000)
    libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f130a1c8000)
    libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1309ec2000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f130acf4000)
undefined symbol: PyExc_ImportError (lib/libboost_python3.so)
undefined symbol: PyProperty_Type (lib/libboost_python3.so)
undefined symbol: PyExc_StopIteration (lib/libboost_python3.so)
undefined symbol: PyBool_Type (lib/libboost_python3.so)
undefined symbol: PyExc_ValueError (lib/libboost_python3.so)
undefined symbol: PyList_Type (lib/libboost_python3.so)
undefined symbol: _Py_NotImplementedStruct (lib/libboost_python3.so)
undefined symbol: PyExc_TypeError (lib/libboost_python3.so)
undefined symbol: PyDict_Type (lib/libboost_python3.so)
...
</code></pre>

<p><code>libpython3.so</code> depend on <code>libpython3.5m.so</code> but itself has no those symbols. </p>

<p>I think based on that I should link my application with <code>libpython3.5m.so</code> instead of with <code>libpython3.so</code>. But the weird thing is that if I use LD_PRELOAD to load the libpython3.so, those symbols are found in <code>ldd -r libboost_python3.so</code></p>

<pre><code># LD_LIBRARY_PATH=lib LD_PRELOAD=lib/libpython3.so ldd -r lib/libboost_python3.so
    linux-vdso.so.1 =&gt; (0x00007ffcb51f0000)
    lib/libpython3.so (0x00007f6f728e3000)
    libstdc+.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libstdc+.so.6     (0x00007f6f725df000)
    libgcc_s.so.1 =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6f723c9000)
    libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6f72004000)
    libpython3.5m.so.1.0 =&gt; lib/libpython3.5m.so.1.0 (0x00007f6f71ae1000)
    libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0     (0x00007f6f718c3000)
    libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6f715bd000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f6f72d32000)
    libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6f713b9000)
    libutil.so.1 =&gt; /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f6f711b6000)
</code></pre>

<p>Why having the <code>libpython3.so</code> and how to use it? Or shall I just only use the <code>libpython3.5m.so</code> directly?</p>