From d219dc432117eb67c067faca060f8725f1aeeed4 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Wed, 27 Mar 2024 04:35:44 -0600 Subject: [PATCH] trying ip build --- .github/workflows/Linux_options.yml | 100 ++++++++++++++++++++++++++++ CMakeLists.txt | 10 +-- 2 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/Linux_options.yml diff --git a/.github/workflows/Linux_options.yml b/.github/workflows/Linux_options.yml new file mode 100644 index 00000000..9e5b7810 --- /dev/null +++ b/.github/workflows/Linux_options.yml @@ -0,0 +1,100 @@ +# This is the Linux_options workflow for the wgrib2 project. This +# tests different wgrib2 build options. +# +# Ed Hartnett, 3/27/24 +name: Linux_options +on: + push: + branches: + - develop + pull_request: + branches: + - develop + +# Cancel in-progress workflows when pushing to a branch +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + Linux_options: + runs-on: ubuntu-latest + env: + FC: gfortran + CC: gcc + + strategy: +# fail-fast: true + matrix: + config: + - { + options: "-DUSE_IPOLATES" + } + + steps: + + - name: install + run: | + sudo apt-get update + sudo apt-get install libnetcdf-dev libnetcdff-dev netcdf-bin pkg-config + sudo apt-get install libpng-dev autotools-dev autoconf + + - name: checkout-jasper + uses: actions/checkout@v2 + with: + repository: jasper-software/jasper + path: jasper + ref: version-1.900.1 + + - name: build-jasper + if: steps.cache-jasper.outputs.cache-hit != 'true' + run: | + cd jasper + ./configure --prefix=$HOME/Jasper + make + make install + + - name: checkout-sp + uses: actions/checkout@v2 + with: + repository: NOAA-EMC/NCEPLIBS-sp + path: sp + ref: develop + + - name: build-sp + run: | + cd sp + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=~/sp -DBUILD_8=ON .. + make -j2 + make install + + - name: checkout-ip2 + uses: actions/checkout@v2 + with: + repository: NOAA-EMC/NCEPLIBS-ip2 + path: ip2 + ref: develop + + - name: build-ip2 + run: | + cd ip2 + mkdir build + cd build + cmake .. -DCMAKE_INSTALL_PREFIX=~/ip2 -DCMAKE_PREFIX_PATH=~ + make -j2 + make install + + - name: checkout + uses: actions/checkout@v2 + with: + path: wgrib2 + + - name: build + run: | + cd wgrib2 + mkdir b + cd b + cmake ${{ matrix.config.options }} .. + make VERBOSE=1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ea4139c..f5c592f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ option(USE_HDF5 "Use HDF5?" off) option(USE_REGEX "Use Regex?" on) option(USE_TIGGE "Use tigge?" on) option(USE_MYSQL "Use MySQL?" off) -# option(USE_IPOLATES "iplib=0,1,3?" 3) +option(USE_IPOLATES "Use NCEPLIBS-ip interpolation library?" off) set(USE_IPOLATES 0) option(USE_UDF "Use UDF?" off) option(USE_OPENMP "Use OpenMP?" on) @@ -74,12 +74,12 @@ if(USE_NETCDF3 AND USE_NETCDF4) message(FATAL_ERROR "USE_NETCDF3 OR USE_NetCDF4, not both") endif() - -if(USE_IPOLATES EQUAL 1) +# If user wants to use NCEPLIBS-ip, find it and the sp library. +if(USE_IPOLATES) find_package(ip CONFIG REQUIRED) find_package(sp CONFIG REQUIRED) -elseif(USE_IPOLATES EQUAL 3) - find_package(ip2 CONFIG REQUIRED) +# elseif(USE_IPOLATES EQUAL 3) +# find_package(ip2 CONFIG REQUIRED) endif() if(USE_NETCDF4)