-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,11 +23,11 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
compiler: [intel, gnu] | ||
compiler: [gnu, intel] | ||
interface: [serial, mpi] | ||
exclude: | ||
# MacOS has no Intel compiler | ||
- os: macos-latest | ||
compiler: intel | ||
- os: macos-latest | ||
compiler: intel | ||
|
||
steps: | ||
|
||
|
@@ -38,9 +38,10 @@ jobs: | |
if: ${{ contains(matrix.compiler, 'intel') }} | ||
uses: rscohn2/setup-oneapi@v0 | ||
with: | ||
# Note: intel 2024.1 and 2024.2 fail to build Fortuno properly due to a compiler bug, | ||
# see https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-bug-Procedure-pointer-association-status-gets-lost/m-p/1612121#M172850 | ||
components: [email protected] | ||
components: | | ||
ifx | ||
icx | ||
impi | ||
- name: Setup Intel environment | ||
if: ${{ contains(matrix.compiler, 'intel') }} | ||
|
@@ -49,6 +50,9 @@ jobs: | |
printenv >> ${GITHUB_ENV} | ||
echo "FC=ifx" >> ${GITHUB_ENV} | ||
echo "FPM_FC=ifx" >> ${GITHUB_ENV} | ||
# Overriding default FPM_FFLAGS as default setting contains '-standard-semantics' | ||
# which is incompatible with intel MPI. | ||
echo "FPM_FFLAGS='-warn all -check all,nouninit -error-limit 1 -O0 -g -stand f18 -traceback'" >> ${GITHUB_ENV} | ||
- name: Setup GNU compiler | ||
if: ${{ contains(matrix.compiler, 'gnu') }} | ||
|
@@ -63,13 +67,38 @@ jobs: | |
echo "FC=${{ env.FC }}" >> ${GITHUB_ENV} | ||
echo "FPM_FC=${{ env.FC }}" >> ${GITHUB_ENV} | ||
- name: Setup MPI on Ubuntu | ||
if: ${{ contains(matrix.os, 'ubuntu') && contains(matrix.interface, 'mpi') }} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y mpich | ||
- name: Setup MPI on MacOS | ||
if: ${{ contains(matrix.os, 'macos') && contains(matrix.interface, 'mpi') }} | ||
run: | | ||
brew install openmpi | ||
- name: Setup serial interface options | ||
if: ${{ contains(matrix.interface, 'serial') }} | ||
run: | | ||
echo "CMAKE_OPTIONS=-DFORTUNO_BUILD_SERIAL_INTERFACE=ON -DFORTUNO_BUILD_MPI_INTERFACE=OFF" >> ${GITHUB_ENV} | ||
echo "MESON_OPTIONS=-Dbuild_serial_interface=true -Dbuild_mpi_interface=false" >> ${GITHUB_ENV} | ||
echo "INTERFACE=serial" >> ${GITHUB_ENV} | ||
- name: Setup mpi interface options | ||
if: ${{ contains(matrix.interface, 'mpi') }} | ||
run: | | ||
echo "CMAKE_OPTIONS=-DFORTUNO_BUILD_SERIAL_INTERFACE=OFF -DFORTUNO_BUILD_MPI_INTERFACE=ON" >> ${GITHUB_ENV} | ||
echo "MESON_OPTIONS='-Dbuild_serial_interface=false -Dbuild_mpi_interface=true'" >> ${GITHUB_ENV} | ||
echo "INTERFACE=mpi" >> ${GITHUB_ENV} | ||
- name: Setup build tools | ||
run: | | ||
pip install cmake fpm meson ninja fypp | ||
- name: Build Fortuno with CMake | ||
run: | | ||
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -B ${BUILD_DIR} -G Ninja | ||
cmake ${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -B ${BUILD_DIR} -G Ninja | ||
cmake --build ${BUILD_DIR} | ||
cmake --install ${BUILD_DIR} | ||
rm -rf ${BUILD_DIR} | ||
|
@@ -81,13 +110,13 @@ jobs: | |
|
||
- name: Build Fortuno with Meson | ||
run: | | ||
meson setup -Dbuild_examples=true ${BUILD_DIR} | ||
meson setup ${MESON_OPTIONS} -Dbuild_examples=true ${BUILD_DIR} | ||
ninja -C ${BUILD_DIR} | ||
rm -rf ${BUILD_DIR} | ||
- name: Test CMake export | ||
run: | | ||
CMAKE_PREFIX_PATH=${INSTALL_DIR} cmake -B ${BUILD_DIR} -G Ninja test/export/serial | ||
CMAKE_PREFIX_PATH=${INSTALL_DIR} cmake -B ${BUILD_DIR} -G Ninja test/export/${INTERFACE} | ||
cmake --build ${BUILD_DIR} | ||
${BUILD_DIR}/app/testapp | ||
${BUILD_DIR}/app/testapp_fypp | ||
|
@@ -101,7 +130,7 @@ jobs: | |
- name: Test Meson pkgconfig export | ||
run: | | ||
export PKG_CONFIG_PATH="${PWD}/${INSTALL_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}" | ||
cd test/export/serial | ||
cd test/export/${INTERFACE} | ||
meson setup --wrap-mode nofallback ${BUILD_DIR} | ||
ninja -C ${BUILD_DIR} | ||
${BUILD_DIR}/testapp | ||
|
@@ -111,7 +140,7 @@ jobs: | |
run: | | ||
FORTUNO_DIR=${PWD} | ||
GIT_REV=$(git rev-parse HEAD) | ||
cd test/export/serial | ||
cd test/export/${INTERFACE} | ||
mkdir subprojects | ||
echo -e "[wrap-git]\ndirectory=fortuno\n" > subprojects/fortuno.wrap | ||
echo -e "url=file://${FORTUNO_DIR}\nrevision=${GIT_REV}\n" >> subprojects/fortuno.wrap | ||
|