Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify multiple architectures for Julia to precompile to #2044

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions images/minimal-notebook/setup-scripts/setup-julia-packages.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ set -exuo pipefail
# - The JULIA_PKGDIR environment variable is set
# - Julia is already set up, with the setup-julia.bash command


# If we don't specify what CPUs the precompilation should be done for, it's
# *only* done for the target of the host doing the compilation. When the
# container runs on a host that's the same architecture, but a *different*
# generation of CPU than what the build host was, the precompilation is useless
# and Julia takes a long long time to start up. This specific multitarget comes
# from https://github.com/JuliaCI/julia-buildkite/blob/70bde73f6cb17d4381b62236fc2d96b1c7acbba7/utilities/build_envs.sh#L20-L76,
# and may need to be updated as new CPU generations come out.
# If the architecture the container runs on is different,
# precompilation may still have to be re-done on first startup - but this
# *should* catch most of the issues. See
# https://github.com/jupyter/docker-stacks/issues/2015 for more information
if [ "$(uname -m)" == "x86_64" ]; then
# See https://github.com/JuliaCI/julia-buildkite/blob/70bde73f6cb17d4381b62236fc2d96b1c7acbba7/utilities/build_envs.sh#L24
# for an explanation of these options
export JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"
elif [ "$(uname -m)" == "aarch64" ]; then
# See https://github.com/JuliaCI/julia-buildkite/blob/70bde73f6cb17d4381b62236fc2d96b1c7acbba7/utilities/build_envs.sh#L54
# for an explanation of these options
export JULIA_CPU_TARGET="generic;cortex-a57;thunderx2t99;carmel"
fi

# Install base Julia packages
julia -e '
import Pkg;
Expand Down