Skip to content

Commit

Permalink
Update continuous integration (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison authored Jan 13, 2024
1 parent b5fee11 commit cf8da09
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 39 deletions.
122 changes: 91 additions & 31 deletions .github/workflows/meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ jobs:
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'
Expand Down Expand Up @@ -55,37 +70,56 @@ jobs:
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
else
echo "LIBDIR=lib" >> $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
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
wget https://github.com/JuliaBinaryWrappers/OpenBLAS_jll.jl/releases/download/OpenBLAS-v0.3.25%2B0/OpenBLAS.v0.3.25.$PLATFORM-libgfortran5.tar.gz
tar -xzvf OpenBLAS.v0.3.25.$PLATFORM-libgfortran5.tar.gz -C deps
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 variable LD_LIBRARY_PATH
- name: Set the environment variables LIBRARY_PATH, LD_LIBRARY_PATH and DYLD_LIBRARY_PATH
if: matrix.os != 'windows-latest'
shell: bash
run: echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/galahad/lib" >> $GITHUB_ENV
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'
Expand All @@ -107,27 +141,53 @@ jobs:

# Uncomment this section to obtain ssh access to VM
# - name: Setup tmate session
# if: matrix.os == 'windows-latest'
# 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
meson setup builddir --buildtype=debug -Dexamples=true -Dtests=true \
--prefix=$GITHUB_WORKSPACE/galahad -Dpythoniface=true \
-Dgalahad_int64=true -Dlibblas_path=$DEPS/deps/$LIBDIR \
-Dliblapack_path=$DEPS/deps/$LIBDIR -Dlibblas=openblas64_ \
-Dliblapack=openblas64_
elif [[ "${{matrix.compiler}}" == "nvidia-hpc" ]]; then
meson setup builddir --buildtype=debug -Dexamples=true -Dtests=true \
--prefix=$GITHUB_WORKSPACE/galahad -Dpythoniface=true \
-Dc_std=none -Dcpp_std=none -Dgalahad_int64=false
else
meson setup builddir --buildtype=debug -Dexamples=true -Dtests=true \
--prefix=$GITHUB_WORKSPACE/galahad -Dpythoniface=true \
-Dgalahad_int64=false
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
Expand Down
42 changes: 35 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,22 @@ py = import('python').find_installation()
host_system = host_machine.system()

# Remove messages about deprecated Intel compilers
if cc.get_id() == 'intel' or cc.get_id() == 'intel-cl'
if cc.get_id() == 'intel'
add_global_arguments('-diag-disable=10441', language : 'c')
add_global_link_arguments('-diag-disable=10441', language : 'c')
endif
if cxx.get_id() == 'intel' or cxx.get_id() == 'intel-cl'
if cc.get_id() == 'intel-cl'
add_global_arguments('/Qdiag-disable=10441', language : 'c')
add_global_link_arguments('/Qdiag-disable=10441', language : 'c')
endif
if cxx.get_id() == 'intel'
add_global_arguments('-diag-disable=10441', language : 'cpp')
add_global_link_arguments('-diag-disable=10441', language : 'cpp')
endif
if cxx.get_id() == 'intel-cl'
add_global_arguments('/Qdiag-disable=10441', language : 'cpp')
add_global_link_arguments('/Qdiag-disable=10441', language : 'cpp')
endif

# Recognise old non-standard double complex intrinsics
if fc.get_id() == 'nagfor'
Expand All @@ -45,15 +53,21 @@ else
endif

pp_options = []
pp_flag = []
if fc.get_id() == 'gcc'
pp_flag += '-cpp'
pp_options += ['-cpp', '-E']
elif fc.get_id() == 'intel' or fc.get_id() == 'intel-llvm'
pp_flag += '-fpp'
pp_options += ['-fpp', '-P']
elif fc.get_id() == 'intel-cl' or fc.get_id() == 'intel-llvm-cl'
pp_flag += '/fpp'
pp_options += ['/fpp', '/P']
elif fc.get_id() == 'nagfor'
pp_flag += '-fpp'
pp_options += ['-fpp', '-F']
elif fc.get_id() == 'nvidia_hpc'
pp_flag += '-Mcpp'
pp_options += ['-Mcpp', '-F']
endif

Expand Down Expand Up @@ -134,7 +148,7 @@ endif

if cxx.get_id() == 'nvidia_hpc'
add_global_arguments('-mp', language : 'cpp')
elif cxx.get_id() == 'gcc' or cxx.get_id() == 'clang'
elif cxx.get_id() == 'gcc' or cxx.get_id() == 'clang' or cxx.get_id() == 'clang-cl'
add_global_arguments('-fopenmp', language : 'cpp')
elif cxx.get_id() == 'intel' or cxx.get_id() == 'intel-llvm'
add_global_arguments('-qopenmp', language : 'cpp')
Expand Down Expand Up @@ -206,6 +220,20 @@ if libhsl.found()
add_global_arguments('-DLANCELOT_USE_MA57', language : 'fortran')
endif

# Link flag for C++
lstdcpp = '-lstdc++'
if host_machine.system() != 'linux'
if cxx.get_id() == 'clang' or cxx.get_id() == 'clang-cl'
lstdcpp = '-lc++'
endif
if cxx.get_id() == 'intel' or cxx.get_id() == 'intel-llvm'
lstdcpp = '-cxxlib'
endif
if cxx.get_id() == 'intel-cl' or cxx.get_id() == 'intel-llvm-cl'
lstdcpp = '/Qcxxlib'
endif
endif

extra_args_single = ['-DGALAHAD_SINGLE', '-DSPRAL_SINGLE']
extra_args_double = ['-DGALAHAD_DOUBLE', '-DSPRAL_DOUBLE']

Expand Down Expand Up @@ -360,7 +388,7 @@ if build_single
fortran_args : extra_args_single,
cpp_args : extra_args_single,
link_language : 'fortran',
link_args : '-lstdc++',
link_args : lstdcpp,
include_directories: libgalahad_single_include,
install : true)
endif
Expand Down Expand Up @@ -391,7 +419,7 @@ if build_double
fortran_args : extra_args_double,
cpp_args : extra_args_double,
link_language : 'fortran',
link_args : '-lstdc++',
link_args : lstdcpp,
include_directories: libgalahad_double_include,
install : true)
endif
Expand Down Expand Up @@ -437,7 +465,7 @@ if build_single
binfile = binary[1]
executable(binname+'_single', binfile,
dependencies : libgalahad_single_deps + libgalahad_deps,
fortran_args : extra_args_single,
fortran_args : pp_flag + extra_args_single,
link_with : libgalahad_single,
link_language : 'fortran',
include_directories: libgalahad_single_include,
Expand All @@ -451,7 +479,7 @@ if build_double
binfile = binary[1]
executable(binname+'_double', binfile,
dependencies : libgalahad_double_deps + libgalahad_deps,
fortran_args : extra_args_double,
fortran_args : pp_flag + extra_args_double,
link_with : libgalahad_double,
link_language : 'fortran',
include_directories: libgalahad_double_include,
Expand Down
2 changes: 1 addition & 1 deletion src/string/meson.build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libgalahad_multi_src += files('string.F90')
libgalahad_src += files('string.F90')

0 comments on commit cf8da09

Please sign in to comment.