Skip to content

Commit 338bbdf

Browse files
ip v5 updates
1 parent 558fad4 commit 338bbdf

File tree

10 files changed

+45
-70
lines changed

10 files changed

+45
-70
lines changed

.github/workflows/Intel.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
strategy:
2525
matrix:
2626
compilers: ["CC=icc FC=ifort", "CC=icx FC=ifx"]
27+
ip_version: ["v5.0.0", "v4.5.0"]
2728

2829
steps:
2930

@@ -90,20 +91,21 @@ jobs:
9091
- name: cache-sp
9192
id: cache-sp
9293
uses: actions/cache@v3
94+
if: matrix.ip_version == 'v4.5.0'
9395
with:
9496
path: ~/sp
9597
key: sp-Intel-${{ matrix.compilers }}-${{ runner.os }}-v2.4.0
9698

9799
- name: checkout-sp
98-
if: steps.cache-sp.outputs.cache-hit != 'true'
100+
if: steps.cache-sp.outputs.cache-hit != 'true' && matrix.ip_version == 'v4.5.0'
99101
uses: actions/checkout@v3
100102
with:
101103
repository: NOAA-EMC/NCEPLIBS-sp
102104
path: sp
103105
ref: v2.4.0
104106

105107
- name: build-sp
106-
if: steps.cache-sp.outputs.cache-hit != 'true'
108+
if: steps.cache-sp.outputs.cache-hit != 'true' && matrix.ip_version == 'v4.5.0'
107109
run: |
108110
cd sp
109111
mkdir build
@@ -142,15 +144,15 @@ jobs:
142144
uses: actions/cache@v3
143145
with:
144146
path: ~/ip
145-
key: ip-Intel-${{ matrix.compilers }}-${{ runner.os }}-v4.3.0
147+
key: ip-Intel-${{ matrix.compilers }}-${{ runner.os }}-${{ matrix.ip_version }}
146148

147149
- name: checkout-ip
148150
if: steps.cache-ip.outputs.cache-hit != 'true'
149151
uses: actions/checkout@v3
150152
with:
151153
repository: NOAA-EMC/NCEPLIBS-ip
152154
path: ip
153-
ref: v4.3.0
155+
ref: ${{ matrix.ip_version }}
154156

155157
- name: build-ip
156158
if: steps.cache-ip.outputs.cache-hit != 'true'

.github/workflows/Linux_versions.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ jobs:
2626
bacio-version: [2.4.1, 2.5.0, 2.6.0]
2727
jasper-version: [4.0.0]
2828
w3emc-version: [2.10.0, 2.11.0]
29-
sp-version: [2.3.3, 2.4.0]
30-
ip-version: [3.3.3, 4.1.0, 4.2.0]
29+
sp-version: [2.3.3, 2.4.0, null]
30+
ip-version: [3.3.3, 4.1.0, 4.2.0, 5.0.0]
31+
exclude:
32+
- sp-version: 2.3.3
33+
ip-version: 5.0.0
34+
- sp-version: 2.4.0
35+
ip-version: 5.0.0
3136

3237
steps:
3338
- name: install-dependencies
@@ -86,20 +91,21 @@ jobs:
8691
- name: cache-sp
8792
id: cache-sp
8893
uses: actions/cache@v3
94+
if: matrix.sp-version != 'null'
8995
with:
9096
path: ~/sp
9197
key: sp-${{ runner.os }}-${{ matrix.sp-version }}
9298

9399
- name: checkout-sp
94-
if: steps.cache-sp.outputs.cache-hit != 'true'
100+
if: steps.cache-sp.outputs.cache-hit != 'true' && matrix.sp-version != 'null'
95101
uses: actions/checkout@v3
96102
with:
97103
repository: NOAA-EMC/NCEPLIBS-sp
98104
path: sp
99105
ref: v${{ matrix.sp-version }}
100106

101107
- name: build-sp
102-
if: steps.cache-sp.outputs.cache-hit != 'true'
108+
if: steps.cache-sp.outputs.cache-hit != 'true' && matrix.sp-version != 'null'
103109
run: |
104110
cd sp
105111
mkdir build

.github/workflows/MacOS.yml

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -71,31 +71,6 @@ jobs:
7171
cmake .. -DCMAKE_INSTALL_PREFIX=~/bacio
7272
make -j2
7373
make install
74-
75-
- name: cache-sp
76-
id: cache-sp
77-
uses: actions/cache@v3
78-
with:
79-
path: ~/sp
80-
key: sp-${{ runner.os }}-2.4.0
81-
82-
- name: checkout-sp
83-
if: steps.cache-sp.outputs.cache-hit != 'true'
84-
uses: actions/checkout@v3
85-
with:
86-
repository: NOAA-EMC/NCEPLIBS-sp
87-
path: sp
88-
ref: v2.4.0
89-
90-
- name: build-sp
91-
if: steps.cache-sp.outputs.cache-hit != 'true'
92-
run: |
93-
cd sp
94-
mkdir build
95-
cd build
96-
cmake .. -DCMAKE_INSTALL_PREFIX=~/sp
97-
make -j2
98-
make install
9974
10075
- name: cache-w3emc
10176
id: cache-w3emc
@@ -127,23 +102,23 @@ jobs:
127102
uses: actions/cache@v3
128103
with:
129104
path: ~/ip
130-
key: ip-MacOS-${{ runner.os }}-4.2.0
105+
key: ip-MacOS-${{ runner.os }}-5.0.0
131106

132107
- name: checkout-ip
133108
if: steps.cache-ip.outputs.cache-hit != 'true'
134109
uses: actions/checkout@v3
135110
with:
136111
repository: NOAA-EMC/NCEPLIBS-ip
137112
path: ip
138-
ref: v4.2.0
113+
ref: v5.0.0
139114

140115
- name: build-ip
141116
if: steps.cache-ip.outputs.cache-hit != 'true'
142117
run: |
143118
cd ip
144119
mkdir build
145120
cd build
146-
cmake .. -DCMAKE_INSTALL_PREFIX=~/ip -DCMAKE_PREFIX_PATH=~/sp
121+
cmake .. -DCMAKE_INSTALL_PREFIX=~/ip
147122
make -j2
148123
make install
149124
@@ -181,6 +156,6 @@ jobs:
181156
run: |
182157
cd grib_utils
183158
mkdir build && cd build
184-
cmake -DCMAKE_PREFIX_PATH="~/bacio;~/jasper;~/sp;~/ip;~/w3emc;~/g2" ..
159+
cmake -DCMAKE_PREFIX_PATH="~/bacio;~/jasper;~/ip;~/w3emc;~/g2" ..
185160
make -j2
186161
ctest --output-on-failure --rerun-failed --verbose

.github/workflows/Spack.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
matrix:
2424
os: ["ubuntu-latest"]
2525
openmp: ["+openmp", "~openmp"]
26+
ip_spec: ["^ip@5.0.0", "^ip@4.2.0 ^sp@2.4.0"]
2627
runs-on: ${{ matrix.os }}
2728

2829
steps:
@@ -37,7 +38,7 @@ jobs:
3738
uses: actions/cache@v3
3839
with:
3940
path: ~/spack-build-cache
40-
key: spack-build-cache-${{ matrix.os }}-1
41+
key: spack-build-cache-${{ matrix.os }}-${{ matrix.ip_spec }}1
4142

4243
- name: spack-build-and-test
4344
run: |
@@ -48,7 +49,7 @@ jobs:
4849
cp $GITHUB_WORKSPACE/grib-util/spack/package.py $SPACK_ROOT/var/spack/repos/builtin/packages/grib-util/package.py
4950
mv $GITHUB_WORKSPACE/grib-util $SPACK_ENV/grib-util
5051
spack develop --no-clone grib-util@develop
51-
spack add grib-util@develop%gcc@11 ${{ matrix.openmp }} ^bacio@2.6.0 ^w3emc@2.10.0 ^g2@3.4.8 ^g2c@develop ^ip@4.2.0 ^sp@2.4.0
52+
spack add grib-util@develop%gcc@11 ${{ matrix.openmp }} ^bacio@2.6.0 ^w3emc@2.10.0 ^g2@3.4.8 ^g2c@develop ${{ ip_spec }}
5253
spack external find cmake gmake
5354
spack mirror add spack-build-cache ~/spack-build-cache
5455
spack concretize

.github/workflows/developer.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,6 @@ jobs:
6565
cmake -DCMAKE_INSTALL_PREFIX=~/bacio ..
6666
make -j2
6767
make install
68-
69-
- name: checkout-sp
70-
uses: actions/checkout@v3
71-
with:
72-
repository: NOAA-EMC/NCEPLIBS-sp
73-
path: sp
74-
ref: develop
75-
76-
- name: build-sp
77-
run: |
78-
cd sp
79-
mkdir build
80-
cd build
81-
cmake -DCMAKE_INSTALL_PREFIX=~/sp ..
82-
make -j2
83-
make install
8468
8569
- name: checkout-w3emc
8670
uses: actions/checkout@v3
@@ -110,7 +94,7 @@ jobs:
11094
cd ip
11195
mkdir build
11296
cd build
113-
cmake -DCMAKE_INSTALL_PREFIX=~/ip -DCMAKE_PREFIX_PATH=~/sp ..
97+
cmake -DCMAKE_INSTALL_PREFIX=~/ip
11498
make -j2
11599
make install
116100
@@ -161,7 +145,7 @@ jobs:
161145
ls -l ~/jasper/lib
162146
export LD_LIBRARY_PATH=/home/runner/jasper/lib
163147
export PATH="~/g2c/bin:$PATH"
164-
cmake -DENABLE_DOCS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="~/bacio;~/jasper;~/sp;~/ip;~/w3emc;~/g2;~/g2c" -DCMAKE_Fortran_FLAGS="-fprofile-arcs -ftest-coverage -O0 -Wall" -DCMAKE_C_FLAGS="-fprofile-arcs -ftest-coverage -O0 -Wall" -DG2C_COMPARE=ON ..
148+
cmake -DENABLE_DOCS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="~/bacio;~/jasper;~/ip;~/w3emc;~/g2;~/g2c" -DCMAKE_Fortran_FLAGS="-fprofile-arcs -ftest-coverage -O0 -Wall" -DCMAKE_C_FLAGS="-fprofile-arcs -ftest-coverage -O0 -Wall" -DG2C_COMPARE=ON ..
165149
make -j2 VERBOSE=1
166150
ctest --output-on-failure --rerun-failed --verbose
167151

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ file(STRINGS "VERSION" pVersion)
88
project(gributil VERSION ${pVersion} LANGUAGES C Fortran)
99

1010
# Handle user options.
11-
option(OPENMP "use OpenMP threading" OFF)
11+
option(OPENMP "Use OpenMP threading" OFF)
1212
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)
1313
option(FTP_TEST_FILES "Fetch and test with files on FTP site." OFF)
1414
option(FTP_LARGE_TEST_FILES "Fetch and test with very large files on FTP site." OFF)
@@ -39,8 +39,10 @@ find_package(ZLIB REQUIRED)
3939

4040
# Find the NCEPLIBS libraries we need.
4141
find_package(bacio 2.4.0 REQUIRED)
42-
find_package(sp 2.3.3 REQUIRED)
4342
find_package(ip 3.3.3 REQUIRED)
43+
if(ip_VERSION LESS 5.0)
44+
find_package(sp 2.3.3 REQUIRED)
45+
endif()
4446
find_package(w3emc 2.10.0 REQUIRED)
4547
find_package(g2 3.4.8 REQUIRED)
4648
# g2c is not required.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Project | Notes
5555
Repository | Notes
5656
-----------|------
5757
[NCEPLIBS-bacio](https://github.com/NOAA-EMC/NCEPLIBS-bacio) | binary I/O for NCEP models
58-
[NCEPLIBS-sp](https://github.com/NOAA-EMC/NCEPLIBS-sp) | spectral transform functions
5958
[NCEPLIBS-ip](https://github.com/NOAA-EMC/NCEPLIBS-ip) | interpolating between NCEP grids
59+
[NCEPLIBS-sp](https://github.com/NOAA-EMC/NCEPLIBS-sp) | spectral transform functions - only needed for ip v4 and lower
6060
[NCEPLIBS-g2](https://github.com/NOAA-EMC/NCEPLIBS-g2) | Fortran implementation of the GRIB 2 functions
6161
[NCEPLIBS-w3emc](https://github.com/NOAA-EMC/NCEPLIBS-w3emc) | GRIB1 library
6262

spack/package.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
1+
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
22
# Spack Project Developers. See the top-level COPYRIGHT file for details.
33
#
44
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
@@ -25,24 +25,23 @@ class GribUtil(CMakePackage):
2525

2626
depends_on("jasper")
2727
depends_on("libpng")
28-
depends_on("zlib")
28+
depends_on("zlib-api")
2929
depends_on("w3emc +extradeps", when="@1.2.4:")
3030
depends_on("w3emc precision=4,d", when="^w3emc@2.10:")
3131
depends_on("w3nco", when="@:1.2.3")
3232
depends_on("g2")
33-
depends_on("g2c@1.7: +utils")
3433
depends_on("bacio")
3534
depends_on("ip")
36-
depends_on("ip precision=d", when="ip@4.1:")
35+
depends_on("ip precision=d", when="^ip@4.1:")
3736
depends_on("ip@:3.3.3", when="@:1.2")
38-
depends_on("sp")
39-
depends_on("sp precision=d", when="sp@2.4:")
37+
depends_on("sp", when="^ip@:4")
38+
depends_on("sp precision=d", when="^ip@:4 ^sp@2.4:")
4039

4140
def cmake_args(self):
4241
args = [
4342
self.define_from_variant("OPENMP", "openmp"),
4443
self.define("BUILD_TESTING", self.run_tests),
45-
self.define("G2C_COMPARE", self.run_tests),
44+
self.define("G2C_COMPARE", False),
4645
]
4746
return args
4847

src/copygb/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ set(fortran_src copygb.F90)
1818
# Build the executable.
1919
set(exe_name copygb)
2020
add_executable(${exe_name} ${fortran_src})
21-
target_link_libraries(${exe_name} PRIVATE bacio::${bacio_name} w3emc::w3emc_d ip::ip_d sp::sp_d)
21+
target_link_libraries(${exe_name} PRIVATE bacio::${bacio_name} w3emc::w3emc_d ip::ip_d)
22+
if(ip_VERSION LESS 5.0)
23+
target_link_libraries(${exe_name} PRIVATE sp::sp_d)
24+
endif()
2225

2326
# Use openMP if found.
2427
if(OpenMP_Fortran_FOUND)

src/copygb2/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ target_link_libraries(${exe_name} PRIVATE
2424
${JASPER_LIBRARIES}
2525
bacio::${bacio_name}
2626
w3emc::w3emc_d
27-
ip::ip_d
28-
sp::sp_d)
27+
ip::ip_d)
28+
29+
if(ip_VERSION LESS 5.0)
30+
target_link_libraries(${exe_name} PRIVATE sp::sp_d)
31+
endif()
2932

3033
# If OpenMP is available, use it.
3134
if(OpenMP_Fortran_FOUND)

0 commit comments

Comments
 (0)