forked from arrayfire/arrayfire
-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (167 loc) · 8.77 KB
/
cpu_build.yml
File metadata and controls
186 lines (167 loc) · 8.77 KB
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
on:
push:
branches:
- master
pull_request:
branches:
- master
name: ci
jobs:
build_cpu:
name: CPU
runs-on: ${{ matrix.os }}
env:
NINJA_VER: 1.10.0
CMAKE_VER: 3.5.1
strategy:
fail-fast: false
matrix:
blas_backend: [Atlas, MKL, OpenBLAS]
os: [ubuntu-16.04, ubuntu-18.04, macos-latest]
exclude:
- os: ubuntu-16.04
blas_backend: Atlas
- os: macos-latest
blas_backend: Atlas
- os: macos-latest
blas_backend: MKL
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Checkout Submodules
shell: bash
run: git submodule update --init --recursive
- name: Download Ninja
env:
OS_NAME: ${{ matrix.os }}
run: |
os_suffix=$(if [ $OS_NAME == 'macos-latest' ]; then echo "mac"; else echo "linux"; fi)
wget --quiet "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VER}/ninja-${os_suffix}.zip"
unzip ./ninja-${os_suffix}.zip
chmod +x ninja
${GITHUB_WORKSPACE}/ninja --version
- name: Download CMake 3.5.1 for Linux
if: matrix.os != 'macos-latest'
env:
OS_NAME: ${{ matrix.os }}
run: |
cmake_suffix=$(if [ $OS_NAME == 'macos-latest' ]; then echo "Darwin-x86_64"; else echo "Linux-x86_64"; fi)
cmake_url=$(echo "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-${cmake_suffix}.tar.gz")
wget --quiet "${cmake_url}"
tar -xf ./cmake-${CMAKE_VER}-${cmake_suffix}.tar.gz
cmake_install_dir=$(echo "cmake-${CMAKE_VER}-x86_64")
mv cmake-${CMAKE_VER}-${cmake_suffix} ${cmake_install_dir}
cmake_lnx_dir=$(echo "${cmake_install_dir}/bin")
cmake_osx_dir=$(echo "${cmake_install_dir}/CMake.app/Contents/bin")
cmake_dir=$(if [ $OS_NAME == 'macos-latest' ]; then echo "${cmake_osx_dir}"; else echo "${cmake_lnx_dir}"; fi)
echo "CMAKE_PROGRAM=$(pwd)/${cmake_dir}/cmake" >> $GITHUB_ENV
- name: Install Dependencies for Macos
if: matrix.os == 'macos-latest'
run: |
brew install boost fontconfig glfw freeimage fftw lapack openblas
echo "CMAKE_PROGRAM=cmake" >> $GITHUB_ENV
- name: Install Common Dependencies for Ubuntu
if: matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04'
run: |
sudo apt-get -qq update
sudo apt-get install -y libfreeimage-dev \
libglfw3-dev \
libfftw3-dev \
liblapacke-dev
- name: Install Atlas for Ubuntu
if: matrix.os == 'ubuntu-18.04' && matrix.blas_backend == 'Atlas'
run: sudo apt-get install -y libatlas-base-dev
- name: Install MKL for Ubuntu
if: (matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04') && matrix.blas_backend == 'MKL'
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
sudo apt-get -qq update
sudo apt-get install -y intel-mkl-64bit-2020.0-088
- name: Install OpenBLAS for Ubuntu
if: (matrix.os == 'ubuntu-16.04' || matrix.os == 'ubuntu-18.04') && matrix.blas_backend == 'OpenBLAS'
run: sudo apt-get install -y libopenblas-dev
- name: CMake Configure
env:
USE_MKL: ${{ matrix.blas_backend == 'MKL' }}
BLAS_BACKEND: ${{ matrix.blas_backend }}
run: |
ref=$(echo ${GITHUB_REF} | awk '/refs\/pull\/[0-9]+\/merge/{print $0}')
prnum=$(echo $ref | awk '{split($0, a, "/"); print a[3]}')
branch=$(git rev-parse --abbrev-ref HEAD)
buildname=$(if [ -z "$prnum" ]; then echo "$branch"; else echo "PR-$prnum"; fi)
dashboard=$(if [ -z "$prnum" ]; then echo "Continuous"; else echo "Experimental"; fi)
buildname="$buildname-cpu-$BLAS_BACKEND"
mkdir build && cd build
${CMAKE_PROGRAM} -G Ninja \
-DCMAKE_MAKE_PROGRAM:FILEPATH=${GITHUB_WORKSPACE}/ninja \
-DBOOST_ROOT:PATH=${BOOST_ROOT_1_72_0} \
-DAF_BUILD_CUDA:BOOL=OFF -DAF_BUILD_OPENCL:BOOL=OFF \
-DAF_BUILD_UNIFIED:BOOL=OFF -DAF_BUILD_EXAMPLES:BOOL=ON \
-DAF_BUILD_FORGE:BOOL=ON \
-DUSE_CPU_MKL:BOOL=$USE_MKL \
-DBUILDNAME:STRING=${buildname} \
..
echo "CTEST_DASHBOARD=${dashboard}" >> $GITHUB_ENV
- name: Build and Test
run: |
cd ${GITHUB_WORKSPACE}/build
ctest -D Experimental --track ${CTEST_DASHBOARD} -T Test -T Submit -R cpu -j2
window_build_cpu:
name: CPU (OpenBLAS, windows-latest)
runs-on: windows-latest
env:
VCPKG_HASH: b79f7675aaa82eb6c5a96ae764fb1ce379a9d5d6 # March 29, 2020 - [hdf5] add tools and fortran feature
NINJA_VER: 1.10.0
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Checkout Submodules
shell: bash
run: git submodule update --init --recursive
- name: VCPKG Cache
uses: actions/cache@v1
id: vcpkg-cache
with:
path: vcpkg
key: vcpkg-deps-${{ env.VCPKG_HASH }}
- name: Install VCPKG Common Deps
if: steps.vcpkg-cache.outputs.cache-hit != 'true'
run: |
git clone --recursive https://github.com/microsoft/vcpkg
Set-Location -Path .\vcpkg
git reset --hard $env:VCPKG_HASH
.\bootstrap-vcpkg.bat
.\vcpkg.exe install --triplet x64-windows fftw3 freeimage freetype glfw3 openblas
Remove-Item .\downloads,.\buildtrees,.\packages -Recurse -Force
- name: Download Ninja
run: |
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v$env:NINJA_VER/ninja-win.zip" -OutFile ninja.zip
Expand-Archive -Path ninja.zip -DestinationPath .
- name: CMake Configure
run: |
$cwd = (Get-Item -Path ".\").FullName
$ref = $env:GITHUB_REF | %{ if ($_ -match "refs/pull/[0-9]+/merge") { $_;} }
$prnum = $ref | %{$_.Split("/")[2]}
$branch = git branch --show-current
$buildname = if($prnum -eq $null) { $branch } else { "PR-$prnum" }
$dashboard = if($prnum -eq $null) { "Continuous" } else { "Experimental" }
$buildname = "$buildname-cpu-openblas"
mkdir build && cd build
cmake .. -G "Visual Studio 16 2019" -A x64 `
-DCMAKE_TOOLCHAIN_FILE:FILEPATH="$env:GITHUB_WORKSPACE\vcpkg\scripts\buildsystems\vcpkg.cmake" `
-DFFTW_INCLUDE_DIR:PATH="$env:GITHUB_WORKSPACE\vcpkg\installed/x64-windows\include" `
-DFFTW_LIBRARY:FILEPATH="$env:GITHUB_WORKSPACE\vcpkg\installed\x64-windows\lib\fftw3.lib" `
-DFFTWF_LIBRARY:FILEPATH="$env:GITHUB_WORKSPACE\vcpkg\installed\x64-windows\lib\fftw3f.lib" `
-DBOOST_ROOT:PATH="$env:BOOST_ROOT_1_72_0" `
-DAF_BUILD_CUDA:BOOL=OFF -DAF_BUILD_OPENCL:BOOL=OFF `
-DAF_BUILD_UNIFIED:BOOL=OFF -DAF_BUILD_FORGE:BOOL=ON `
-DBUILDNAME:STRING="$buildname"
echo "CTEST_DASHBOARD=${dashboard}" >> $GITHUB_ENV
- name: Build and Test
run: |
$cwd = (Get-Item -Path ".\").FullName
$Env:PATH += ";$cwd/vcpkg/installed/x64-windows/bin"
Set-Location -Path $cwd/build
ctest -D Experimental --track ${CTEST_DASHBOARD} -T Test -T Submit -C Release -R cpu -E pinverse -j2