support special compile flags for single file

This commit is contained in:
Chen Zhang 2016-03-04 17:32:26 -05:00
parent ef45d440d9
commit 81ac9aefa1
2 changed files with 26 additions and 26 deletions

View File

@ -32,15 +32,6 @@ if ("${DAMASK_DRIVER}" STREQUAL "FEM")
set (FEM ON ) set (FEM ON )
endif("${DAMASK_DRIVER}" STREQUAL "FEM") endif("${DAMASK_DRIVER}" STREQUAL "FEM")
# if (DAMASK_DRIVER STREQUAL "SPECTRAL")
# set (SPECTRAL ON )
# message('set to spectral solver')
# endif()
# if (DAMASK_DRIVER STREQUAL "FEM")
# set (FEM ON )
# message('set to FEM solver')
# endif()
# COMPILE VARIABLES # COMPILE VARIABLES
add_definitions(-DDAMASKVERSION="${DAMASK_V}") add_definitions(-DDAMASKVERSION="${DAMASK_V}")
add_definitions(-DPETSc) add_definitions(-DPETSc)
@ -186,9 +177,6 @@ set (STANDARD_CHECK_gfortran "-std=f2008ts -pedantic-errors" )
# all: # all:
# -name as_is: case sensitive Fortran! # -name as_is: case sensitive Fortran!
################################################################################################### ###################################################################################################
# -diag-disable 7410 should disable warning about directory statement in inquire function,
# but does not work. hence the other 2 statements
###################################################################################################
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -fpp" ) set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -fpp" )
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -ftz" ) set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -ftz" )
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -assume byterecl,fpe_summary") set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -assume byterecl,fpe_summary")
@ -200,8 +188,6 @@ set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn interfaces"
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn ignore_loc" ) set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn ignore_loc" )
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn alignments" ) set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn alignments" )
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn unused" ) set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn unused" )
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -diag-remark 7410" )
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn nostderrors" )
################################################################################################### ###################################################################################################
# COMPILE SWITCHES FOR RUNTIME DEBUGGING # COMPILE SWITCHES FOR RUNTIME DEBUGGING
# -g: Generate symbolic debugging information in the object file # -g: Generate symbolic debugging information in the object file
@ -240,7 +226,6 @@ set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -warn stderrors"
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -debug-parameters all" ) set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -debug-parameters all" )
set (LINK_OPTIONS_ifort "-shared-intel") set (LINK_OPTIONS_ifort "-shared-intel")
# set (LINK_OPTIONS_ifort "-static-intel")
################################################################################################### ###################################################################################################
# COMPILE SWITCHES # COMPILE SWITCHES
# -shared # -shared
@ -317,14 +302,6 @@ set (LINK_OPTIONS_ifort "-shared-intel")
# -Wunsafe-loop-optimizations: warn if the loop cannot be optimized due to nontrivial assumptions. # -Wunsafe-loop-optimizations: warn if the loop cannot be optimized due to nontrivial assumptions.
# -Wstrict-overflow: # -Wstrict-overflow:
################################################################################################### ###################################################################################################
# fno-range-check: Disable range checking on results of simplification of constant expressions during compilation
# --> allows the definition of DAMASK_NaN
#-fall-intrinsics: all intrinsic procedures (including the GNU-specific extensions) are accepted. -Wintrinsics-std will be ignored
# and no user-defined procedure with the same name as any intrinsic will be called except when it is explicitly declared external
# --> allows the use of 'isnan'
#-fno-fast-math:
# --> otherwise, when setting -ffast-math, isnan always evaluates to false (I would call it a bug)
###################################################################################################
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -xf95-cpp-input" ) set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -xf95-cpp-input" )
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -ffree-line-length-132" ) set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -ffree-line-length-132" )
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fimplicit-none" ) set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fimplicit-none" )
@ -339,9 +316,6 @@ set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wconversion-extra"
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wimplicit-procedure" ) set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wimplicit-procedure" )
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wno-unused-parameter" ) set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wno-unused-parameter" )
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fno-range-check" ) set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fno-range-check" )
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fall-intrinsics" )
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fno-fast-math" )
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fall-intrinsics" )
################################################################################################### ###################################################################################################
# COMPILE SWITCHES FOR RUNTIME DEBUGGING # COMPILE SWITCHES FOR RUNTIME DEBUGGING
# -ffpe-trap=invalid,\ stop execution if floating point exception is detected (NaN is silent) # -ffpe-trap=invalid,\ stop execution if floating point exception is detected (NaN is silent)

View File

@ -1,6 +1,32 @@
# The dependency detection in CMake is not functioning for Fortran # The dependency detection in CMake is not functioning for Fortran
# !!! EXPLICIT DEPENDENCY DECLARATION !!! # !!! EXPLICIT DEPENDENCY DECLARATION !!!
# SOME FILES REQUIRE SPECIAL FLAGS
if (INTEL_FORTRAN)
# -diag-disable 7410 should disable warning about directory statement
# in inquire function, but does not work. hence the other 2 statements
SET_SOURCE_FILES_PROPERTIES( "spectral_interface.f90" PROPERTIES
COMPILE_FLAGS "-diag-remark 7410 -stand none -warn nostderrors" )
elseif (GNU_FORTRAN)
# fno-range-check: Disable range checking on results of simplification of constant expressions during compilation
# --> allows the definition of DAMASK_NaN
#-fall-intrinsics: all intrinsic procedures (including the GNU-specific extensions) are accepted. -Wintrinsics-std will be ignored
# and no user-defined procedure with the same name as any intrinsic will be called except when it is explicitly declared external
# --> allows the use of 'isnan'
#-fno-fast-math:
# --> otherwise, when setting -ffast-math, isnan always evaluates to false (I would call it a bug)
SET_SOURCE_FILES_PROPERTIES( "prec.f90" PROPERTIES
COMPILE_FLAGS "-fno-range-check -fall-intrinsics -fno-fast-math")
#-fall-intrinsics: all intrinsic procedures (including the GNU-specific extensions) are accepted. -Wintrinsics-std will be ignored
# and no user-defined procedure with the same name as any intrinsic will be called except when it is explicitly declared external
# --> allows the use of 'getcwd'
SET_SOURCE_FILES_PROPERTIES( "spectral_interface.f90" PROPERTIES
COMPILE_FLAGS "-fall-intrinsics")
# long lines for interaction matrix
SET_SOURCE_FILES_PROPERTIES( "lattice.f90" PROPERTIES
COMPILE_FLAGS "-ffree-line-length-240")
endif(INTEL_FORTRAN)
add_library(DAMASK_PREC "prec.f90") add_library(DAMASK_PREC "prec.f90")
if (SPECTRAL) if (SPECTRAL)