Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 32 additions & 22 deletions src/Libt8.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading