Skip to content

Commit d8e994d

Browse files
authored
OneAPI updates (#1697)
1 parent 2a3e4f2 commit d8e994d

File tree

4 files changed

+57
-10
lines changed

4 files changed

+57
-10
lines changed

configs/sites/tier2/aws-ubuntu2404/README.md

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ apt upgrade -y
4949
apt 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
5558
apt install -y vim nano
@@ -227,12 +230,46 @@ apt install intel-oneapi-compiler-dpcpp-cpp-2024.2 intel-oneapi-compiler-fortran
227230
exit
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
233270
sudo su -
234271

235-
source /opt/intel/oneapi/setvars.sh
272+
module load intel-oneapi-full-env/2024.2.1
236273

237274
cd /opt/spack-stack
238275
source ./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

298335
spack 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
301342
sed -i 's/ifx/ifort/g' ${PWD}/site/compilers.yaml
302343

303344
unset SPACK_SYSTEM_CONFIG_PATH
304345

305346
spack 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]"
307348
spack config add "packages:gmake:buildable:False"
308349

309350
spack 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
359400
module use /opt/spack-stack/envs/unified-env-oneapi/install/modulefiles/Core

configs/sites/tier2/aws-ubuntu2404/compilers.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ compilers:
99
flags: {}
1010
operating_system: ubuntu24.04
1111
target: x86_64
12-
modules: []
12+
modules:
13+
- intel-oneapi-full-env/2024.2.1
1314
environment: {}
1415
extra_rpaths: []
1516
- compiler:
16-
spec: gcc@13.3.0
17+
spec: gcc@11.4.0
1718
paths:
1819
cc: /usr/bin/gcc
1920
cxx: /usr/bin/g++

configs/sites/tier2/aws-ubuntu2404/packages.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,8 @@ packages:
9292
externals:
9393
9494
prefix: /usr
95+
llvm:
96+
buildable: false
97+
externals:
98+
99+
prefix: /usr

configs/sites/tier2/aws-ubuntu2404/packages_oneapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
packages:
22
all:
3-
compiler:: [[email protected], gcc@13.3.0]
3+
compiler:: [[email protected], gcc@11.4.0]
44
providers:
55
66
# Remove the next three lines to switch to intel-oneapi-mkl

0 commit comments

Comments
 (0)