-
Notifications
You must be signed in to change notification settings - Fork 17
201 lines (178 loc) · 6.98 KB
/
macos.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
189
190
191
192
193
194
195
196
197
198
199
200
201
name: MacOS
on:
pull_request:
branches:
- master
schedule:
# Runs every day at 23:15
- cron: '15 23 * * *'
jobs:
build:
name: Building with ${{ matrix.sofa_version }}
runs-on: macos-12
if: ${{ false }}
strategy:
fail-fast: false
matrix:
sofa_version: [ master ]
include:
- sofa_version: master
SOFA_VERSION_I: 999999
PYTHON_VERSION: 3.9
PYBIND11_VERSION: 2.6
BOOST_VERSION: 1.76.0
BOOST_LINK: https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz
QT_VERSION: 5.12.6
env:
SOFA_VERSION: ${{ matrix.sofa_version }}
SOFA_ROOT: /opt/sofa
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
BOOST_VERSION: ${{ matrix.BOOST_VERSION }}
QT_VERSION: ${{ matrix.QT_VERSION }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: |
git fetch origin
git rebase origin/master
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7' #${{ matrix.PYTHON_VERSION }}
- name: Install requirements
run: |
brew install ccache eigen libpng libjpeg libtiff glew
python3 -m pip install numpy
# PYBIND11
- name: Install pybind11
run: |
git clone --depth 1 -b v${{ matrix.PYBIND11_VERSION }} https://github.com/pybind/pybind11.git /tmp/pybind11
cmake -S/tmp/pybind11 -B/tmp/pybind11/build -DPYBIND11_TEST=OFF -DCMAKE_BUILD_TYPE=Release
sudo cmake --install /tmp/pybind11/build
rm -rf /tmp/pybind11
- name: Opt permission
run: sudo chown -R $(whoami) /opt
# BOOST
- name: cache boost
uses: actions/cache@v2
id: cache-boost
with:
path: /opt/boost
key: boost-${{ matrix.BOOST_VERSION }}-macos-1015
- name: Download boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
curl --output boost.tar.gz -L "${{ matrix.BOOST_LINK }}"
tar xzf boost.tar.gz
- name: Patch boost
if: ${{ steps.cache-boost.outputs.cache-hit != 'true' && matrix.BOOST_VERSION == '1.67.0' }}
run: |
curl --output a.patch -L "https://github.com/boostorg/build/commit/b3a59d265929a213f02a451bb63cea75d668a4d9.patch?full_index=1"
git apply -v --directory=boost_1_67_0/tools/build a.patch
curl --output b.patch -L "https://gist.githubusercontent.com/jnbrunet/d9537ff8679b2b35976356f11f334777/raw/8d2a2a1e46d13064c2e18c5caa229b9b81933285/6e14ca24.patch"
patch -d boost_1_67_0 boost/atomic/detail/ops_gcc_x86_dcas.hpp < b.patch
- name: Build boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
if [ "$BOOST_VERSION" = "1.76.0" ]; then
cd boost_1_76_0
./bootstrap.sh --prefix=/opt/boost --without-libraries=python,mpi,log --without-icu --libdir=/opt/boost/lib
./b2 cxxflags=-std=c++11 link=shared threading=multi,single --layout=tagged -d0 -q variant=release architecture=x86 install
else
cd boost_1_67_0
./bootstrap.sh --prefix=/opt/boost --without-libraries=python,mpi,log --without-icu --libdir=/opt/boost/lib -with-toolset=darwin
./b2 toolset=darwin cxxflags=-std=c++11 link=shared threading=multi,single --layout=tagged -d0 -q variant=release architecture=x86 install
fi
# QT
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: /opt/qt
key: ${{ format('qt-{0}-macos-10.15', matrix.QT_VERSION) }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.QT_VERSION }}
dir: '/opt/qt'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
modules: 'qtcharts qtwebengine'
aqtversion: '==2.0.5'
setup-python: false
# SOFA
- name: Download SOFA Release
run: |
if [ "$SOFA_VERSION" = "master" ]; then
curl --output sofa.zip -L "https://ci.inria.fr/sofa-ci-dev/job/nightly-generate-binaries/CI_BRANCH=master,CI_SCOPE=standard/lastSuccessfulBuild/artifact/MacOS/*zip*/MacOS.zip"
unzip sofa.zip -d temp
mv temp/MacOS/`ls temp/MacOS` sofa.zip
rm -rf temp
unzip sofa.zip -d temp
mv temp/`ls temp` $SOFA_ROOT
else
curl --output sofa.zip -L "https://github.com/sofa-framework/sofa/releases/download/$SOFA_VERSION/SOFA_"$SOFA_VERSION"_MacOS.zip"
unzip sofa.zip -d temp
sudo mv temp/`ls temp` $SOFA_ROOT
fi
# CCACHE
- name: Get Time
id: time
uses: nanzm/[email protected]
with:
timeZone: 8
format: 'YYYY-MM-DD-HH-mm-ss'
- name: ccache cache files
uses: actions/cache@v2
if: ${{ always() }}
with:
path: .ccache
key: macos-ccache-${{ steps.time.outputs.time }}
restore-keys: |
macos-ccache-
# MKL
- name: cache MKL
uses: actions/cache@v2
id: cache-mkl
with:
path: /opt/intel
key: mkl-macos-10.15
- name: Install MKL
if: steps.cache-mkl.outputs.cache-hit != 'true'
run: |
URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17714/m_BaseKit_p_2021.2.0.2855_offline.dmg
curl --output intel_mkl.dmg --url "$URL" --retry 5 --retry-delay 5
hdiutil attach intel_mkl.dmg
echo "MKL volume mounted. Now trying to install..."
sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper --action install --components intel.oneapi.mac.mkl.devel --eula=accept --continue-with-optional-error=yes --log-dir=. -c
sudo chown -R $(whoami) /opt
echo "MKL installation done."
# CARIBOU
- name: Build caribou
env:
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: "500M"
PYTHONEXE: ${{ format('/usr/bin/python{0}', matrix.PYTHON_VERSION) }}
run:
export CCACHE_BASEDIR=$GITHUB_WORKSPACE &&
export CCACHE_DIR=$GITHUB_WORKSPACE/.ccache &&
ccache -z &&
cmake
-DBOOST_ROOT=/opt/boost
-DPYTHON_EXECUTABLE=$PYTHONEXE
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCARIBOU_BUILD_TESTS=ON
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=SofaCaribou
.
&& make && make install
&& tar czvf SofaCaribou.tar.gz SofaCaribou
&& echo ${CCACHE_BASEDIR}
&& ccache -s
- name: Archive production
uses: actions/upload-artifact@v2
with:
name: caribou_macos_${{ matrix.sofa_version }}
path: SofaCaribou.tar.gz