Skip to content

Commit

Permalink
Merge branch 'develop' into as_cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
AlysonStahl-NOAA authored Oct 28, 2024
2 parents 6e1b626 + d5f8a95 commit 732b73c
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 2 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/Intel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# This is the Intel workflow for the wgrib2 project. This
# tests with Intel Classic and oneAPI.
#
# Alex Richert, 22 Oct 2024
name: Intel
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

strategy:
matrix:
compilers: ["oneapi", "classic"]

steps:

- name: install
run: |
sudo apt-get update
sudo apt-get install libnetcdf-dev libnetcdff-dev netcdf-bin pkg-config \
libpng-dev autotools-dev autoconf libaec-dev libopenblas-serial-dev \
libopenjp2-7 libopenjp2-7-dev
- name: "Install Intel"
uses: NOAA-EMC/ci-install-intel-toolkit@develop
with:
compiler-setup: ${{ matrix.compilers }}

- name: cache-jasper
id: cache-jasper
uses: actions/cache@v4
with:
path: ~/jasper
key: jasper-${{ runner.os }}-${{ matrix.compilers }}-1.900.1

- name: checkout-jasper
if: steps.cache-jasper.outputs.cache-hit != 'true'
uses: actions/checkout@v4
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
CFLAGS="-Wno-implicit-function-declaration -Wno-incompatible-pointer-types" ./configure --prefix=$HOME/jasper
make
make install
- name: cache-ip
id: cache-ip
uses: actions/cache@v4
with:
path: ~/ip
key: ip-${{ runner.os }}-${{ matrix.compilers }}-develop

- name: checkout-ip
if: steps.cache-ip.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: NOAA-EMC/NCEPLIBS-ip
path: ip
ref: develop

- name: build-ip
if: steps.cache-ip.outputs.cache-hit != 'true'
run: |
cd ip
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/ip -DCMAKE_PREFIX_PATH=~/sp
make -j2
make install
- name: checkout
uses: actions/checkout@v4
with:
path: wgrib2

- name: build
run: |
cd wgrib2
mkdir b
cd b
cmake -DCMAKE_PREFIX_PATH="~/ip" .. -DUSE_OPENMP=OFF
make VERBOSE=1
ctest --verbose --output-on-failure --rerun-failed
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,18 @@ endif()
include(GNUInstallDirs)

message(STATUS "Setting compiler flags...")
if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_C_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_C_FLAGS "-g -traceback ${CMAKE_C_FLAGS} -DIFORT")
if(CMAKE_C_COMPILER_ID MATCHES "^(IntelLLVM)$")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Rno-debug-disables-optimization")
endif()
set(CMAKE_C_FLAGS_DEBUG "-O0")
elseif(CMAKE_C_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS} -DGFORTRAN")
set(CMAKE_C_FLAGS_DEBUG "-O0")
endif()

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-g -traceback ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
Expand Down
6 changes: 6 additions & 0 deletions wgrib2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ set_target_properties(wgrib2_exe PROPERTIES OUTPUT_NAME wgrib2)

if(USE_NETCDF)
target_link_libraries(obj_lib PUBLIC NetCDF::NetCDF_C)
if(BUILD_SHARED_LIB)
target_link_libraries(wgrib2_lib PUBLIC NetCDF::NetCDF_C)
endif()
target_link_libraries(wgrib2_exe PUBLIC NetCDF::NetCDF_C)
endif()

Expand All @@ -111,6 +114,9 @@ endif()

if(USE_OPENMP)
target_link_libraries(obj_lib PUBLIC OpenMP::OpenMP_C)
if(BUILD_SHARED_LIB)
target_link_libraries(wgrib2_lib PUBLIC OpenMP::OpenMP_C)
endif()
endif()

if(USE_IPOLATES)
Expand Down

0 comments on commit 732b73c

Please sign in to comment.