|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +set -eu |
| 4 | + |
| 5 | +umask 0022 |
| 6 | +module purge |
| 7 | + |
| 8 | +if [ "$#" -lt 1 ]; then |
| 9 | + echo "Error: Not enough arguments. Provide Intel oneAPI installation prefix." |
| 10 | + exit 1 |
| 11 | +fi |
| 12 | + |
| 13 | +ONEAPI_INSTALL_DIR=${1} |
| 14 | +ONEAPI_VERSION="2026.0.0" |
| 15 | +COMPILER_VERSION="2026.0" |
| 16 | +MKL_VERSION="2026.0" |
| 17 | +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 |
| 18 | + |
| 19 | +mkdir -p ${ONEAPI_INSTALL_DIR}/src |
| 20 | +cd ${ONEAPI_INSTALL_DIR}/src |
| 21 | +wget ${ONEAPI_DOWNLOAD_URL} |
| 22 | +ONEAPI_INSTALL_SCRIPT="${ONEAPI_DOWNLOAD_URL##*/}" |
| 23 | +sh ./${ONEAPI_INSTALL_SCRIPT} -a --silent --eula accept --install-dir ${ONEAPI_INSTALL_DIR} --intel-sw-improvement-program-consent decline 2>&1 | tee log.install |
| 24 | + |
| 25 | +# Check that compiler and mkl versions are correct |
| 26 | +if [ ! -d "${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}" ]; then |
| 27 | + echo "Error, directory ${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION} does not exist" |
| 28 | + exit 1 |
| 29 | +fi |
| 30 | +if [ ! -d "${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}" ]; then |
| 31 | + echo "Error, directory ${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION} does not exist" |
| 32 | + exit 1 |
| 33 | +fi |
| 34 | + |
| 35 | +# Create modulefiles - special modules for Cray, Intel auto-generated modules elsewhere |
| 36 | +HOSTNAME=$(hostname) |
| 37 | +if [[ "${HOSTNAME}" == *"blueback"* || "${HOSTNAME}" == *"narwhal"* ]]; then |
| 38 | + mkdir -p ${ONEAPI_INSTALL_DIR}/modulefiles/intel-oneapi |
| 39 | + cat << EOF > ${ONEAPI_INSTALL_DIR}/modulefiles/intel-oneapi/2026.0.0 |
| 40 | +#%Module |
| 41 | +# |
| 42 | +# Intel oneAPI module |
| 43 | +# |
| 44 | +
|
| 45 | +conflict intel |
| 46 | +conflict intel-classic |
| 47 | +conflict intel-oneapi |
| 48 | +
|
| 49 | +set INTEL_CURPATH ${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION} |
| 50 | +set INTEL_LEVEL ${COMPILER_VERSION} |
| 51 | +
|
| 52 | +setenv INTEL_PATH \$INTEL_CURPATH |
| 53 | +setenv INTEL_VERSION \$INTEL_LEVEL |
| 54 | +setenv INTEL_COMPILER_TYPE "ONEAPI" |
| 55 | +
|
| 56 | +prepend-path {LD_LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/opt/compiler/lib:${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib} |
| 57 | +setenv {OCL_ICD_FILENAMES} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib/libintelocl.so} |
| 58 | +setenv {CMPLR_ROOT} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}} |
| 59 | +prepend-path {CMAKE_PREFIX_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}} |
| 60 | +prepend-path {NLSPATH} {} |
| 61 | +prepend-path {LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib} |
| 62 | +prepend-path {DIAGUTIL_PATH} {} |
| 63 | +prepend-path {MANPATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/share/man} |
| 64 | +prepend-path {PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/bin} |
| 65 | +prepend-path {PKG_CONFIG_PATH} {${ONEAPI_INSTALL_DIR}/compiler/${COMPILER_VERSION}/lib/pkgconfig} |
| 66 | +prepend-path {LD_LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib} |
| 67 | +prepend-path {CMAKE_PREFIX_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib/cmake} |
| 68 | +prepend-path {CPATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/include} |
| 69 | +prepend-path {LIBRARY_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib} |
| 70 | +setenv {MKLROOT} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}} |
| 71 | +prepend-path {PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/bin} |
| 72 | +prepend-path {PKG_CONFIG_PATH} {${ONEAPI_INSTALL_DIR}/mkl/${MKL_VERSION}/lib/pkgconfig} |
| 73 | +
|
| 74 | +proc ModulesHelp { } { |
| 75 | + global INTEL_LEVEL |
| 76 | + global INTEL_CURPATH |
| 77 | +} |
| 78 | +
|
| 79 | +# This module was produced with dom-gen 0.0.1 |
| 80 | +
|
| 81 | +module-whatis "Intel oneAPI compiler" |
| 82 | +EOF |
| 83 | + |
| 84 | +else |
| 85 | + cd ${ONEAPI_INSTALL_DIR} |
| 86 | + ./modulefiles-setup.sh --output-dir=${ONEAPI_INSTALL_DIR}/modulefiles --ignore-latest 2>&1 | tee log.modulefiles |
| 87 | + # Fix non-ascii symbols in Intel modulefiles; must follow links |
| 88 | + for file in `find ./modulefiles -type l`; do |
| 89 | + echo $file |
| 90 | + sed -i --follow-symlinks 's/®//g' $file |
| 91 | + done |
| 92 | +fi |
0 commit comments