Skip to content

Commit 2e86faa

Browse files
authored
Merge branch 'develop' into issue4468
2 parents ca6b496 + 0ff8549 commit 2e86faa

Some content is hidden

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

45 files changed

+22138
-212
lines changed

.cirrus.yml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
macos_instance:
22
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest
33

4-
task:
5-
name: AppleM1/LLVM
6-
compile_script:
7-
- brew install llvm
8-
- export PATH=/opt/homebrew/opt/llvm/bin:$PATH
9-
- export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
10-
- export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
11-
- make TARGET=VORTEX USE_OPENMP=1 CC=clang
4+
#task:
5+
# name: AppleM1/LLVM
6+
# compile_script:
7+
# - brew install llvm
8+
# - export PATH=/opt/homebrew/opt/llvm/bin:$PATH
9+
# - export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
10+
# - export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
11+
# - make TARGET=VORTEX USE_OPENMP=1 CC=clang
1212

13-
task:
14-
name: AppleM1/LLVM/ILP64
15-
compile_script:
16-
- brew install llvm
17-
- export PATH=/opt/homebrew/opt/llvm/bin:$PATH
18-
- export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
19-
- export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
20-
- make TARGET=VORTEX USE_OPENMP=1 CC=clang INTERFACE64=1
13+
#task:
14+
# name: AppleM1/LLVM/ILP64
15+
# compile_script:
16+
# - brew install llvm
17+
# - export PATH=/opt/homebrew/opt/llvm/bin:$PATH
18+
# - export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
19+
# - export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
20+
# - make TARGET=VORTEX USE_OPENMP=1 CC=clang INTERFACE64=1
2121

22-
task:
23-
name: AppleM1/LLVM/CMAKE
24-
compile_script:
25-
- brew install llvm
26-
- export PATH=/opt/homebrew/opt/llvm/bin:$PATH
27-
- export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
28-
- export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
29-
- mkdir build
30-
- cd build
31-
- cmake -DTARGET=VORTEX -DCMAKE_C_COMPILER=clang -DBUILD_SHARED_LIBS=ON ..
32-
- make -j 4
22+
#task:
23+
# name: AppleM1/LLVM/CMAKE
24+
# compile_script:
25+
# - brew install llvm
26+
# - export PATH=/opt/homebrew/opt/llvm/bin:$PATH
27+
# - export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
28+
# - export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
29+
# - mkdir build
30+
# - cd build
31+
# - cmake -DTARGET=VORTEX -DCMAKE_C_COMPILER=clang -DBUILD_SHARED_LIBS=ON ..
32+
# - make -j 4
3333

34-
task:
35-
name: AppleM1/GCC/MAKE/OPENMP
36-
compile_script:
37-
- brew install gcc@11
38-
- export PATH=/opt/homebrew/bin:$PATH
39-
- export LDFLAGS="-L/opt/homebrew/lib"
40-
- export CPPFLAGS="-I/opt/homebrew/include"
41-
- make CC=gcc-11 FC=gfortran-11 USE_OPENMP=1
34+
#task:
35+
# name: AppleM1/GCC/MAKE/OPENMP
36+
# compile_script:
37+
# - brew install gcc@11
38+
# - export PATH=/opt/homebrew/bin:$PATH
39+
# - export LDFLAGS="-L/opt/homebrew/lib"
40+
# - export CPPFLAGS="-I/opt/homebrew/include"
41+
# - make CC=gcc-11 FC=gfortran-11 USE_OPENMP=1
4242

4343
macos_instance:
4444
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest

.github/workflows/apple_m.yml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: apple m
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
7+
cancel-in-progress: true
8+
9+
permissions:
10+
contents: read # to fetch code (actions/checkout)
11+
12+
jobs:
13+
build:
14+
if: "github.repository == 'OpenMathLib/OpenBLAS'"
15+
runs-on: macos-14
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
build: [cmake, make]
21+
fortran: [gfortran]
22+
openmp: [0, 1]
23+
ilp64: [0, 1]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v3
28+
29+
- name: Print system information
30+
run: |
31+
if [ "$RUNNER_OS" == "Linux" ]; then
32+
cat /proc/cpuinfo
33+
elif [ "$RUNNER_OS" == "macOS" ]; then
34+
sysctl -a | grep machdep.cpu
35+
else
36+
echo "::error::$RUNNER_OS not supported"
37+
exit 1
38+
fi
39+
40+
- name: Install Dependencies
41+
run: |
42+
if [ "$RUNNER_OS" == "Linux" ]; then
43+
sudo apt-get install -y gfortran cmake ccache libtinfo5
44+
elif [ "$RUNNER_OS" == "macOS" ]; then
45+
# It looks like "gfortran" isn't working correctly unless "gcc" is re-installed.
46+
brew reinstall gcc
47+
brew install coreutils cmake ccache
48+
brew install llvm
49+
else
50+
echo "::error::$RUNNER_OS not supported"
51+
exit 1
52+
fi
53+
54+
- name: Compilation cache
55+
uses: actions/cache@v3
56+
with:
57+
path: ~/.ccache
58+
# We include the commit sha in the cache key, as new cache entries are
59+
# only created if there is no existing entry for the key yet.
60+
# GNU make and cmake call the compilers differently. It looks like
61+
# that causes the cache to mismatch. Keep the ccache for both build
62+
# tools separate to avoid polluting each other.
63+
key: ccache-${{ runner.os }}-${{ matrix.build }}-${{ matrix.fortran }}-${{ github.ref }}-${{ github.sha }}
64+
# Restore a matching ccache cache entry. Prefer same branch and same Fortran compiler.
65+
restore-keys: |
66+
ccache-${{ runner.os }}-${{ matrix.build }}-${{matrix.fortran }}-${{ github.ref }}
67+
ccache-${{ runner.os }}-${{ matrix.build }}-${{matrix.fortran }}
68+
ccache-${{ runner.os }}-${{ matrix.build }}
69+
70+
- name: Configure ccache
71+
run: |
72+
if [ "${{ matrix.build }}" = "make" ]; then
73+
# Add ccache to path
74+
if [ "$RUNNER_OS" = "Linux" ]; then
75+
echo "/usr/lib/ccache" >> $GITHUB_PATH
76+
elif [ "$RUNNER_OS" = "macOS" ]; then
77+
echo "$(brew --prefix)/opt/ccache/libexec" >> $GITHUB_PATH
78+
echo "/opt/homebrew/opt/llvm/bin" >>$GITHUB_PATH
79+
echo "" >>$GITHUB_PATH
80+
else
81+
echo "::error::$RUNNER_OS not supported"
82+
exit 1
83+
fi
84+
fi
85+
# Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota (5 GB).
86+
test -d ~/.ccache || mkdir -p ~/.ccache
87+
echo "max_size = 300M" > ~/.ccache/ccache.conf
88+
echo "compression = true" >> ~/.ccache/ccache.conf
89+
ccache -s
90+
91+
- name: Build OpenBLAS
92+
run: |
93+
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
94+
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
95+
export CC="/opt/homebrew/opt/llvm/bin/clang"
96+
case "${{ matrix.build }}" in
97+
"make")
98+
make -j$(nproc) DYNAMIC_ARCH=1 USE_OPENMP=${{matrix.openmp}} INTERFACE64=${{matrix.ilp64}} FC="ccache ${{ matrix.fortran }}"
99+
;;
100+
"cmake")
101+
export LDFLAGS="$LDFLAGS -Wl,-ld_classic"
102+
mkdir build && cd build
103+
cmake -DDYNAMIC_ARCH=1 \
104+
-DUSE_OPENMP=${{matrix.openmp}} \
105+
-DINTERFACE64=${{matrix.ilp64}} \
106+
-DNOFORTRAN=0 \
107+
-DBUILD_WITHOUT_LAPACK=0 \
108+
-DCMAKE_VERBOSE_MAKEFILE=ON \
109+
-DCMAKE_BUILD_TYPE=Release \
110+
-DCMAKE_Fortran_COMPILER=${{ matrix.fortran }} \
111+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
112+
-DCMAKE_Fortran_COMPILER_LAUNCHER=ccache \
113+
..
114+
cmake --build .
115+
;;
116+
*)
117+
echo "::error::Configuration not supported"
118+
exit 1
119+
;;
120+
esac
121+
122+
- name: Show ccache status
123+
continue-on-error: true
124+
run: ccache -s
125+
126+
- name: Run tests
127+
timeout-minutes: 60
128+
run: |
129+
case "${{ matrix.build }}" in
130+
"make")
131+
MAKE_FLAGS='DYNAMIC_ARCH=1 USE_OPENMP=0'
132+
echo "::group::Tests in 'test' directory"
133+
make -C test $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}"
134+
echo "::endgroup::"
135+
echo "::group::Tests in 'ctest' directory"
136+
make -C ctest $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}"
137+
echo "::endgroup::"
138+
echo "::group::Tests in 'utest' directory"
139+
make -C utest $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}"
140+
echo "::endgroup::"
141+
;;
142+
"cmake")
143+
cd build && ctest
144+
;;
145+
*)
146+
echo "::error::Configuration not supported"
147+
exit 1
148+
;;
149+
esac

0 commit comments

Comments
 (0)