-
Notifications
You must be signed in to change notification settings - Fork 27
205 lines (202 loc) · 8.94 KB
/
ci.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
202
203
204
205
name: CI
on:
push:
branches:
- master
- dev
pull_request:
workflow_dispatch:
inputs:
ref:
description: 'Commit hash, branch name, or tag to run the CI pipeline for'
required: false
default: 'HEAD'
type: string
jobs:
Win64:
runs-on: windows-latest
strategy:
fail-fast: true
env:
BASE_DIR: ${{ github.workspace }}
SRC_DIR: ${{ github.workspace }}/src
BUILD_DIR: ${{ github.workspace }}/build
INSTALL_PREFIX: ${{ github.workspace }}/cadet
steps:
- uses: actions/checkout@v4
with:
submodules: true
path: src
ref: ${{ github.event.inputs.ref || github.ref }}
- uses: ilammy/msvc-dev-cmd@v1
- name: Get MSVC version
id: get-msvc
run: |
$MSVC_VERSION = cl 2>&1 | Select-String -Pattern 'Version (\d\d\.\d\d)' | % { $_.matches.groups[1].Value }
echo "version=$MSVC_VERSION" >> $Env:GITHUB_OUTPUT
- uses: actions/cache@v4
id: cache
with:
path: |
${{ github.workspace }}/hdf5
${{ github.workspace }}/suitesparse/install
${{ github.workspace }}/eigen/install
key: ${{ runner.os }}-deps-${{ steps.get-msvc.outputs.version }}-1
- name: Download MKL and TBB
run: |
cd "${env:BASE_DIR}"
$base_dir = $($env:BASE_DIR.Replace('\', '/'))
nuget install inteltbb.devel.win -Version 2021.8.0.25874
nuget install intelmkl.static.win-x64 -Version 2023.0.0.25930
Invoke-WebRequest -Uri "https://gitlab.com/libeigen/eigen/-/archive/master/eigen-master.zip" -OutFile eigen.zip
7z x eigen.zip
- name: Build UMFPACK and HDF5 and Eigen3
if: steps.cache.outputs.cache-hit != 'true'
run: |
$base_dir = $($env:BASE_DIR.Replace('\', '/'))
Invoke-WebRequest -Uri "https://www.hdfgroup.org/package/cmake-hdf5-1-14-0-zip/?wpdmdl=17553" -OutFile hdf5.zip
7z x hdf5.zip
cd CMake-hdf5-1.14.0
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DHDF5_BUILD_FORTRAN:BOOL=OFF -DHDF5_ENABLE_F2003:BOOL=OFF -DHDF5_BUILD_JAVA:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH="${base_dir}/hdf5" -DCTEST_CONFIGURATION_TYPE:STRING=Release -DBUILD_TESTING=ON -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF -DHDF5_BUILD_HL_LIB=OFF -DHDF5_BUILD_CPP_LIB=OFF -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH="${base_dir}/CMake-hdf5-1.14.0" -DHDF5_PACKAGE_EXTLIBS:BOOL=ON -DSITE:STRING=WIN10VS202264.XXXX -DBUILDNAME:STRING=Windows-WIN10-vs2022-STATIC -G "Ninja" hdf5-1.14.0
ninja install
cd "${env:BASE_DIR}"
Invoke-WebRequest -Uri "https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v5.7.2.zip" -OutFile suitesparse.zip
7z x suitesparse.zip -osuitesparse\code -y
Invoke-WebRequest -Uri "https://github.com/jlblancoc/suitesparse-metis-for-windows/archive/e8d953dffb8a99aa8b65ff3ff03e12a3ed72f90c.zip" -OutFile ssb.zip
7z x ssb.zip -osuitesparse\code -y
cd ${env:BASE_DIR}\suitesparse\code
xcopy .\SuiteSparse-5.7.2 .\suitesparse-metis-for-windows-e8d953dffb8a99aa8b65ff3ff03e12a3ed72f90c\SuiteSparse /s /e /y /q
cd "${env:BASE_DIR}\suitesparse\code\suitesparse-metis-for-windows-e8d953dffb8a99aa8b65ff3ff03e12a3ed72f90c"
Remove-Item -ErrorAction Ignore -Recurse -Force lapack_windows
Remove-Item -ErrorAction Ignore -Recurse -Force lapack_windows
cd "${env:BASE_DIR}\suitesparse\code"
mkdir build
cd build
$ENV:MKLROOT="${env:BASE_DIR}/intelmkl.static.win-x64.2023.0.0.25930/lib/native/win-x64".Replace('\', '/')
cmake -DCMAKE_INSTALL_PREFIX="${base_dir}\suitesparse\install" -DBLA_VENDOR=Intel10_64lp_seq -DBLA_STATIC=ON -G "Ninja" -DCMAKE_C_FLAGS="/GL" -DCMAKE_STATIC_LINKER_FLAGS="/LTCG" -DCMAKE_BUILD_TYPE=Release -DBUILD_METIS=OFF ..\suitesparse-metis-for-windows-e8d953dffb8a99aa8b65ff3ff03e12a3ed72f90c\
ninja install
cd "${env:BASE_DIR}"
Invoke-WebRequest -Uri "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip" -OutFile eigen.zip
7z x eigen.zip -oeigen\code -y
cd eigen
mkdir build
cd build
cmake ../code/eigen-3.4.0 -DCMAKE_INSTALL_PREFIX="../install"
cmake --build . --target install
- name: Build and Install
run: |
cd "${env:BASE_DIR}"
cmake -E make_directory "${env:BUILD_DIR}"
cmake -E make_directory "${env:INSTALL_PREFIX}"
cd "${env:BUILD_DIR}"
$ENV:MKLROOT="${env:BASE_DIR}/intelmkl.static.win-x64.2023.0.0.25930/lib/native/win-x64".Replace('\', '/')
$ENV:TBB_ROOT="${env:BASE_DIR}/inteltbb.devel.win.2021.8.0.25874/lib/native".Replace('\', '/')
$ENV:UMFPACK_ROOT="${env:BASE_DIR}/suitesparse/install".Replace('\', '/')
$ENV:Eigen3_DIR="${env:BASE_DIR}/eigen/install".Replace('\', '/')
$install_prefix = $($env:INSTALL_PREFIX.Replace('\', '/'))
$src_dir = $($env:SRC_DIR.Replace('\', '/'))
$base_dir = $($env:BASE_DIR.Replace('\', '/'))
cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX="${install_prefix}" -DCMAKE_BUILD_TYPE=Release -DHDF5_ROOT="${base_dir}/hdf5" -DENABLE_STATIC_LINK_DEPS=ON -DENABLE_STATIC_LINK_LAPACK=ON -DBLA_VENDOR=Intel10_64lp_seq "${src_dir}"
ninja
ninja install
- name: Include Deps and Package
run: |
cd "${env:BASE_DIR}"
Copy-Item "${env:BASE_DIR}\inteltbb.redist.win.2021.8.0.25874\runtimes\win-x64\native\tbb12.dll" "${env:INSTALL_PREFIX}\bin\"
Copy-Item "${env:BASE_DIR}\inteltbb.redist.win.2021.8.0.25874\runtimes\win-x64\native\tbb12.dll" "${env:BUILD_DIR}\src\cadet-cli\"
Copy-Item "${env:BASE_DIR}\inteltbb.redist.win.2021.8.0.25874\runtimes\win-x64\native\tbb12.dll" "${env:BUILD_DIR}\test\"
7z a "${env:BASE_DIR}\cadet-${{ runner.os }}.zip" cadet\
- name: Check if it runs
run: |
cd "${env:INSTALL_PREFIX}\bin"
.\cadet-cli.exe --version
.\createLWE.exe
.\cadet-cli.exe LWE.h5
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: cadet-${{ runner.os }}
retention-days: 5
path: ${{ github.workspace }}/cadet-${{ runner.os }}.zip
Ubuntu-latest:
runs-on: ubuntu-latest
strategy:
fail-fast: true
defaults:
run:
shell: bash -l {0}
env:
SRC_DIR: ${{ github.workspace }}/src
BUILD_DIR: ${{ github.workspace }}/build
INSTALL_PREFIX: ${{ github.workspace }}/install
BUILD_TYPE: Release
steps:
- uses: actions/checkout@v4
with:
submodules: true
path: src
ref: ${{ github.event.inputs.ref || github.ref }}
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt -y install \
build-essential \
libhdf5-dev \
liblapack-dev \
libblas-dev \
libtbb-dev \
libsuperlu-dev \
libeigen3-dev;
- name: Build and Install
run: |
cmake -E make_directory "${BUILD_DIR}"
cmake -E make_directory "${INSTALL_PREFIX}"
cd "${BUILD_DIR}"
cmake -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" "${SRC_DIR}"
make install -j$(nproc)
- name: Check if it runs
run: |
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:$LD_LIBRARY_PATH
${INSTALL_PREFIX}/bin/cadet-cli --version || true
${INSTALL_PREFIX}/bin/createLWE
${INSTALL_PREFIX}/bin/cadet-cli LWE.h5 || true
- name: Run tests
run: |
${BUILD_DIR}/test/testRunner [CI]
MacOS:
runs-on: macos-latest
strategy:
fail-fast: true
defaults:
run:
shell: bash -l {0}
env:
SRC_DIR: ${{ github.workspace }}/src
BUILD_DIR: ${{ github.workspace }}/build
INSTALL_PREFIX: ${{ github.workspace }}/install
BUILD_TYPE: Release
steps:
- uses: actions/checkout@v4
with:
submodules: true
path: src
ref: ${{ github.event.inputs.ref || github.ref }}
- name: Install Dependencies
run: |
brew update > /dev/null || true
brew install cmake
brew install hdf5
brew install tbb
brew install eigen
- name: Build and Install
run: |
cmake -E make_directory "${BUILD_DIR}"
cmake -E make_directory "${INSTALL_PREFIX}"
cd "${BUILD_DIR}"
cmake -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" "${SRC_DIR}"
make install -j$(sysctl -n hw.logicalcpu)
- name: Check if it runs
run: |
${INSTALL_PREFIX}/bin/cadet-cli --version || true
${INSTALL_PREFIX}/bin/createLWE
${INSTALL_PREFIX}/bin/cadet-cli LWE.h5 || true