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

Decouple building of core and bindings #207

Open
havogt opened this issue Mar 26, 2019 · 1 comment
Open

Decouple building of core and bindings #207

havogt opened this issue Mar 26, 2019 · 1 comment
Milestone

Comments

@havogt
Copy link
Collaborator

havogt commented Mar 26, 2019

Currently we build/install everything in one CMake project: C++/Fortran with different compilers, Python etc. This has several draw-backs:
We want static libraries, but for python we need also the shared libraries, which requires to build static and shared in the same CMake project as well and introduces a complicated dependency on configuration options.

I suggest the following steps:

  • For the core we build either shared or static switched by the standard CMake variable BUILD_SHARED_LIBS.
  • Allow to install static and shared to the same location but with 2 different target files. The SerialboxConfig.cmake will be installed by both and checks which target files are available (static/shared/both) and makes them available in different namespaces, e.g. Serialbox::static::serialbox. (Maybe with a default Serialbox::serialbox pointing to one of them.)
  • Fortran bindings are installed afterwards, using the serialbox core installation.
  • Python as well (which is probably just a copy and maybe a CMake config).
  • A superbuild can drive installation of all combinations (if no proper package manager is available).

This has the advantage that core can be installed with e.g. only the GNU toolchain, but Fortran bindings can be installed with different Fortran compilers, without having to hack the toolchains and supporting complicated module environments as we do today (e.g. using gnu for c++, but Cray for Fortran).

Any comments? @wdeconinck @clementval @cosunae

@havogt havogt added this to the v3.0.0 milestone Mar 26, 2019
@wdeconinck
Copy link
Contributor

Something along these lines is what I implemented with PR #201
Both shared (if possible) and static (always available) targets are built, and an extra target that can alias either the shared or static version, so that client code does not have to inquire if shared is available.
https://github.com/eth-cscs/serialbox2/pull/201/files#diff-1aee15f96239085ba008b5154e2274a1R143

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

2 participants