Remove unneeded boost dependencies

Issue #81 resolved
BAZfp created an issue

While attempting to select only the few boost dependencies blaze requires, I noticed that boost::shared_ptr is used in conjunction with std::shared_ptr. This is likely the case with other boost usages too. It would be extremely useful to minimise boost dependencies to improve portability.

./math/adaptors/symmetricmatrix/SharedValue.h:110 - boost::shared_ptr usage

Boost include list:

#include <boost/shared_ptr.hpp>
#include <boost/cast.hpp>
#include <boost/smart_ptr/shared_array.hpp>
#include <boost/checked_delete.hpp>
#include <boost/bind.hpp>
#include <boost/exception_ptr.hpp>

Using BCP to extract the relevant boost libraries gives me 7MB of boost.

Comments (11)

  1. Klaus Iglberger

    Hi!

    Thanks a lot for pointing out this way to improve Blaze. In the upcoming releases we will try to step by step remove unneeded Boost dependencies.

    Best regards,

    Klaus!

  2. Klaus Iglberger

    As of commit a575827 the Blaze library is no longer depending on Boost. Blaze without Boost dependency is immediately available via cloning the Blaze repository, the first official release without explicit Boost dependency will be Blaze 3.2.

    Please note that it is still necessary to link to according Boost libraries in case Boost threads are used for the shared memory parallelization and Boost is still required in case Boost is included in the Blazemark.

  3. Jan Marquardt

    As of today, there is still a remnant of the boost dependency in the main CMakeLists.txt, line 74:

    #==================================================================================================
    # Configure Boost
    #==================================================================================================
    
    find_package(Boost 1.54.0 REQUIRED)
    target_include_directories(blaze INTERFACE ${Boost_INCLUDE_DIRS})
    

    In my opinion, these lines should be completey removed to enable "building"/configuring the library without having boost installed. There is a find_package(Boost threads) at the proper position in the main CMakeLists in case boost threads should be used.

    This would also enable the removal of the boost dependency from the vcpkg package.

  4. Klaus Iglberger

    Hi Jan!

    Thanks a lot for this hint. This is an unfortunate oversight on our side. Commit 7b153fd removes the Boost dependencies from the CMakeLists.txt file. The vcpkg port will be updated with the next Blaze release. We apologize for the inconvenience,

    Best regards,

    Klaus!

  5. Jan Marquardt

    Hi Klaus,

    I am happy to help and glad to get this upstream! While we are at it, do you think a compile-flag that disables the dependency on LAPACK is reasonable? This would be great as it would mean one could use the library completely without additional dependencies, if one doesn't require the matrix decompositions. Do you think that it would possible to put everything that uses LAPACK behind #ifdefs without removing core functionality? If you do, I would take a shot at it. In my mind, this would be a cmake-only switch that adds a #define to deactivate all functions that use LAPACK.

    Best regards, Jan

  6. Klaus Iglberger

    Hi Jan!

    You can compile Blaze entirely without any LAPACK library installed. From my point of view the only necessary change would be to mark the dependency to LAPACK in the CMakeLists.txt file as optional. If you have some free time on your hand, you can give it a shot. Thanks,

    Best regards,

    Klaus!

  7. Log in to comment