Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable shared library build and other options with cmake #147

Open
pguio opened this issue Oct 3, 2019 · 9 comments
Open

Disable shared library build and other options with cmake #147

pguio opened this issue Oct 3, 2019 · 9 comments

Comments

@pguio
Copy link
Collaborator

pguio commented Oct 3, 2019

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
Copy link
Member

slayoo commented Oct 3, 2019

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:

  • cmake -LA
  • ccmake

@slayoo
Copy link
Member

slayoo commented Oct 3, 2019

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

Shared lib is built unconditionally:

add_library(blitz SHARED ${blitz_LIB_SRCS})

Static lib is built for non-windows builds:

if (NOT WIN32)

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

@slayoo
Copy link
Member

slayoo commented Oct 3, 2019

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

Added a separate issue: #148

@slayoo
Copy link
Member

slayoo commented Oct 3, 2019

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

@pguio : could you elaborate?

@pguio
Copy link
Collaborator Author

pguio commented Oct 3, 2019

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
Copy link
Member

slayoo commented Oct 3, 2019

Boost serialisation is handled:

option(ENABLE_SERIALISATION "Enable serialization support using Boost::Serialization" OFF)

TBB is handled:

option(TBB "Use Intel Threading Building Blocks atomic types" OFF)

Threadsafe is here:

option(BZ_THREADSAFE "Enable Blitz thread-safety features" OFF)

no trace of --with-blas, @papadop @pguio: added a separate issue - #149

@citibeth
Copy link
Contributor

citibeth commented Oct 3, 2019 via email

@HerveAncher
Copy link
Contributor

HerveAncher commented Mar 23, 2020

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
Copy link
Collaborator Author

pguio commented Apr 21, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants