-
Notifications
You must be signed in to change notification settings - Fork 116
Cmake refactoring #233
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
Cmake refactoring #233
Conversation
@LecrisUT Thanks for the refactoring and improvements of documents! |
This I got from the discussion in Libxc. Specifically it is controlled by |
Standard according to "Professional CMake: A Practical Guide" Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
The `find_package` was not previously implemented so it is still possible to rename Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Cmake object magic! Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
This is helpful if the project is included via `ExternalProject` and you use something like `ccmake`. In that case all options will be displayed, and the helper messages can become ambiguous (despite the clear prefixing) Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
…hContent Couldn't find a safe way to ensure install will not override pre-installed spglib installation. This needs to be discussed with specific implementation examples. Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
- Fixed fortran install - Moved `CMAKE_POSITION_INDEPENDENT_CODE` to the relevant object Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
7add637
to
61b4f32
Compare
Codecov ReportBase: 93.34% // Head: 93.34% // No change to project coverage 👍
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## develop #233 +/- ##
========================================
Coverage 93.34% 93.34%
========================================
Files 15 15
Lines 902 902
========================================
Hits 842 842
Misses 60 60 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Rebased it onto A few things though:
|
@LecrisUT, @lan496, I have a minor question. I just recently know cmake option of
But it can be also
Which do you prefer? |
I agree. It was also used as tests. We have (C) and are preparing (Fortran) tests, so I agree. Can it be written in an issue? |
OK! Thanks. |
Sourceforge mailing list is not at all very active. We can use github instead. I have no idea about gitter/matrix/irc. Only github is not enough? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
@atztogo I like the latter because it needs fewer commands, although a bit newer CMake >= 3.13 is required. |
Oh yeah, I completely forget about
Sure, only github is fine. The others are like slack, but open sourced. All those 3 are interoperable. I'm always reachable on matrix if someone wants to discuss something there. |
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Bare with me on this one, it is a beast of a refactoring:
cmake --install --component Spglib_Development
to install only specific components. Might be useful downstream if they want to install only specific files from thislibsymspg-omp
that is guaranteed to be built with OpenMP. The main library is still built with OpenMP, but subsequent runs might overwrite it. This makes more sense with the next changesExternalProject
We can use components like:
Which will test that spglib is built with
omp
and as astatic
library, but also includefortran
if available. If not passed any components, it will try to load all components. Normally components should only be optional additional libraries, but here we have 2 special cases:shared
andstatic
: These components will switch what kind of libraries to include in the project, i.e. to link as a shared or static library. These are optional and if not passed, it will try to figure out fromSPGLIB_SHARED_LIBS
(required to be as it is defined) orBUILD_SHARED_LIBS
if defined (allows to fallback to what's available)omp
: This includes thelibsyspg-omp
library. This is effectively a copy oflibsymspg
that is guaranteed to be built via OpenMP. Normally we should not be including the build options as components like that, but often times you can see exceptions for MPI and OpenMP types (e.g. in package distributions).I have disabled completely install steps when spglib is imported via
ExternalProject
. This could otherwise lead to overwriting the system installed version. I couldn't find a clean way to allow installation safely, so I've left a note to contact us about how it should be done.Luckily we have not yet pushed a
2.1
release with the options changes, so there is little affecting downstream.