@@ -26,26 +26,34 @@ if ! command -v juliaup &> /dev/null; then
2626 exit 1
2727fi
2828
29- if ! command -v julia & > /dev/null; then
30- echo " Julia is not installed. Which version do you want to install?"
29+ # Ask which Julia version to use, defaulting to the currently active version
30+ if juliaup status 2> /dev/null | grep ' ^\s*\*' | grep -q ' 1\.12' ; then
31+ _default_julia=" 1.12"
32+ _default_choice=2
33+ else
34+ _default_julia=" 1.11"
35+ _default_choice=1
36+ fi
37+
38+ if [[ " $_yes " == " true" ]]; then
39+ _julia_choice=" "
40+ echo " Non-interactive mode: using Julia ${_default_julia} "
41+ else
42+ echo " Which Julia version do you want to use?"
3143 echo " 1) Julia 1.11"
3244 echo " 2) Julia 1.12"
33- if [[ " $_yes " == " true" ]]; then
34- _julia_choice=" "
35- echo " Non-interactive mode: using default (1.11)"
36- else
37- read -rp " Enter 1 or 2 [default: 1]: " _julia_choice
38- fi
39- case " ${_julia_choice} " in
40- 1|" " ) _desired_julia=" 1.11" ;;
41- 2) _desired_julia=" 1.12" ;;
42- * ) echo " Invalid choice. Exiting." ; exit 1 ;;
43- esac
44- echo " Installing Julia ${_desired_julia} ..."
45- juliaup add " ${_desired_julia} "
46- juliaup default " ${_desired_julia} "
47- echo " Julia ${_desired_julia} installed and set as default."
45+ read -rp " Enter 1 or 2 [default: ${_default_choice} ]: " _julia_choice
4846fi
47+ case " ${_julia_choice} " in
48+ 1) _desired_julia=" 1.11" ;;
49+ 2) _desired_julia=" 1.12" ;;
50+ " " ) _desired_julia=" ${_default_julia} " ;;
51+ * ) echo " Invalid choice. Exiting." ; exit 1 ;;
52+ esac
53+ echo " Installing and activating Julia ${_desired_julia} ..."
54+ juliaup add " ${_desired_julia} "
55+ juliaup default " ${_desired_julia} "
56+ echo " Julia ${_desired_julia} is now the default."
4957
5058julia_version=$( julia --version | awk ' {print($3)}' )
5159julia_major=${julia_version: 0: 3}
@@ -128,11 +136,7 @@ echo "Updating packages..."
128136if test -f " Manifest.toml" ; then
129137 rm Manifest.toml
130138fi
131- julia --startup-file=no --project -e " using Pkg; Pkg.add(\" PyCall\" ); Pkg.build(\" PyCall\" )"
132- if [[ $PYTHON == " " ]]; then
133- julia --startup-file=no --project -e " using Pkg; Pkg.add(\" Conda\" ); using Conda; Conda.add(\" matplotlib\" ); using ControlPlots"
134- fi
135- julia --startup-file=no --project -e " using Pkg; Pkg.instantiate()"
139+ julia --startup-file=no --project -e " using Pkg; Pkg.resolve(); Pkg.instantiate()"
136140
137141julia --project -t auto -e " using Pkg; Pkg.precompile()"
138142julia --project -t auto --heap-size-hint=8000M -e " include(\" ./test/create_sys_image.jl\" );"
0 commit comments