forked from firemodels/fds
-
Notifications
You must be signed in to change notification settings - Fork 3
188 lines (166 loc) · 6.6 KB
/
osx.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: github-osx
on:
push:
paths:
- .github/**
- Build/**
- Source/**
pull_request:
paths:
- .github/**
- Build/**
- Source/**
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
env:
# update urls for oneapi and openmpi packages according to
# https://github.com/oneapi-src/oneapi-ci/blob/master/.github/workflows/build_all.yml
# https://open-mpi.org/software/ompi/
MACOS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/cd013e6c-49c4-488b-8b86-25df6693a9b7/m_BaseKit_p_2023.2.0.49398_offline.dmg
MACOS_BASEKIT_COMPONENTS: intel.oneapi.mac.mkl.devel
MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/edb4dc2f-266f-47f2-8d56-21bc7764e119/m_HPCKit_p_2023.2.0.49443_offline.dmg
MACOS_HPCKIT_COMPONENTS: intel.oneapi.mac.cpp-compiler:intel.oneapi.mac.ifort-compiler
OPENMPI_URL: https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz
jobs:
osx-intel-openmpi:
# build on osx using ifort with openmpi and mkl based on
# https://github.com/oneapi-src/oneapi-ci
name: osx intel openmpi
runs-on: [macos-latest]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
# install oneapi components from web installer based on
# oneapi-ci/scripts/install_macos.sh
- name: prepare for cache restore
run: |
sudo mkdir -p /opt/intel
sudo chown $USER /opt/intel
sudo mkdir -p /opt/openmpi
sudo chown $USER /opt/openmpi
- name: cache install oneapi, openmpi
id: cache-install
uses: actions/cache@v3
with:
path: |
/opt/intel/oneapi
/opt/openmpi
key: install-${{ env.MACOS_BASEKIT_URL }}-${{ env.MACOS_BASEKIT_COMPONENTS }}-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_HPCKIT_COMPONENTS }}-${{ env.OPENMPI_URL }}
- name: install oneapi compilers
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
curl --output webimage_hpc.dmg --url "$MACOS_HPCKIT_URL" --retry 5 --retry-delay 5
hdiutil attach webimage_hpc.dmg
sudo /Volumes/"$(basename "$MACOS_HPCKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$MACOS_HPCKIT_COMPONENTS" --eula=accept --log-dir=.installer_exit_code=$?
hdiutil detach /Volumes/"$(basename "$MACOS_HPCKIT_URL" .dmg)" -quiet
exit $installer_exit_code
- name: install openmpi
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
source /opt/intel/oneapi/setvars.sh
curl --output openmpi.tar.gz --url "$OPENMPI_URL"
mkdir openmpi
tar xf openmpi.tar.gz -C ./openmpi --strip-components 1
cd openmpi
./configure \
CC=icc CXX=icpc F77=ifort FC=ifort \
CFLAGS=-m64 CXXFLAGS=-m64 FFLAGS=-m64 FCFLAGS=-m64 LDFLAGS=-m64 \
--prefix=/opt/openmpi \
--with-hwloc=internal \
--with-libevent=internal \
--without-psm \
--without-tm \
--without-verbs \
--enable-static \
--disable-shared
make all install
- name: set openmpi environment variables
run: |
echo "PATH=/opt/openmpi/bin:$PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/openmpi/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "OMPI_CC=icc" >> $GITHUB_ENV
echo "OMPI_CXX=icpc" >> $GITHUB_ENV
echo "OMPI_F77=ifort" >> $GITHUB_ENV
echo "OMPI_FC=ifort" >> $GITHUB_ENV
- name: install oneapi mkl
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
curl --output webimage_base.dmg --url "$MACOS_BASEKIT_URL" --retry 5 --retry-delay 5
hdiutil attach webimage_base.dmg
sudo /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$MACOS_BASEKIT_COMPONENTS" --eula=accept --log-dir=.installer_exit_code=$?
hdiutil detach /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)" -quiet
exit $installer_exit_code
- name: install oneapi mklmpi wrapper
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
source /opt/intel/oneapi/setvars.sh
cd ${MKLROOT}/interfaces/mklmpi/
sudo make libintel64
- name: build fds debug
run: |
source /opt/intel/oneapi/setvars.sh
cd ./Build/ompi_intel_osx_db
sh ./make_fds.sh
./fds_ompi_intel_osx_db
- name: build fds release
run: |
source /opt/intel/oneapi/setvars.sh
cd ./Build/ompi_intel_osx
sh ./make_fds.sh
./fds_ompi_intel_osx
osx-gnu-openmpi:
# debug build on osx using gfortran with openmpi and mkl
name: osx gnu openmpi
runs-on: [macos-latest]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: install openmpi
run: |
brew install open-mpi
echo "OMPI_FC=gfortran-11" >> $GITHUB_ENV
# install oneapi components from web installer based on
# oneapi-ci/scripts/install_macos.sh
- name: prepare for cache restore
run: |
sudo mkdir -p /opt/intel
sudo chown $USER /opt/intel
- name: cache install oneapi
id: cache-install
uses: actions/cache@v3
with:
path: /opt/intel/oneapi
key: install-${{ env.MACOS_BASEKIT_URL }}-${{ env.MACOS_BASEKIT_COMPONENTS }}
- name: install oneapi mkl
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
curl --output webimage_base.dmg --url "$MACOS_BASEKIT_URL" --retry 5 --retry-delay 5
hdiutil attach webimage_base.dmg
sudo /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$MACOS_BASEKIT_COMPONENTS" --eula=accept --log-dir=.installer_exit_code=$?
hdiutil detach /Volumes/"$(basename "$MACOS_BASEKIT_URL" .dmg)" -quiet
exit $installer_exit_code
- name: install oneapi mklmpi wrapper
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
source /opt/intel/oneapi/setvars.sh
cd ${MKLROOT}/interfaces/mklmpi/
sudo make libintel64
- name: build fds debug
run: |
source /opt/intel/oneapi/setvars.sh
cd ./Build/ompi_gnu_osx_db
sh ./make_fds.sh
./fds_ompi_gnu_osx_db
- name: build fds release
run: |
source /opt/intel/oneapi/setvars.sh
cd ./Build/ompi_gnu_osx
sh ./make_fds.sh
./fds_ompi_gnu_osx