ParaViewTestNO_ICC_IDYNAMIC_NEEDED.cmake
Go to the documentation of this file.
1 # Tests whether the compiler is Intel icc and needs -i_dynamic
2 
3 MACRO(TESTNO_ICC_IDYNAMIC_NEEDED VARIABLE LOCAL_TEST_DIR)
4  IF(NOT DEFINED "HAVE_${VARIABLE}")
5  TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
6  ${CMAKE_BINARY_DIR}
7  ${LOCAL_TEST_DIR}/ParaViewTestNO_ICC_IDYNAMIC_NEEDED.cxx
8  OUTPUT_VARIABLE OUTPUT)
9  MESSAGE(STATUS "Check if using the Intel icc compiler, and if -i_dynamic is needed... COMPILE_RESULT...${HAVE_${VARIABLE}} RUN_RESULT...${VARIABLE}\n")
10  IF(HAVE_${VARIABLE}) #Test compiled, either working intel w/o -i_dynamic, or another compiler
11  IF(${VARIABLE}) #Intel icc compiler, -i_dynamic not needed
12  FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
13  "-i_dynamic not needed, (Not Intel icc, or this version of Intel icc does not conflict with OS glibc.")
14  MESSAGE(STATUS "-i_dynamic not needed, (Not Intel icc, or this version of Intel icc does not conflict with OS glibc.")
15  ELSE() #The compiler is not Intel icc
16  FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
17  "The compiler ERROR--This should never happen")
18  MESSAGE(STATUS "The compiler ERROR--This should never happen")
19  ENDIF()
20  ELSE() #Test did not compile, either badly broken compiler, or intel -i_dynamic needed
21  FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
22  "\tThe -i_dynamic compiler flag is needed for the Intel icc compiler on this platform.\n")
23  MESSAGE("The -i_dynamic compiler flag is needed for the Intel icc compiler on this platform.")
24  ENDIF()
25  FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "TestNO_ICC_IDYNAMIC_NEEDED produced following output:\n${OUTPUT}\n\n")
26  ENDIF()
27 ENDMACRO()