-
Notifications
You must be signed in to change notification settings - Fork 7
Add cmake build system #12
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
base: master
Are you sure you want to change the base?
Conversation
6602dd8 to
dc71b66
Compare
dc71b66 to
ea390a7
Compare
becb749 to
2ffc108
Compare
da9cbff to
7f35526
Compare
|
@mtaillefumier thanks, this seems to work according to initial tests. It's just not yet installing the two binaries |
|
The other thing we should discuss is if we would not prefer to have the library as a static library. Usually we do static libraries to avoid confusion when multiple versions of the same library are around. |
|
We can solve this with |
|
Update:
|
chaoos
left a comment
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.
I can build, but not install. It fails to install lemon_contents with:
$ cmake -S . -B build -DCMAKE_INSTALL_PREFIX=./install_dir
...
$ cmake --build build -j
...
$ cmake --install build
-- Install configuration: ""
-- Installing: /home/roman/projects/tmp/lemon/install_dir/lib/cmake/clemon/ClemonConfig.cmake
-- Installing: /home/roman/projects/tmp/lemon/install_dir/lib/cmake/clemon/ClemonConfigVersion.cmake
-- Installing: /home/roman/projects/tmp/lemon/install_dir/lib/pkgconfig/clemon.pc
-- Installing: /home/roman/projects/tmp/lemon/install_dir/lib/liblemon.so
-- Set non-toolchain portion of runtime path of "/home/roman/projects/tmp/lemon/install_dir/lib/liblemon.so" to ""
-- Installing: /home/roman/projects/tmp/lemon/install_dir/lib/cmake/clemon/ClemonTargets.cmake
-- Installing: /home/roman/projects/tmp/lemon/install_dir/lib/cmake/clemon/ClemonTargets-noconfig.cmake
CMake Error at build/cmake_install.cmake:103 (file):
file INSTALL cannot find "/home/roman/projects/tmp/lemon/lemon_contents":
No such file or directory.
It does work if the build directory is equal to the source directory though, ie.
cmake -S . -DCMAKE_INSTALL_PREFIX=./install_dir
cmake --build . -j
cmake --install .
works!
| src/reader_latticeParallelNonBlockingMapped.c | ||
| src/writer_recordDataNonBlocking.c) | ||
|
|
||
| add_library(lemon SHARED ${LEMON_SRCS}) |
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.
With the BUILD_SHARED_LIBS variable this should now be:
| add_library(lemon SHARED ${LEMON_SRCS}) | |
| add_library(lemon ${LEMON_SRCS}) |
Else you always get shared libs.
|
Trying to install on e.g. juwels booster still fails for me, i.e. does not move the binaries to the separate install directory : CMake Error at cmake_install.cmake:99 (file): file INSTALL cannot find "/p/home/jusers/ottnad1/juwels/source/lemon/lemon_contents": No such file or directory. (lemon_contents and lemon_benchmark are located in the build not the source directory.) |
This pr contains a minimal version of the cmake build system. It compiles the library and generate all necessary config files for use in other cmake and pkg-config projects. It should make the library detection in tmlQCD easier.
NB: there is no changes to the original build system.