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

Add CMake build support #790

Closed
wants to merge 1 commit into from
Closed

Conversation

guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Sep 1, 2022

Description:

This PR adds the relevant files to build combine with CMake. I had this around privately for a long time, and I think it would be good to expose this also to other users and developers that want to build combine with CMake.

It is a draft PR for now because there is still something I want to improve: right now, the python libraries are always installed in the system Python package directory, but it would be good to have a configuration option maybe called PYTHON_LOCAL to install to the local library directory for the user (like --local for pip). I will implement this when I have time, but I still wanted to open the PR already to get feedback from interested people that want to give it a shot.

You can try it out with:

git clone [email protected]:guitargeek/HiggsAnalysis-CombinedLimit.git -b 112x_cmake HiggsAnalysis/CombinedLimit
cd HiggsAnalysis/CombinedLimit
mkdir build
cd build
cmake3 -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
cmake3 --build . -j8
make install

Unlike the standalone Makefile that is already in the repo, this should work not only on lxplus because of the smart CMake macros that try to find the dependencies at the right place.

Tested on:

I'll try to make it work for the "vanilla" versions of the operating systems, so no cmsenv allowed for example. A yellow sign means it doesn't work immediately out of the box, but after only small adaptations to the environment like sourcing a newer ROOT version.

Still todo:

  • add PYTHON_LOCAL option described before
  • automatically detect correct C++ standard matching the ROOT installation
  • remove restriction that source code directory must be named HiggsAnalysis/CombinedLimit DONE
  • try to get rid of using cmake_path because it's only available in cmake 3.20 which is quite new

@guitargeek guitargeek changed the title Add new CMakeLists.txt for first CMake build support Add CMake build support Sep 1, 2022
@nsmith- nsmith- changed the base branch from 112x to main January 18, 2023 04:04
@guitargeek guitargeek force-pushed the 112x_cmake branch 2 times, most recently from 8f0231e to 811b35b Compare April 11, 2023 14:24
@guitargeek
Copy link
Contributor Author

Superseded by: #943.

Thanks @will-cern!

@guitargeek guitargeek closed this Apr 17, 2024
@guitargeek guitargeek deleted the 112x_cmake branch April 18, 2024 21:58
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

Successfully merging this pull request may close these issues.

1 participant