@@ -49,7 +49,10 @@ apt upgrade -y
4949apt install -y build-essential g++-11 gcc-11 gfortran-11 g++-12 gcc-12 gfortran-12 g++-13 gcc-13 gfortran-13 make cmake automake autoconf apt-utils
5050
5151# Install other requirements.
52- apt install -y cpp-11 libgomp1 git git-lfs autopoint mysql-server libmysqlclient-dev qtbase5-dev qt5-qmake libqt5svg5-dev qt5dxcb-plugin wget curl file tcl-dev gnupg2 iproute2 locales unzip less bzip2 gettext libtree pkg-config libcurl4-openssl-dev mysql-server libtool flex
52+ apt install -y cpp-11 libgomp1 git git-lfs autopoint mysql-server libmysqlclient-dev qtbase5-dev qt5-qmake libqt5svg5-dev qt5dxcb-plugin wget curl file tcl-dev gnupg2 iproute2 locales unzip less bzip2 gettext libtree pkg-config libcurl4-openssl-dev mysql-server libtool flex llvm-14
53+
54+ # Set llvm config.
55+ update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-14 10
5356
5457# Editors
5558apt install -y vim nano
@@ -227,12 +230,46 @@ apt install intel-oneapi-compiler-dpcpp-cpp-2024.2 intel-oneapi-compiler-fortran
227230exit
228231```
229232
233+ #### Setup OneAPI Modules
234+
235+ ``` bash
236+ sudo su -
237+ # Create all modulefiles.
238+ /opt/intel/oneapi/modulefiles-setup.sh --output-dir=/opt/intel/oneapi/modulefiles
239+
240+ # Add the oneapi module files to lmod init (confirm that this file does not exist)
241+ cat << 'EOF ' >> /etc/profile.d/z01_lmod.sh
242+ module use /opt/intel/oneapi/modulefiles
243+ EOF
244+
245+ # Create combined module file.
246+ mkdir /opt/intel/oneapi/modulefiles/intel-oneapi-full-env/
247+ cat << 'EOF ' >> /opt/intel/oneapi/modulefiles/intel-oneapi-full-env/2024.2.1
248+ #%Module1.0
249+ ##
250+ ## intel-oneapi-full-env/2024.2.1
251+ ## Intel oneAPI full module environment
252+
253+ proc ModulesHelp { } {
254+ puts stderr "intel-oneapi-full-env defines the entire module set used for spack-stack intel builds"
255+ }
256+ module-whatis "intel-oneapi-full-env defines the entire module set used for spack-stack intel builds"
257+ module load tbb/2021.13
258+ module load compiler-rt/2024.2.1
259+ module load compiler/2024.2.1
260+ module load ifort/2024.2.1
261+ module load mpi/2021.13
262+ module load mkl/2024.2
263+ module load compiler-intel-llvm/2024.2.1
264+ EOF
265+ ```
266+
230267#### Install Intel OneAPI Spack-Stack Environment
231268
232269``` bash
233270sudo su -
234271
235- source /opt/ intel/ oneapi/setvars.sh
272+ module load intel- oneapi-full-env/2024.2.1
236273
237274cd /opt/spack-stack
238275source ./setup.sh
@@ -256,12 +293,12 @@ cat << 'EOF' >> ${SPACK_SYSTEM_CONFIG_PATH}/packages.yaml
256293 gcc:
257294 buildable: false
258295 externals:
259- - spec: gcc@13.3 .0
296+ - spec: gcc@11.4 .0
260297 prefix: /usr
261298 gcc-runtime:
262299 buildable: false
263300 externals:
264- - spec: gcc-runtime@13.3 .0
301+ - spec: gcc-runtime@11.4 .0
265302 prefix: /usr
266303 intel-oneapi-mkl:
267304 buildable: false
@@ -297,13 +334,17 @@ EOF
297334
298335spack compiler find --scope system
299336
300- # Replace ifx with ifort
337+ # Edit site/compilers.yaml
338+ pico ${PWD} /site/compilers.yaml
339+ # 1) Replace ifx with ifort.
340+ # 2) Add "- intel-oneapi-full-env/2024.2.1" to the modules section for oneapi.
341+ # 3) Disable gcc compilers other than 11.4.0
301342sed -i ' s/ifx/ifort/g' ${PWD} /site/compilers.yaml
302343
303344unset SPACK_SYSTEM_CONFIG_PATH
304345
305346spack config add
" packages:all:providers:mpi:[[email protected] ]" 306- spack config add
" packages:all:compiler:[[email protected] , gcc@13.3 .0]" 347+ spack config add
" packages:all:compiler:[[email protected] , gcc@11.4 .0]" 307348spack config add " packages:gmake:buildable:False"
308349
309350spack concretize 2>&1 | tee log.concretize
@@ -353,7 +394,7 @@ ctest
353394
354395``` bash
355396# Re-source the intel OneAPI environment
356- source /opt/ intel/ oneapi/setvars.sh
397+ module load intel- oneapi-full-env/2024.2.1
357398
358399# Example given for building jedi-bundle
359400module use /opt/spack-stack/envs/unified-env-oneapi/install/modulefiles/Core
0 commit comments