Update azure-pipelines.yml
[platform/upstream/openblas.git] / azure-pipelines.yml
1 trigger:
2   # start a new build for every push
3   batch: False
4   branches:
5     include:
6       - develop
7 resources:
8   containers:
9       - container: oneapi-hpckit
10         image: intel/oneapi-hpckit:latest
11         options: '-v /usr/bin/sudo:/usr/bin/sudo -v /usr/lib/sudo/libsudo_util.so.0:/usr/lib/sudo/libsudo_util.so.0 -v /usr/lib/sudo/sudoers.so:/usr/lib/sudo/sudoers.so'
12       - container: oneapi-basekit
13         image: intel/oneapi-basekit:latest
14         options: '-v /usr/bin/sudo:/usr/bin/sudo -v /usr/lib/sudo/libsudo_util.so.0:/usr/lib/sudo/libsudo_util.so.0 -v /usr/lib/sudo/sudoers.so:/usr/lib/sudo/sudoers.so'
15  
16 jobs:
17 # manylinux1 is useful to test because the
18 # standard Docker container uses an old version
19 # of gcc / glibc
20 - job: manylinux1_gcc
21   pool:
22     vmImage: 'ubuntu-16.04'
23   steps:
24   - script: |
25       echo "FROM quay.io/pypa/manylinux1_x86_64
26         COPY . /tmp/openblas
27         RUN cd /tmp/openblas                                      &&  \
28             COMMON_FLAGS='DYNAMIC_ARCH=1 TARGET=NEHALEM NUM_THREADS=32' && \
29             BTYPE='BINARY=64' CC=gcc && \
30             make QUIET_MAKE=1 $COMMON_FLAGS $BTYPE && \
31             make -C test $COMMON_FLAGS $BTYPE && \
32             make -C ctest $COMMON_FLAGS $BTYPE && \
33             make -C utest $COMMON_FLAGS $BTYPE" > Dockerfile
34       docker build .
35     displayName: Run manylinux1 docker build
36 - job: Intel_SDE_skx
37   pool:
38     vmImage: 'ubuntu-16.04'
39   steps:
40   - script: |
41       # at the time of writing the available Azure Ubuntu vm image
42       # does not support AVX512VL, so use more recent LTS version
43       echo "FROM ubuntu:bionic
44       COPY . /tmp/openblas
45       RUN apt-get -y update && apt-get -y install \\
46           cmake \\
47           gfortran \\
48           make \\
49           wget
50       RUN mkdir /tmp/SDE && cd /tmp/SDE && \\
51           mkdir sde-external-8.35.0-2019-03-11-lin && \\
52           wget --quiet -O sde-external-8.35.0-2019-03-11-lin.tar.bz2 https://www.dropbox.com/s/fopsnzj67572sj5/sde-external-8.35.0-2019-03-11-lin.tar.bz2?dl=0 && \\
53           tar -xjvf sde-external-8.35.0-2019-03-11-lin.tar.bz2 -C /tmp/SDE/sde-external-8.35.0-2019-03-11-lin --strip-components=1
54       RUN cd /tmp/openblas && CC=gcc make QUIET_MAKE=1 DYNAMIC_ARCH=1 NUM_THREADS=32 BINARY=64
55       CMD cd /tmp/openblas && echo 0 > /proc/sys/kernel/yama/ptrace_scope && CC=gcc OPENBLAS_VERBOSE=2 /tmp/SDE/sde-external-8.35.0-2019-03-11-lin/sde64 -cpuid_in /tmp/SDE/sde-external-8.35.0-2019-03-11-lin/misc/cpuid/skx/cpuid.def -- make -C utest DYNAMIC_ARCH=1 NUM_THREADS=32 BINARY=64" > Dockerfile
56       docker build -t intel_sde .
57       # we need a privileged docker run for sde process attachment
58       docker run --privileged intel_sde
59     displayName: 'Run AVX512 SkylakeX docker build / test'
60
61 - job: Windows_cl
62   pool:
63      vmImage: 'windows-latest'
64   steps:   
65   - task: CMake@1
66     inputs:
67       workingDirectory: 'build' # Optional
68       cmakeArgs: '-G "Visual Studio 16 2019" ..'
69   - task: CMake@1
70     inputs:
71       cmakeArgs: '--build . --config Release'
72       workingDirectory: 'build'
73   - script: |
74       cd build
75       cd utest
76       dir
77       openblas_utest.exe
78   
79 - job: OSX_OpenMP
80   pool:
81      vmImage: 'macOS-10.15'
82   steps:   
83   - script: |
84       brew update
85       make TARGET=CORE2 DYNAMIC_ARCH=1 USE_OPENMP=1 INTERFACE64=1 CC=gcc-10 FC=gfortran-10
86      
87 - job: OSX_GCC_Nothreads
88   pool:
89      vmImage: 'macOS-10.15'
90   steps:   
91   - script: |
92       brew update
93       make USE_THREADS=0 CC=gcc-10 FC=gfortran-10
94      
95 - job: OSX_OpenMP_Clang
96   pool:
97      vmImage: 'macOS-10.15'
98   variables:
99      LD_LIBRARY_PATH: /usr/local/opt/llvm/lib
100      LIBRARY_PATH: /usr/local/opt/llvm/lib
101   steps:   
102   - script: |
103       brew update
104       brew install llvm libomp
105       make TARGET=CORE2 USE_OPENMP=1 INTERFACE64=1 DYNAMIC_ARCH=1 CC=/usr/local/opt/llvm/bin/clang FC=gfortran-10
106
107 - job: OSX_Ifort_Clang
108   pool:
109      vmImage: 'macOS-10.15'
110   variables:
111      LD_LIBRARY_PATH: /usr/local/opt/llvm/lib
112      MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/17643/m_HPCKit_p_2021.2.0.2903_offline.dmg
113      LIBRARY_PATH: /usr/local/opt/llvm/lib
114      MACOS_FORTRAN_COMPONENTS: intel.oneapi.mac.ifort-compiler
115   steps:   
116   - script: |
117       brew update
118       brew install llvm libomp
119       sudo mkdir -p /opt/intel
120       sudo chown $USER /opt/intel
121     displayName: prepare for cache restore
122   - task: Cache@2
123     inputs:
124       path: /opt/intel/oneapi
125       key: '"install" | "$(MACOS_HPCKIT_URL)" | "$(MACOS_FORTRAN_COMPONENTS)"'
126       cacheHitVar: CACHE_RESTORED
127   - script: | 
128       curl --output webimage.dmg --url $(MACOS_HPCKIT_URL) --retry 5 --retry-delay 5
129       hdiutil attach webimage.dmg
130       sudo /Volumes/"$(basename "$(MACOS_HPCKIT_URL)" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$(MACOS_FORTRAN_COMPONENTS)" --eula=accept --continue-with-optional-error=yes --log-dir=.
131       installer_exit_code=$?
132       hdiutil detach /Volumes/"$(basename "$URL" .dmg)" -quiet
133       exit $installer_exit_code
134     displayName: install
135     condition: ne(variables.CACHE_RESTORED, 'true')
136   - script: | 
137       source /opt/intel/oneapi/setvars.sh
138       make CC=/usr/local/opt/llvm/bin/clang FC=ifort
139  
140 - job: OSX_NDK_ARMV7
141   pool:
142      vmImage: 'macOS-10.15'
143   steps:   
144   - script: | 
145       brew update
146       brew install --cask android-ndk
147       export ANDROID_NDK_HOME=/usr/local/share/android-ndk
148       make TARGET=ARMV7 ONLY_CBLAS=1 CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi21-clang AR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar HOSTCC=gcc ARM_SOFTFP_ABI=1 -j4
149  
150 - job: ALPINE_MUSL
151   pool:
152      vmImage: 'ubuntu-latest'
153   steps:
154   - script: |
155         wget 'https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.9.0/alpine-chroot-install' \
156           && echo 'e5dfbbdc0c4b3363b99334510976c86bfa6cb251  alpine-chroot-install' | sha1sum -c || exit 1
157         alpine() { /alpine/enter-chroot -u "$USER" "$@"; }
158         sudo sh alpine-chroot-install -p 'build-base gfortran perl linux-headers sudo'
159         alpine make DYNAMIC_ARCH=1 BINARY=64
160         alpine bash -c "echo ''|sudo -S make DYNAMIC_ARCH=1 BINARY=64 install"
161         alpine ls -l /opt/OpenBLAS/include
162         alpine echo "// tests that inclusion of openblas_config.h works with musl" >test_install.c
163         alpine echo "#include <openblas_config.h>" >>test_install.c
164         alpine echo "cpu_set_t* cpu_set = NULL;" >>test_install.c
165         alpine gcc -I/opt/OpenBLAS/include test_install.c -lopenblas -lpthread -lgfortran -o test_install
166