Skip to content

Commit

Permalink
Merge branch 'develop' into ejh_clang
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett authored Nov 1, 2024
2 parents 1bd524f + a49bdb7 commit 70ed417
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/Linux_options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ jobs:
- {
options: "-DBUILD_WITH_W3EMC=OFF"
}
- {
options: "-DBUILD_UTILS=ON -DBUILD_WITH_W3EMC=OFF"
}

steps:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Linux_shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
cd g2
mkdir build
cd build
cmake ${{ matrix.config.options }} -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip" -DCMAKE_INSTALL_PREFIX="~/g2/install" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DBUILD_SHARED_LIBS=ON ..
cmake ${{ matrix.config.options }} -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip" -DCMAKE_INSTALL_PREFIX="~/g2/install" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DBUILD_SHARED_LIBS=ON -DBUILD_UTILS=OFF ..
make -j2 VERBOSE=1
- name: cache-data
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/Linux_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ jobs:
jasper-version: [2.0.33, 3.0.5, 4.0.0]
bacio-version: [2.4.1, 2.5.0, 2.6.0]
w3emc-version: [2.9.2, 2.9.3, 2.10.0]
build-utils: [ON, OFF]
exclude:
# utils require w3emc version >= 2.10.0
- w3emc-version: 2.9.2
build-utils: ON
- w3emc-version: 2.9.3
build-utils: ON
gcc-version: [12]
include:
- gcc-version: 14
Expand Down Expand Up @@ -78,7 +85,7 @@ jobs:
cd g2
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip" -DLOGGING=ON -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data ..
cmake -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip" -DLOGGING=ON -DBUILD_UTILS=${{ matrix.build-utils }} -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data ..
make -j2 VERBOSE=1
- name: cache-data
Expand Down
27 changes: 23 additions & 4 deletions .github/workflows/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,22 @@ on:
branches:
- develop

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
developer:
runs-on: ubuntu-latest
env:
FC: gfortran
CC: gcc
LD_LIBRARY_PATH: /home/runner/work/NCEPLIBS-g2/NCEPLIBS-g2/nceplibs/jasper/lib/

strategy:
fail-fast: true
matrix:
config: ["asan/warning check", "docs/code coverage"]

steps:

Expand Down Expand Up @@ -51,18 +61,26 @@ jobs:
key: data-developer-5

- name: asan
if: matrix.config == 'asan/warning check'
run: |
set -x
cd g2
mkdir build
doxygen --version
cd build
cmake -DBUILD_UTILS=OFF -DG2C_COMPARE=ON -DUSE_AEC=ON -DFTP_LARGE_TEST_FILES=ON -DENABLE_DOCS=ON -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug ..
cmake -DBUILD_UTILS=OFF -DUSE_AEC=ON -DFTP_LARGE_TEST_FILES=ON -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug ..
make -j2 VERBOSE=1
ctest --verbose --output-on-failure --rerun-failed
- name: test_asan
- name: build
if: matrix.config == 'docs/code coverage'
run: |
cd $GITHUB_WORKSPACE/g2/build
set -x
cd g2
mkdir build
doxygen --version
cd build
cmake -DBUILD_UTILS=ON -DG2C_COMPARE=OFF -DUSE_AEC=ON -DFTP_LARGE_TEST_FILES=ON -DENABLE_DOCS=ON -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data ..
make -j2 VERBOSE=1
ctest --verbose --output-on-failure --rerun-failed
gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null
Expand All @@ -73,6 +91,7 @@ jobs:
cp $GITHUB_WORKSPACE/g2/build/tests/data/* ~/data
- name: upload-test-coverage
if: matrix.config == 'docs/code coverage'
uses: actions/upload-artifact@v4
with:
name: g2-test-coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/memcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
cd g2
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c" -DCMAKE_Fortran_FLAGS="-g -O0" -DCMAKE_C_FLAGS="-g -O0" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug ..
cmake -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-bacio;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-w3emc;$GITHUB_WORKSPACE/nceplibs/jasper;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-ip;$GITHUB_WORKSPACE/nceplibs/NCEPLIBS-g2c" -DCMAKE_Fortran_FLAGS="-g -O0" -DCMAKE_C_FLAGS="-g -O0" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DBUILD_UTILS=OFF -DCMAKE_BUILD_TYPE=Debug ..
make -j2 VERBOSE=1
- name: test_memcheck
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ option(LOGGING "Turn on internal logging messages. Only useful to g2 developers.
option(BUILD_4 "Build libg2_4.a" ON)
option(BUILD_D "Build libg2_d.a" ON)
option(BUILD_WITH_W3EMC "Build with NCEPLIBS-w3emc, enabling some GRIB1 functionality" ON)
option(BUILD_UTILS "Build grib utilities" ON)
option(USE_AEC "Build with AEC (CCSDS) compression support" OFF)
option(BUILD_UTILS "Build grib utilities" OFF)
option(G2C_COMPARE "Enable copygb2 tests using g2c_compare" OFF)

# Developers can use this option to specify a local directory which
Expand Down
4 changes: 4 additions & 0 deletions src/g2index.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ end subroutine getg2i2r
nlen, nnum, nmess, irgi)
if (irgi .gt. 1 .or. nnum .eq. 0 .or. nlen .eq. 0) then
iret = 92
if (associated(cbuf)) then
deallocate(cbuf)
nullify(cbuf)
endif
return
endif
numtot = numtot + nnum
Expand Down
2 changes: 1 addition & 1 deletion test_utils/run_degrib2_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo ""
echo "*** Running degrib2 tests"

# Confirm that degrib2 fails without any arguments.
degrib2 && exit 1
../utils/degrib2 && exit 1

# Degrib2 a GRIB2 file.
../utils/degrib2 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 &> test_gdaswave.degrib2.txt
Expand Down

0 comments on commit 70ed417

Please sign in to comment.