Hello, I'm the maintainer of QuantLib in the MacPorts package management system.
I had to apply two patches to QuantLib 1.7 to allow it to build in MacPorts.
First, I had to patch acinclude.m4 to change -lboost_thread -lboost_system
to -lboost_thread-mt -lboost_system-mt
to match the library names used by boost in MacPorts. It would be helpful if it were possible to specify the boost library names, or a suffix, via a configure argument instead of having to patch.
Second, I had to remove -lboost_thread
from Examples/FRA/Makefile.am. It is redundant.
Hello,
you're right on both counts.
As for the redundant
-lboost_thread
, there's already a pull request in our queue to fix it at https://github.com/lballabio/QuantLib/pull/27.The naming of Boost libraries should be detected by
./connfigure
on its own. It already does it forlibboost_unit_test_framework
(see line 116 and following inacinclude.m4
butlibboost_system
andlibboost_thread
are more recent additions and don't use the same mechanism. I'll open an issue on GitHub to fix this. Thanks for the heads-up.Also, I'm curious: Boost.System and Boost.Thread are only needed if you configure the library with
--enable-thread-safe-observer-pattern
, which is somewhat safer but is not the default as it degrades performances. What was the rationale for enabling it? Was it to support the C# and Java bindings?The only configure arguments we supply are
--prefix=/opt/local --with-boost-include=/opt/local/include --with-boost-lib=/opt/local/lib
and./configure
sayschecking whether to enable thread-safe observer pattern... no
.That's weird. You shouldn't have to bother with libboost_system and libboost_thread in this case (apart from the redundant one, which should be removed anyway). I'll check the macros; in the meantime, may you check in your Makefiles what is the values of
BOOST_THREAD_LIB
?.I think I jumped to the wrong conclusion when working on this issue originally. When I saw the error that libboost_thread could not be found, I searched the source and found occurrences in acinclude.m4 and Examples/FRA/Makefile.am and patched them both. In fact patching acinclude.m4 was not necessary in my case because
BOOST_THREAD_LIB
is empty as you suspected.Glad to hear it. It should still be fixed, though.
Ok, I'm going to close this one. The corresponding GitHub issues are https://github.com/lballabio/QuantLib/pull/27 and https://github.com/lballabio/QuantLib/issues/35.