Add a prefix GALAHAD_ for BLAS and LAPACK symbols when needed #183
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Meson | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: GALAHAD/${{ matrix.os }}/${{ matrix.compiler }}/${{ matrix.version }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
version: ['12'] | |
include: | |
- compiler: gcc | |
int64: false | |
- os: ubuntu-latest | |
compiler: gcc | |
version: '13' | |
int64: true | |
allow_failure: true | |
- os: windows-latest | |
compiler: intel-classic | |
version: '2021.10' | |
int64: false | |
allow_failure: true | |
- os: ubuntu-latest | |
compiler: intel-classic | |
version: '2021.10' | |
int64: false | |
allow_failure: true | |
- os: macos-latest | |
compiler: intel-classic | |
version: '2021.10' | |
int64: false | |
allow_failure: true | |
- os: windows-latest | |
compiler: intel | |
version: '2023.2' | |
int64: false | |
allow_failure: true | |
- os: ubuntu-latest | |
compiler: intel | |
version: '2023.2' | |
int64: false | |
allow_failure: true | |
# - os: ubuntu-latest | |
# compiler: nvidia-hpc | |
# version: '23.11' | |
# int64: false | |
# allow_failure: true | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out GALAHAD | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Meson and Ninja | |
run: pip install meson ninja numpy | |
- name: Set the environment variables GALAHAD, JULIA_GALAHAD_LIBRARY_PATH, DEPS and LIBDIR | |
shell: bash | |
run: | | |
echo "GALAHAD=$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
echo "JULIA_GALAHAD_LIBRARY_PATH=$GITHUB_WORKSPACE/galahad/lib" >> $GITHUB_ENV | |
echo "DEPS=$GITHUB_WORKSPACE/.." >> $GITHUB_ENV | |
if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then | |
echo "LIBDIR=lib" >> $GITHUB_ENV | |
fi | |
if [[ "${{matrix.os}}" == "macos-latest" ]]; then | |
echo "LIBDIR=lib" >> $GITHUB_ENV | |
fi | |
if [[ "${{matrix.os}}" == "windows-latest" ]]; then | |
echo "LIBDIR=bin" >> $GITHUB_ENV | |
fi | |
- name: Install dependencies | |
shell: bash | |
run: | | |
cd $DEPS | |
mkdir deps | |
PLATFORM="" | |
if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then | |
PLATFORM="x86_64-linux-gnu" | |
fi | |
if [[ "${{matrix.os}}" == "macos-latest" ]]; then | |
PLATFORM="x86_64-apple-darwin" | |
fi | |
if [[ "${{matrix.os}}" == "windows-latest" ]]; then | |
PLATFORM="x86_64-w64-mingw32" | |
choco install wget | |
fi | |
if [[ "${{matrix.int64}}" == "true" ]]; then | |
wget https://github.com/JuliaBinaryWrappers/OpenBLAS_jll.jl/releases/download/OpenBLAS-v0.3.26%2B0/OpenBLAS.v0.3.26.$PLATFORM-libgfortran5.tar.gz | |
tar -xzvf OpenBLAS.v0.3.26.$PLATFORM-libgfortran5.tar.gz -C deps | |
fi | |
# wget https://github.com/JuliaBinaryWrappers/OpenBLAS32_jll.jl/releases/download/OpenBLAS32-v0.3.26%2B0/OpenBLAS32.v0.3.26.$PLATFORM-libgfortran5.tar.gz | |
# tar -xzvf OpenBLAS32.v0.3.26.$PLATFORM-libgfortran5.tar.gz -C deps | |
- name: Set the environment variables LIBRARY_PATH, LD_LIBRARY_PATH and DYLD_LIBRARY_PATH | |
if: matrix.os != 'windows-latest' | |
shell: bash | |
run: | | |
if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then | |
echo "LIBRARY_PATH=$LIBRARY_PATH:$GITHUB_WORKSPACE/galahad/lib:$GITHUB_WORKSPACE/../deps/lib" >> $GITHUB_ENV | |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/galahad/lib:$GITHUB_WORKSPACE/../deps/lib" >> $GITHUB_ENV | |
fi | |
if [[ "${{matrix.os}}" == "macos-latest" ]]; then | |
echo "LIBRARY_PATH=$LIBRARY_PATH:$GITHUB_WORKSPACE/galahad/lib:$GITHUB_WORKSPACE/../deps/lib" >> $GITHUB_ENV | |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/galahad/lib:$GITHUB_WORKSPACE/../deps/lib" >> $GITHUB_ENV | |
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GITHUB_WORKSPACE/galahad/lib:$GITHUB_WORKSPACE/../deps/lib" >> $GITHUB_ENV | |
echo "DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/opt/intel/oneapi/compiler/2023.2.0/mac/compiler/lib" >> $GITHUB_ENV | |
fi | |
# if [[ "${{matrix.os}}" == "windows-latest" ]]; then | |
# echo "PATH=$PATH:/d/a/GALAHAD/GALAHAD/../deps/bin" >> $GITHUB_ENV | |
# fi | |
- name: Set environment variables for OpenMP | |
if: matrix.os != 'windows-latest' | |
shell: bash | |
run: | | |
echo "OMP_CANCELLATION=TRUE" >> $GITHUB_ENV | |
echo "OMP_PROC_BIND=TRUE" >> $GITHUB_ENV | |
- name: Install compilers | |
uses: fortran-lang/setup-fortran@main | |
with: | |
compiler: ${{ matrix.compiler }} | |
version: ${{ matrix.version }} | |
- name: Update Intel compilers | |
if: matrix.compiler == 'intel' | |
shell: bash | |
run: echo "FC=ifort" >> $GITHUB_ENV | |
# Uncomment this section to obtain ssh access to VM | |
# - name: Setup tmate session | |
# if: matrix.os == 'macos-latest' | |
# uses: mxschmitt/action-tmate@v3 | |
- name: Setup GALAHAD | |
shell: bash | |
run: | | |
CSTD="c99" | |
CPPSTD="c++11" | |
INT64="false" | |
SSIDS="true" | |
BLAS="openblas" | |
LAPACK="openblas" | |
BLAS_PATH="" | |
LAPACK_PATH="" | |
PYTHON_INTERFACE="true" | |
if [[ "${{matrix.compiler}}" == "nvidia-hpc" ]]; then | |
CSTD="none" | |
CPPSTD="none" | |
BLAS="blas_lp64" | |
LAPACK="lapack_lp64" | |
BLAS_PATH="/opt/nvidia/hpc_sdk/Linux_x86_64/23.11/compilers/lib" | |
LAPACK_PATH="/opt/nvidia/hpc_sdk/Linux_x86_64/23.11/compilers/lib" | |
fi | |
if [[ "${{matrix.int64}}" == "true" ]]; then | |
INT64="true" | |
BLAS="openblas64_" | |
LAPACK="openblas64_" | |
BLAS_PATH="$DEPS/deps/$LIBDIR" | |
LAPACK_PATH="$DEPS/deps/$LIBDIR" | |
fi | |
if [[ "${{matrix.compiler}}" == "nvidia-hpc" || "${{matrix.compiler}}" == "intel-classic" || ( "${{matrix.compiler}}" == "intel" && "${{matrix.os}}" == "windows-latest" ) ]]; then | |
SSIDS="false" | |
fi | |
meson setup builddir --buildtype=debug \ | |
--prefix=$GITHUB_WORKSPACE/galahad \ | |
-Dc_std=$CSTD \ | |
-Dcpp_std=$CPPSTD \ | |
-Dexamples=true \ | |
-Dtests=true \ | |
-Dssids=$SSIDS \ | |
-Dpythoniface=true \ | |
-Dgalahad_int64=$INT64 \ | |
-Dlibblas_path=${BLAS_PATH} \ | |
-Dliblapack_path=${LAPACK_PATH} \ | |
-Dlibblas=$BLAS \ | |
-Dliblapack=$LAPACK | |
- name: Build GALAHAD | |
shell: bash | |
run: | | |
meson compile -C builddir | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.version }}_meson-log.txt | |
path: builddir/meson-logs/meson-log.txt | |
- name: Install GALAHAD | |
shell: bash | |
run: | | |
meson install -C builddir | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.version }}_install-log.txt | |
path: builddir/meson-logs/install-log.txt | |
- name: Test GALAHAD | |
shell: bash | |
run: | | |
meson test -C builddir | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.version }}_testlog.txt | |
path: builddir/meson-logs/testlog.txt | |
- name: Install Julia | |
uses: julia-actions/setup-julia@v1 | |
- name: Test GALAHAD.jl | |
shell: bash | |
run: julia --color=yes -e 'using Pkg; Pkg.develop(path="GALAHAD.jl"); Pkg.test("GALAHAD")' |