Menu

#181 Provide a way to customize the boost library names

None
closed
nobody
None
5
2016-01-08
2015-12-28
No

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.

Discussion

  • Luigi Ballabio

    Luigi Ballabio - 2016-01-05

    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 for libboost_unit_test_framework (see line 116 and following in acinclude.m4 but libboost_system and libboost_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?

     
  • Ryan Carsten Schmidt

    The only configure arguments we supply are --prefix=/opt/local --with-boost-include=/opt/local/include --with-boost-lib=/opt/local/lib and ./configure says checking whether to enable thread-safe observer pattern... no.

     
  • Luigi Ballabio

    Luigi Ballabio - 2016-01-06

    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?.

     
  • Ryan Carsten Schmidt

    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.

     
  • Luigi Ballabio

    Luigi Ballabio - 2016-01-08
    • status: open --> closed
    • Group: -->
     

Log in to post a comment.