Skip to content

Commit

Permalink
Add IntelLLVM support (#252)
Browse files Browse the repository at this point in the history
* Add IntelLLVM support

* Use develop version for Intel CI

* Set t after loop to avoid array out of bounds
  • Loading branch information
AlexanderRichert-NOAA authored Aug 23, 2023
1 parent 33a8878 commit 9ce4204
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 31 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/Intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ defaults:
jobs:
Intel:
runs-on: ubuntu-latest
env:
CC: icc
FC: ifort
strategy:
matrix:
compilers: ["CC=icc FC=ifort", "CC=icx FC=ifx"]

steps:

Expand All @@ -44,7 +44,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/jasper
key: jasper-Intel-2.0.33
key: jasper-Intel-${{ matrix.compilers }}-2.0.33

- name: checkout-jasper
if: steps.cache-jasper.outputs.cache-hit != 'true'
Expand All @@ -59,7 +59,7 @@ jobs:
run: |
cd jasper
mkdir b && cd b
cmake .. -DCMAKE_INSTALL_PREFIX=~/jasper
${{ matrix.compilers }} cmake .. -DCMAKE_INSTALL_PREFIX=~/jasper
make -j2
make install
Expand All @@ -68,22 +68,22 @@ jobs:
uses: actions/cache@v2
with:
path: ~/bacio
key: bacio-Intel-${{ runner.os }}-v2.5.0
key: bacio-Intel-${{ matrix.compilers }}-${{ runner.os }}-develop

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

- name: build-bacio
if: steps.cache-bacio.outputs.cache-hit != 'true'
run: |
cd bacio
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/bacio
${{ matrix.compilers }} cmake .. -DCMAKE_INSTALL_PREFIX=~/bacio
make -j2
make install
Expand All @@ -92,23 +92,23 @@ jobs:
uses: actions/cache@v2
with:
path: ~/sp
key: sp-Intel-${{ runner.os }}-2.3.3-1
key: sp-Intel-${{ matrix.compilers }}-${{ runner.os }}-develop

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

- name: build-sp
if: steps.cache-sp.outputs.cache-hit != 'true'
run: |
cd sp
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/sp
${{ matrix.compilers }} cmake .. -DCMAKE_INSTALL_PREFIX=~/sp
make -j2
make install
Expand All @@ -117,23 +117,23 @@ jobs:
uses: actions/cache@v2
with:
path: ~/w3emc
key: w3emc-Intel-${{ runner.os }}-2.10.0-bacio-2.5.0
key: w3emc-Intel-${{ matrix.compilers }}-${{ runner.os }}-develop

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

- name: build-w3emc
if: steps.cache-w3emc.outputs.cache-hit != 'true'
run: |
cd w3emc
mkdir build
cd build
cmake -DBUILD_WITH_BUFR=OFF -DCMAKE_PREFIX_PATH=~/bacio -DCMAKE_INSTALL_PREFIX=~/w3emc ..
${{ matrix.compilers }} cmake -DBUILD_WITH_BUFR=OFF -DCMAKE_PREFIX_PATH=~/bacio -DCMAKE_INSTALL_PREFIX=~/w3emc ..
make -j2
make install
Expand All @@ -142,23 +142,23 @@ jobs:
uses: actions/cache@v2
with:
path: ~/ip
key: ip-Intel-${{ runner.os }}-4.1.0
key: ip-Intel-${{ matrix.compilers }}-${{ runner.os }}-develop

- name: checkout-ip
if: steps.cache-ip.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: NOAA-EMC/NCEPLIBS-ip
path: ip
ref: v4.1.0
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
${{ matrix.compilers }} cmake .. -DCMAKE_INSTALL_PREFIX=~/ip -DCMAKE_PREFIX_PATH=~/sp
make -j2
make install
Expand All @@ -167,23 +167,23 @@ jobs:
uses: actions/cache@v2
with:
path: ~/g2
key: g2-Intel-${{ runner.os }}-2.0.33-2.5.0-3.4.5
key: g2-Intel-${{ matrix.compilers }}-${{ runner.os }}-develop

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

- name: build-g2
if: steps.cache-g2.outputs.cache-hit != 'true'
run: |
cd g2
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=~/g2 -DCMAKE_PREFIX_PATH="~/bacio;~/jasper" ..
${{ matrix.compilers }} cmake -DCMAKE_INSTALL_PREFIX=~/g2 -DCMAKE_PREFIX_PATH="~/bacio;~/jasper;~/w3emc" ..
make -j2
make install
Expand All @@ -196,7 +196,6 @@ jobs:
run: |
cd grib_utils
mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH="~/bacio;~/jasper;~/sp;~/ip;~/w3emc;~/g2" -DCMAKE_Fortran_FLAGS="-heap-arrays" ..
${{ matrix.compilers }} cmake -DCMAKE_PREFIX_PATH="~/bacio;~/jasper;~/sp;~/ip;~/w3emc;~/g2" -DCMAKE_Fortran_FLAGS="-heap-arrays" ..
make -j2
ctest --output-on-failure --rerun-failed --verbose
2 changes: 1 addition & 1 deletion src/cnvgrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Mark Potts, Kyle Gerheiser

# Set compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-g ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 ${CMAKE_Fortran_FLAGS}")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
Expand Down
2 changes: 1 addition & 1 deletion src/copygb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# George Gayno, Mark Potts

# Set the compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-g -r8 -auto ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 ${CMAKE_Fortran_FLAGS}")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
Expand Down
2 changes: 1 addition & 1 deletion src/copygb2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Mark Potts, Kyle Gerheiser

# Set compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-g -r8 -auto -convert big_endian -fpp ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 ${CMAKE_Fortran_FLAGS}")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
Expand Down
2 changes: 1 addition & 1 deletion src/degrib2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# George Gayno, Mark Potts

# Set compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-g -convert big_endian -axCORE-AVX2 -fpp ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 ${CMAKE_Fortran_FLAGS}")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
Expand Down
2 changes: 1 addition & 1 deletion src/grb2index/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Mark Potts, Kyle Gerheiser

# Set compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-g -convert big_endian -axCORE-AVX2 -fpp ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 ${CMAKE_Fortran_FLAGS}")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
Expand Down
2 changes: 1 addition & 1 deletion src/grbindex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# George Gayno, Mark Potts

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS
"-g -assume noold_ldout_format -convert big_endian -axCORE-AVX2 -fpp ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 ${CMAKE_Fortran_FLAGS}")
Expand Down
2 changes: 1 addition & 1 deletion src/tocgrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Mark Potts, Kyle Gerheiser

# Set compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-g -assume noold_ldout_format -axCORE-AVX2 ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 ${CMAKE_Fortran_FLAGS}")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
Expand Down
2 changes: 1 addition & 1 deletion src/tocgrib2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Mark Potts, Kyle Gerheiser

# Set the compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-g -axCORE-AVX2 ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 ${CMAKE_Fortran_FLAGS}")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
Expand Down
2 changes: 1 addition & 1 deletion src/tocgrib2super/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Mark Potts, Kyle Gerheiser

# Set the compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-g -assume noold_ldout_format -axCORE-AVX2 ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 ${CMAKE_Fortran_FLAGS}")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
Expand Down
2 changes: 2 additions & 0 deletions tests/test_degrib2_int.F90
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ program test_degrib2_int
pt(iutpos(t)) = 0
end do

t = NUM_TN_T

! Check different units for secondary times.
pt(iutpos(t)) = 99
pt(33) = 2
Expand Down

0 comments on commit 9ce4204

Please sign in to comment.