You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [[ -n"${JUHPC_CUDA_HOME}"||-n"${JUHPC_ROCM_HOME}" ]];then
95
+
julia --project=$JULIA_PREFDIR -e 'using Pkg; Pkg.add("Preferences")'
96
+
echo"[extras]">>$JULIA_PREF_PROJECT
97
+
fi
98
+
99
+
if [ -n"${JUHPC_CUDA_HOME}" ];then# Set preference for using the local CUDA runtime before any installation of CUDA.jl to avoid downloading of artifacts
julia --project=$JULIA_PREFDIR -e 'using Preferences; set_preferences!("CUDA_Runtime_jll", "local"=>true)'
103
+
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)")'
105
+
fi
106
+
fi
107
+
108
+
if [ -n"${JUHPC_ROCM_HOME}" ];then# Set preference for using the local ROCm runtime before any installation of AMDGPU.jl to avoid downloading of artifacts
julia --project=$JULIA_PREFDIR -e 'using Preferences; set_preferences!("AMDGPU", "use_artifacts"=>false, "eager_gc"=>false)'
112
+
fi
113
+
114
+
if [ -n"${JUHPC_CUDA_HOME}" ];thenexport CUDA_HOME=$JUHPC_CUDA_HOME;fi
115
+
if [ -n"${JUHPC_ROCM_HOME}" ];thenexport ROCM_PATH=$JUHPC_ROCM_HOME;fi
116
+
117
+
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]!=""])'
118
+
119
+
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)'
121
+
fi
122
+
123
+
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)
124
+
julia --project=$JULIA_PREFDIR -e 'using ROCM; ROCM.AMDGPU.ROCmDiscovery.use_artifacts!(false)'
125
+
fi
126
+
127
+
if [ -n"${JUHPC_MPI_VENDOR}" ];then
128
+
check_var "JUHPC_MPI_EXEC"
129
+
julia --project=$JULIA_PREFDIR -e 'using MPIPreferences; MPIPreferences.use_system_binary(mpiexec=split(ENV["JUHPC_MPI_EXEC"]), vendor=ENV["JUHPC_MPI_VENDOR"])'
130
+
elif [ -n"${JUHPC_MPI_HOME}" ];then
131
+
check_var "JUHPC_MPI_EXEC"
132
+
julia --project=$JULIA_PREFDIR -e 'using MPIPreferences; MPIPreferences.use_system_binary(mpiexec=split(ENV["JUHPC_MPI_EXEC"]), extra_paths=["$(ENV["JUHPC_MPI_HOME"])/lib"])'
133
+
fi
134
+
135
+
if [ -n"${JUHPC_HDF5_HOME}" ];then
136
+
julia --project=$JULIA_PREFDIR -e 'using HDF5; HDF5.API.set_libraries!("$(ENV["JUHPC_HDF5_HOME"])/lib/libhdf5.so", "$(ENV["JUHPC_HDF5_HOME"])/lib/libhdf5_hl.so")'
137
+
fi
138
+
139
+
info "... done."
140
+
141
+
142
+
# Create a wrapper for juliaup that installs juliaup (and latest julia) on scratch if it is not already installed
0 commit comments