Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small refactoring for the build system #266

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/containerized-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
if: matrix.fortran-compiler != 'ifx' || matrix.rte-kernels != 'accel'
run: |
$FC --version
make libs
make -C build separate-libs
make -j4 libs
make -j4 -C build separate-libs
#
# Build libraries, examples and tests (expect failure)
#
Expand All @@ -90,7 +90,7 @@ jobs:
shell: bash
run: |
$FC --version
make libs 2> >(tee make.err >&2) && {
make -j4 libs 2> >(tee make.err >&2) && {
echo "Unexpected success"
exit 1
} || {
Expand All @@ -106,7 +106,7 @@ jobs:
#
- name: Run examples and tests
if: steps.build-success.outcome != 'skipped'
run: make tests
run: make -j4 tests
#
# Relax failure thresholds for single precision
#
Expand All @@ -118,7 +118,7 @@ jobs:
#
- name: Compare the results
if: steps.build-success.outcome != 'skipped'
run: make check
run: make -j4 check
#
# Generate validation plots
#
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ jobs:
- name: Build libraries, examples and tests
run: |
$FC --version
make libs
make -C build separate-libs
make -j4 libs
make -j4 -C build separate-libs
#
# Run examples and tests
#
- name: Run examples and tests
run: make tests
run: make -j4 tests
#
# Compare the results
#
- name: Compare the results
run: make check
run: make -j4 check
10 changes: 5 additions & 5 deletions .github/workflows/self-hosted-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,22 @@ jobs:
- name: Build libraries, examples and tests
run: |
$FC --version
make libs
make -C build separate-libs
make -j8 libs
make -j8 -C build separate-libs
#
# Run examples and tests (expect success)
#
- name: Run examples and tests (expect success)
id: run-success
if: matrix.config-name != 'cce-gpu-openmp'
run: make tests
run: make -j8 tests
#
# Run examples and tests (expect failure)
#
- name: Run examples and tests (expect failure)
if: steps.run-success.outcome == 'skipped'
run: |
make tests && {
make -j8 tests && {
echo "Unexpected success"
exit 1
} || echo "Expected failure"
Expand All @@ -126,4 +126,4 @@ jobs:
#
- name: Compare the results
if: steps.run-success.outcome != 'skipped'
run: make check
run: make -j8 check
8 changes: 4 additions & 4 deletions .gitlab/levante.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ variables:
# Build libraries, examples and tests
#
- ${FC} ${VERSION_FCFLAGS}
- make libs
- make -C build separate-libs
- make -j8 libs
- make -j8 -C build separate-libs
#
# Check out data
#
- git clone --depth 1 https://github.com/earth-system-radiation/rrtmgp-data.git "${RRTMGP_DATA}"
#
# Run examples and tests
#
- make tests
- make -j8 tests
#
# Compare the results
#
- make check
- make -j8 check

.nvhpc-gpu-openacc:
extends:
Expand Down
8 changes: 4 additions & 4 deletions .gitlab/lumi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,20 @@ setup-python:
# Build libraries, examples and tests
#
- ${FC} ${VERSION_FCFLAGS}
- make libs
- make -C build separate-libs
- make -j8 libs
- make -j8 -C build separate-libs
#
# Check out data
#
- git clone --depth 1 https://github.com/earth-system-radiation/rrtmgp-data.git "${RRTMGP_DATA}"
#
# Run examples and tests
#
- make tests
- make -j8 tests
#
# Compare the results
#
- make check
- make -j8 check

.cce-gpu-openacc:
extends:
Expand Down
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
all: libs tests check docs

libs:
make -C build -j
make -C tests -j 1
make -C examples/all-sky -j
make -C examples/rfmip-clear-sky -j
$(MAKE) -C build
$(MAKE) -C tests
$(MAKE) -C examples/all-sky
$(MAKE) -C examples/rfmip-clear-sky

tests:
make -C tests tests
make -C examples/rfmip-clear-sky tests
make -C examples/all-sky tests
$(MAKE) -C examples/rfmip-clear-sky $@
$(MAKE) -C examples/all-sky $@
$(MAKE) -C tests $@

check:
make -C tests check
make -C examples/rfmip-clear-sky check
make -C examples/all-sky check
$(MAKE) -C examples/rfmip-clear-sky $@
$(MAKE) -C examples/all-sky $@
$(MAKE) -C tests $@

docs:
@cd doc; ./build_documentation.sh

clean:
make -C build clean
make -C tests clean
make -C examples/rfmip-clear-sky clean
make -C examples/all-sky clean
$(MAKE) -C build $@
$(MAKE) -C examples/rfmip-clear-sky $@
$(MAKE) -C examples/all-sky $@
$(MAKE) -C tests $@
rm -rf public
4 changes: 2 additions & 2 deletions examples/all-sky/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ tests:
$(RUN_CMD) bash all_tests.sh

check:
python ${RRTMGP_ROOT}/examples/compare-to-reference.py --ref_dir ${RRTMGP_DATA}/examples/all-sky/reference --tst_dir ${RRTMGP_ROOT}/examples/all-sky \
$${PYTHON-python} ${RRTMGP_ROOT}/examples/compare-to-reference.py --ref_dir ${RRTMGP_DATA}/examples/all-sky/reference --tst_dir ${RRTMGP_ROOT}/examples/all-sky \
--var lw_flux_up lw_flux_dn sw_flux_up sw_flux_dn sw_flux_dir \
--file rrtmgp-allsky-lw.nc rrtmgp-allsky-sw.nc
python ${RRTMGP_ROOT}/examples/compare-to-reference.py --ref_dir ${RRTMGP_DATA}/examples/all-sky/reference --tst_dir ${RRTMGP_ROOT}/examples/all-sky \
$${PYTHON-python} ${RRTMGP_ROOT}/examples/compare-to-reference.py --ref_dir ${RRTMGP_DATA}/examples/all-sky/reference --tst_dir ${RRTMGP_ROOT}/examples/all-sky \
--var lw_flux_up lw_flux_dn sw_flux_up sw_flux_dn sw_flux_dir \
--file rrtmgp-allsky-lw-no-aerosols.nc rrtmgp-allsky-sw-no-aerosols.nc

Expand Down
2 changes: 1 addition & 1 deletion examples/rfmip-clear-sky/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tests: multiple_input4MIPs_radiation_RFMIP_UColorado-RFMIP-1-2_none.nc \
$(RUN_CMD) ./rrtmgp_rfmip_sw 8 multiple_input4MIPs_radiation_RFMIP_UColorado-RFMIP-1-2_none.nc ${RRTMGP_DATA}/rrtmgp-gas-sw-g224.nc

check:
python ${RRTMGP_ROOT}/examples/compare-to-reference.py \
$${PYTHON-python} ${RRTMGP_ROOT}/examples/compare-to-reference.py \
--ref_dir ${RRTMGP_DATA}/examples/rfmip-clear-sky/reference --tst_dir ${RRTMGP_ROOT}/examples/rfmip-clear-sky \
--var rld rlu rsd rsu --file r??_Efx_RTE-RRTMGP-181204_rad-irf_r1i1p1f1_gn.nc

Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ mo_cloud_sampling.o: $(LIB_DEPS) mo_cloud_sampling.F90
mo_gas_optics_defs_rrtmgp.o: $(LIB_DEPS) mo_testing_utils.o mo_simple_netcdf.o mo_gas_optics_defs_rrtmgp.F90

mo_load_coefficients.o: $(LIB_DEPS) mo_simple_netcdf.o mo_load_coefficients.F90
mo_rfmip_io.o.o: $(LIB_DEPS) mo_simple_netcdf.o mo_rfmip_io.F90
mo_rfmip_io.o: $(LIB_DEPS) mo_simple_netcdf.o mo_rfmip_io.F90
mo_simple_netcdf.o: $(LIB_DEPS) mo_simple_netcdf.F90

rte_optic_prop_unit_tests.o: $(LIB_DEPS) mo_testing_utils.o rte_optic_prop_unit_tests.F90
Expand Down
Loading