Repository navigation
Generate example scripts from Literate .lit sources - #6
Merged
Merged
Conversation
- Add src/generate.jl to produce X.jl and X.ipynb from every X.lit - Regenerate each example's script from its .lit before running it in the tests - Add .lit sources for Scintillation, UserLib, JuliaAction and WaterPhantom, and remove the older *_lit.jl sources - Fix JuliaAction linking: strip shell quotes from julia-config.jl output - Rename UserLibrary.cpp to UserLib.cpp to match the UserLib example - Ignore build outputs of the CustomLib and EmbedJulia examples Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Put UserLib.cpp before the Geant4 libraries on the compile command. With --as-needed (the Ubuntu default) libraries listed before the code that uses them are dropped, which left G4VSolid undefined at load time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Makes the
.litfiles the single source for the examples, and has the tests regenerate each script before running it, so that the scripts can't drift from their sources.Changes
src/generate.jl: generatesX.jlandX.ipynbfrom everyX.litin the repo, or only the names given as arguments (julia --project=. src/generate.jl [name ...]). It uses the same Literate options asdocs/literate.jlin Geant4.jl.test/runtests.jl:run_exampleregenerates a script from its.lit(if one exists) and then runs it. The extended examples are now enabled..litsources for Scintillation, UserLib, JuliaAction and WaterPhantom. The older*_lit.jlfiles are removed. Each script generated from a.litmatches the committed.jl.julia-config.jl --ldlibswraps paths in shell quotes. These were passed literally to the linker and causedld: warning: search path ''…'' not found. They are now stripped, and the duplicate-rpathis dropped.UserLibrary.cppis renamed toUserLib.cpp, the name the script compiles.UserLib.cppnow comes before the Geant4 libraries on the compile command, so the library also loads on Linux (undefined symbol: _ZTI8G4VSolidwith--as-needed)..gitignore: ignores the built.exe/.dylib/.sofiles andedepHist.png.Project.toml: addsLibdl, and a[sources]entry that pointsGeant4at a local checkout.Notes for reviewers
[sources]path (/Users/mato/Development/Geant4.jl) only exists on the author's machine, so CI will fail to resolve the environment while it is there..jlthat is out of sync with its.lit.🤖 Generated with Claude Code