Skip to content

Commit

Permalink
Add Intel LLVM support (#184)
Browse files Browse the repository at this point in the history
* Add Intel LLVM to cmake configs

* Add Intel LLVM to Intel.yml CI

* Test with Alex's llvm-ized sp (revert this commit)

* Exclude icx/ifx+openmp because of bug

* Disable -check all for intelllvm

* Use latest intel versions

* Re-enable openmp for intel llvm

* retest with my sp

* cache key tweak intel.yml

* check nouninit for intelllvm

* Update user_guide.md

* fix intel oneapi name is user_guide.md
  • Loading branch information
AlexanderRichert-NOAA authored Aug 21, 2023
1 parent ac8e57a commit 112ed17
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/Intel.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a CI workflow for the NCEPLIBS-ip project.
#
# This workflow builds with the Intel compiler.
# This workflow builds with the Intel Classic and OneAPI compilers.
#
# Ed Hartnett, 1/8/23
name: Intel
Expand All @@ -21,13 +21,10 @@ defaults:
jobs:
Intel:
runs-on: ubuntu-latest
env:
CC: icc
FC: ifort
CXX: icpc
strategy:
matrix:
openmp: [ ON, OFF ]
compilers: ["CC=icc FC=ifort", "CC=icx FC=ifx"]

steps:

Expand All @@ -48,23 +45,23 @@ jobs:
uses: actions/cache@v2
with:
path: ~/sp
key: sp-${{ runner.os }}-Intel-${{ matrix.openmp }}-2.3.3-1
key: sp-${{ runner.os }}-Intel-${{ matrix.compilers }}-${{ matrix.openmp }}-alextest

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

- name: build-sp
if: steps.cache-sp.outputs.cache-hit != 'true'
run: |
cd sp
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=~/sp -DOPENMP=${{ matrix.openmp}} ..
${{ matrix.compilers }} cmake -DCMAKE_INSTALL_PREFIX=~/sp -DOPENMP=${{ matrix.openmp}} ..
make -j2
make install
Expand All @@ -78,7 +75,7 @@ jobs:
cd ip
mkdir build
cd build
cmake -DOPENMP=${{ matrix.openmp }} -DBUILD_SHARED_LIBS=OFF -DCMAKE_PREFIX_PATH="~/sp" ..
${{ matrix.compilers }} cmake -DOPENMP=${{ matrix.openmp }} -DBUILD_SHARED_LIBS=OFF -DCMAKE_PREFIX_PATH="~/sp" ..
make -j2 VERBOSE=1
- name: test
Expand Down
5 changes: 5 additions & 0 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ The NCEP general interpolation library (NCEPLIBS-ip) contains Fortran
used at NCEP. The library is particularly efficient when interpolating
many fields at one time.

NCEPLIBS-ip supports compilation with the GNU Compiler Collection
(gfortran), Intel Classic (ifort), and Intel OneAPI (ifx) compilers.
In the case of Intel LLVM, it is recommended to use at least version
2023.2.1 to avoid any number of compiler issues.

## Interpolation

There are currently six interpolation methods available in the
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ constants_mod.F90 ip_grids_mod.F90 ip_grid_factory_mod.F90
ip_interpolators_mod.F90 earth_radius_mod.F90 polfix_mod.F90)

# Set compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-g -traceback -warn all -auto -convert big_endian -assume byterecl -fp-model strict -fpp ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check all -warn all")
set(fortran_d_flags "-r8")
Expand Down
8 changes: 6 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ execute_process(COMMAND cmake -E create_symlink
)

# Set compiler flags for intel.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "-r8 -g -traceback -check all -warn all -heap-arrays -assume byterecl ${CMAKE_Fortran_FLAGS} ")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "-r8 -g -check all -traceback -warn all -heap-arrays -assume byterecl ${CMAKE_Fortran_FLAGS} ")
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(IntelLLVM)$")
# Avoid Intel OneAPI 2023.2.1 bug
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -check nouninit ")
endif()
set(CMAKE_C_FLAGS "-std=c99")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "-fdefault-real-8 -fno-range-check -g -fbacktrace -fcheck=all -Wall -O0 -fimplicit-none -Wsurprising -Wextra ${CMAKE_Fortran_FLAGS} ")
Expand Down

0 comments on commit 112ed17

Please sign in to comment.