TRILAB-21 Intel flags
This commit is contained in:
@@ -31,10 +31,10 @@ endif ()
|
||||
# The provided CMake Fortran macros don't provide a general compile/run function
|
||||
# so this one is used.
|
||||
#-----------------------------------------------------------------------------
|
||||
macro (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN)
|
||||
macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN_VAR)
|
||||
#
|
||||
# if (NOT DEFINED ${RUN_RESULT_VAR})
|
||||
message (STATUS "Detecting Fortran ${FUNCTION}")
|
||||
message (STATUS "Detecting Fortran ${FUNCTION_NAME}")
|
||||
if (CMAKE_REQUIRED_LIBRARIES)
|
||||
set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
@@ -43,18 +43,18 @@ macro (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN)
|
||||
endif ()
|
||||
file (WRITE
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90
|
||||
"${CODE}"
|
||||
"${SOURCE_CODE}"
|
||||
)
|
||||
TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90
|
||||
CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
|
||||
RUN_OUTPUT_VARIABLE OUTPUT
|
||||
RUN_OUTPUT_VARIABLE OUTPUT_VAR
|
||||
)
|
||||
|
||||
set(${RETURN} ${OUTPUT})
|
||||
set(${RETURN_VAR} ${OUTPUT_VAR})
|
||||
|
||||
#message ( "Test result1 ${RETURN} ")
|
||||
#message ( "Test result1 ${RETURN_VAR} ")
|
||||
#message ( "Test result3 ${RESULT} ")
|
||||
#message ( "Test result2 ${CMAKE_MATCH_0} ")
|
||||
#message ( "Test result4 ${CMAKE_MATCH_1} ")
|
||||
@@ -66,34 +66,34 @@ macro (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN)
|
||||
|
||||
if (${COMPILE_RESULT_VAR})
|
||||
if (${RUN_RESULT_VAR} MATCHES 0)
|
||||
message (STATUS "Testing Fortran ${FUNCTION} - OK")
|
||||
message (STATUS "Testing Fortran ${FUNCTION_NAME} - OK")
|
||||
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the Fortran ${FUNCTION} exists passed with the following output:\n"
|
||||
"${OUTPUT}\n\n"
|
||||
"Determining if the Fortran ${FUNCTION_NAME} exists passed with the following output:\n"
|
||||
"${OUTPUT_VAR}\n\n"
|
||||
)
|
||||
else ()
|
||||
message (STATUS "Testing Fortran ${FUNCTION} - Fail")
|
||||
message (STATUS "Testing Fortran ${FUNCTION_NAME} - Fail")
|
||||
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
"Determining if the Fortran ${FUNCTION_NAME} exists failed with the following output:\n"
|
||||
"${OUTPUT_VAR}\n\n")
|
||||
endif ()
|
||||
endif ()
|
||||
# endif ()
|
||||
endmacro ()
|
||||
|
||||
# Read source line beginning at the line matching Input:"START" and ending at the line matching Input:"END"
|
||||
macro (READ_SOURCE START END RETURN)
|
||||
file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" CODE)
|
||||
string (REGEX MATCH "${START}[\\\t\\\n\\\r[].+]*${END}" CODE ${CODE})
|
||||
set (RETURN "${CODE}")
|
||||
macro (READ_SOURCE SOURCE_START SOURCE_END RETURN_VAR)
|
||||
file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_CODE)
|
||||
string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_CODE})
|
||||
set (RETURN_VAR "${SOURCE_CODE}")
|
||||
endmacro ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Check to see C_LONG_DOUBLE is available
|
||||
|
||||
READ_SOURCE("PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" "END PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" CODE)
|
||||
READ_SOURCE("PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" "END PROGRAM PROG_FC_HAVE_C_LONG_DOUBLE" SOURCE_CODE)
|
||||
CHECK_FORTRAN_FEATURE(c_long_double
|
||||
"${CODE}"
|
||||
"${SOURCE_CODE}"
|
||||
FORTRAN_HAVE_C_LONG_DOUBLE
|
||||
)
|
||||
|
||||
@@ -105,9 +105,9 @@ endif ()
|
||||
|
||||
# Check to see C_LONG_DOUBLE is different from C_DOUBLE
|
||||
|
||||
READ_SOURCE("MODULE type_mod" "END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE" CODE)
|
||||
READ_SOURCE("MODULE type_mod" "END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE" SOURCE_CODE)
|
||||
CHECK_FORTRAN_FEATURE(c_long_double
|
||||
"${CODE}"
|
||||
"${SOURCE_CODE}"
|
||||
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE
|
||||
)
|
||||
if (${FORTRAN_C_LONG_DOUBLE_IS_UNIQUE})
|
||||
@@ -133,9 +133,9 @@ endif ()
|
||||
# Determine the available KINDs for REALs and INTEGERs
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" CODE)
|
||||
READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" SOURCE_CODE)
|
||||
FORTRAN_RUN ("REAL and INTEGER KINDs"
|
||||
"${CODE}"
|
||||
"${SOURCE_CODE}"
|
||||
XX
|
||||
YY
|
||||
PROG_OUTPUT
|
||||
@@ -372,8 +372,8 @@ ENABLE_LANGUAGE (C)
|
||||
# The provided CMake C macros don't provide a general compile/run function
|
||||
# so this one is used.
|
||||
#-----------------------------------------------------------------------------
|
||||
macro (C_RUN FUNCTION CODE RETURN)
|
||||
message (STATUS "Detecting C ${FUNCTION}")
|
||||
macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR)
|
||||
message (STATUS "Detecting C ${FUNCTION_NAME}")
|
||||
if (CMAKE_REQUIRED_LIBRARIES)
|
||||
set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
@@ -382,16 +382,16 @@ macro (C_RUN FUNCTION CODE RETURN)
|
||||
endif ()
|
||||
file (WRITE
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
|
||||
${CODE}
|
||||
${SOURCE_CODE}
|
||||
)
|
||||
TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
|
||||
CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
|
||||
RUN_OUTPUT_VARIABLE OUTPUT
|
||||
RUN_OUTPUT_VARIABLE OUTPUT_VAR
|
||||
)
|
||||
|
||||
set (${RETURN} ${OUTPUT})
|
||||
set (${RETURN_VAR} ${OUTPUT_VAR})
|
||||
|
||||
#message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
|
||||
#message ( "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ")
|
||||
@@ -401,21 +401,21 @@ macro (C_RUN FUNCTION CODE RETURN)
|
||||
|
||||
if (${COMPILE_RESULT_VAR})
|
||||
if (${RUN_RESULT_VAR} MATCHES 1)
|
||||
set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION}")
|
||||
message (STATUS "Testing C ${FUNCTION} - OK")
|
||||
set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
|
||||
message (STATUS "Testing C ${FUNCTION_NAME} - OK")
|
||||
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the C ${FUNCTION} exists passed with the following output:\n"
|
||||
"${OUTPUT}\n\n"
|
||||
"Determining if the C ${FUNCTION_NAME} exists passed with the following output:\n"
|
||||
"${OUTPUT_VAR}\n\n"
|
||||
)
|
||||
else ()
|
||||
message (STATUS "Testing C ${FUNCTION} - Fail")
|
||||
set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION}")
|
||||
message (STATUS "Testing C ${FUNCTION_NAME} - Fail")
|
||||
set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
|
||||
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the C ${FUNCTION} exists failed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
"Determining if the C ${FUNCTION_NAME} exists failed with the following output:\n"
|
||||
"${OUTPUT_VAR}\n\n")
|
||||
endif ()
|
||||
else ()
|
||||
message (FATAL_ERROR "Compilation of C ${FUNCTION} - Failed")
|
||||
message (FATAL_ERROR "Compilation of C ${FUNCTION_NAME} - Failed")
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user