5
5
# - preferences for HPC key packages that require system libraries;
6
6
# - a wrapper for juliaup that installs juliaup (and latest julia) in an appropriate location (e.g., scratch) if it is not already installed;
7
7
# - an activation script that sets environment variables for juliaup, julia and HPC key packages;
8
- # - an uenv view equivalent to the activation script (optional ).
8
+ # - optionally executing a site-specific post installation julia script, using the project where preferences were set (e.g, to modify preferences or to create an uenv view equivalent to the activation script).
9
9
10
10
11
11
# Define info, error, cleanup and check functions
@@ -50,7 +50,7 @@ check_dir() {
50
50
51
51
export JUHPC_SETUP_INSTALLDIR=" $1 "
52
52
export JULIAUP_INSTALLDIR=" $2 "
53
- export JUHPC_UENV_VIEW_CREATOR =" $3 "
53
+ export JUHPC_POST_INSTALL_JL =" $3 "
54
54
55
55
56
56
# Set (derived) general environment variables
@@ -62,14 +62,14 @@ export TMP_JULIAUP_ROOTDIR=$TMP/juliaup
62
62
63
63
# Start installation
64
64
65
- info " starting installation of HPC setup for juliaup, julia and HPC key packages requiring system libraries..."
65
+ info " Starting installation of HPC setup for juliaup, julia and HPC key packages requiring system libraries..."
66
66
check_var " JULIAUP_INSTALLDIR" " JUHPC_SETUP_INSTALLDIR"
67
67
check_dir " $JUHPC_SETUP_INSTALLDIR "
68
68
69
69
70
70
# Download and install julia in /tmp using juliaup
71
71
72
- info " installing temporary juliaup installation in $TMP_JULIAUP_ROOTDIR ..."
72
+ info " Installing temporary juliaup installation in $TMP_JULIAUP_ROOTDIR ..."
73
73
74
74
export TMP_JULIAUP_BINDIR=$TMP_JULIAUP_ROOTDIR /bin # juliaup and julia binaries
75
75
export JULIAUP_DEPOT_PATH=$TMP_JULIAUP_ROOTDIR /depot
@@ -85,7 +85,7 @@ info "... done."
85
85
86
86
# Create preferences for HPC key packages that require system libraries (MPI.jl, CUDA.jl, HDF5.jl, ADIOS2.jl, ...)
87
87
88
- info " creating preferences for HPC key packages..."
88
+ info " Creating preferences for HPC key packages..."
89
89
90
90
export JULIA_PREFDIR=$JUHPC_SETUP_INSTALLDIR /julia_preferences
91
91
export JULIA_PREF_PROJECT=$JULIA_PREFDIR /Project.toml
@@ -141,7 +141,7 @@ info "... done."
141
141
142
142
# Create a wrapper for juliaup that installs juliaup (and latest julia) on scratch if it is not already installed
143
143
144
- info " creating wrapper for juliaup..."
144
+ info " Creating wrapper for juliaup..."
145
145
146
146
export JULIAUP_WRAPPER_BINDIR=$JUHPC_SETUP_INSTALLDIR /juliaup_wrapper
147
147
export JULIAUP_WRAPPER=$JULIAUP_WRAPPER_BINDIR /juliaup
@@ -156,7 +156,7 @@ info() {
156
156
}
157
157
158
158
if [ ! -f $(ENV["JULIAUP_BINDIR"])/juliaup ]; then
159
- info "installing juliaup and latest julia in $(ENV["JULIAUP_INSTALLDIR"])..."
159
+ info "This is the first call to juliaup; juliaup and the latest julia will now be installed. After that, you can use juliaup and julia normally. Installing in $(ENV["JULIAUP_INSTALLDIR"])..."
160
160
PATH_OLD=\$PATH
161
161
export PATH=\$(echo \$PATH | perl -pe "s|[^:]*juliaup(?:_wrapper)?[^:]*:?||g") # Remove all juliaup paths from PATH
162
162
curl -fsSL https://install.julialang.org | sh -s -- --add-to-path=no --yes --path=$(ENV["JULIAUP_INSTALLDIR"]) --background-selfupdate 0 --startup-selfupdate 0 || { echo "Failed to install Juliaup (and Julia)." >&2; exit 1; }
@@ -174,7 +174,7 @@ info "... done."
174
174
175
175
# Create an activation script that sets environment variables for juliaup, julia and HPC key packages
176
176
177
- info " creating activation script..."
177
+ info " Creating activation script..."
178
178
179
179
export JULIAUP_DEPOT=$JULIAUP_INSTALLDIR /depot
180
180
export JULIA_DEPOT=$JULIAUP_INSTALLDIR /depot
@@ -185,39 +185,46 @@ info() {
185
185
local message="\$1"
186
186
echo -e "$(ENV["JUHPC"]) \$message" >&2
187
187
}
188
- info "activating HPC setup for juliaup, julia and HPC key packages requiring system libraries..."
188
+ info "Activating HPC setup for juliaup, julia and HPC key packages requiring system libraries..."
189
189
export PATH=$(ENV["JULIAUP_WRAPPER_BINDIR"]):$(ENV["JULIAUP_BINDIR"]):\$PATH # The wrapper must be before the juliaup bindir
190
+ info "PATH: \$PATH"
190
191
export JULIAUP_DEPOT_PATH=$(ENV["JULIAUP_DEPOT"])
192
+ info "JULIAUP_DEPOT_PATH: \$JULIAUP_DEPOT_PATH"
191
193
export JULIA_DEPOT_PATH=$(ENV["JULIA_DEPOT"])
194
+ info "JULIA_DEPOT_PATH: \$JULIA_DEPOT_PATH"
192
195
export JULIA_LOAD_PATH=:$(ENV["JULIA_PREFDIR"])
193
- $(haskey(ENV,"JUHPC_CUDA_HOME") && ENV["JUHPC_CUDA_HOME"] != "" ?
194
- "export CUDA_HOME=$(ENV["JUHPC_CUDA_HOME"]); export JULIA_CUDA_MEMORY_POOL=none" : "")
195
- $(haskey(ENV,"JUHPC_ROCM_HOME") && ENV["JUHPC_ROCM_HOME"] != "" ?
196
- "export ROCM_PATH=$(ENV["JUHPC_ROCM_HOME"])" : "")
197
- $(haskey(ENV,"JUHPC_ADIOS2_HOME") && ENV["JUHPC_ADIOS2_HOME"] != "" ?
198
- "export JULIA_ADIOS2_PATH=$(ENV["JUHPC_ADIOS2_HOME"])" : "")
199
- echo -e "PATH=\$PATH\n"\
200
- "JULIAUP_DEPOT_PATH=\$JULIAUP_DEPOT_PATH\n"\
201
- "JULIA_DEPOT_PATH=\$JULIA_DEPOT_PATH\n"\
202
- "JULIA_LOAD_PATH=\$JULIA_LOAD_PATH\n"\
203
- "CUDA_HOME=\$CUDA_HOME\n"\
204
- "JULIA_ADIOS2_PATH=\$JULIA_ADIOS2_PATH" >&2
196
+ info "JULIA_LOAD_PATH: \$JULIA_LOAD_PATH"
197
+ $(haskey(ENV,"JUHPC_CUDA_HOME") && ENV["JUHPC_CUDA_HOME"] != "" ? """
198
+ export CUDA_HOME=$(ENV["JUHPC_CUDA_HOME"])
199
+ info "CUDA_HOME: \$CUDA_HOME"
200
+ export JULIA_CUDA_MEMORY_POOL=none
201
+ info "JULIA_CUDA_MEMORY_POOL: \$JULIA_CUDA_MEMORY_POOL"
202
+ """ : "")
203
+ $(haskey(ENV,"JUHPC_ROCM_HOME") && ENV["JUHPC_ROCM_HOME"] != "" ? """
204
+ export ROCM_PATH=$(ENV["JUHPC_ROCM_HOME"])
205
+ info "ROCM_PATH: \$ROCM_PATH"
206
+ """ : "")
207
+ $(haskey(ENV,"JUHPC_ADIOS2_HOME") && ENV["JUHPC_ADIOS2_HOME"] != "" ? """
208
+ export JULIA_ADIOS2_PATH=$(ENV["JUHPC_ADIOS2_HOME"])
209
+ info "JULIA_ADIOS2_PATH: \$JULIA_ADIOS2_PATH"
210
+ """ : "")
205
211
""")' > $ACTIVATE_SCRIPT
206
212
207
213
info " ... done."
208
214
209
215
210
- # Optionally create an uenv view equivalent to the activation script - only done if JUHPC_UENV_VIEW_CREATOR is set
216
+ # Optionally execute a site-specific post installation julia script ( if passed a third argument)
211
217
212
- if [ -n " ${JUHPC_UENV_VIEW_CREATOR } " ]; then
213
- info " creating uenv view ..."
214
- julia $JUHPC_UENV_VIEW_CREATOR
218
+ if [ -n " ${JUHPC_POST_INSTALL_JL } " ]; then
219
+ info " Executing site-specific post installation julia script (using the project where preferences were set) ..."
220
+ julia --project= $JULIA_PREFDIR $JUHPC_POST_INSTALL_JL
215
221
info " ... done."
216
222
fi
217
223
218
224
219
- # Remove temporary juliaup installation
225
+ # Remove temporary juliaup installation and Manifest.toml in the preferences directory
220
226
221
227
cleanup
228
+ rm -f $JULIA_PREFDIR /Manifest.toml
222
229
223
- info " ... HPC setup for juliaup, julia and HPC key packages requiring system libraries is complete."
230
+ info " ... Installation of HPC setup for juliaup, julia and HPC key packages requiring system libraries is complete."
0 commit comments