diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5f1a726a..9d66ad9e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index af5847e9..09cdcacf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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})