Shared library does not 'need' boost_system
I built QuantLib (with --enable-thread-safe-singleton-init configured) on Linux. The shared library declares that it needs a few other libraries:
$ objdump -p ql/.libs/libQuantLib.so.0.0.0 | grep NEEDED
NEEDED libstdc++.so.6
NEEDED libm.so.6
NEEDED libc.so.6
NEEDED libgcc_s.so.1
It does not declare that it needs boost_system.so.
However, it does include a symbol which can only be resolved in boost_system.so:
$ objdump --dynamic-reloc --demangle ql/.libs/libQuantLib.so.0.0.0 | grep R_X86_64_JUMP_SLOT | grep :: | tr -s ' ' | cut -d ' ' -f 3- | sed 's/@@Base//' | sort -u >jumpslots.lst
$ nm --defined-only --extern-only --demangle ql/.libs/libQuantLib.so.0.0.0 | cut -d ' ' -f 3- | grep :: | sort -u >exported.lst
$ comm -23 jumpslots.lst exported.lst >required.lst
$ grep -v std required.lst
boost::system::generic_category()
As a consequence, when i try to load this library into Python, via the SWIG wrapper, it fails with:
ImportError: /path/to/lib/libQuantLib.so.0: undefined symbol: _ZN5boost6system16generic_categoryEv
Is that as intended? Or should the build process be adding a DT_NEEDED entry to the library? If so, am i doing something wrong, or is this a shortcoming of the build process?
There could also be something wrong with the way i am building or using the SWIG wrapper, but this does look like a problem with the QuantLib library itself to me.
I don't know about DT_NEEDED entries (I thought autotools took care of those?), but yes, the library requires boost_system and possibly a couple of other. If you run
quantlib-config --libs
you should see the required link parameters. I know the above is called while building the Python wrappers, but it's quite possible that other languages don't. Which one are you using?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Ran into this again today.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This should be resolved by #1504
Correct, thanks for noticing.