Skip to content

Commit

Permalink
Remove musica-core dependency (#51)
Browse files Browse the repository at this point in the history
* merge in musica-core dependencies

* don't run tests in parallel

* remove unneeded utility modules

* remove io functions from string_t

* remove debug output from tests to reduce log file size

* update valgrind suppressions for MPI

* update valgrind suppressions

* fix valgrind suppression format error

* remove wildcards from valgrind supresssion error types

* add valgrind suppression
  • Loading branch information
mattldawson authored Mar 4, 2024
1 parent 6970a8f commit 6930151
Show file tree
Hide file tree
Showing 185 changed files with 12,267 additions and 1,883 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# include things to copy
!src/
!include/
!etc/
!data/
!cmake/
Expand Down
30 changes: 4 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: build Docker image
run: docker build -t tuv-x-test .
- name: run tests in container
run: docker run --name test-container -t tuv-x-test bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'
run: docker run --name test-container -t tuv-x-test bash -c 'make test ARGS="--rerun-failed --output-on-failure"'
build_test_with_mpi_no_memcheck:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
Expand All @@ -28,7 +28,7 @@ jobs:
- name: build Docker image for MPI tests
run: docker build -t tuv-x-mpi-test . -f Dockerfile.mpi
- name: run MPI tests in container
run: docker run -t tuv-x-mpi-test bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'
run: docker run -t tuv-x-mpi-test bash -c 'make test ARGS="--rerun-failed --output-on-failure"'
build_test_no_mpi_with_memcheck:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
Expand All @@ -39,24 +39,13 @@ jobs:
- name: build Docker image
run: docker build -t tuv-x-test . -f Dockerfile.memcheck
- name: run tests in container
run: docker run --name test-container -t tuv-x-test bash -c 'make coverage ARGS="--rerun-failed --output-on-failure -j8"'
run: docker run --name test-container -t tuv-x-test bash -c 'make coverage ARGS="--rerun-failed --output-on-failure"'
- name: copy coverage from container
run: docker cp test-container:build/coverage.info .
- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.info
build_test_yaml_no_mpi_with_memcheck:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: build Docker image with YAML and memcheck
run: docker build -t tuv-x-yaml-test . -f Dockerfile.yaml.memcheck
- name: run tests in container
run: docker run -t tuv-x-yaml-test bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'
build_test_with_mpi_with_memcheck:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
Expand All @@ -67,15 +56,4 @@ jobs:
- name: build Docker image for MPI tests
run: docker build -t tuv-x-mpi-test . -f Dockerfile.mpi.memcheck
- name: run MPI tests in container
run: docker run -t tuv-x-mpi-test bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'
build_test_yaml_with_mpi_with_memcheck:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: build Docker image with YAML and memcheck for MPI tests
run: docker build -t tuv-x-mpi-yaml-test . -f Dockerfile.yaml.mpi.memcheck
- name: run MPI tests in container
run: docker run -t tuv-x-mpi-yaml-test bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'
run: docker run -t tuv-x-mpi-test bash -c 'make test ARGS="--rerun-failed --output-on-failure"'
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ option(ENABLE_COVERAGE "Enable code coverage output" OFF)
option(ENABLE_MEMCHECK "Enable memory checking in tests" ON)
option(ENABLE_NC_CONFIG "Use nc-config to determine NetCDF libraries" OFF)
option(BUILD_DOCS "Build the documentation" OFF)
option(ENABLE_YAML "Uses YAML parser instead of JSON" OFF)

# Set up include and lib directories
set(TUVX_MOD_DIR "${PROJECT_BINARY_DIR}/include")
Expand Down Expand Up @@ -79,11 +78,16 @@ add_executable(tuv-x src/tuvx.F90 version.F90)
target_link_libraries(tuv-x
PUBLIC
musica::tuvx
musica::musicacore
yaml-cpp::yaml-cpp
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
)

target_include_directories(tuv-x
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>)

if(ENABLE_OPENMP)
target_link_libraries(tuv-x PUBLIC OpenMP::OpenMP_Fortran)
endif()
Expand Down
21 changes: 2 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:35
FROM fedora:37

RUN dnf -y update \
&& dnf -y install \
Expand All @@ -15,34 +15,17 @@ RUN dnf -y update \
python3 \
python3-pip \
lapack-devel \
yaml-cpp-devel \
&& dnf clean all

RUN pip3 install numpy scipy

# install json-fortran
RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.2.0.tar.gz \
&& tar -zxvf 8.2.0.tar.gz \
&& cd json-fortran-8.2.0 \
&& export FC=gfortran \
&& mkdir build \
&& cd build \
&& cmake -D SKIP_DOC_GEN:BOOL=TRUE .. \
&& sudo make install

# add a symlink
# Create symlinks in the Docker container
RUN ln -s /usr/local/jsonfortran-gnu-8.2.0/lib/libjsonfortran.a /usr/local/lib64/libjsonfortran.a && \
ln -s /usr/local/jsonfortran-gnu-8.2.0/lib/libjsonfortran.so.8.2 /usr/local/lib64/libjsonfortran.so.8.2 && \
ln -s /usr/local/jsonfortran-gnu-8.2.0/lib/libjsonfortran.so /usr/local/lib64/libjsonfortran.so && \
ln -s /usr/local/jsonfortran-gnu-8.2.0/lib/libjsonfortran.so.8.2.0 /usr/local/lib64/libjsonfortran.so.8.2.0

ENV LD_LIBRARY_PATH=/usr/local/lib64

# build the tuv-x tool
COPY . /tuv-x/
RUN mkdir /build \
&& cd /build \
&& export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-8.2.0" \
&& cmake -D CMAKE_BUILD_TYPE=release \
-D ENABLE_MEMCHECK=OFF \
/tuv-x \
Expand Down
14 changes: 2 additions & 12 deletions Dockerfile.docs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:35
FROM fedora:37

RUN dnf -y update \
&& dnf -y install \
Expand All @@ -16,18 +16,9 @@ RUN dnf -y update \
python3 \
python3-pip \
lapack-devel \
yaml-cpp-devel \
&& dnf clean all

# install json-fortran
RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.2.0.tar.gz \
&& tar -zxvf 8.2.0.tar.gz \
&& cd json-fortran-8.2.0 \
&& export FC=gfortran \
&& mkdir build \
&& cd build \
&& cmake -D SKIP_DOC_GEN:BOOL=TRUE .. \
&& sudo make install

# build the tuv-x tool
COPY . /tuv-x/

Expand All @@ -40,7 +31,6 @@ RUN echo "The suffix is '$SWITCHER_SUFFIX'"

RUN mkdir /build \
&& cd /build \
&& export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-8.2.0" \
&& cmake -D ENABLE_TESTS=OFF \
-D BUILD_DOCS=ON \
/tuv-x \
Expand Down
14 changes: 2 additions & 12 deletions Dockerfile.memcheck
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:35
FROM fedora:37

RUN dnf -y update \
&& dnf -y install \
Expand All @@ -15,25 +15,15 @@ RUN dnf -y update \
python3 \
python3-pip \
lapack-devel \
yaml-cpp-devel \
&& dnf clean all

RUN pip3 install numpy scipy

# install json-fortran
RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.2.0.tar.gz \
&& tar -zxvf 8.2.0.tar.gz \
&& cd json-fortran-8.2.0 \
&& export FC=gfortran \
&& mkdir build \
&& cd build \
&& cmake -D SKIP_DOC_GEN:BOOL=TRUE .. \
&& sudo make install

# build the tuv-x tool
COPY . /tuv-x/
RUN mkdir /build \
&& cd /build \
&& export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-8.2.0" \
&& cmake -D ENABLE_COVERAGE:BOOL=TRUE \
-D CMAKE_BUILD_TYPE=COVERAGE \
/tuv-x \
Expand Down
17 changes: 4 additions & 13 deletions Dockerfile.mpi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:35
FROM fedora:37

RUN dnf -y update \
&& dnf install -y sudo \
Expand All @@ -24,31 +24,22 @@ RUN sudo dnf -y install \
python3-pip \
valgrind-openmpi \
lapack-devel \
yaml-cpp-devel \
&& sudo dnf clean all

ENV PATH="${PATH}:/usr/lib64/openmpi/bin/"
ENV OMP_NUM_THREADS=5

RUN pip3 install numpy scipy

# install json-fortran
RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.2.0.tar.gz \
&& tar -zxvf 8.2.0.tar.gz \
&& cd json-fortran-8.2.0 \
&& export FC=gfortran \
&& mkdir build \
&& cd build \
&& cmake -D SKIP_DOC_GEN:BOOL=TRUE .. \
&& sudo make install


# build the tuv-x tool
COPY . tuv-x/
RUN mkdir build \
&& cd build \
&& export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-8.2.0" \
&& cmake -D CMAKE_BUILD_TYPE=release \
-D CMAKE_Fortran_COMPILER=/usr/lib64/openmpi/bin/mpif90 \
-D CMAKE_C_COMPILER=/usr/lib64/openmpi/bin/mpicc \
-D CMAKE_CXX_COMPILER=/usr/lib64/openmpi/bin/mpicxx \
-D ENABLE_OPENMP:BOOL=TRUE \
-D ENABLE_MPI:BOOL=TRUE \
-D ENABLE_MEMCHECK:BOOL=FALSE \
Expand Down
16 changes: 4 additions & 12 deletions Dockerfile.mpi.memcheck
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:35
FROM fedora:37

RUN dnf -y update \
&& dnf install -y sudo \
Expand All @@ -24,30 +24,22 @@ RUN sudo dnf -y install \
python3-pip \
valgrind-openmpi \
lapack-devel \
yaml-cpp-devel \
&& sudo dnf clean all

ENV PATH="${PATH}:/usr/lib64/openmpi/bin/"
ENV OMP_NUM_THREADS=5

RUN pip3 install numpy scipy

# install json-fortran
RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.2.0.tar.gz \
&& tar -zxvf 8.2.0.tar.gz \
&& cd json-fortran-8.2.0 \
&& export FC=gfortran \
&& mkdir build \
&& cd build \
&& cmake -D SKIP_DOC_GEN:BOOL=TRUE .. \
&& sudo make install

# build the tuv-x tool
COPY . tuv-x/
RUN mkdir build \
&& cd build \
&& export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-8.2.0" \
&& cmake -D CMAKE_BUILD_TYPE=debug \
-D CMAKE_Fortran_COMPILER=/usr/lib64/openmpi/bin/mpif90 \
-D CMAKE_C_COMPILER=/usr/lib64/openmpi/bin/mpicc \
-D CMAKE_CXX_COMPILER=/usr/lib64/openmpi/bin/mpicxx \
-D ENABLE_OPENMP:BOOL=TRUE \
-D ENABLE_MPI:BOOL=TRUE \
-D ENABLE_MEMCHECK:BOOL=TRUE \
Expand Down
33 changes: 0 additions & 33 deletions Dockerfile.yaml.memcheck

This file was deleted.

50 changes: 0 additions & 50 deletions Dockerfile.yaml.mpi.memcheck

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Tropospheric ultraviolet-extended (TUV-x): A photolysis rate calculator
[![DOI](https://zenodo.org/badge/396946468.svg)](https://zenodo.org/badge/latestdoi/396946468)
[![](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/NCAR/tuv-x)

Copyright (C) 2020 National Center for Atmospheric Research
Copyright (C) 2020-4 National Center for Atmospheric Research

# Try it out!

Expand All @@ -22,7 +22,7 @@ a tutorial on how to use TUV-x.
# Building and installing
To build and install TUV-x locally, you must have the following libraries installed:

- [json-fortran](https://github.com/jacobwilliams/json-fortran)
- [yaml-cpp](https://github.com/jbeder/yaml-cpp/)
- [NetCDF](https://www.unidata.ucar.edu/software/netcdf/) (both C and Fortran libraries)

You must also have CMake installed on your machine.
Expand Down Expand Up @@ -185,4 +185,4 @@ installation and usage instructions.
# License

- [Apache 2.0](/LICENSE)
- Copyright (C) 2022 National Center for Atmospheric Research
- Copyright (C) 2020-4 National Center for Atmospheric Research
Loading

0 comments on commit 6930151

Please sign in to comment.