1 # Tests whether the compiler is Intel icc and needs -i_dynamic 3 MACRO(TESTNO_ICC_IDYNAMIC_NEEDED VARIABLE LOCAL_TEST_DIR)
4 IF(NOT DEFINED
"HAVE_${VARIABLE}")
5 TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
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")
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.")
25 FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"TestNO_ICC_IDYNAMIC_NEEDED produced following output:\n${OUTPUT}\n\n")