-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix CMake configuration to make Physsim usable as a library #2
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
32a7f74
Add basic .gitignore
tmadlener 73caed4
Use modern cmake approach to get downstream usability
tmadlener 573784c
Make examples build again
tmadlener 180b6e2
Cleanup dictionary generation and libray building
tmadlener b784da1
Update README with build instructions
tmadlener ff5a593
Add github actions CI workflows
tmadlener 07d3e57
Remove travis-ci configuration
tmadlener File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: keyh4ep | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cvmfs-contrib/github-action-cvmfs@v3 | ||
- uses: aidasoft/run-lcg-view@v4 | ||
with: | ||
container: centos7 | ||
view-path: /cvmfs/sw-nightlies.hsf.org/key4hep | ||
run: | | ||
mkdir build | ||
cd build | ||
echo "::group::Run CMake" | ||
cmake -GNinja \ | ||
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " \ | ||
-DCMAKE_CXX_STANDARD=17 \ | ||
-DCMAKE_INSTALL_PREFIX=../install \ | ||
.. | ||
echo "::endgroup::" && echo "::group::Build" | ||
ninja -k0 | ||
echo "::endgroup::" && echo "::group::Install" | ||
ninja install | ||
echo "::endgroup::" && echo "::group::Build example processors" | ||
cd ../install | ||
export CMAKE_PREFIX_PATH=$(pwd):${CMAKE_PREFIX_PATH} | ||
cd ../example_stdhep | ||
mkdir build | ||
cd build | ||
cmake -GNinja \ | ||
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " \ | ||
-DCMAKE_CXX_STANDARD=17 \ | ||
-DCMAKE_INSTALL_PREFIX=../install \ | ||
.. | ||
ninja -k0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: linux | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
centos7: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
COMPILER: [gcc10, clang11] | ||
LCG: [100] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cvmfs-contrib/github-action-cvmfs@v3 | ||
- uses: aidasoft/run-lcg-view@v4 | ||
with: | ||
view-path: "/cvmfs/clicdp.cern.ch/iLCSoft/lcg/${{ matrix.LCG }}/nightly/x86_64-centos7-${{ matrix.COMPILER }}-opt" | ||
setup-script: "init_ilcsoft.sh" | ||
run: | | ||
mkdir build | ||
cd build | ||
echo "::group::Run CMake" | ||
cmake -GNinja \ | ||
-C ${ILCSOFT}/ILCSoft.cmake \ | ||
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " \ | ||
-DCMAKE_INSTALL_PREFIX=../install \ | ||
.. | ||
echo "::endgroup::" && echo "::group::Build" | ||
ninja -k0 | ||
echo "::endgroup::" && echo "::group::Install" | ||
ninja install | ||
echo "::endgroup::" && echo "::group::Build example processors" | ||
cd ../install | ||
export CMAKE_PREFIX_PATH=$(pwd):${CMAKE_PREFIX_PATH} | ||
cd ../example_stdhep | ||
mkdir build | ||
cd build | ||
cmake -GNinja \ | ||
-C ${ILCSOFT}/ILCSoft.cmake \ | ||
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " \ | ||
-DCMAKE_INSTALL_PREFIX=../install \ | ||
.. | ||
ninja -k0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build/ | ||
/install/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
############################################################### | ||
# Physsim CMAKE CONFIG | ||
# | ||
# Exported Targets | ||
# | ||
# Physsim::Physsim The Physsim library | ||
############################################################### | ||
@PACKAGE_INIT@ | ||
|
||
# set_and_check(Physsim_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") | ||
# set_and_check(Physsim_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@") | ||
|
||
include(CMakeFindDependencyMacro) | ||
find_dependency(ROOT @ROOT_VERSION@) | ||
|
||
if (NOT TARGET Physsim::Physsim) | ||
include("${CMAKE_CURRENT_LIST_DIR}/PhyssimTargets.cmake") | ||
endif() | ||
|
||
check_required_components(Physsim) | ||
|
||
# Print the default "Found" message and check library location | ||
include(FindPackageHandleStandardArgs) | ||
get_property(TEST_PHYSSIM_LIBRARY TARGET Physsim::Physsim PROPERTY LOCATION) | ||
find_package_handle_standard_args(Physsim DEFAULT_MSG CMAKE_CURRENT_LIST_FILE TEST_PHYSSIM_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") | ||
|
||
include(CMakePackageConfigHelpers) | ||
|
||
# Version file is same wherever we are | ||
write_basic_package_version_file(${PROJECT_BINARY_DIR}/PhyssimConfigVersion.cmake | ||
VERSION ${Physsim_VERSION} | ||
COMPATIBILITY SameMajorVersion ) | ||
|
||
# Build tree config | ||
# export(EXPORT PhyssimTargets NAMESPACE Physsim:: FILE ${PROJECT_BINARY_DIR}/PhyssimTargets.cmake) | ||
|
||
# Install tree config | ||
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/PhyssimConfig.cmake.in | ||
${PROJECT_BINARY_DIR}/PhyssimConfig.cmake | ||
INSTALL_DESTINATION ${CMAKE_INSTALL_CMAKEDIR} | ||
) | ||
|
||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PhyssimConfig.cmake | ||
${CMAKE_CURRENT_BINARY_DIR}/PhyssimConfigVersion.cmake | ||
DESTINATION ${CMAKE_INSTALL_CMAKEDIR}) | ||
|
||
install(EXPORT PhyssimTargets | ||
DESTINATION ${CMAKE_INSTALL_CMAKEDIR} | ||
NAMESPACE Physsim::) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This makes the libraries now go to lib64, which breaks the check in ilcsoft-install
(And the assignment of the library to MARLIN_DLL, which happens because of how physsim is done in ilcsoft install https://github.com/iLCSoft/iLCInstall/blob/b32418db68960110ade0270a7ce37fbe32241983/releases/HEAD/release-ilcsoft.cfg#L167-L168 )
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.
That is true. I have made a PR to iLCInstall to accomodate for the
lib[64]
changes.MARLIN_DLL
should not really matter for Physsim, because it does not build processors. Those need to be explicitly built from the examples directory.