diff --git a/recipes/fortuno/build.sh b/recipes/fortuno/build.sh index 8686cc107d8b7..6b86508d287cb 100644 --- a/recipes/fortuno/build.sh +++ b/recipes/fortuno/build.sh @@ -13,10 +13,7 @@ cmake_options=( "-DFORTUNO_WITH_MPI=${MPI}" ) -mkdir -p _build -pushd _build - -FFLAGS="-fno-backtrace" cmake "${cmake_options[@]}" -GNinja .. -ninja all install - -popd +BUILD_DIR="_build" +FFLAGS="-fno-backtrace" cmake "${cmake_options[@]}" -GNinja -B ${BUILD_DIR} +cmake --build ${BUILD_DIR} +cmake --install ${BUILD_DIR} diff --git a/recipes/fortuno/meta.yaml b/recipes/fortuno/meta.yaml index 909a81b2bb80c..fb62c58041ead 100644 --- a/recipes/fortuno/meta.yaml +++ b/recipes/fortuno/meta.yaml @@ -44,6 +44,10 @@ requirements: test: requires: + - {{ compiler('fortran') }} + - {{ stdlib('c') }} + - cmake + - ninja - pkg-config commands: - pkg-config fortuno --exact-version={{ version }} diff --git a/recipes/fortuno/run_test.sh b/recipes/fortuno/run_test.sh new file mode 100644 index 0000000000000..aaae4b7478bcd --- /dev/null +++ b/recipes/fortuno/run_test.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -ex + +INTERFACES=( "serial" ) +if [ "${mpi}" != "nompi" ]; then + INTERFACES+=( "mpi" ) +fi + +cmake_options=( ${CMAKE_ARGS} ) +for interface in ${INTERFACES[@]}; do + RUNNER="" + if [[ "${interface}" == "mpi" ]]; then + RUNNER="mpirun -np 2" + fi + BUILD_DIR="_build_${interface}" + cmake "${cmake_options[@]}" -GNinja -B ${BUILD_DIR} + cmake --build ${BUILD_DIR} + ${RUNNER} ${BUILD_DIR}/app/testapp +done