Skip to content

Commit 85ce182

Browse files
committed
fix version number extraction
1 parent 975f03e commit 85ce182

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/juhpc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ if [ -n "${JUHPC_CUDA_HOME}" ]; then # Set preference for using the local CUDA
101101

102102
julia --project=$JULIA_PREFDIR -e 'using Preferences; set_preferences!("CUDA_Runtime_jll", "local"=>true)'
103103
if [ -n "${JUHPC_CUDA_RUNTIME_VERSION}" ]; then
104-
julia --project=$JULIA_PREFDIR -e 'using Preferences; v=VersionNumber(ENV["JUHPC_CUDA_RUNTIME_VERSION"]); set_preferences!("CUDA_Runtime_jll", "version"=> "$(v.major).$(v.minor)")'
104+
julia --project=$JULIA_PREFDIR -e 'using Preferences; set_preferences!("CUDA_Runtime_jll", "version"=>join(split(ENV["JUHPC_CUDA_RUNTIME_VERSION"],".")[1:2],"."))'
105105
fi
106106
fi
107107

@@ -117,7 +117,7 @@ if [ -n "${JUHPC_ROCM_HOME}" ]; then export ROCM_PATH=$JUHPC_ROCM_HOME; fi
117117
julia --project=$JULIA_PREFDIR -e 'using Pkg; Pkg.add([p for (p,l) in [("MPIPreferences", "JUHPC_MPI_VENDOR"), ("MPIPreferences", "JUHPC_MPI_HOME"), ("CUDA", "JUHPC_CUDA_HOME"), ("AMDGPU", "JUHPC_ROCM_HOME"), ("HDF5", "JUHPC_HDF5_HOME")] if haskey(ENV,l) && ENV[l]!=""])'
118118

119119
if [ -n "${JUHPC_CUDA_HOME}" ]; then # Set preference for using the local CUDA runtime in a more stable way (in case the previous would not be valid anymore)
120-
julia --project=$JULIA_PREFDIR -e 'using CUDA; CUDA.set_runtime_version!((VersionNumber(ENV[key]) for key in ["JUHPC_CUDA_RUNTIME_VERSION"] if haskey(ENV,key) && ENV[key]!=="")...; local_toolkit=true)'
120+
julia --project=$JULIA_PREFDIR -e 'using CUDA; CUDA.set_runtime_version!((VersionNumber(join(split(ENV[key],".")[1:2],".")) for key in ["JUHPC_CUDA_RUNTIME_VERSION"] if haskey(ENV,key) && ENV[key]!=="")...; local_toolkit=true)'
121121
fi
122122

123123
if [ -n "${JUHPC_ROCM_HOME}" ]; then # Set preference for using the local ROCm runtime in a more stable way (in case the previous would not be valid anymore)
@@ -151,8 +151,8 @@ julia -e '
151151
println("""#!/bin/bash
152152
153153
info() {
154-
local message="$1"
155-
echo -e "$JUHPC $message" >&2
154+
local message="\$1"
155+
echo -e "$(ENV["JUHPC"]) \$message" >&2
156156
}
157157
158158
if [ ! -f $(ENV["JULIAUP_BINDIR"])/juliaup ]; then
@@ -181,6 +181,11 @@ export JULIA_DEPOT=$JULIAUP_INSTALLDIR/depot
181181
export ACTIVATE_SCRIPT=$JUHPC_SETUP_INSTALLDIR/activate
182182

183183
julia -e 'println("""
184+
info() {
185+
local message="\$1"
186+
echo -e "$(ENV["JUHPC"]) \$message" >&2
187+
}
188+
info "activating HPC setup for juliaup, julia and HPC key packages requiring system libraries..."
184189
export PATH=$(ENV["JULIAUP_WRAPPER_BINDIR"]):$(ENV["JULIAUP_BINDIR"]):\$PATH # The wrapper must be before the juliaup bindir
185190
export JULIAUP_DEPOT_PATH=$(ENV["JULIAUP_DEPOT"])
186191
export JULIA_DEPOT_PATH=$(ENV["JULIA_DEPOT"])

0 commit comments

Comments
 (0)