Skip to content

Use Julia 1.12 and Pkg workspaces#2815

Merged
visr merged 7 commits into
mainfrom
packagecompiler-1.12
Jan 20, 2026
Merged

Use Julia 1.12 and Pkg workspaces#2815
visr merged 7 commits into
mainfrom
packagecompiler-1.12

Conversation

@visr

@visr visr commented Jan 19, 2026

Copy link
Copy Markdown
Member

This is #2761 but staying on PackageCompiler, not moving to JuliaC yet. It seems most of the issues are related to that part, so better hold off on that and let it mature so we can at least work on the latest Julia.

@visr
visr force-pushed the packagecompiler-1.12 branch from 702b9af to fcb3d97 Compare January 20, 2026 13:17
@visr
visr marked this pull request as ready for review January 20, 2026 19:07
@visr
visr merged commit 1fe6468 into main Jan 20, 2026
22 of 24 checks passed
@visr
visr deleted the packagecompiler-1.12 branch January 20, 2026 19:07
visr added a commit that referenced this pull request Jan 27, 2026
Trying #2629 again now that we
are some patch releases further along.
EDIT: the switch to Julia v1.12 is now done with
#2815, I rebased this to only
add the JuliaC switch, which is less urgent.

For JuliaC we use this branch:
JuliaLang/JuliaC.jl#47. That should set the
desired CPU_TARGET, which was the main reason for reverting the previous
attempt.

Status: I can run the TeamCity JuliaC generated binaries locally, so the
CPU_TARGET seems to work. The Linux binaries seem to for some models.
The libribasim.dll file grew from 0.9 to 1.2 GB.

Update: this now works well on Windows. There is a libribasim.dll.a
added to the zip root that we perhaps should remove, but the Windows
build went from 1h40m to 1h8m, and testing the binaries from 20m to 17m
as well so latency doesn't seem increased. I ran the Windows binaries
locally.

The binary wasn't working directly for me on Linux only after fiddling
with the load path, we need to fix that, perhaps in main.rs or with a
JuliaC rpath option or such. EDIT: see
JuliaLang/JuliaC.jl#109

<details><summary>Details, now fixed with rpath=`@bundle`</summary>
<p>

```
visser_mn@v-h7rdp002 ~/bin  $ ribasim/bin/ribasim ~/ribasim-nl/trivial/ribasim.toml 
Failed to load libribasim from "/u/visser_mn/bin/ribasim/bin/../lib/libribasim.so"
Error: DlOpen { desc: "libjulia.so.1.12: cannot open shared object file: No such file or directory" }
visser_mn@v-h7rdp002 ~/bin  $ export LD_LIBRARY_PATH=~/bin/ribasim/lib:$LD_LIBRARY_PATH
visser_mn@v-h7rdp002 ~/bin  $ ribasim/bin/ribasim ~/ribasim-nl/trivial/ribasim.toml 
Failed to load libribasim from "/u/visser_mn/bin/ribasim/bin/../lib/libribasim.so"
Error: DlOpen { desc: "libjulia-internal.so.1.12: cannot open shared object file: No such file or directory" }
visser_mn@v-h7rdp002 ~/bin  $ ldd ~/bin/ribasim/bin/ribasim
	linux-vdso.so.1 (0x00007ffe803d2000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f79b3905000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f79b36ed000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f79b34cd000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f79b30f7000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f79b3b09000)
visser_mn@v-h7rdp002 ~/bin  $ ldd ~/bin/ribasim/lib/libribasim.so 
	linux-vdso.so.1 (0x00007ffc99973000)
	libjulia.so.1.12 => /u/visser_mn/bin/ribasim/lib/libjulia.so.1.12 (0x00007fcc064d7000)
	libjulia-internal.so.1.12 => not found
	libc.so.6 => /lib64/libc.so.6 (0x00007fcbc1277000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fcbc1073000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fcbc0e53000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fcc062cd000)
visser_mn@v-h7rdp002 ~/bin  $ export LD_LIBRARY_PATH=~/bin/ribasim/lib:~/bin/ribasim/lib/julia:$LD_LIBRARY_PATH
visser_mn@v-h7rdp002 ~/bin  $ ribasim/bin/ribasim ~/ribasim-nl/trivial/ribasim.toml 
┌ Info: Starting a Ribasim simulation at 2026-01-26T23:16:08.652.
│   toml_path = "/u/visser_mn/ribasim-nl/trivial/ribasim.toml"
│   cli.ribasim_version = "2026.1.0-rc1"
│   starttime = 2020-01-01T00:00:00
│   endtime = 2021-01-01T00:00:00
└   threads = 1
┌ Warning: The following experimental features are enabled: concentration
└ @ Ribasim /opt/teamcityagent/work/ecd2b8f9b25b1609/ribasim/core/src/logging.jl:51
[ Info: Computation time: 503 milliseconds
[ Info: The model finished successfully at 2026-01-26T23:16:14.037.
```

It seems the default of the JuliaC LinkRecipe is the magic string
`@julia`, whereas we need the magic string `@bundle`.
```
$ objdump -p libribasim.so | grep -E 'RPATH|RUNPATH'
  RPATH                /u/svc-teamcity-ansible/.julia/juliaup/julia-1.12.4+0.x64.linux.gnu/lib:/u/svc-teamcity-ansible/.julia/juliaup/julia-1.12.4+0.x64.linux.gnu/lib/julia
```

</p>
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant