Use the same default CPU target as PackageCompiler#47
Conversation
That problem is now fixed on May be worth testing again to see if your issue is gone |
c124d97 to
ece781c
Compare
|
I can't really tell, on Julia nightly both main and this PR fail in the same way. Full test output
|
|
I tried 1.13.0-alpha2 and got the same error as on nightly above. However 1.12-nightly, (the future 1.12.3), which includes your fix,, passes all tests on this branch for me, so that seems promising. |
ece781c to
067bae5
Compare
|
Would be great if CI can be approved for this. I rebased, and now that Julia 1.12.3 is out I expect this to work (it does locally). Binaries get a bit bigger. Not sure how to best test this. |
067bae5 to
43ede0d
Compare
|
This is working well for me, using it without trimming as a replacement for PackageCompiler. The advantage is that our build time went from 1h40m to 1h8m in Deltares/Ribasim#2761. |
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>
|
Bump :) |
Fixes JuliaLang#33. This requires Julia 1.12.3 or later.
|
Is there still interest in this PR? |
I recently force-pushed JuliaLang/JuliaC.jl#47. But doing that breaks our Manifest.toml. So I made a separate branch meant for Ribasim instead. This also updates PythonCall and JuliaCall to the latest patch releases. These are pinned since the versions need to match between Pkg and Pixi.
Fix #33.
I was hoping it was just a matter of changing the defaults, but it seems to cause segfaults for me running testset "Programmatic binary (trim)" locally on Windows.EDIT: indeed fixed by JuliaLang/julia#58952 (comment), so requires 1.12.3