Repository navigation
Make ImportRoadrunnerAndDependencies.cmake usable by consumers - #1432
Open
matthiaskoenig wants to merge 1 commit into
Open
matthiaskoenig wants to merge 1 commit into
matthiaskoenig wants to merge 1 commit into
Conversation
find_package(zlib CONFIG REQUIRED) only resolves on a case insensitive file system. The dependency tree ships ZLIBConfig.cmake and roadrunner's own build asks for it as find_package(ZLIB CONFIG REQUIRED COMPONENTS static), so including the helper from another project failed on Linux at that line. The helper also assumed the consuming project had already put the dependency config directories on CMAKE_PREFIX_PATH and the install tree's cmake directory on CMAKE_MODULE_PATH, which is something only roadrunner's own CMakeLists does. Without those paths sbml-static, PocoFoundation, SUNDIALS and FindLLVM are not found either. It now derives both from its own location and from RR_DEPENDENCIES_INSTALL_PREFIX, so a consuming project points at the trees and includes the file. Documents the consuming side in the installation docs: which tree to link against, that the LLVM and dependency trees have to stay in place, the C++17 and RTTI requirement, and that a lib64 dependency tree is not copied into the install tree. Part of sys-bio#1431. The third cause reported there, install(DIRECTORY "${RR_DEPENDENCIES_INSTALL_PREFIX}/lib") ignoring lib64, is a decision about the artifact layout and is left out of this change.
This was referenced Nov 5, 2026
Collaborator
Author
|
The documentation section added here points at |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes the two code level causes in #1431, which together make the installed
ImportRoadrunnerAndDependencies.cmakeunusable from another C++ project on Linux.Changes
find_package(zlib ...)becomesfind_package(ZLIB ... COMPONENTS static).The dependency tree ships
ZLIBConfig.cmake, so the lowercase name only resolved on a caseinsensitive file system. This is the same call roadrunner's own build makes at
CMakeLists.txt:403.The helper now sets up the search paths its
find_packagecalls need, instead of assuming theconsuming project has already done it. It derives the roadrunner prefix and the cmake directory,
where
FindLLVM.cmakeand the roadrunner package files are installed, from its own location, andadds the dependency config directories (
<deps>/cmake,<deps>/lib*/cmake,<deps>/lib*/cmake/Poco)the way
CMakeLists.txt:380does for roadrunner's own build.RR_DEPENDENCIES_INSTALL_PREFIXandLLVM_INSTALL_PREFIXdefault to the roadrunner install tree. Consuming a roadrunner install is now:A new documentation section, "Using RoadRunner from another C++ project", records what a consumer
has to know: link against the install tree and not the build tree, keep the LLVM and dependency
trees where they were because the exported targets name those archives by absolute path, compile
with C++17 or later and with RTTI enabled,
Poco::Foundationpulls the compile up to C++20 anyway,and a
lib64dependency tree is not copied into the install tree soRR_DEPENDENCIES_INSTALL_PREFIXhas to be passed.
Verification
Built roadrunner
developon Ubuntu 24.04 x86_64 against libroadrunner-deps v2.3.9(
manylinux_2_28) andllvm-23.1.4-ubuntu-24, then configured, built and ran a separate consumerproject against the install tree: it imports through the helper, links
roadrunner-static::roadrunner-staticand simulatesdx/dt = -k*x, givingx(1) = 0.367879againstexp(-1) = 0.367879. The resulting binary needs only libm, libstdc++, libgcc_s and libc. Before thischange the same project stopped at the
zlibline, and with that line fixed by hand it stopped atsbml-static.The roadrunner build itself does not include this file, so nothing in the build or the test suites
is affected. For the record, the full suites on that build are green: 3505 C++ tests and 15 Python
tests.
Not addressed here: the third cause in #1431,
install(DIRECTORY "${RR_DEPENDENCIES_INSTALL_PREFIX}/lib")at
CMakeLists.txt:506ignoringlib64, which is why alib64dependency tree has to be keptaround. That one changes what the published artifact contains, so it needs a decision rather than a
patch.