Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1400 - trunk/CMake
- Date: Thu, 24 May 2007 21:01:03 -0600 (MDT)
Author: bigler
Date: Thu May 24 21:01:03 2007
New Revision: 1400
Added:
trunk/CMake/CompilerInfo.cmake
Log:
Added missing file for determining information about the compiler.
Added: trunk/CMake/CompilerInfo.cmake
==============================================================================
--- (empty file)
+++ trunk/CMake/CompilerInfo.cmake Thu May 24 21:01:03 2007
@@ -0,0 +1,73 @@
+# Sets some variables depending on which compiler you are using
+#
+# USING_GCC : gcc is being used for C compiler
+# USING_GPP : g++ is being used for C++ compiler
+# USING_ICC : icc is being used for C compiler
+# USING_ICPC : icpc is being used for C++ compiler
+
+# Have to set this variable outside of the top level IF statement,
+# since CMake will break if you use it in an IF statement.
+SET(MANTA_COMPILER_NAME_REGEXPR "icc.*$")
+
+IF(NOT CMAKE_COMPILER_IS_GNUCC)
+ # This regular expression also matches things like icc-9.1
+ IF (CMAKE_C_COMPILER MATCHES ${MANTA_COMPILER_NAME_REGEXPR})
+ SET(USING_ICC TRUE)
+ ENDIF(CMAKE_C_COMPILER MATCHES ${MANTA_COMPILER_NAME_REGEXPR})
+ELSE(NOT CMAKE_COMPILER_IS_GNUCC)
+ SET(USING_GCC TRUE)
+ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
+
+SET(MANTA_COMPILER_NAME_REGEXPR "icpc.*$")
+IF(NOT CMAKE_COMPILER_IS_GNUCXX)
+ IF (CMAKE_CXX_COMPILER MATCHES ${MANTA_COMPILER_NAME_REGEXPR})
+ SET(USING_ICPC TRUE)
+
+ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
+ ARGS --version
+ OUTPUT_VARIABLE TEMP)
+
+ STRING(REGEX MATCH "([0-9\\.]+)"
+ INTEL_COMPILER_VERSION
+ ${TEMP})
+
+ MARK_AS_ADVANCED(INTEL_COMPILER_VERSION)
+ ENDIF(CMAKE_CXX_COMPILER MATCHES ${MANTA_COMPILER_NAME_REGEXPR})
+ELSE(NOT CMAKE_COMPILER_IS_GNUCXX)
+ SET(USING_GPP TRUE)
+ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
+
+# Do some error checking
+
+# Mixing compilers
+IF (USING_ICC AND USING_GPP)
+ FIRST_TIME_MESSAGE("Using icc combined with g++. Good luck with that.")
+ENDIF(USING_ICC AND USING_GPP)
+
+IF (USING_GCC AND USING_ICPC)
+ FIRST_TIME_MESSAGE("Using gcc combined with icpc. Good luck with that.")
+ENDIF(USING_GCC AND USING_ICPC)
+
+IF (USING_ICC AND USING_GPP)
+ FIRST_TIME_MESSAGE("Using icc combined with g++. Good luck with that")
+ENDIF(USING_ICC AND USING_GPP)
+
+# Using unknown compilers
+IF (NOT USING_ICC AND NOT USING_GCC)
+ FIRST_TIME_MESSAGE("Specified C compiler ${CMAKE_C_COMPILER} is not
recognized (gcc, icc). Using CMake defaults.")
+ENDIF(NOT USING_ICC AND NOT USING_GCC)
+
+IF (NOT USING_ICPC AND NOT USING_GPP)
+ FIRST_TIME_MESSAGE("Specified CXX compiler ${CMAKE_CXX_COMPILER} is not
recognized (g++, icpc). Using CMake defaults.")
+ENDIF(NOT USING_ICPC AND NOT USING_GPP)
+
+# Warn if the compiler is not icc on SGI_LINUX systems
+IF (CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
+ IF(NOT USING_ICC)
+ FIRST_TIME_MESSAGE("Intel Compilers recommended on ia64. setenv CC
icc before running cmake.")
+ ENDIF(NOT USING_ICC)
+
+ IF(NOT USING_ICPC)
+ FIRST_TIME_MESSAGE("Intel Compilers recommended on ia64. setenv CXX
icpc before running cmake.")
+ ENDIF(NOT USING_ICPC)
+ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
- [MANTA] r1400 - trunk/CMake, bigler, 05/24/2007
Archive powered by MHonArc 2.6.16.