[CI] Compile GALAHAD with HSL subset #2
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: libHSL | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: ${{ matrix.os }}/${{ matrix.compiler }}-v${{ matrix.version }}/Int${{ matrix.int }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-13] | |
arch: ['x64'] | |
version: ['11'] | |
int: ['32'] | |
include: | |
- compiler: gcc | |
- os: windows-latest | |
compiler: intel-classic | |
version: '2021.10' | |
int: '32' | |
- os: ubuntu-latest | |
compiler: intel-classic | |
version: '2021.10' | |
int: '32' | |
- os: windows-latest | |
compiler: intel | |
version: '2023.2' | |
int: '32' | |
- os: ubuntu-latest | |
compiler: intel | |
version: '2023.2' | |
int: '32' | |
# - os: ubuntu-latest | |
# compiler: nvidia-hpc | |
# version: '23.11' | |
# int: '32' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out GALAHAD | |
uses: actions/checkout@v4 | |
- 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 "DEPS=$GITHUB_WORKSPACE/.." >> $GITHUB_ENV | |
if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then | |
echo "LIBDIR=lib" >> $GITHUB_ENV | |
echo "JULIA_GALAHAD_LIBRARY_PATH=$GITHUB_WORKSPACE/galahad/lib" >> $GITHUB_ENV | |
fi | |
if [[ "${{matrix.os}}" == "macos-13" ]]; then | |
echo "LIBDIR=lib" >> $GITHUB_ENV | |
echo "JULIA_GALAHAD_LIBRARY_PATH=$GITHUB_WORKSPACE/galahad/lib" >> $GITHUB_ENV | |
fi | |
if [[ "${{matrix.os}}" == "windows-latest" ]]; then | |
echo "LIBDIR=bin" >> $GITHUB_ENV | |
echo "JULIA_GALAHAD_LIBRARY_PATH=$GITHUB_WORKSPACE/galahad/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-13" ]]; then | |
PLATFORM="x86_64-apple-darwin" | |
fi | |
if [[ "${{matrix.os}}" == "windows-latest" ]]; then | |
PLATFORM="x86_64-w64-mingw32"/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 | |
choco install wget | |
fi | |
- 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-13" ]]; 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 | |
- 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 Julia | |
if: (matrix.int == '32') && !(matrix.os == 'windows-latest' && (matrix.compiler == 'intel' || matrix.compiler == 'intel-classic')) | |
uses: julia-actions/setup-julia@v2 | |
- 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-13' | |
# uses: mxschmitt/action-tmate@v3 | |
- name: Download libHSL | |
if: matrix.libhsl == 'true' | |
env: | |
LIBHSL: ${{ secrets.LIBHSL }} | |
shell: bash | |
run: | | |
curl -O ${LIBHSL} | |
unzip libhsl.zip | |
- name: Setup libHSL | |
if: matrix.libhsl == 'true' | |
shell: bash | |
run: | | |
BLAS="blas" | |
LAPACK="lapack" | |
BLAS_PATH="" | |
LAPACK_PATH="" | |
SHARED_STATIC="shared" | |
if [[ ( "${{matrix.compiler}}" == "intel-classic" && "${{matrix.os}}" == "windows-latest" ) || ( "${{matrix.compiler}}" == "intel" && "${{matrix.os}}" == "windows-latest" ) ]]; then | |
SHARED_STATIC="static" | |
fi | |
cd libHSL-* | |
meson setup builddir -Ddefault_library=${SHARED_STATIC} \ | |
--buildtype=debug \ | |
--prefix=$GITHUB_WORKSPACE/libhsl \ | |
-Dlibblas_path=${BLAS_PATH} \ | |
-Dliblapack_path=${LAPACK_PATH} \ | |
-Dlibblas=$BLAS \ | |
-Dliblapack=$LAPACK | |
- name: Compile libHSL | |
if: matrix.libhsl == 'true' | |
shell: bash | |
run: meson compile -C builddir | |
- name: Install libHSL | |
if: matrix.libhsl == 'true' | |
shell: bash | |
run: meson install -C builddir | |
- name: Setup GALAHAD | |
shell: bash | |
run: | | |
CSTD="c99" | |
CPPSTD="c++11" | |
INT64="false" | |
SSIDS="true" | |
BLAS="openblas" | |
LAPACK="openblas" | |
BLAS_PATH="" | |
LAPACK_PATH="" | |
HSL_PATH="" | |
HSL_MODULES="" | |
PYTHON_INTERFACE="true" | |
SHARED_STATIC="shared" | |
LD_CLASSIC="" | |
if [[ "${{matrix.os}}" == "macos-13" ]]; then | |
LD_CLASSIC="-Wl,-ld_classic" | |
fi | |
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.int}}" == "64" ]]; then | |
INT64="true" | |
BLAS="openblas64_" | |
LAPACK="openblas64_" | |
BLAS_PATH="$DEPS/deps/$LIBDIR" | |
LAPACK_PATH="$DEPS/deps/$LIBDIR" | |
fi | |
if [[ "${{matrix.libhsl}}" == "true" ]]; then | |
HSL_PATH="$GITHUB_WORKSPACE/libhsl/lib" | |
HSL_MODULES="$GITHUB_WORKSPACE/libhsl/modules" | |
fi | |
if [[ ( "${{matrix.compiler}}" == "intel-classic" && "${{matrix.os}}" == "windows-latest" ) || ( "${{matrix.compiler}}" == "intel" && "${{matrix.os}}" == "windows-latest" ) ]]; then | |
SHARED_STATIC="static" | |
fi | |
if [[ ( "${{matrix.compiler}}" == "intel-classic" && "${{matrix.os}}" == "windows-latest" ) || ( "${{matrix.compiler}}" == "intel" && "${{matrix.os}}" == "windows-latest" ) || ( "${{matrix.compiler}}" == "intel-classic" && "${{matrix.os}}" == "macos-13" ) ]]; then | |
PYTHON_INTERFACE="false" | |
fi | |
if [[ "${{matrix.compiler}}" == "nvidia-hpc" || "${{matrix.compiler}}" == "intel-classic" || ( "${{matrix.compiler}}" == "intel" && "${{matrix.os}}" == "windows-latest" ) ]]; then | |
SSIDS="false" | |
fi | |
meson setup builddir -Ddefault_library=${SHARED_STATIC} \ | |
--buildtype=debug \ | |
--prefix=$GITHUB_WORKSPACE/galahad \ | |
-Dc_std=$CSTD \ | |
-Dcpp_std=$CPPSTD \ | |
-Dexamples=true \ | |
-Dtests=true \ | |
-Dssids=$SSIDS \ | |
-Dpythoniface=${PYTHON_INTERFACE} \ | |
-Dgalahad_int64=$INT64 \ | |
-Dlibblas_path=${BLAS_PATH} \ | |
-Dliblapack_path=${LAPACK_PATH} \ | |
-Dlibhsl_path=${HSL_PATH} \ | |
-Dlibhsl_modules=${HSL_MODULES} \ | |
-Dlibblas=$BLAS \ | |
-Dliblapack=$LAPACK \ | |
-Dfortran_link_args=${LD_CLASSIC} \ | |
-Dc_link_args=${LD_CLASSIC} | |
- name: Build GALAHAD | |
shell: bash | |
run: | | |
meson compile -C builddir | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: ${{ matrix.os }}_${{ matrix.compiler }}-v${{ matrix.version }}_Int${{ matrix.int }}_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 }}-v${{ matrix.version }}_Int${{ matrix.int }}_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 }}-v${{ matrix.version }}_Int${{ matrix.int }}_testlog.txt | |
path: builddir/meson-logs/testlog.txt | |
- name: Test GALAHAD.jl | |
if: (matrix.int == '32') && !(matrix.os == 'windows-latest' && (matrix.compiler == 'intel' || matrix.compiler == 'intel-classic')) | |
shell: bash | |
run: julia --color=yes -e 'using Pkg; Pkg.develop(path="GALAHAD.jl"); Pkg.test("GALAHAD")' |