From 81d0b8749f50f570977a0ab05ef0c4f3168c199f Mon Sep 17 00:00:00 2001 From: Benedict Geihe Date: Tue, 12 Sep 2023 09:59:22 +0200 Subject: [PATCH 1/6] use set_preferences to set system hdf5 --- utils/libtrixi-init-julia | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/utils/libtrixi-init-julia b/utils/libtrixi-init-julia index f2c49c7c..8f43f461 100755 --- a/utils/libtrixi-init-julia +++ b/utils/libtrixi-init-julia @@ -315,16 +315,13 @@ echo # Set system HDF5 library echo "Use system HDF5 for Julia... " JULIA_HDF5_PATH="$hdf5_libdir" JULIA_DEPOT_PATH="$julia_depot" $julia_exec --project=. \ - -e 'using Pkg; Pkg.build("HDF5"; verbose = true)' -# Note: The following code replaces the previous line for HDF5 v0.17+, which has not yet -# been released at the time of writing -# -e " -# using Preferences, UUIDs -# set_preferences!(UUID(\"f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f\"), -# \"libhdf5\" => \"$hdf5_library\", -# \"libhdf5_hl\" => \"$hdf5_hl_library\", -# force = true) -# " + -e " +using Preferences, UUIDs +set_preferences!(UUID(\"f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f\"), + \"libhdf5\" => \"$hdf5_library\", + \"libhdf5_hl\" => \"$hdf5_hl_library\", + force = true) +" [ $? -eq 0 ] || die "could not configure system HDF5 library for Julia" echo From 81097897d0e1286454730842d75a6b2eb333bae9 Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Tue, 12 Sep 2023 10:35:33 +0200 Subject: [PATCH 2/6] Remove `LD_PRELOAD` for libcurl --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4ad07dc..82c2e228 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,8 +37,6 @@ jobs: t8code_version: - '1.4.1' env: - # Necessary for HDF5 to play nice with Julia - LD_PRELOAD: /lib/x86_64-linux-gnu/libcurl.so.4 # Necessary such that libtrixi will not use its own default for the depot path JULIA_DEPOT_PATH: ~/.julia steps: From 021ff8ffea06d73592886cb237e1b54e70569184 Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Tue, 12 Sep 2023 10:52:30 +0200 Subject: [PATCH 3/6] Fancy LD_PRELOAD dancing --- .github/workflows/ci.yml | 2 ++ utils/libtrixi-init-julia | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82c2e228..f4ad07dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,8 @@ jobs: t8code_version: - '1.4.1' env: + # Necessary for HDF5 to play nice with Julia + LD_PRELOAD: /lib/x86_64-linux-gnu/libcurl.so.4 # Necessary such that libtrixi will not use its own default for the depot path JULIA_DEPOT_PATH: ~/.julia steps: diff --git a/utils/libtrixi-init-julia b/utils/libtrixi-init-julia index 8f43f461..1faa4cc8 100755 --- a/utils/libtrixi-init-julia +++ b/utils/libtrixi-init-julia @@ -314,7 +314,7 @@ echo # Set system HDF5 library echo "Use system HDF5 for Julia... " -JULIA_HDF5_PATH="$hdf5_libdir" JULIA_DEPOT_PATH="$julia_depot" $julia_exec --project=. \ +LD_PRELOAD="" JULIA_HDF5_PATH="$hdf5_libdir" JULIA_DEPOT_PATH="$julia_depot" $julia_exec --project=. \ -e " using Preferences, UUIDs set_preferences!(UUID(\"f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f\"), From 933eb09cf117345909cdd910ef57be0fbc317ab3 Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Tue, 12 Sep 2023 11:08:18 +0200 Subject: [PATCH 4/6] Continue the LD_PRELOAD dance --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4ad07dc..7c65e0bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,6 +160,7 @@ jobs: check_bounds: 'auto' env: LIBTRIXI_DEBUG: all + LD_PRELOAD: "" - name: Run examples run: | From ed91195b494bc7b632665eb258c3389a4b10fa12 Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Tue, 12 Sep 2023 11:50:00 +0200 Subject: [PATCH 5/6] Properly unset LD_PRELOAD in init script only when running in CI --- .github/workflows/ci.yml | 2 +- utils/libtrixi-init-julia | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c65e0bc..32193983 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,7 +160,7 @@ jobs: check_bounds: 'auto' env: LIBTRIXI_DEBUG: all - LD_PRELOAD: "" + LD_PRELOAD: "" # Disable preloading libcurl.so since it does not work with the JLL-provided libhdf5.so - name: Run examples run: | diff --git a/utils/libtrixi-init-julia b/utils/libtrixi-init-julia index 1faa4cc8..76c24fa4 100755 --- a/utils/libtrixi-init-julia +++ b/utils/libtrixi-init-julia @@ -314,7 +314,13 @@ echo # Set system HDF5 library echo "Use system HDF5 for Julia... " -LD_PRELOAD="" JULIA_HDF5_PATH="$hdf5_libdir" JULIA_DEPOT_PATH="$julia_depot" $julia_exec --project=. \ +# Disable preloading libcurl.so if it has been set when running within the GitHub runner, +# since it does not work with the JLL-provided libhdf5.so +if [ "$CI" = "true" ] && [ -n "$LD_PRELOAD" ]; then + store_ld_preload="$LD_PRELOAD" + LD_PRELOAD="" +fi +JULIA_HDF5_PATH="$hdf5_libdir" JULIA_DEPOT_PATH="$julia_depot" $julia_exec --project=. \ -e " using Preferences, UUIDs set_preferences!(UUID(\"f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f\"), @@ -322,6 +328,10 @@ set_preferences!(UUID(\"f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f\"), \"libhdf5_hl\" => \"$hdf5_hl_library\", force = true) " +# Restore LD_PRELOAD if it had been set before +if [ "$CI" = "true" ] && [ -n "$store_ld_preload" ]; then + LD_PRELOAD="$store_ld_preload" +fi [ $? -eq 0 ] || die "could not configure system HDF5 library for Julia" echo From 4225f4535675b1b5c902b2ed5ee4b6d7a2eec669 Mon Sep 17 00:00:00 2001 From: Benedict <135045760+bgeihe@users.noreply.github.com> Date: Tue, 12 Sep 2023 12:24:46 +0200 Subject: [PATCH 6/6] Update utils/libtrixi-init-julia Co-authored-by: Michael Schlottke-Lakemper --- utils/libtrixi-init-julia | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/libtrixi-init-julia b/utils/libtrixi-init-julia index 76c24fa4..fdac701b 100755 --- a/utils/libtrixi-init-julia +++ b/utils/libtrixi-init-julia @@ -320,7 +320,7 @@ if [ "$CI" = "true" ] && [ -n "$LD_PRELOAD" ]; then store_ld_preload="$LD_PRELOAD" LD_PRELOAD="" fi -JULIA_HDF5_PATH="$hdf5_libdir" JULIA_DEPOT_PATH="$julia_depot" $julia_exec --project=. \ +JULIA_DEPOT_PATH="$julia_depot" $julia_exec --project=. \ -e " using Preferences, UUIDs set_preferences!(UUID(\"f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f\"),