11name : continuous build
22
3- on : [push, pull_request]
3+ on : [push, pull_request, workflow_dispatch ]
44
55concurrency :
66 group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -11,17 +11,24 @@ permissions:
1111
1212jobs :
1313 build :
14- if : " github.repository == 'OpenMathLib/OpenBLAS'"
14+ if : " github.repository == 'OpenMathLib/OpenBLAS' || github.event_name == 'workflow_dispatch' "
1515 runs-on : ${{ matrix.os }}
1616
1717 strategy :
1818 fail-fast : false
1919 matrix :
20- os : [ubuntu-latest, macos-latest]
20+ os : [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
21+ cc : [gcc, clang, clang-21]
2122 fortran : [gfortran, flang]
2223 build : [cmake, make]
2324 exclude :
2425 - os : macos-latest
26+ cc : gcc
27+ - os : macos-latest
28+ cc : clang-21
29+ - os : macos-latest
30+ fortran : flang
31+ - os : ubuntu-24.04-arm
2532 fortran : flang
2633
2734 steps :
@@ -42,14 +49,27 @@ jobs:
4249 - name : Install Dependencies
4350 run : |
4451 if [ "$RUNNER_OS" == "Linux" ]; then
52+ cat << EOF | sudo tee -a /etc/apt/apt.conf.d/01norecommend
53+ APT::Install-Recommends "0";
54+ APT::Install-Suggests "0";
55+ EOF
4556 sudo apt-get update
46- sudo apt-get install -y gfortran cmake ccache
47- wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
48- sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
57+ sudo apt-get install -y ccache
58+ if [ "${{ matrix.cc }}" == "clang-21" ]; then
59+ wget https://apt.llvm.org/llvm.sh
60+ chmod +x llvm.sh
61+ sudo ./llvm.sh 21
62+ fi
63+ if [ "${{ matrix.fortran }}" == "flang" ]; then
64+ wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
65+ sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
66+ else
67+ sudo apt-get install -y ${{ matrix.fortran }}
68+ fi
4969 elif [ "$RUNNER_OS" == "macOS" ]; then
5070 # It looks like "gfortran" isn't working correctly unless "gcc" is re-installed.
5171 brew reinstall gcc
52- brew install coreutils cmake ccache
72+ brew install coreutils ccache
5373 else
5474 echo "::error::$RUNNER_OS not supported"
5575 exit 1
@@ -64,12 +84,12 @@ jobs:
6484 # GNU make and cmake call the compilers differently. It looks like
6585 # that causes the cache to mismatch. Keep the ccache for both build
6686 # tools separate to avoid polluting each other.
67- key : ccache-${{ runner.os }}-${{ matrix.build }}-${{ matrix.fortran }}-${{ github.ref }}-${{ github.sha }}
87+ key : ccache-${{ runner.os }}-${{ runner.arch }}-${{ matrix.build }}-${{ matrix.cc }}-${{ matrix.fortran }}-${{ github.ref }}-${{ github.sha }}
6888 # Restore a matching ccache cache entry. Prefer same branch and same Fortran compiler.
6989 restore-keys : |
70- ccache-${{ runner.os }}-${{ matrix.build }}-${{ matrix.fortran }}-${{ github.ref }}
71- ccache-${{ runner.os }}-${{ matrix.build }}-${{ matrix.fortran }}
72- ccache-${{ runner.os }}-${{ matrix.build }}
90+ ccache-${{ runner.os }}-${{ runner.arch }}-${{ matrix.build }}-${{ matrix.cc }}-${{ matrix.fortran }}-${{ github.ref }}
91+ ccache-${{ runner.os }}-${{ runner.arch }}-${{ matrix.build }}-${{ matrix.cc }}-${{ matrix.fortran }}
92+ ccache-${{ runner.os }}-${{ runner.arch }}-${{ matrix.build }}-${{ matrix.cc }}
7393
7494 - name : Configure ccache
7595 run : |
@@ -90,6 +110,14 @@ jobs:
90110 echo "compression = true" >> ~/.ccache/ccache.conf
91111 ccache -s
92112
113+ - name : Add gfortran runtime to link path
114+ if : matrix.build == 'make' && runner.os == 'macOS'
115+ run : |
116+ GFORTRAN_LIBDIR=$(gfortran -print-file-name=libgfortran.dylib | xargs dirname)
117+ echo "Using gfortran runtime in $GFORTRAN_LIBDIR"
118+ # Preserve whatever LDFLAGS may already contain
119+ echo "LDFLAGS=${LDFLAGS:+$LDFLAGS }-L$GFORTRAN_LIBDIR" >> "$GITHUB_ENV"
120+
93121 - name : Build OpenBLAS
94122 run : |
95123 if [ "${{ matrix.fortran }}" = "flang" ]; then
@@ -102,7 +130,7 @@ jobs:
102130 fi
103131 case "${{ matrix.build }}" in
104132 "make")
105- make -j$(nproc) DYNAMIC_ARCH=1 USE_OPENMP=0 FC="ccache ${{ matrix.fortran }}"
133+ make -j$(nproc) DYNAMIC_ARCH=1 USE_OPENMP=0 CC="ccache ${{ matrix.cc }}" FC="ccache ${{ matrix.fortran }}"
106134 ;;
107135 "cmake")
108136 mkdir build && cd build
@@ -111,6 +139,7 @@ jobs:
111139 -DBUILD_WITHOUT_LAPACK=0 \
112140 -DCMAKE_VERBOSE_MAKEFILE=ON \
113141 -DCMAKE_BUILD_TYPE=Release \
142+ -DCMAKE_C_COMPILER=${{ matrix.cc }} \
114143 -DCMAKE_Fortran_COMPILER=${{ matrix.fortran }} \
115144 -DCMAKE_C_COMPILER_LAUNCHER=ccache \
116145 -DCMAKE_Fortran_COMPILER_LAUNCHER=ccache \
@@ -134,13 +163,13 @@ jobs:
134163 "make")
135164 MAKE_FLAGS='DYNAMIC_ARCH=1 USE_OPENMP=0'
136165 echo "::group::Tests in 'test' directory"
137- make -C test $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}"
166+ make -C test $MAKE_FLAGS CC="ccache ${{ matrix.cc }}" FC="ccache ${{ matrix.fortran }}"
138167 echo "::endgroup::"
139168 echo "::group::Tests in 'ctest' directory"
140- make -C ctest $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}"
169+ make -C ctest $MAKE_FLAGS CC="ccache ${{ matrix.cc }}" FC="ccache ${{ matrix.fortran }}"
141170 echo "::endgroup::"
142171 echo "::group::Tests in 'utest' directory"
143- make -C utest $MAKE_FLAGS FC="ccache ${{ matrix.fortran }}"
172+ make -C utest $MAKE_FLAGS CC="ccache ${{ matrix.cc }}" FC="ccache ${{ matrix.fortran }}"
144173 echo "::endgroup::"
145174 ;;
146175 "cmake")
@@ -364,15 +393,15 @@ jobs:
364393 steps :
365394 - name : Checkout repository
366395 uses : actions/checkout@v3
367-
396+
368397 - name : Install Dependencies
369398 run : |
370399 sudo apt-get update
371400 sudo apt-get install -y gcc gfortran make
372-
401+
373402 - name : Build OpenBLAS
374403 run : |
375- make -j${nproc}
404+ make -j${nproc}
376405 make -j${nproc} lapack-test
377-
378-
406+
407+
0 commit comments