Browse Source

Fixes for NAG CMake

tags/v0.3.29
Matthew Thompson 10 months ago
parent
commit
be19966d3b
3 changed files with 32 additions and 2 deletions
  1. +25
    -0
      cmake/fc.cmake
  2. +6
    -1
      cmake/lapack.cmake
  3. +1
    -1
      cmake/system.cmake

+ 25
- 0
cmake/fc.cmake View File

@@ -269,6 +269,31 @@ if (${F_COMPILER} STREQUAL "CRAY")
endif ()
endif ()

if (${F_COMPILER} STREQUAL "NAGFOR")
set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_NAG")
if (INTERFACE64)
set(FCOMMON_OPT "${FCOMMON_OPT} -i8")
endif ()
# Options from Makefile.system
# -dcfuns: Enable non-standard double precision complex intrinsic functions
# -ieee=full: enables all IEEE arithmetic facilities including non-stop arithmetic.
# -w=obs: Suppress warning messages about obsolescent features
# -thread_safe: Compile code for safe execution in a multi-threaded environment.
# -recursive: Specifies that procedures are RECURSIVE by default.
set(FCOMMON_OPT "${FCOMMON_OPT} -dcfuns -recursive -ieee=full -w=obs -thread_safe")
# Options from Reference-LAPACK
# Suppress compiler banner and summary
set(FCOMMON_OPT "${FCOMMON_OPT} -quiet")
# Disable other common warnings
# -w=x77: Suppress warning messages about Fortran 77 features
# -w=ques: Suppress warning messages about questionable usage
# -w=unused: Suppress warning messages about unused variables
set(FCOMMON_OPT "${FCOMMON_OPT} -w=x77 -w=ques -w=unused")
if (USE_OPENMP)
set(FCOMMON_OPT "${FCOMMON_OPT} -openmp")
endif ()
endif ()

# from the root Makefile - this is for lapack-netlib to compile the correct secnd file.
if (${F_COMPILER} STREQUAL "GFORTRAN")
set(TIMER "INT_ETIME")


+ 6
- 1
cmake/lapack.cmake View File

@@ -1018,7 +1018,12 @@ foreach (LA_FILE ${LA_GEN_SRC})
endforeach ()

if (NOT C_LAPACK)
set_source_files_properties(${LA_SOURCES} PROPERTIES COMPILE_FLAGS "${LAPACK_FFLAGS}")
# The below line is duplicating Fortran flags but NAG has a few flags
# that cannot be specified twice. It's possible this is not needed for
# any compiler, but for safety, we only turn off for NAG
if (NOT ${F_COMPILER} STREQUAL "NAGFOR")
set_source_files_properties(${LA_SOURCES} PROPERTIES COMPILE_FLAGS "${LAPACK_FFLAGS}")
endif ()
if (${F_COMPILER} STREQUAL "GFORTRAN")
set_source_files_properties(${LA_SOURCES} PROPERTIES COMPILE_FLAGS "${LAPACK_FFLAGS} -fno-tree-vectorize")
endif()


+ 1
- 1
cmake/system.cmake View File

@@ -642,7 +642,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
endif ()

if (CMAKE_Fortran_COMPILER)
if ("${F_COMPILER}" STREQUAL "NAG" OR "${F_COMPILER}" STREQUAL "CRAY" OR CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang.*")
if ("${F_COMPILER}" STREQUAL "NAGFOR" OR "${F_COMPILER}" STREQUAL "CRAY" OR CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang.*")
set(FILTER_FLAGS "-msse3;-mssse3;-msse4.1;-mavx;-mavx2,-mskylake-avx512")
if (CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang.*")
message(STATUS "removing fortran flags")


Loading…
Cancel
Save