Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
boulderdaze committed Sep 26, 2024
2 parents 8084aee + 2bd5a8a commit ff76e70
Show file tree
Hide file tree
Showing 58 changed files with 2,571 additions and 583 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
- Dockerfile.mpi
- Dockerfile.mpi_openmp
- Dockerfile.python
- Dockerfile.pip
build_type: [Release, Debug]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -37,10 +39,10 @@ jobs:
run: rm -rf /opt/hostedtoolcache

- name: Build Docker image
run: docker build -t musica -f docker/${{ matrix.dockerfile }} .
run: docker build -t musica -f docker/${{ matrix.dockerfile }} . --build-arg MUSICA_GIT_TAG=${{ github.sha }} --build-arg BUILD_TYPE=${{ matrix.build_type }}

- name: Run tests in container
if: matrix.dockerfile != 'Dockerfile.coverage'
if: matrix.dockerfile != 'Dockerfile.coverage' && matrix.dockerfile != 'Dockerfile.pip'
run: docker run --name test-container -t musica bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'

- name: Run coverage tests in container
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
strategy:
matrix:
compiler:
- { cpp: g++-11, c: gcc-11, fc: gfortran-11}
- { cpp: g++-12, c: gcc-12, fc: gfortran-12}
- { cpp: g++-13, c: gcc-13, fc: gfortran-13}
- { cpp: g++-14, c: gcc-14, fc: gfortran-14}
- { cpp: clang++, c: clang, fc: gfortran-12}
- { cpp: g++-14, c: gcc-14, fc: gfortran-14}
build_type: [Release]
env:
CC: ${{ matrix.compiler.c }}
Expand All @@ -44,6 +45,7 @@ jobs:
cmake -S . -B build \
-D CMAKE_CXX_FLAGS=-Wl,-ld_classic \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D MUSICA_GIT_TAG=${{ github.sha }} \
-D MUSICA_ENABLE_PYTHON_LIBRARY=ON \
-D Python3_EXECUTABLE=$PYTHON_PATH
Expand All @@ -57,6 +59,7 @@ jobs:
cmake -S . -B build \
-D CMAKE_CXX_FLAGS=-Wl,-ld_classic \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D MUSICA_GIT_TAG=${{ github.sha }} \
-D MUSICA_ENABLE_PYTHON_LIBRARY=ON \
-D Python3_EXECUTABLE=$PYTHON_PATH \
-D CMAKE_OSX_SYSROOT=""
Expand All @@ -73,7 +76,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
gcc_version: [11, 12, 13]
gcc_version: [13, 14]
build_type: [Release]
env:
FC: gfortran-${{ matrix.gcc_version }}
Expand All @@ -85,7 +88,7 @@ jobs:
run: brew install netcdf netcdf-fortran

- name: Run Cmake
run: cmake -S . -B build -D CMAKE_CXX_FLAGS=-Wl,-ld_classic -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D MUSICA_BUILD_FORTRAN_INTERFACE=ON
run: cmake -S . -B build -D CMAKE_CXX_FLAGS=-Wl,-ld_classic -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D MUSICA_GIT_TAG=${{ github.sha }} -D MUSICA_BUILD_FORTRAN_INTERFACE=ON

- name: Build
run: cmake --build build --verbose --parallel 10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pep8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: autopep8
uses: peter-evans/autopep8@v2
with:
args: --recursive --in-place --aggressive --aggressive .
args: --recursive --in-place --aggressive --aggressive --max-line-length 120 .

- name: Check for changes
id: check-changes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
run: pip install --verbose .[test]

- name: Test
run: python -m unittest discover -s python/test
run: python -m unittest discover -v -s python/test
22 changes: 16 additions & 6 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
- { cpp: g++-14, c: gcc-14, fc: gfortran-14}
- { cpp: clang++, c: clang, fc: gfortran-12}
options:
- {python: ON, tuvx: OFF}
- {python: OFF, tuvx: ON}
- {micm: ON, tuvx: OFF, python: ON}
- {micm: OFF, tuvx: ON, python: OFF}
build_type: [Release]
env:
CC: ${{ matrix.compiler.c }}
Expand All @@ -40,21 +40,31 @@ jobs:
sudo apt-get install -y liblapack-dev libblas-dev build-essential libnetcdf-dev libnetcdff-dev
sudo apt-get install -y python3-numpy
- name: Run Cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D MUSICA_ENABLE_PYTHON_LIBRARY=${{ matrix.options.python }} -D MUSICA_ENABLE_TUVX=${{ matrix.matrix.options.tuvx }}
- name: Run Cmake
# TUV-x doesn't work with gcc 13
if: matrix.compiler.fc != 'gfortran-13' && matrix.options.tuvx != 'ON'
run: |
cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D MUSICA_GIT_TAG=${{ github.sha }} \
-D MUSICA_ENABLE_MICM=${{ matrix.options.micm }} \
-D MUSICA_ENABLE_TUVX=${{ matrix.options.tuvx }} \
-D MUSICA_ENABLE_PYTHON_LIBRARY=${{ matrix.options.python }}
- name: Build
if: matrix.compiler.fc != 'gfortran-13' && matrix.options.tuvx != 'ON'
run: cmake --build build --verbose

- name: Run tests
if: matrix.compiler.fc != 'gfortran-13' && matrix.options.tuvx != 'ON'
run: |
cd build
ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose
fortran:
runs-on: ubuntu-24.04
continue-on-error: true
strategy:
matrix:
gcc_version: [12, 13, 14]
gcc_version: [14]
build_type: [Debug, Release]
env:
CXX: g++-${{ matrix.gcc_version }}
Expand All @@ -70,7 +80,7 @@ jobs:
sudo apt-get install -y libnetcdf-dev netcdf-bin libnetcdff-dev liblapack-dev libblas-dev
- name: Run Cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D MUSICA_BUILD_FORTRAN_INTERFACE=ON
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D MUSICA_GIT_TAG=${{ github.sha }} -D MUSICA_BUILD_FORTRAN_INTERFACE=ON

- name: Build
run: cmake --build build --verbose --parallel 1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- run: pip install numpy

- name: Run Cmake
run: cmake -S . -B build -G "MinGW Makefiles" -D MUSICA_ENABLE_TUVX=OFF -D MUSICA_ENABLE_PYTHON_LIBRARY=ON
run: cmake -S . -B build -G "MinGW Makefiles" -D MUSICA_GIT_TAG=${{ github.sha }} -D MUSICA_ENABLE_TUVX=OFF -D MUSICA_ENABLE_PYTHON_LIBRARY=ON

- name: Build
run: cmake --build build --parallel
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- run: pip install numpy

- name: Run CMake
run: cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -D MUSICA_ENABLE_TUVX=OFF -D MUSICA_ENABLE_PYTHON_LIBRARY=ON
run: cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture }} -D MUSICA_GIT_TAG=${{ github.sha }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -D MUSICA_ENABLE_TUVX=OFF -D MUSICA_ENABLE_PYTHON_LIBRARY=ON

- name: Build
run: cmake --build build --config ${{ matrix.build_type }} --parallel
Expand All @@ -86,7 +86,7 @@ jobs:
- run: pip install numpy

- name: Run CMake
run: cmake -S . -B build -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang++.exe" -DCMAKE_C_COMPILER="C:/Program Files/LLVM/bin/clang.exe" -G"MinGW Makefiles" -D MUSICA_ENABLE_TUVX=OFF -D MUSICA_ENABLE_PYTHON_LIBRARY=ON
run: cmake -S . -B build -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang++.exe" -DCMAKE_C_COMPILER="C:/Program Files/LLVM/bin/clang.exe" -G"MinGW Makefiles" -D MUSICA_GIT_TAG=${{ github.sha }} -D MUSICA_ENABLE_TUVX=OFF -D MUSICA_ENABLE_PYTHON_LIBRARY=ON

- name: Build
run: cmake --build build --parallel
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
- run: pip install numpy

- name: Run CMake
run: cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }} -T ClangCL -D MUSICA_ENABLE_TUVX=OFF -D MUSICA_ENABLE_PYTHON_LIBRARY=ON
run: cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }} -T ClangCL -D MUSICA_GIT_TAG=${{ github.sha }} -D MUSICA_ENABLE_TUVX=OFF -D MUSICA_ENABLE_PYTHON_LIBRARY=ON

- name: Build
run: cmake --build build --config Debug --parallel
Expand Down
10 changes: 0 additions & 10 deletions .gitmodules

This file was deleted.

2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ number: 10
page: "E1743 - E1760"
doi: "10.1175/BAMS-D-19-0331.1"
url: "https://journals.ametsoc.org/view/journals/bams/101/10/bamsD190331.xml"
version: 0.7.3
version: 0.8.0
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.21)

# must be on the same line so that pyproject.toml can correctly identify the version
project(musica-distribution VERSION 0.7.3)
project(musica-distribution VERSION 0.8.0)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_MODULE_PATH}/SetDefaults.cmake)
Expand Down
15 changes: 13 additions & 2 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ if (MUSICA_BUILD_FORTRAN_INTERFACE)
pkg_check_modules(netcdfc IMPORTED_TARGET REQUIRED netcdf)
endif()

# ##############################################################################
# yaml-cpp

FetchContent_Declare(
yaml-cpp
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp/
GIT_TAG 0.8.0
GIT_PROGRESS NOT
${FETCHCONTENT_QUIET})
FetchContent_MakeAvailable(yaml-cpp)

################################################################################
# google test
if(MUSICA_ENABLE_TESTS)
Expand Down Expand Up @@ -51,7 +62,7 @@ endif()
if (MUSICA_ENABLE_MICM AND MUSICA_BUILD_C_CXX_INTERFACE)

set_git_default(MICM_GIT_REPOSITORY https://github.com/NCAR/micm.git)
set_git_default(MICM_GIT_TAG 6b1c58a9be14095e3f3c6df403c91c4e800f23de)
set_git_default(MICM_GIT_TAG v3.6.0)

FetchContent_Declare(micm
GIT_REPOSITORY ${MICM_GIT_REPOSITORY}
Expand All @@ -75,7 +86,7 @@ if (MUSICA_ENABLE_TUVX AND MUSICA_BUILD_C_CXX_INTERFACE)
set(TUVX_INSTALL_INCLUDE_DIR ${MUSICA_INSTALL_INCLUDE_DIR} CACHE STRING "" FORCE)

set_git_default(TUVX_GIT_REPOSITORY https://github.com/NCAR/tuv-x.git)
set_git_default(TUVX_GIT_TAG 674ee1e72853bb44d23c36602fa73c955b2f021d)
set_git_default(TUVX_GIT_TAG v0.10.0)

FetchContent_Declare(tuvx
GIT_REPOSITORY ${TUVX_GIT_REPOSITORY}
Expand Down
2 changes: 1 addition & 1 deletion cmake/test_util.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function(create_standard_test_cxx)
include(CMakeParseArguments)
cmake_parse_arguments(${prefix} " " "${singleValues}" "${multiValues}" ${ARGN})
add_executable(test_${TEST_NAME} ${TEST_SOURCES})
target_link_libraries(test_${TEST_NAME} PUBLIC musica::musica GTest::gtest_main)
target_link_libraries(test_${TEST_NAME} PUBLIC musica::musica GTest::gtest_main yaml-cpp)
if(MUSICA_ENABLE_OPENMP)
target_link_libraries(test_${TEST_NAME} PUBLIC OpenMP::OpenMP_CXX)
endif()
Expand Down
18 changes: 15 additions & 3 deletions configs/analytical/reactions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,26 @@
"reactions":
[
{
"type": "ARRHENIUS", "A": 0.00012, "B": 7, "C" : 75, "D": 50, "E": 0.5,
"reactants": {"B": {"qty": 1}},
"products": {"C": {"yield": 1}}
"type": "USER_DEFINED",
"MUSICA name" : "reaction 2",
"reactants": {"E": {"qty": 1}},
"products": {"F": {"yield": 1}}
},
{
"type": "USER_DEFINED",
"MUSICA name" : "reaction 1",
"reactants": {"D": {"qty": 1}},
"products": {"E": {"yield": 1}}
},
{
"type": "ARRHENIUS", "A": 0.004, "C" : 50,
"reactants": {"A": {"qty": 1}},
"products": {"B": {"yield": 1}}
},
{
"type": "ARRHENIUS", "A": 0.012, "B": -2, "C" : 75, "D": 50, "E": 1.0e-6,
"reactants": {"B": {"qty": 1}},
"products": {"C": {"yield": 1}}
}
]
}
Expand Down
9 changes: 9 additions & 0 deletions configs/analytical/species.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
},
{
"name": "C", "type": "CHEM_SPEC"
},
{
"name": "D", "type": "CHEM_SPEC"
},
{
"name": "E", "type": "CHEM_SPEC"
},
{
"name": "F", "type": "CHEM_SPEC"
}
]
}
6 changes: 3 additions & 3 deletions configs/chapman/reactions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"yield": 2.0
}
},
"MUSICA name": "R1"
"MUSICA name": "jO2"
},
{
"type": "ARRHENIUS",
Expand All @@ -37,7 +37,7 @@
"O": {},
"O2": {}
},
"MUSICA name": "R3"
"MUSICA name": "jO3->O"
},
{
"type": "ARRHENIUS",
Expand All @@ -62,7 +62,7 @@
"O1D": {},
"O2": {}
},
"MUSICA name": "R5"
"MUSICA name": "jO3->O1D"
},
{
"type": "ARRHENIUS",
Expand Down
5 changes: 4 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM fedora:35
FROM fedora:latest

ARG MUSICA_GIT_TAG=main
ARG BUILD_TYPE=Release

RUN dnf -y update \
Expand All @@ -15,6 +16,7 @@ RUN dnf -y update \
json-devel \
python \
valgrind \
tree \
&& dnf clean all

# Copy the musica code
Expand All @@ -25,6 +27,7 @@ RUN cd musica \
&& cmake -S . \
-B build \
-D CMAKE_BUILD_TYPE=${BUILD_TYPE} \
-D MUSICA_GIT_TAG=${MUSICA_GIT_TAG} \
&& cd build \
&& make install -j 8

Expand Down
10 changes: 8 additions & 2 deletions docker/Dockerfile.docs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM fedora:37
FROM fedora:latest

ARG MUSICA_GIT_TAG=main
ARG BUILD_TYPE=Release

RUN dnf -y update \
&& dnf -y install \
Expand All @@ -17,7 +20,8 @@ RUN dnf -y update \

COPY . /musica/

RUN pip3 install -r /musica/docs/requirements.txt
RUN python3 -m pip install --upgrade pip setuptools \
&& python3 -m pip install -r /musica/docs/requirements.txt

ARG SUFFIX=""
ENV SWITCHER_SUFFIX=$SUFFIX
Expand All @@ -28,6 +32,8 @@ RUN mkdir /build \
&& cd /build \
&& cmake -D MUSICA_BUILD_DOCS=ON \
-D MUSICA_ENABLE_TUVX=OFF \
-D MUSICA_GIT_TAG=${MUSICA_GIT_TAG} \
-D CMAKE_BUILD_TYPE=${BUILD_TYPE} \
/musica \
&& make docs

Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.fortran-gcc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM fedora:35
FROM fedora:latest

ARG MUSICA_GIT_TAG=main
ARG BUILD_TYPE=Release

RUN dnf -y update \
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.fortran-gcc.integration
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:35
FROM fedora:latest

ARG MUSICA_GIT_TAG=main
ARG BUILD_TYPE=Release
Expand Down Expand Up @@ -38,6 +38,7 @@ RUN cd musica \
&& cmake -S . \
-B build \
-D CMAKE_BUILD_TYPE=${BUILD_TYPE} \
-D MUSICA_GIT_TAG=${MUSICA_GIT_TAG} \
&& cd build \
&& make install -j

Expand Down
Loading

0 comments on commit ff76e70

Please sign in to comment.