Skip to content

Commit

Permalink
Set build rpath to install rpath so that plugins run from build dir
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwbrei committed Aug 8, 2024
1 parent 9168ba3 commit b7827a6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/ccpp-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,27 @@ jobs:
-DXercesC_DIR=/usr \
-Dpodio_DIR=/app/podio/install/lib/cmake/podio/
cmake --build build --target install
- name: Examine dynamic linking
run: |
echo "ldd bin/jana"
ldd bin/jana
echo "ldd bin/libJANA.so"
ldd lib/libJANA.so
echo "bin/jana rpath"
objdump -x bin/jana | grep PATH
echo "lib/libJANA.so rpath"
objdump -x lib/libJANA.so | grep PATH
- name: JTest
run: |
echo "--- Running JTest plugin -----------------------"
ctest --test-dir build -R jana-plugin-jtest-tests --rerun-failed --output-on-failure
ctest --test-dir build --output-on-failure -R jana-plugin-jtest-tests
- name: jana-unit-tests
run: |
echo "--- Running jana-unit-tests ------------------------------"
ctest --test-dir build -R jana-unit-tests --rerun-failed --output-on-failure
ctest --test-dir build --output-on-failure -R jana-unit-tests
- name: TimesliceExample with simple (physics event) topology
run: |
echo "--- Running TimesliceExample with simple topology ------------------------------"
ctest --test-dir build -R jana-example-timeslices-simple-tests --rerun-failed --output-on-failure
ctest --test-dir build --output-on-failure -R jana-example-timeslices-simple-tests
- name: TimesliceExample with complex (timeslice) topology
run: |
echo "--- Running TimesliceExample with complex topology ------------------------------"
ctest --test-dir build -R jana-example-timeslices-simple-tests --rerun-failed --output-on-failure
ctest --test-dir build --output-on-failure -R jana-example-timeslices-complex-tests
4 changes: 2 additions & 2 deletions cmake/AddInternalPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ macro(add_jana_plugin plugin_name)
PREFIX ""
SUFFIX ".so"
SKIP_BUILD_RPATH FALSE
BUILD_WITH_INSTALL_RPATH FALSE
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_RPATH_USE_LINK_PATH TRUE
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib/JANA/plugins"
)
Expand Down Expand Up @@ -48,7 +48,7 @@ macro(add_jana_plugin plugin_name)
target_link_libraries(${plugin_name}_tests PRIVATE ${plugin_name} VendoredCatch2)
set_target_properties(${plugin_name}_tests PROPERTIES
SKIP_BUILD_RPATH FALSE
BUILD_WITH_INSTALL_RPATH FALSE
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_RPATH_USE_LINK_PATH TRUE
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib/JANA/plugins"
)
Expand Down
4 changes: 2 additions & 2 deletions src/examples/TimesliceExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ if (USE_PODIO)
target_link_libraries(TimesliceExample PUBLIC PodioExampleDatamodel PodioExampleDatamodelDict podio::podioRootIO)

add_test(NAME jana-example-timeslices-simple-tests
COMMAND jana -Pplugins=TimesliceExample -Pjana:nevents=10 events.root)
COMMAND ${CMAKE_INSTALL_PREFIX}/bin/jana -Pplugins=TimesliceExample -Pjana:nevents=10 events.root)

add_test(NAME jana-example-timeslices-complex-tests
COMMAND jana -Pplugins=TimesliceExample -Pjana:nevents=10 timeslices.root)
COMMAND ${CMAKE_INSTALL_PREFIX}/bin/jana -Pplugins=TimesliceExample -Pjana:nevents=10 timeslices.root)

else()
message(STATUS "Skipping examples/TimesliceExample because USE_PODIO=Off")
Expand Down

0 comments on commit b7827a6

Please sign in to comment.