-
Notifications
You must be signed in to change notification settings - Fork 26
172 lines (164 loc) · 6.89 KB
/
cmake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Build
on: [push, pull_request]
jobs:
build-linux:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
compiler: [g++-7] #, g++-8, g++-9, g++-10, clang++-8, clang++-9, clang++-10]
CUDA: ['0'] #, '8.0', '11.0', 'NVHPC-22.5']
ONEAPI: ['0', '2023.2.0', '2024.0']
runs-on: ${{ matrix.os }}
env:
CUDA_ROOT: '/usr/local/cuda'
steps:
- name: Install g++-7 (if needed)
if: matrix.compiler == 'g++-7'
run: |
sudo apt install g++-7
- name: Install g++-8 (if needed)
if: matrix.compiler == 'g++-8'
run: |
sudo apt install g++-8
- name: Install clang++-8 (if needed)
if: matrix.compiler == 'clang++-8'
run: |
sudo apt install clang-8
- name: Install clang++-9 (if needed)
if: matrix.compiler == 'clang++-9'
run: |
sudo apt install clang-9
- name: Install clang++-10 (if needed)
if: matrix.compiler == 'clang++-10'
run: |
sudo apt install clang-10
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Install CUDA runtime (if needed)
if: matrix.CUDA != '0' && matrix.ONEAPI == 0
run: |
case ${{ matrix.CUDA }} in
8.0)
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/patches/2/cuda_8.0.61.2_linux-run
sudo sh cuda_8.0.61_375.26_linux-run --extract=${CUDA_ROOT}
sudo sh ${CUDA_ROOT}/cuda-linux64-rel-8.0.61-21551265.run --tar mxvf -C ${CUDA_ROOT}
sudo sh cuda_8.0.61.2_linux-run --accept-eula --silent --installdir=${CUDA_ROOT}
;;
11.0)
wget https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda_11.0.3_450.51.06_linux.run
sudo sh cuda_11.0.3_450.51.06_linux.run --toolkit --toolkitpath=${CUDA_ROOT} --override --silent
;;
NVHPC-22.5)
wget https://developer.download.nvidia.com/hpc-sdk/22.5/nvhpc_2022_225_Linux_x86_64_cuda_11.7.tar.gz
tar xpzf nvhpc_2022_225_Linux_x86_64_cuda_11.7.tar.gz
sudo NVHPC_SILENT="true" NVHPC_INSTALL_DIR="$CUDA_ROOT" NVHPC_INSTALL_TYPE="single" ./nvhpc_2022_225_Linux_x86_64_cuda_11.7/install
esac
- name: Install OneAPI Base-Toolkit (if needed)
if: matrix.ONEAPI != '0' && matrix.CUDA == '0'
run: |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update
sudo apt install intel-basekit-${{ matrix.ONEAPI }}
- name: Create build directory
run: |
mkdir build
- name: Run CMake configure (default)
if: matrix.CUDA == '0' && matrix.ONEAPI == '0'
env:
CXX: ${{ matrix.compiler }}
run: |
cd build
cmake ..
- name: Run CMake configure (CUDA)
if: matrix.CUDA != '0' && matrix.CUDA != 'NVHPC-22.5' && matrix.ONEAPI == '0'
env:
CXX: ${{ matrix.compiler }}
run: |
export CPATH=${CUDA_ROOT}/include:${CPATH}
export LD_LIBRARY_PATH=${CUDA_ROOT}/lib64:${CUDA_ROOT}/lib64/stubs:${LD_LIBRARY_PATH}
export LIBRARY_PATH=${CUDA_ROOT}/lib64:${CUDA_ROOT}/lib64/stubs:${LIBRARY_PATH}
export CUDA_LIB_PATH=${CUDA_ROOT}/lib64:${CUDA_ROOT}/lib64/stubs
export PATH=${CUDA_ROOT}:${PATH}
export CUDA_HOME=${CUDA_ROOT}
export CUDA_PATH=${CUDA_ROOT}
export CUDAToolkit_ROOT=${CUDA_ROOT}
cd build
cmake -DFIRESTARTER_BUILD_TYPE="FIRESTARTER_CUDA" -DCMAKE_EXE_LINKER_FLAGS="-L${CUDA_ROOT}/lib64/stubs/" ..
- name: Run CMake configure (CUDA with NVHPC)
if: matrix.CUDA == 'NVHPC-22.5' && matrix.ONEAPI == '0'
env:
CXX: ${{ matrix.compiler }}
run: |
NVARCH=`uname -s`_`uname -m`; export NVARCH
PATH=$CUDA_ROOT/$NVARCH/22.5/compilers/bin:$PATH; export PATH
LD_LIBRARY_PATH=$CUDA_ROOT/$NVARCH/22.5/compilers/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
LD_LIBRARY_PATH=$CUDA_ROOT/$NVARCH/22.5/cuda/11.7/lib64:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
LD_LIBRARY_PATH=$CUDA_ROOT/$NVARCH/22.5/cuda/11.7/lib64/stubs:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
cd build
cmake -DFIRESTARTER_BUILD_TYPE="FIRESTARTER_CUDA" -DCMAKE_EXE_LINKER_FLAGS=-L"$CUDA_ROOT/$NVARCH/22.5/cuda/11.7/lib64/stubs" -LA ..
- name: Run CMake configure (OneAPI 2023.2.0)
if: matrix.CUDA == '0' && matrix.ONEAPI =='2023.2.0'
run: |
. /opt/intel/oneapi/setvars.sh
cd build
cmake -DFIRESTARTER_BUILD_TYPE="FIRESTARTER_ONEAPI" ..
- name: Run CMake configure (OneAPI 2024.0)
if: matrix.CUDA == '0' && matrix.ONEAPI =='2024.0'
run: |
. /opt/intel/oneapi/${{ matrix.ONEAPI }}/oneapi-vars.sh
cd build
cmake -DFIRESTARTER_BUILD_TYPE="FIRESTARTER_ONEAPI" ..
- name: Build (default, CUDA)
if: matrix.ONEAPI =='0'
run: |
cd build
make -j2
- name: Build (OneAPI 2023.2.0)
if: matrix.CUDA == '0' && matrix.ONEAPI =='2023.2.0'
run: |
. /opt/intel/oneapi/setvars.sh
cd build
cmake -DFIRESTARTER_BUILD_TYPE="FIRESTARTER_ONEAPI" ..
- name: Build (OneAPI 2024.0)
if: matrix.CUDA == '0' && matrix.ONEAPI =='2024.0'
run: |
. /opt/intel/oneapi/${{ matrix.ONEAPI }}/oneapi-vars.sh
cd build
make -j2
- name: Strip binary (default)
if: matrix.CUDA == '0' && matrix.ONEAPI == '0'
run: |
cd build
strip src/FIRESTARTER
- name: Strip binary (CUDA)
if: matrix.CUDA != '0' && matrix.ONEAPI == '0'
run: |
cd build
strip src/FIRESTARTER_CUDA
- name: Strip binary (OneAPI)
if: matrix.ONEAPI != '0' && matrix.CUDA == '0'
run: |
cd build
strip src/FIRESTARTER_ONEAPI
- name: Test FIRESTARTER (default)
if: matrix.CUDA == '0' && matrix.ONEAPI == '0'
run: ./build/src/FIRESTARTER -t 1
- uses: actions/upload-artifact@v2
if: matrix.compiler == 'clang++-10' && matrix.CUDA == '0' && matrix.ONEAPI == '0'
with:
name: FIRESTARTER-linux
path: build/src/FIRESTARTER
- uses: actions/upload-artifact@v2
if: matrix.compiler == 'clang++-10' && matrix.CUDA != '0' && matrix.ONEAPI == '0'
with:
name: FIRESTARTER_CUDA_${{ matrix.CUDA }}-linux
path: build/src/FIRESTARTER_CUDA
- uses: actions/upload-artifact@v2
if: matrix.compiler == 'clang++-10' && matrix.CUDA == '0' && matrix.ONEAPI != '0'
with:
name: FIRESTARTER_ONEAPI_${{ matrix.ONEAPI }}-linux
path: build/src/FIRESTARTER_ONEAPI