From 40edcc8ed94bd23e3221df08f1339c21e160a1a5 Mon Sep 17 00:00:00 2001 From: Arpit Babbar Date: Mon, 20 Jul 2026 21:30:59 +0200 Subject: [PATCH 1/2] Fix for PackageCompiler --- src/Libt8.jl | 54 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/src/Libt8.jl b/src/Libt8.jl index a1b9f1a..f14e3e7 100644 --- a/src/Libt8.jl +++ b/src/Libt8.jl @@ -13,28 +13,38 @@ export t8code_jll using ..T8code: _PREFERENCE_LIBT8, _PREFERENCE_LIBP4EST, _PREFERENCE_LIBSC using MPIPreferences: MPIPreferences -@static if _PREFERENCE_LIBT8 == "t8code_jll" && MPIPreferences.binary == "system" - @warn "System MPI version detected, but not a system t8code version. To make T8code.jl work, you need to set the preferences, see https://github.com/DLR-AMR/T8code.jl#using-a-custom-version-of-mpi-andor-t8code." -elseif _PREFERENCE_LIBT8 == "t8code_jll" - const libt8 = t8code_jll.libt8 -else - const libt8 = _PREFERENCE_LIBT8 -end - -@static if _PREFERENCE_LIBP4EST == "t8code_jll" && MPIPreferences.binary == "system" - @warn "System MPI version detected, but not a system t8code version. To make T8code.jl work, you need to set the preferences, see https://github.com/DLR-AMR/T8code.jl#using-a-custom-version-of-mpi-andor-t8code." -elseif _PREFERENCE_LIBP4EST == "t8code_jll" - const libp4est = t8code_jll.libp4est -else - const libp4est = _PREFERENCE_LIBP4EST -end - -@static if _PREFERENCE_LIBSC == "t8code_jll" && MPIPreferences.binary == "system" - @warn "System MPI version detected, but not a system t8code version. To make T8code.jl work, you need to set the preferences, see https://github.com/DLR-AMR/T8code.jl#using-a-custom-version-of-mpi-andor-t8code." -elseif _PREFERENCE_LIBSC == "t8code_jll" - const libsc = t8code_jll.libsc -else - const libsc = _PREFERENCE_LIBSC +# Load libp4est and libsc paths at runtime for PackageCompiler.jl-generated executables +libp4est = "" +libsc = "" +libt8 = "" + +function __init__() + global libp4est + global libsc + global libt8 + @static if _PREFERENCE_LIBP4EST == "t8code_jll" && MPIPreferences.binary == "system" + @warn "System MPI version detected, but not a system p4est version. ..." + elseif _PREFERENCE_LIBP4EST == "t8code_jll" + libp4est = t8code_jll.libp4est + else + libp4est = _PREFERENCE_LIBP4EST + end + + @static if _PREFERENCE_LIBSC == "t8code_jll" && MPIPreferences.binary == "system" + @warn "System MPI version detected, but not a system t8code version. To make T8code.jl work, you need to set the preferences, see https://github.com/DLR-AMR/T8code.jl#using-a-custom-version-of-mpi-andor-t8code." + elseif _PREFERENCE_LIBSC == "t8code_jll" + libsc = t8code_jll.libsc + else + libsc = _PREFERENCE_LIBSC + end + + @static if _PREFERENCE_LIBT8 == "t8code_jll" && MPIPreferences.binary == "system" + @warn "System MPI version detected, but not a system t8code version. To make T8code.jl work, you need to set the preferences, see https://github.com/DLR-AMR/T8code.jl#using-a-custom-version-of-mpi-andor-t8code." + elseif _PREFERENCE_LIBT8 == "t8code_jll" + libt8 = t8code_jll.libt8 + else + libt8 = _PREFERENCE_LIBT8 + end end # Define missing types From d52507285431722b3b689f97f1eb8f05994f1f36 Mon Sep 17 00:00:00 2001 From: Arpit Babbar Date: Wed, 29 Jul 2026 20:36:00 +0200 Subject: [PATCH 2/2] Update src/Libt8.jl Co-authored-by: Benedict <135045760+benegee@users.noreply.github.com> --- src/Libt8.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Libt8.jl b/src/Libt8.jl index f14e3e7..241d05d 100644 --- a/src/Libt8.jl +++ b/src/Libt8.jl @@ -23,7 +23,7 @@ function __init__() global libsc global libt8 @static if _PREFERENCE_LIBP4EST == "t8code_jll" && MPIPreferences.binary == "system" - @warn "System MPI version detected, but not a system p4est version. ..." + @warn "System MPI version detected, but not a system t8code version. To make T8code.jl work, you need to set the preferences, see https://github.com/DLR-AMR/T8code.jl#using-a-custom-version-of-mpi-andor-t8code." elseif _PREFERENCE_LIBP4EST == "t8code_jll" libp4est = t8code_jll.libp4est else