-
Notifications
You must be signed in to change notification settings - Fork 555
119 lines (108 loc) · 5.45 KB
/
Copy pathunix_cpu_build.yml
File metadata and controls
119 lines (108 loc) · 5.45 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
on:
push:
branches:
- master
- v3.8
pull_request:
branches:
- master
- v3.8
name: ci
jobs:
build_cpu:
name: CPU
runs-on: ${{ matrix.os }}
env:
NINJA_VER: 1.10.2
CMAKE_VER: 3.5.1
strategy:
fail-fast: false
matrix:
blas_backend: [Atlas, MKL, OpenBLAS]
os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
exclude:
- os: macos-latest
blas_backend: Atlas
- os: macos-latest
blas_backend: MKL
steps:
- name: Checkout Repository
uses: actions/checkout@master
- 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-20.04' || matrix.os == 'ubuntu-18.04'
run: |
sudo add-apt-repository ppa:mhier/libboost-latest
sudo apt-get -qq update
sudo apt-get install -y libboost1.74-dev \
libfreeimage-dev \
libglfw3-dev \
libfftw3-dev \
liblapacke-dev
- name: Install Atlas for Ubuntu
if: matrix.os != 'macos-latest' && matrix.blas_backend == 'Atlas'
run: sudo apt-get install -y libatlas-base-dev
- name: Install MKL for Ubuntu
if: matrix.os != 'macos-latest' && matrix.blas_backend == 'MKL'
run: |
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
sudo sh -c 'echo deb https://apt.repos.intel.com/oneapi all main > /etc/apt/sources.list.d/oneAPI.list'
sudo apt-get -qq update
sudo apt-get install -y intel-basekit
- name: Install OpenBLAS for Ubuntu
if: matrix.os != 'macos-latest' && 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)
backend=$(if [ "$USE_MKL" == 1 ]; then echo "Intel-MKL"; else echo "FFTW/LAPACK/BLAS"; fi)
buildname="$buildname-cpu-$BLAS_BACKEND"
mkdir build && cd build
${CMAKE_PROGRAM} -G Ninja \
-DCMAKE_MAKE_PROGRAM:FILEPATH=${GITHUB_WORKSPACE}/ninja \
-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 \
-DAF_COMPUTE_LIBRARY:STRING=$backend \
-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