Fix tpls and macros
- continuation
#90
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: github-Linux-trilinos | |
on: | |
pull_request: | |
types: [ opened, reopened, synchronize ] | |
paths-ignore: | |
- 'logos/**' | |
- 'helper_scripts/**' | |
- 'docker_scripts/**' | |
- 'docs/**' | |
- '**/*.md' | |
push: # for direct quick fixes | |
branches: | |
- 'main' | |
- 'develop' | |
paths-ignore: | |
- 'logos/**' | |
- 'helper_scripts/**' | |
- 'docker_scripts/**' | |
- 'docs/**' | |
- '**/*.md' | |
concurrency: | |
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{github.event_name == 'pull_request'}} | |
jobs: | |
CI-trilinos: | |
name: Trilinos | |
strategy: | |
matrix: | |
image: | |
- ubuntu-20.04-gnu_10-eigen_3.3.7-gtest-trilinos_hash-ef73d14babf6e7556b0420add98cce257ccaa56b | |
build_type: | |
- Release | |
- Debug | |
requirements: | |
- "apt install -y openmpi-bin libopenmpi-dev;sed -i -e '$alocalhost slots=4' /etc/openmpi/openmpi-default-hostfile" | |
runs-on: ubuntu-latest | |
container: pressiomodelreduction/${{ matrix.image }} | |
env: | |
num_cpus: 4 | |
eigen_inc_dir: /home/pressio_builds/eigen/install/include/eigen3 | |
gtest_dir: /home/pressio_builds/gtest/install | |
trilinos_dir: /home/pressio_builds/trilinos/install | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Creating environnement | |
run: | | |
apt-get update -y | |
${{ matrix.requirements }} | |
- name: Configure | |
run: | | |
cmake -B builddir \ | |
-D CMAKE_BUILD_TYPE:STRING=${{ matrix.build_type }} \ | |
-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \ | |
-D CMAKE_C_COMPILER:FILEPATH=/usr/bin/mpicc \ | |
-D CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/mpic++ \ | |
-D MPI_Fortran_COMPILER:FILEPATH=/usr/bin/mpif90 \ | |
-D PRESSIO_ENABLE_TESTS:BOOL=ON \ | |
-D PRESSIO_ENABLE_TPL_EIGEN:BOOL=ON \ | |
-D PRESSIO_ENABLE_TPL_MPI:BOOL=ON \ | |
-D PRESSIO_ENABLE_TPL_TRILINOS:BOOL=ON \ | |
-D PRESSIO_ENABLE_TPL_KOKKOS:BOOL=ON \ | |
-D PRESSIO_ENABLE_TPL_BLAS:BOOL=ON \ | |
-D PRESSIO_ENABLE_TPL_LAPACK:BOOL=ON \ | |
-D PRESSIO_ENABLE_DEBUG_PRINT=ON \ | |
-D EIGEN_INCLUDE_DIR=$eigen_inc_dir \ | |
-D GTEST_ROOT=$gtest_dir \ | |
-D Trilinos_DIR=${{ env.trilinos_dir }}/lib/cmake/Trilinos \ | |
-D CMAKE_INSTALL_PREFIX:PATH=../install \ | |
-D CMAKE_CXX_FLAGS='' | |
- name: Build | |
run: cmake --build builddir -j $num_cpus --target install | |
- name: Checkout pressio examples | |
uses: actions/checkout@v4 | |
with: | |
repository: Pressio/pressio-templates-usage-as-library | |
path: examples | |
- name: Example - CMake installed | |
working-directory: examples/cmake_find_package | |
run: | | |
cmake -B builddir \ | |
-DCMAKE_PREFIX_PATH=../../install \ | |
&& cmake --build builddir \ | |
&& ./builddir/pressio-example | |
- name: Example - CMake include_directories | |
working-directory: examples/cmake_include_directories | |
run: | | |
cmake -B builddir \ | |
-DEIGEN_INCLUDE_DIR=$eigen_inc_dir \ | |
&& cmake --build builddir \ | |
&& ./builddir/pressio-example | |
- name: Example - CMake add_subdirectory | |
working-directory: examples/cmake_add_subdirectory | |
run: | | |
cmake -B builddir \ | |
-DEIGEN_INCLUDE_DIR=$eigen_inc_dir \ | |
&& cmake --build builddir \ | |
&& ./builddir/pressio-example | |
- name: Example - include only | |
working-directory: examples | |
run: | | |
$CXX \ | |
-DPRESSIO_ENABLE_TPL_EIGEN \ | |
-DPRESSIO_ENABLE_TPL_TRILINOS \ | |
-I$eigen_inc_dir \ | |
-I$trilinos_dir/include \ | |
-I../include \ | |
-c main.cpp \ | |
&& $CXX -o pressio-example main.o \ | |
&& ./pressio-example | |
- name: Example - include only with embedded definitions | |
working-directory: examples | |
run: | | |
$CXX \ | |
-DPRESSIO_ENABLE_TPL_TRILINOS \ | |
-I$eigen_inc_dir \ | |
-Itrilinos_dir/include \ | |
-I../include \ | |
-c main_with_defines.cpp \ | |
&& $CXX -o pressio-example main.o \ | |
&& ./pressio-example | |
- name: Test | |
working-directory: builddir | |
run: | | |
export LD_LIBRARY_PATH=${{ env.trilinos_dir }}/lib | |
export OMPI_ALLOW_RUN_AS_ROOT=1 | |
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | |
ctest -j $num_cpus --output-on-failure |