Repository navigation
Add a from source build script and a minimal link example - #1433
Open
matthiaskoenig wants to merge 1 commit into
Open
matthiaskoenig wants to merge 1 commit into
matthiaskoenig wants to merge 1 commit into
Conversation
scripts/build_roadrunner.sh builds roadrunner from a git checkout the way .github/workflows/main.yml does: it downloads the prebuilt libroadrunner-deps and llvm-build release assets for the host, configures with Ninja and ccache when they are available, and builds the install target. The dependency and LLVM versions are read from the workflow matrix of the checkout it builds, so the script follows the versions used in CI instead of carrying its own copy. Python bindings are on by default, with SWIG taken from PyPI because the stable ABI needs 4.4.1 or newer; Julia and Java are off. Two things the workflow leaves implicit are handled explicitly. Release assets are resolved per host, falling back to the manylinux build when the pinned release has nothing for the host OS, which is the situation on Ubuntu 24.04 now that the runners moved on. And the LLVM tree is checked with llvm-config --has-rtti, because roadrunner strips -fno-rtti from the flags llvm-config reports and compiles its back end with RTTI, so an LLVM built with LLVM_ENABLE_RTTI=OFF would only fail much later with undefined typeinfo symbols. scripts/link-example is a separate cmake project that links the install tree and simulates dx/dt = -k*x, checking the result against exp(-t). It is the smallest complete answer to "how do I use this from C++", and it doubles as a check that the installed cmake package files and headers work from outside the build. build_roadrunner.sh --link-example builds and runs it after installing.
This was referenced Nov 5, 2026
Collaborator
Author
|
@luciansmith We have a ton of issues building and linking roadrunner based on the documentation. Adding a proper build script and example linking so this gets easier for people (and myself). |
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.
Adds two things that currently have to be rebuilt by hand by anyone who wants roadrunner from
source: a build script that follows the CI workflow, and the smallest complete example of linking
against the result.
scripts/build_roadrunner.shRuns in an empty folder and produces a usable install tree, following
.github/workflows/main.yml: clone or update the checkout, download the prebuiltlibroadrunner-deps and llvm-build release assets for the host, configure with Ninja and ccache when
present, build the
installtarget. Python bindings are on by default, Julia and Java off; SWIGcomes from PyPI because the stable ABI needs 4.4.1 or newer and the distribution packages are older.
--helplists the options (build type, jobs, tests, plugins, prefixes,--cmake-arg, ...).The dependency and LLVM versions are read from the workflow matrix of the checkout being built
(
libroadrunner_deps_release_version,llvm_name,llvm_release_version), so the script trackswhat CI uses rather than carrying its own copy.
Two things the workflow leaves implicit are handled explicitly:
ubuntu-24asset now that
ubuntu-latesthas moved on, so a literal transcription of the workflow 404s onUbuntu 24.04. The script tries the host OS asset in the pinned release, then the
manylinux_2_28asset from the same release, then the newest release that still has the host asset, and otherwise
explains what to do.
cmake/FindLLVM.cmakestrips-fno-rttifrom the flagsllvm-configreports and roadrunner compiles its back end with RTTI, so an LLVM built withLLVM_ENABLE_RTTI=OFFfails at link time with undefined typeinfo symbols. The script asksllvm-config --has-rttifirst and stops with that explanation instead.scripts/link-exampleA separate cmake project, not built in tree, that imports the install tree through
ImportRoadrunnerAndDependencies.cmake, linksroadrunner-static::roadrunner-staticand simulatesdx/dt = -k*xfrom an inline SBML string, printing the trajectory and checking it againstexp(-t). It needs no data files and returns non-zero when the result is wrong, so it also servesas a check that the installed cmake package files and headers are usable from outside the build.
build_roadrunner.sh --link-examplebuilds and runs it after installing.Verification
On Ubuntu 24.04 x86_64, from an empty folder: fresh clone, dependency and LLVM downloads, full
build, install, then both test suites and the example.
The example binary needs only libm, libstdc++, libgcc_s and libc. The
--source-dir,--deps-prefix,--llvm-prefix,--no-python,--run-testsand--link-examplepaths wereexercised, as were the RTTI check in both directions, with a stub
llvm-configreportingNO.Note on #1432
scripts/link-exampleneeds the fix in #1432 to configure on Linux: without it the include ofImportRoadrunnerAndDependencies.cmakestops atfind_package(zlib ...), and with only that linefixed it stops at
sbml-static. The two are best merged together. #1432 also adds a documentationsection that points at
scripts/link-example; if that one is merged without this one, the pointershould be dropped.