forked from NCAR/UFS_UTILS
-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (152 loc) · 5.55 KB
/
intel.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
name: intel
on: [push, pull_request]
# Use custom shell with -l so .bash_profile is sourced which loads intel/oneapi/setvars.sh
# without having to do it in manually every step
defaults:
run:
shell: bash -leo pipefail {0}
jobs:
intel-build-and-test:
runs-on: ${{ matrix.os }}
env:
CC: icc
FC: ifort
CXX: icpc
strategy:
matrix:
os: [ubuntu-20.04]
steps:
# See https://software.intel.com/content/www/us/en/develop/articles/oneapi-repo-instructions.html
- name: install-intel
run: |
cd /tmp
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile
- name: cache-netcdf
id: cache-netcdf
uses: actions/cache@v2
with:
path: ~/netcdf
key: netcdf-c-$4.7.4-{{ runner.os }}-intel
- name: build-hdf5
if: steps.cache-netcdf.outputs.cache-hit != 'true'
run: |
export CC=mpiicc
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.7/src/hdf5-1.10.7.tar.gz &> /dev/null
tar -xzf hdf5-1.10.7.tar.gz
pushd hdf5-1.10.7
./configure --prefix=${HOME}/netcdf --enable-parallel --disable-tools --disable-fortran --disable-cxx --enable-parallel-tests
make -j2
make install
- name: build-netcdf-c
if: steps.cache-netcdf.outputs.cache-hit != 'true'
run: |
export CC=mpiicc
export CPPFLAGS=-I${HOME}/netcdf/include
export LDFLAGS=-L${HOME}/netcdf/lib
wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-c-4.7.4.tar.gz &> /dev/null
tar -xzf netcdf-c-4.7.4.tar.gz
pushd netcdf-c-4.7.4
./configure --prefix=${HOME}/netcdf --disable-dap --disable-utilities
make -j2
make install
- name: build-netcdf-fortran
if: steps.cache-netcdf.outputs.cache-hit != 'true'
run: |
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${HOME}/netcdf/lib"
export PATH="${HOME}/netcdf/bin:$PATH"
export CC=mpiicc
export FC=mpiifort
export CPPFLAGS=-I${HOME}/netcdf/include
export LDFLAGS=-L${HOME}/netcdf/lib
wget https://github.com/Unidata/netcdf-fortran/archive/v4.5.3.tar.gz &> /dev/null
tar -xzf v4.5.3.tar.gz
pushd netcdf-fortran-4.5.3
./configure --prefix=${HOME}/netcdf
make -j2
make install
- name: cache-esmf
id: cache-esmf
uses: actions/cache@v2
with:
path: ~/esmf
key: esmf-8.0.1-${{ runner.os }}-intel
- name: build-esmf
if: steps.cache-esmf.outputs.cache-hit != 'true'
run: |
pushd ~
export ESMF_DIR=~/esmf-ESMF_8_0_1
wget https://github.com/esmf-org/esmf/archive/ESMF_8_0_1.tar.gz &> /dev/null
tar zxf ESMF_8_0_1.tar.gz
cd esmf-ESMF_8_0_1
export ESMF_COMM=intelmpi
export ESMF_INSTALL_BINDIR=bin
export ESMF_INSTALL_LIBDIR=lib
export ESMF_INSTALL_MODDIR=mod
export ESMF_COMPILER=intel
export ESMF_INSTALL_PREFIX=~/esmf
export ESMF_NETCDF=split
export ESMF_NETCDF_INCLUDE=${HOME}/netcdf/include
export ESMF_NETCDF_LIBPATH=${HOME}/netcdf/lib
make -j2
make install
- name: cache-jasper
id: cache-jasper
uses: actions/cache@v2
with:
path: ~/jasper
key: jasper-2.0.25-${{ runner.os }}-intel
- name: build-jasper
if: steps.cache-jasper.outputs.cache-hit != 'true'
run: |
wget https://github.com/jasper-software/jasper/archive/version-2.0.25.tar.gz &> /dev/null
tar zxf version-2.0.25.tar.gz
cd jasper-version-2.0.25
mkdir build-jasper && cd build-jasper
cmake .. -DCMAKE_INSTALL_PREFIX=~/jasper
make -j2
make install
- name: checkout-nceplibs
uses: actions/checkout@v2
with:
repository: NOAA-EMC/NCEPLIBS
path: nceplibs
- name: cache-nceplibs
id: cache-nceplibs
uses: actions/cache@v2
with:
path: ~/nceplibs
key: nceplibs-1.3.0-${{ runner.os }}-intel
- name: build-nceplibs
if: steps.cache-nceplibs.outputs.cache-hit != 'true'
run: |
export ESMFMKFILE=~/esmf/lib/esmf.mk
wget https://github.com/NOAA-EMC/NCEPLIBS/archive/v1.3.0.tar.gz &> /dev/null
tar zxf v1.3.0.tar.gz
cd NCEPLIBS-1.3.0
mkdir build && cd build
cmake .. -DCMAKE_PREFIX_PATH='~;~/jasper;~/netcdf' -DCMAKE_INSTALL_PREFIX='~/nceplibs' -DFLAT=ON
make -j2
- name: checkout-ufs-utils
uses: actions/checkout@v2
with:
path: ufs_utils
- name: build
run: |
export ESMFMKFILE=~/esmf/lib/esmf.mk
cd ufs_utils
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH='~;~/jasper;~/nceplibs;~/netcdf'
make -j2
- name: test
run: |
cd ufs_utils/build/tests
wget -i ./chgres_cube/data/files.txt -P ./chgres_cube/data
wget -i ./sfc_climo_gen/data/files.txt -P ./sfc_climo_gen/data
cd ../
ctest --rerun-failed --output-on-failure