@@ -31,16 +31,6 @@ info() {
31
31
echo -e " $JUHPC $message " >&2
32
32
}
33
33
34
- info_start () {
35
- local message=" $1 "
36
- info " $message ..."
37
- }
38
-
39
- info_end () {
40
- local message=" $1 "
41
- info " ... done. $message completed."
42
- }
43
-
44
34
cleanup () {
45
35
info " cleaning up temporary juliaup installation in $TMP_JULIAUP_ROOTDIR ."
46
36
rm -rf " $TMP_JULIAUP_ROOTDIR "
@@ -102,8 +92,7 @@ check_dir "$JUHPC_SETUP_INSTALLDIR"
102
92
103
93
# Download and install julia in /tmp using juliaup
104
94
105
- INFO_MSG=" Installing temporary juliaup installation in $TMP_JULIAUP_ROOTDIR "
106
- info_start " $INFO_MSG "
95
+ info " Installing juliaup and julia temporarily in $TMP_JULIAUP_ROOTDIR ..."
107
96
108
97
export TMP_JULIAUP_BINDIR=" $TMP_JULIAUP_ROOTDIR /bin" # juliaup and julia binaries
109
98
export JULIAUP_DEPOT_PATH=" $TMP_JULIAUP_ROOTDIR /depot"
@@ -117,16 +106,16 @@ curl -fsSL https://install.julialang.org | sh -s -- --add-to-path=no --yes --pat
117
106
118
107
if [ ! -f " $TMP_JULIAUP_BINDIR /juliaup" ]; then error " temporary juliaup installation failed." ; fi
119
108
120
- info_end " $INFO_MSG "
109
+ info " ... done: temporary installation completed. "
121
110
122
111
123
112
# Create preferences for HPC key packages that require system libraries (MPI.jl, CUDA.jl, AMDGPU.jl, HDF5.jl, ADIOS2.jl, ...)
124
113
125
- INFO_MSG=" Creating preferences for HPC key packages"
126
- info_start " $INFO_MSG "
114
+ info " Creating preferences for HPC key packages..."
127
115
128
116
export JULIA_PREFDIR=" $JUHPC_SETUP_INSTALLDIR /julia_preferences"
129
117
export JULIA_PREF_PROJECT=" $JULIA_PREFDIR /Project.toml"
118
+ export JULIA_PREFS=" $JULIA_PREFDIR /LocalPreferences.toml"
130
119
mkdir -p " $JULIA_PREFDIR " || { error " failed to create directory: $JULIA_PREFDIR " ; }
131
120
132
121
if [[ -n " ${JUHPC_CUDA_HOME} " || -n " ${JUHPC_ROCM_HOME} " ]]; then
@@ -174,12 +163,14 @@ if [ -n "${JUHPC_HDF5_HOME}" ]; then
174
163
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")'
175
164
fi
176
165
177
- info_end " $INFO_MSG "
166
+ if [ ! -s " $JULIA_PREFS " ]; then error " preferences file is missing or empty." ; fi
167
+
168
+ info " ... done: preferences created."
178
169
179
170
180
171
# Create a wrapper for juliaup that installs juliaup (and latest julia) on scratch if it is not already installed
181
172
182
- info_start " Creating wrapper for juliaup"
173
+ info " Creating wrapper for juliaup... "
183
174
184
175
export JULIAUP_WRAPPER_BINDIR=" $JUHPC_SETUP_INSTALLDIR /juliaup_wrapper"
185
176
export JULIAUP_WRAPPER=" $JULIAUP_WRAPPER_BINDIR /juliaup"
@@ -207,14 +198,14 @@ JULIAUP_EXE="$(ENV["JULIAUP_BINDIR"])/juliaup"
207
198
208
199
if [ ! -f "\$JULIAUP_EXE" ]; then
209
200
print_logo
210
- 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"]) ..."
211
- sleep 3
201
+ info "This is the first call to juliaup: installing juliaup and the latest julia..."
202
+ sleep 2
212
203
PATH_OLD="\$PATH"
213
204
export PATH=\$(echo \$PATH | perl -pe "s|[^:]*juliaup(?:_wrapper)?[^:]*:?||g") # Remove all juliaup paths from PATH
214
205
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; }
215
206
export PATH="\$PATH_OLD"
216
207
if [ ! -f "\$JULIAUP_EXE" ]; then error "juliaup installation failed."; fi
217
- info "... done. Installation of juliaup and the latest julia in $(ENV["JULIAUP_INSTALLDIR"]) completed . You can use juliaup and julia normally."
208
+ info "... done: installation completed (location: $(ENV["JULIAUP_INSTALLDIR"])) . You can now use juliaup and julia normally."
218
209
else
219
210
"\$JULIAUP_EXE" \$@
220
211
fi
@@ -229,7 +220,7 @@ info "... done."
229
220
230
221
# Create an activation script that sets environment variables for juliaup, julia and HPC key packages
231
222
232
- info_start " Creating activate script"
223
+ info " Creating activate script... "
233
224
234
225
export JULIAUP_DEPOT=" $JULIAUP_INSTALLDIR /depot"
235
226
export JULIA_DEPOT=" $JULIAUP_INSTALLDIR /depot"
@@ -273,16 +264,15 @@ info "... done."
273
264
# Optionally execute a site-specific post installation julia script (if passed a third argument)
274
265
275
266
if [ -n " ${JUHPC_POST_INSTALL_JL} " ]; then
276
- INFO_MSG=" Executing site-specific post installation julia script (using the project where preferences were set)"
277
- info_start " $INFO_MSG "
267
+ info " Executing site-specific post-installation julia script (using the project where preferences were set)..."
278
268
julia --project=" $JULIA_PREFDIR " " $JUHPC_POST_INSTALL_JL "
279
- info_end " $INFO_MSG "
269
+ info " ... done: post-installation script completed. "
280
270
fi
281
271
282
272
283
273
# Remove temporary juliaup installation and Manifest.toml in the preferences directory
284
274
285
275
cleanup
286
- rm -f " $JULIA_PREFDIR /Manifest.toml"
276
+ mv " $JULIA_PREFDIR /Manifest.toml " " $JULIA_PREFDIR /Manifest.toml.bak " || { error " failed to move Manifest.toml in $JULIA_PREFDIR " ; }
287
277
288
- info " ... Installation of HPC setup for juliaup, julia and HPC key packages requiring system libraries is complete.\n\n"
278
+ info " ... The installation of the HPC setup for juliaup, julia and HPC key packages is complete.\n\n"
0 commit comments