blitzpp / blitz

Blitz++ Multi-Dimensional Array Library for C++
https://github.com/blitzpp/blitz/wiki
Other
402 stars 83 forks source link

Disable shared library build and other options with cmake #147

Open pguio opened 4 years ago

pguio commented 4 years ago

Hello, I tried to install the latest autotools free version using cmake and I can't figure out how to disable building the shared library. I tried cmake -DBUILD_SHARED_LIBS=false -DBUILD_STATIC_LIBS=true .. but it didn't do anything. Any idea? More generally is there a way to see the available configuration variables (something like configure --help)? And have all the options regarding threading been ported to cmake? I cannot figure out how to generate benchmarks/plot_benchmarks.m from benchmarks/plot_benchmarks.m.in with cmake Thank you, Patrick

slayoo commented 4 years ago

More generally is there a way to see the available configuration variables (something like configure --help)?

According to https://stackoverflow.com/questions/16851084/how-to-list-all-cmake-build-options-and-their-default-values, the ways to do it include:

slayoo commented 4 years ago

cmake -DBUILD_SHARED_LIBS=false -DBUILD_STATIC_LIBS=true .. but it didn't do anything. Any idea?

Shared lib is built unconditionally:

https://github.com/blitzpp/blitz/blob/e1c40dfbc0f2a50b817f815320ede4de63ddd5ff/src/CMakeLists.txt#L3

Static lib is built for non-windows builds:

https://github.com/blitzpp/blitz/blob/e1c40dfbc0f2a50b817f815320ede4de63ddd5ff/src/CMakeLists.txt#L12

@papadop would adding support for disabling the shared lib be straightforward?

slayoo commented 4 years ago

I cannot figure out how to generate benchmarks/plot_benchmarks.m from benchmarks/plot_benchmarks.m.in with cmake

Added a separate issue: https://github.com/blitzpp/blitz/issues/148

slayoo commented 4 years ago

And have all the options regarding threading been ported to cmake?

@pguio : could you elaborate?

pguio commented 4 years ago

I was thinking of the options --enable-threadsafe and --with-tbb primarily

But looking at the configure options, I can also mention boost serialisation options --enable-serialization and --with-boost*, and for benchmarks the option --with-blas

slayoo commented 4 years ago

Boost serialisation is handled: https://github.com/blitzpp/blitz/blob/e1c40dfbc0f2a50b817f815320ede4de63ddd5ff/blitz/CMakeLists.txt#L28

TBB is handled: https://github.com/blitzpp/blitz/blob/e1c40dfbc0f2a50b817f815320ede4de63ddd5ff/blitz/CMakeLists.txt#L6

Threadsafe is here: https://github.com/blitzpp/blitz/blob/e1c40dfbc0f2a50b817f815320ede4de63ddd5ff/blitz/CMakeLists.txt#L4

no trace of --with-blas, @papadop @pguio: added a separate issue - https://github.com/blitzpp/blitz/issues/149

citibeth commented 4 years ago

CMake has stuff build into it allowing the user to choose shared or static. As long as the Blitz++ CMake build follows the CMake conventions, this should "just happen."

https://cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html

On Thu, Oct 3, 2019 at 11:34 AM Sylwester Arabas notifications@github.com wrote:

Boost serialisation is handled:

https://github.com/blitzpp/blitz/blob/e1c40dfbc0f2a50b817f815320ede4de63ddd5ff/blitz/CMakeLists.txt#L28

TBB is handled:

https://github.com/blitzpp/blitz/blob/e1c40dfbc0f2a50b817f815320ede4de63ddd5ff/blitz/CMakeLists.txt#L6

Threadsafe is here:

https://github.com/blitzpp/blitz/blob/e1c40dfbc0f2a50b817f815320ede4de63ddd5ff/blitz/CMakeLists.txt#L4

no trace of --with-blas, @papadop https://github.com/papadop @pguio https://github.com/pguio: added a separate issue - #149 https://github.com/blitzpp/blitz/issues/149

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blitzpp/blitz/issues/147?email_source=notifications&email_token=AAOVY57AGRC74R3L735TV5DQMYGIFA5CNFSM4I5C2DUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAITJIY#issuecomment-537998499, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOVY53H6ZPZTMWK2X55EADQMYGIFANCNFSM4I5C2DUA .

HerveAncher commented 4 years ago

Hi everybody,

Last week I pushed a PR to build static library under Windows, and manage exported files in relation. I think the best way if to use the flag BUILD_SHARED_LIBSand add test like that in CMakeList.txt:

if (BUILD_SHARED_LIBS)
    add_library(blitz SHARED ${blitz_LIB_SRCS})
    <...>
endif()
pguio commented 4 years ago

Dear all,

I was wondering whether the issue to disable shared library build had ever been addressed? I can't seem to be able to build with disabled shared library. I have tried with the cmake option BUILD_SHARED_LIBS=OFF without success. Any suggestions? Patrick