Skip to content

Commit 9a34217

Browse files
authored
Merge pull request #3717 from xianyi/develop
Update from develop for 0.3.21 release
2 parents 79f54f2 + 94cba8e commit 9a34217

File tree

8,235 files changed

+2182161
-29813
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

8,235 files changed

+2182161
-29813
lines changed

.github/workflows/dynamic_arch.yml

Lines changed: 212 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,20 @@ on: [push, pull_request]
55
jobs:
66
build:
77
runs-on: ${{ matrix.os }}
8+
89
strategy:
910
fail-fast: false
1011
matrix:
1112
os: [ubuntu-latest, macos-latest]
1213
fortran: [gfortran, flang]
1314
build: [cmake, make]
15+
exclude:
16+
- os: macos-latest
17+
fortran: flang
18+
1419
steps:
1520
- name: Checkout repository
16-
uses: actions/checkout@v2
17-
18-
- name: Compilation cache
19-
uses: actions/cache@v2
20-
with:
21-
path: ~/.ccache
22-
# We include the commit sha in the cache key, as new cache entries are
23-
# only created if there is no existing entry for the key yet.
24-
key: ${{ runner.os }}-ccache-${{ github.sha }}
25-
# Restore any ccache cache entry, if none for
26-
# ${{ runner.os }}-ccache-${{ github.sha }} exists
27-
restore-keys: |
28-
${{ runner.os }}-ccache-
21+
uses: actions/checkout@v3
2922

3023
- name: Print system information
3124
run: |
@@ -34,7 +27,7 @@ jobs:
3427
elif [ "$RUNNER_OS" == "macOS" ]; then
3528
sysctl -a | grep machdep.cpu
3629
else
37-
echo "$RUNNER_OS not supported"
30+
echo "::error::$RUNNER_OS not supported"
3831
exit 1
3932
fi
4033
@@ -43,61 +36,224 @@ jobs:
4336
if [ "$RUNNER_OS" == "Linux" ]; then
4437
sudo apt-get install -y gfortran cmake ccache
4538
elif [ "$RUNNER_OS" == "macOS" ]; then
39+
# It looks like "gfortran" isn't working correctly unless "gcc" is re-installed.
40+
brew reinstall gcc
4641
brew install coreutils cmake ccache
4742
else
48-
echo "$RUNNER_OS not supported"
43+
echo "::error::$RUNNER_OS not supported"
4944
exit 1
5045
fi
51-
ccache -M 300M # Limit the ccache size; Github's overall cache limit is 5GB
5246
53-
- name: gfortran build
54-
if: matrix.build == 'make' && matrix.fortran == 'gfortran'
47+
- name: Compilation cache
48+
uses: actions/cache@v3
49+
with:
50+
path: ~/.ccache
51+
# We include the commit sha in the cache key, as new cache entries are
52+
# only created if there is no existing entry for the key yet.
53+
# GNU make and cmake call the compilers differently. It looks like
54+
# that causes the cache to mismatch. Keep the ccache for both build
55+
# tools separate to avoid polluting each other.
56+
key: ccache-${{ runner.os }}-${{ matrix.build }}-${{ matrix.fortran }}-${{ github.ref }}-${{ github.sha }}
57+
# Restore a matching ccache cache entry. Prefer same branch and same Fortran compiler.
58+
restore-keys: |
59+
ccache-${{ runner.os }}-${{ matrix.build }}-${{ matrix.fortran }}-${{ github.ref }}
60+
ccache-${{ runner.os }}-${{ matrix.build }}-${{ matrix.fortran }}
61+
ccache-${{ runner.os }}-${{ matrix.build }}
62+
63+
- name: Configure ccache
5564
run: |
56-
if [ "$RUNNER_OS" == "Linux" ]; then
57-
export PATH="/usr/lib/ccache:${PATH}"
58-
elif [ "$RUNNER_OS" == "macOS" ]; then
59-
export PATH="$(brew --prefix)/opt/ccache/libexec:${PATH}"
60-
else
61-
echo "$RUNNER_OS not supported"
62-
exit 1
65+
if [ "${{ matrix.build }}" = "make" ]; then
66+
# Add ccache to path
67+
if [ "$RUNNER_OS" = "Linux" ]; then
68+
echo "/usr/lib/ccache" >> $GITHUB_PATH
69+
elif [ "$RUNNER_OS" = "macOS" ]; then
70+
echo "$(brew --prefix)/opt/ccache/libexec" >> $GITHUB_PATH
71+
else
72+
echo "::error::$RUNNER_OS not supported"
73+
exit 1
74+
fi
6375
fi
76+
# Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota (5 GB).
77+
test -d ~/.ccache || mkdir -p ~/.ccache
78+
echo "max_size = 300M" > ~/.ccache/ccache.conf
79+
echo "compression = true" >> ~/.ccache/ccache.conf
80+
ccache -s
6481
65-
make -j$(nproc) DYNAMIC_ARCH=1 USE_OPENMP=0
66-
67-
- name: flang build
68-
if: matrix.build == 'make' && matrix.fortran == 'flang'
82+
- name: Build OpenBLAS
6983
run: |
70-
if [ "$RUNNER_OS" == "Linux" ]; then
71-
export PATH="/usr/lib/ccache:${PATH}"
72-
elif [ "$RUNNER_OS" == "macOS" ]; then
73-
exit 0
74-
else
75-
echo "$RUNNER_OS not supported"
76-
exit 1
84+
if [ "${{ matrix.fortran }}" = "flang" ]; then
85+
# download and install classic flang
86+
cd /usr/
87+
sudo wget -nv https://github.com/flang-compiler/flang/releases/download/flang_20190329/flang-20190329-x86-70.tgz
88+
sudo tar xf flang-20190329-x86-70.tgz
89+
sudo rm flang-20190329-x86-70.tgz
90+
cd -
7791
fi
92+
case "${{ matrix.build }}" in
93+
"make")
94+
make -j$(nproc) DYNAMIC_ARCH=1 USE_OPENMP=0 FC="ccache ${{ matrix.fortran }}"
95+
;;
96+
"cmake")
97+
mkdir build && cd build
98+
cmake -DDYNAMIC_ARCH=1 \
99+
-DNOFORTRAN=0 \
100+
-DBUILD_WITHOUT_LAPACK=0 \
101+
-DCMAKE_VERBOSE_MAKEFILE=ON \
102+
-DCMAKE_BUILD_TYPE=Release \
103+
-DCMAKE_Fortran_COMPILER=${{ matrix.fortran }} \
104+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
105+
-DCMAKE_Fortran_COMPILER_LAUNCHER=ccache \
106+
..
107+
cmake --build .
108+
;;
109+
*)
110+
echo "::error::Configuration not supported"
111+
exit 1
112+
;;
113+
esac
114+
115+
- name: Show ccache status
116+
continue-on-error: true
117+
run: ccache -s
118+
119+
- name: Run tests
120+
timeout-minutes: 60
121+
run: |
122+
case "${{ matrix.build }}" in
123+
"make")
124+
MAKE_FLAGS='DYNAMIC_ARCH=1 USE_OPENMP=0'
125+
echo "::group::Tests in 'test' directory"
126+
make -C test $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}"
127+
echo "::endgroup::"
128+
echo "::group::Tests in 'ctest' directory"
129+
make -C ctest $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}"
130+
echo "::endgroup::"
131+
echo "::group::Tests in 'utest' directory"
132+
make -C utest $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}"
133+
echo "::endgroup::"
134+
;;
135+
"cmake")
136+
cd build && ctest
137+
;;
138+
*)
139+
echo "::error::Configuration not supported"
140+
exit 1
141+
;;
142+
esac
143+
144+
145+
msys2:
146+
runs-on: windows-latest
147+
148+
strategy:
149+
fail-fast: false
150+
matrix:
151+
msystem: [MINGW64, MINGW32, CLANG64]
152+
idx: [int32, int64]
153+
include:
154+
- msystem: MINGW64
155+
idx: int32
156+
target-prefix: mingw-w64-x86_64
157+
fc-pkg: mingw-w64-x86_64-gcc-fortran
158+
- msystem: MINGW32
159+
idx: int32
160+
target-prefix: mingw-w64-i686
161+
fc-pkg: mingw-w64-i686-gcc-fortran
162+
- msystem: CLANG64
163+
idx: int32
164+
target-prefix: mingw-w64-clang-x86_64
165+
c-lapack-flags: -DC_LAPACK=ON
166+
- msystem: MINGW64
167+
idx: int64
168+
idx64-flags: -DBINARY=64 -DINTERFACE64=1
169+
target-prefix: mingw-w64-x86_64
170+
fc-pkg: mingw-w64-x86_64-gcc-fortran
171+
- msystem: CLANG64
172+
idx: int64
173+
idx64-flags: -DBINARY=64 -DINTERFACE64=1
174+
target-prefix: mingw-w64-clang-x86_64
175+
c-lapack-flags: -DC_LAPACK=ON
176+
exclude:
177+
- msystem: MINGW32
178+
idx: int64
78179

79-
cd /usr/
80-
sudo wget -nv https://github.com/flang-compiler/flang/releases/download/flang_20190329/flang-20190329-x86-70.tgz
81-
sudo tar xf flang-20190329-x86-70.tgz
82-
sudo rm flang-20190329-x86-70.tgz
83-
cd -
180+
defaults:
181+
run:
182+
# Use MSYS2 bash as default shell
183+
shell: msys2 {0}
84184

85-
make -j$(nproc) DYNAMIC_ARCH=1 USE_OPENMP=0 FC=flang
185+
env:
186+
CHERE_INVOKING: 1
86187

188+
steps:
189+
- name: Get CPU name
190+
shell: pwsh
191+
run : |
192+
Get-CIMInstance -Class Win32_Processor | Select-Object -Property Name
193+
194+
- name: Install build dependencies
195+
uses: msys2/setup-msys2@v2
196+
with:
197+
msystem: ${{ matrix.msystem }}
198+
update: true
199+
release: false # Use pre-installed version
200+
install: >-
201+
base-devel
202+
${{ matrix.target-prefix }}-cc
203+
${{ matrix.fc-pkg }}
204+
${{ matrix.target-prefix }}-cmake
205+
${{ matrix.target-prefix }}-ninja
206+
${{ matrix.target-prefix }}-ccache
87207
88-
- name: CMake gfortran build
89-
if: matrix.build == 'cmake' && matrix.fortran == 'gfortran'
208+
- name: Checkout repository
209+
uses: actions/checkout@v3
210+
211+
- name: Compilation cache
212+
uses: actions/cache@v3
213+
with:
214+
# It looks like this path needs to be hard-coded.
215+
path: C:/msys64/home/runneradmin/.ccache
216+
# We include the commit sha in the cache key, as new cache entries are
217+
# only created if there is no existing entry for the key yet.
218+
key: ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}-${{ github.ref }}-${{ github.sha }}
219+
# Restore a matching ccache cache entry. Prefer same branch.
220+
restore-keys: |
221+
ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}-${{ github.ref }}
222+
ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}
223+
224+
- name: Configure ccache
225+
# Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota.
90226
run: |
91-
if [ "$RUNNER_OS" == "Linux" ]; then
92-
export PATH="/usr/lib/ccache:${PATH}"
93-
elif [ "$RUNNER_OS" == "macOS" ]; then
94-
export PATH="$(brew --prefix)/opt/ccache/libexec:${PATH}"
95-
else
96-
echo "$RUNNER_OS not supported"
97-
exit 1
98-
fi
227+
which ccache
228+
test -d ~/.ccache || mkdir -p ~/.ccache
229+
echo "max_size = 250M" > ~/.ccache/ccache.conf
230+
echo "compression = true" >> ~/.ccache/ccache.conf
231+
ccache -s
232+
echo $HOME
233+
cygpath -w $HOME
234+
235+
- name: Configure OpenBLAS
236+
run: |
237+
mkdir build && cd build
238+
cmake -DBUILD_SHARED_LIBS=ON \
239+
-DBUILD_STATIC_LIBS=ON \
240+
-DDYNAMIC_ARCH=ON \
241+
-DUSE_THREAD=ON \
242+
-DNUM_THREADS=64 \
243+
-DTARGET=CORE2 \
244+
${{ matrix.idx64-flags }} \
245+
${{ matrix.c-lapack-flags }} \
246+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
247+
-DCMAKE_Fortran_COMPILER_LAUNCHER=ccache \
248+
..
249+
250+
- name: Build OpenBLAS
251+
run: cd build && cmake --build .
252+
253+
- name: Show ccache status
254+
continue-on-error: true
255+
run: ccache -s
99256

100-
mkdir build
101-
cd build
102-
cmake -DDYNAMIC_ARCH=1 -DNOFORTRAN=0 -DBUILD_WITHOUT_LAPACK=0 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release ..
103-
make -j$(nproc)
257+
- name: Run tests
258+
timeout-minutes: 60
259+
run: cd build && ctest

.travis.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ matrix:
2525
# - BTYPE="BINARY=64"
2626
#
2727
# - <<: *test-ubuntu
28-
os: linux-ppc64le
28+
os: linux
29+
arch: ppc64le
2930
before_script: &common-before
3031
- COMMON_FLAGS="DYNAMIC_ARCH=1 TARGET=POWER8 NUM_THREADS=32"
3132
script:
32-
- make QUIET_MAKE=1 $COMMON_FLAGS $BTYPE
33+
- travis_wait 20 make QUIET_MAKE=1 $COMMON_FLAGS $BTYPE
3334
- make -C test $COMMON_FLAGS $BTYPE
3435
- make -C ctest $COMMON_FLAGS $BTYPE
3536
- make -C utest $COMMON_FLAGS $BTYPE
@@ -43,6 +44,7 @@ matrix:
4344
arch: s390x
4445
before_script:
4546
- COMMON_FLAGS="DYNAMIC_ARCH=1 TARGET=Z13 NUM_THREADS=32"
47+
- sudo apt-get install --only-upgrade binutils
4648
env:
4749
# for matrix annotation only
4850
- TARGET_BOX=IBMZ_LINUX
@@ -55,6 +57,7 @@ matrix:
5557
compiler: clang
5658
before_script:
5759
- COMMON_FLAGS="DYNAMIC_ARCH=1 TARGET=Z13 NUM_THREADS=32"
60+
- sudo apt-get install --only-upgrade binutils
5861
env:
5962
# for matrix annotation only
6063
- TARGET_BOX=IBMZ_LINUX
@@ -101,7 +104,7 @@ matrix:
101104
- sudo apt-get update
102105
- sudo apt-get install gcc-9 gfortran-9 -y
103106
script:
104-
- make QUIET_MAKE=1 BINARY=64 USE_OPENMP=1 CC=gcc-9 FC=gfortran-9
107+
- travis_wait 20 make QUIET_MAKE=1 BINARY=64 USE_OPENMP=1 CC=gcc-9 FC=gfortran-9
105108
- make -C test $COMMON_FLAGS $BTYPE
106109
- make -C ctest $COMMON_FLAGS $BTYPE
107110
- make -C utest $COMMON_FLAGS $BTYPE
@@ -118,7 +121,7 @@ matrix:
118121
- sudo apt-get update
119122
- sudo apt-get install gcc-9 gfortran-9 -y
120123
script:
121-
- make QUIET_MAKE=1 BUILD_BFLOAT16=1 BINARY=64 USE_OPENMP=1 CC=gcc-9 FC=gfortran-9
124+
- travis_wait 20 make QUIET_MAKE=1 BUILD_BFLOAT16=1 BINARY=64 USE_OPENMP=1 CC=gcc-9 FC=gfortran-9
122125
- make -C test $COMMON_FLAGS $BTYPE
123126
- make -C ctest $COMMON_FLAGS $BTYPE
124127
- make -C utest $COMMON_FLAGS $BTYPE
@@ -269,9 +272,9 @@ matrix:
269272
# - CFLAGS="-O2 -mno-thumb -Wno-macro-redefined -isysroot /Applications/Xcode-11.5.GM.Seed.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk -arch armv7 -miphoneos-version-min=5.1"
270273
# - BTYPE="TARGET=ARMV7 HOSTCC=clang NOFORTRAN=1"
271274

272-
- &test-graviton2
275+
- &test-neoversen1
273276
os: linux
274-
arch: arm64-graviton2
277+
arch: arm64
275278
dist: focal
276279
group: edge
277280
virt: lxd

BACKERS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Thank you for the support.
22

3+
### [2019.12/2021.9] [Chan-Zuckerberg Foundation EOSS Initiative](https://chanzuckerberg.com/eoss/)
4+
5+
Between December 2019 and September 2021, development and maintaining of OpenBLAS was funded in part by the Chan-Zuckerberg Foundation in the context of two grants awarded to the NumPy Foundation and managed by NumFocus (Cycles 1 and 3 of the Essential Open Source Software for Science (EOSS) Initiative of the Chan-Zuckerberg Foundation)
6+
37
### [2013.8] [Testbed for OpenBLAS project](https://www.bountysource.com/fundraisers/443-testbed-for-openblas-project)
48

59
https://www.bountysource.com/fundraisers/443-testbed-for-openblas-project/pledges

0 commit comments

Comments
 (0)