-
Notifications
You must be signed in to change notification settings - Fork 58
Add compiler install scripts in util/compilers #2099
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Utility script to install Intel oneAPI 2026.0.0, fix non-ascii characters | ||
| # in the Intel auto-generated modulefiles (bug filed with Intel to correct | ||
| # upstream) on non-Cray systems, or to create a single module on Cray systems. | ||
|
|
||
| # Missing: patching of libirc.so and libimf.so to add the missing symbolic | ||
| # links to libc.so.6 and libm.so.6. | ||
|
Comment on lines
+7
to
+8
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For those interested: Depending on the location of
and
and you'll need to install |
||
|
|
||
| set -eu | ||
|
|
||
| umask 0022 | ||
| module purge | ||
|
|
||
| if [ "$#" -lt 1 ]; then | ||
| echo "Error: Not enough arguments. Provide Intel oneAPI installation prefix." | ||
| exit 1 | ||
| fi | ||
|
|
||
| ONEAPI_INSTALL_DIR=${1} | ||
| ONEAPI_VERSION="2026.0.0" | ||
| COMPILER_VERSION="2026.0" | ||
| MKL_VERSION="2026.0" | ||
| ONEAPI_DOWNLOAD_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/71180075-e4e3-4c6f-bbbb-19017ed0cf7d/intel-oneapi-toolkit-2026.0.0.198_offline.sh | ||
|
|
||
| mkdir -p ${ONEAPI_INSTALL_DIR}/src | ||
| cd ${ONEAPI_INSTALL_DIR}/src | ||
| wget ${ONEAPI_DOWNLOAD_URL} | ||
| ONEAPI_INSTALL_SCRIPT="${ONEAPI_DOWNLOAD_URL##*/}" | ||
| sh ./${ONEAPI_INSTALL_SCRIPT} -a --silent --eula accept --install-dir ${ONEAPI_INSTALL_DIR} --intel-sw-improvement-program-consent decline 2>&1 | tee log.install | ||
|
|
||
| # Check that compiler and mkl versions are correct | ||
| if [ ! -d "${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}" ]; then | ||
| echo "Error, directory ${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION} does not exist" | ||
| exit 1 | ||
| fi | ||
| if [ ! -d "${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}" ]; then | ||
| echo "Error, directory ${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION} does not exist" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Create modulefiles - special modules for Cray, Intel auto-generated modules elsewhere | ||
|
eap marked this conversation as resolved.
|
||
| HOSTNAME=$(hostname) | ||
| if [[ "${HOSTNAME}" == *"blueback"* || "${HOSTNAME}" == *"narwhal"* ]]; then | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If your system is a cray, then add the hostname here. |
||
| mkdir -p ${ONEAPI_INSTALL_DIR}/modulefiles/intel-oneapi | ||
| cat << EOF > ${ONEAPI_INSTALL_DIR}/modulefiles/intel-oneapi/${ONEAPI_VERSION} | ||
| #%Module | ||
| # | ||
| # Intel oneAPI module | ||
| # | ||
|
|
||
| conflict intel | ||
| conflict intel-classic | ||
| conflict intel-oneapi | ||
|
|
||
| set INTEL_CURPATH ${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION} | ||
| set INTEL_LEVEL ${COMPILER_VERSION} | ||
|
|
||
| setenv INTEL_PATH \$INTEL_CURPATH | ||
| setenv INTEL_VERSION \$INTEL_LEVEL | ||
| setenv INTEL_COMPILER_TYPE "ONEAPI" | ||
|
|
||
| prepend-path {LD_LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/opt/compiler/lib:${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib} | ||
| setenv {OCL_ICD_FILENAMES} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib/libintelocl.so} | ||
| setenv {CMPLR_ROOT} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}} | ||
| prepend-path {CMAKE_PREFIX_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}} | ||
| prepend-path {NLSPATH} {} | ||
| prepend-path {LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib} | ||
| prepend-path {DIAGUTIL_PATH} {} | ||
| prepend-path {MANPATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/share/man} | ||
| prepend-path {PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/bin} | ||
| prepend-path {PKG_CONFIG_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib/pkgconfig} | ||
| prepend-path {LD_LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib} | ||
| prepend-path {CMAKE_PREFIX_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib/cmake} | ||
| prepend-path {CPATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/include} | ||
| prepend-path {LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib} | ||
| setenv {MKLROOT} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}} | ||
| prepend-path {PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/bin} | ||
| prepend-path {PKG_CONFIG_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib/pkgconfig} | ||
|
|
||
| proc ModulesHelp { } { | ||
| global INTEL_LEVEL | ||
| global INTEL_CURPATH | ||
| } | ||
|
|
||
| # This module was produced with dom-gen 0.0.1 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See below. I just needed to add something here ...
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's rename it to "was produced with the spack-stack Intel oneAPI installer wrapper" |
||
|
|
||
| module-whatis "Intel oneAPI compiler" | ||
| EOF | ||
|
|
||
| else | ||
| cd ${ONEAPI_INSTALL_DIR} | ||
| ./modulefiles-setup.sh --output-dir=${ONEAPI_INSTALL_DIR}/modulefiles --ignore-latest 2>&1 | tee log.modulefiles | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll also add: I have successfully stacked multiple versions of the oneAPI toolkit into the same install directory. If an existing |
||
| # Fix non-ascii symbols in Intel modulefiles; must follow links | ||
| for file in `find ./modulefiles -type l`; do | ||
| echo $file | ||
| sed -i --follow-symlinks 's/®//g' $file | ||
| done | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Utility script to install Intel oneAPI 2026.1.0, fix non-ascii characters | ||
| # in the Intel auto-generated modulefiles (bug filed with Intel to correct | ||
| # upstream) on non-Cray systems, or to create a single module on Cray systems. | ||
|
|
||
| # Missing: patching of libirc.so and libimf.so to add the missing symbolic | ||
| # links to libc.so.6 and libm.so.6. | ||
|
|
||
| set -eu | ||
|
|
||
| umask 0022 | ||
| module purge | ||
|
|
||
| if [ "$#" -lt 1 ]; then | ||
| echo "Error: Not enough arguments. Provide Intel oneAPI installation prefix." | ||
| exit 1 | ||
| fi | ||
|
|
||
| ONEAPI_INSTALL_DIR=${1} | ||
| ONEAPI_VERSION="2026.1.0" | ||
| COMPILER_VERSION="2026.1" | ||
| MKL_VERSION="2026.1" | ||
| ONEAPI_DOWNLOAD_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/33cb2a22-ddf1-4aa9-8d68-1f5a118acaf2/intel-oneapi-toolkit-2026.1.0.192_offline.sh | ||
|
|
||
| mkdir -p ${ONEAPI_INSTALL_DIR}/src | ||
| cd ${ONEAPI_INSTALL_DIR}/src | ||
| wget ${ONEAPI_DOWNLOAD_URL} | ||
| ONEAPI_INSTALL_SCRIPT="${ONEAPI_DOWNLOAD_URL##*/}" | ||
| sh ./${ONEAPI_INSTALL_SCRIPT} -a --silent --eula accept --install-dir ${ONEAPI_INSTALL_DIR} --intel-sw-improvement-program-consent decline 2>&1 | tee log.install | ||
|
|
||
| # Check that compiler and mkl versions are correct | ||
| if [ ! -d "${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}" ]; then | ||
| echo "Error, directory ${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION} does not exist" | ||
| exit 1 | ||
| fi | ||
| if [ ! -d "${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}" ]; then | ||
| echo "Error, directory ${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION} does not exist" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Create modulefiles - special modules for Cray, Intel auto-generated modules elsewhere | ||
| HOSTNAME=$(hostname) | ||
| if [[ "${HOSTNAME}" == *"blueback"* || "${HOSTNAME}" == *"narwhal"* ]]; then | ||
| mkdir -p ${ONEAPI_INSTALL_DIR}/modulefiles/intel-oneapi | ||
| cat << EOF > ${ONEAPI_INSTALL_DIR}/modulefiles/intel-oneapi/${ONEAPI_VERSION} | ||
| #%Module | ||
| # | ||
| # Intel oneAPI module | ||
| # | ||
|
|
||
| conflict intel | ||
| conflict intel-classic | ||
| conflict intel-oneapi | ||
|
|
||
| set INTEL_CURPATH ${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION} | ||
| set INTEL_LEVEL ${COMPILER_VERSION} | ||
|
|
||
| setenv INTEL_PATH \$INTEL_CURPATH | ||
| setenv INTEL_VERSION \$INTEL_LEVEL | ||
| setenv INTEL_COMPILER_TYPE "ONEAPI" | ||
|
|
||
| prepend-path {LD_LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/opt/compiler/lib:${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib} | ||
| setenv {OCL_ICD_FILENAMES} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib/libintelocl.so} | ||
| setenv {CMPLR_ROOT} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}} | ||
| prepend-path {CMAKE_PREFIX_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}} | ||
| prepend-path {NLSPATH} {} | ||
| prepend-path {LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib} | ||
| prepend-path {DIAGUTIL_PATH} {} | ||
| prepend-path {MANPATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/share/man} | ||
| prepend-path {PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/bin} | ||
| prepend-path {PKG_CONFIG_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib/pkgconfig} | ||
| prepend-path {LD_LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib} | ||
| prepend-path {CMAKE_PREFIX_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib/cmake} | ||
| prepend-path {CPATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/include} | ||
| prepend-path {LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib} | ||
| setenv {MKLROOT} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}} | ||
| prepend-path {PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/bin} | ||
| prepend-path {PKG_CONFIG_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib/pkgconfig} | ||
|
|
||
| proc ModulesHelp { } { | ||
| global INTEL_LEVEL | ||
| global INTEL_CURPATH | ||
| } | ||
|
|
||
| # This module was produced with dom-gen 0.0.1 | ||
|
|
||
| module-whatis "Intel oneAPI compiler" | ||
| EOF | ||
|
|
||
| else | ||
| cd ${ONEAPI_INSTALL_DIR} | ||
| ./modulefiles-setup.sh --output-dir=${ONEAPI_INSTALL_DIR}/modulefiles --ignore-latest 2>&1 | tee log.modulefiles | ||
| # Fix non-ascii symbols in Intel modulefiles; must follow links | ||
| for file in `find ./modulefiles -type l`; do | ||
| echo $file | ||
| sed -i --follow-symlinks 's/®//g' $file | ||
| done | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Note. nvhpc binds to the system gcc at install time. A system update | ||
| # that bumps the default gcc means reinstalling the SDK, not just | ||
| # rebuilding the software stack and the downstream applications. | ||
|
|
||
| if [ "$#" -lt 1 ]; then | ||
| echo "Error: Not enough arguments. Provide NVHPC SDK installation prefix." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Configure install via command line arguments | ||
| export NVHPC_SILENT=true | ||
| export NVHPC_INSTALL_DIR=${1} | ||
| export NVHPC_INSTALL_TYPE=single # or "network" for heterogeneous systems; check installer doc for details | ||
| export NVHPC_DEFAULT_CUDA=13.2 # optional; sets the default CUDA version | ||
|
|
||
| # Download and install nvhpc | ||
| mkdir -p ${NVHPC_INSTALL_DIR}/src | ||
| cd ${NVHPC_INSTALL_DIR}/src | ||
| wget https://developer.download.nvidia.com/hpc-sdk/26.5/nvhpc_2026_265_Linux_x86_64_cuda_13.2.tar.gz | ||
| tar xpzf nvhpc_2026_265_Linux_x86_64_cuda_13.2.tar.gz | ||
| nvhpc_2026_265_Linux_x86_64_cuda_13.2/install | ||
|
|
||
| # Bug fix for missing include directory (symbolic link) | ||
| cd ${NVHPC_INSTALL_DIR} | ||
| ln -s Linux_x86_64/26.5/compilers/include include | ||
|
|
||
| cd ${NVHPC_INSTALL_DIR}/src | ||
| rm -fr nvhpc_2026_265_Linux_x86_64_cuda_13.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't used the "intel-oneapi-toolkit" installer before; what is included with this installer? Just oneAPI c/c++/fortran/mkl or does it include other things like oneapi-mpi and tbb ? In any case documenting the targets up here would be helpful just so its clear what is included by this script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intel oneAPI Toolkit
Compilers, MPI, MKL, TBB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional, mandatory dependencies nowadays are umf and a few others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It includes a lot. From my look at 2026.1 I see:
Normally when I install locally, I do:
Which means I exclude:
— Intel oneAPI Collective Communications Library
— Intel Cryptography Primitives Library
— Intel VTune Profiler
— Intel oneAPI Deep Neural Network Library
Some I suppose VTune might be nice to have but it is also pretty bulky. No one (yet) has asked for the other ones so I just ignore them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I don't really care about these. For one, if we install the compiler one time with this install script instead of every time a new environment is built with Spack that builds its own compilers, we are still saving a lot of disk space. Second, if someone comes around who is using spack-stack and then wants to use those dependencies for their work, I have to go back in. As I said, these are pragmatic scripts that are supposed to cover our needs with the minimum effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eap These scripts are really only for us and for convenience. I would expect us to go and look at the Intel oneAPI toolkit website/documentation to see what's included - this changes with releases (they went through several iterations over the last years; some releases had separate base + hpc toolkits, now it is only one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe adding a link to the official website/documentation will do ... but running a google search is just as fast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works for me; I just wasn't familiar with that; I've defaulted to using their apt install sources.