Skip to content

Commit

Permalink
Merge pull request #30 from NOAA-EMC/gcc-10-settable-flags
Browse files Browse the repository at this point in the history
GCC 10 flags, compiler check, and settable flags
  • Loading branch information
kgerheiser authored Aug 27, 2020
2 parents 3d19900 + dc49331 commit 064c8e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:

- name: install-netcdf
run: |
sudo apt-get update
sudo apt-get install libnetcdf-dev libnetcdff-dev netcdf-bin pkg-config
- name: install-mpi
Expand Down
10 changes: 7 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
include("list_of_files.cmake")

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "-g -traceback -fixed")
set(CMAKE_Fortran_FLAGS "-g -traceback -fixed ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2")
set(fortran_d_flags "-r8")
set(fortran_8_flags "-i8 -r8")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS
"-g -fno-range-check -fbacktrace -funroll-loops -ffixed-form")
"-g -fno-range-check -fbacktrace -funroll-loops -ffixed-form ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2")
set(CMAKE_Fortran_FLAGS_DEBUG "-ggdb -Wall")
set(fortran_d_flags "-fdefault-real-8")
set(fortran_8_flags "-fdefault-integer-8 -fdefault-real-8")
endif()

if(${CMAKE_Fortran_COMPILER_ID} MATCHES "^(GNU)$" AND ${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w -fallow-argument-mismatch -fallow-invalid-boz")
endif()

set(kinds "4" "8" "d")
foreach(kind ${kinds})
set(lib_name ${PROJECT_NAME}_${kind})
Expand Down

0 comments on commit 064c8e8

Please sign in to comment.