DEAL_II_ADD_EXTERNAL_LIBS_AT_TAIL(-lm)
;;
- clang*)
- dnl Like many other compilers, clang produces warnings for array
- dnl accesses out of bounds, even if they are in code that's dead
- dnl for this dimension. Suppress this.
- dnl
- dnl There are a number of other warnings we get that can't easily
- dnl be worked around and that are definitely not useful. Suppress
- dnl those too.
- CXXFLAGSG="$CXXFLAGS -DDEBUG -g -Wall -Wno-array-bounds -Wno-parentheses -Wno-delete-non-virtual-dtor -Wno-unneeded-internal-declaration -Wno-unused-function -Wno-unused-variable"
- CXXFLAGSO="$CXXFLAGS -O2 -Wno-array-bounds -Wno-parentheses -Wno-delete-non-virtual-dtor -Wno-unneeded-internal-declaration -Wno-unused-function -Wno-unused-variable"
- CXXFLAGSPIC="-fPIC"
- LDFLAGSPIC="-fPIC"
;;
intel_icc*)
# per email by John Fowkes on the mailing list in Feb 2012,
# so don't run the test on cygwin.
#
-ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wa,--compress-debug-sections")
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS "-Wa,--compress-debug-sections")
+ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS_DEBUG "-Wa,--compress-debug-sections")
+ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS_DEBUG "-Wa,--compress-debug-sections")
#
+#
+#
+# ######################
+# # FAT NOTE 2: #
+# ######################
#
# For the moment we assume that CC and CXX are the same compilers.
# (We only need CC for the compilation of the bundled umfpack library.)
"CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}\n"
)
ENDIF()
+#
+# ... and that we can set the same _default_ flags for both.
+#
+# So at the end of the default compiler flags setup, we just set all
+# C-Flags to the corersponding CXX-Flags:
+#
#
"Please set the relevant compiler options by hand.\n")
ENDIF()
+#
+# For the moment we assume that CC and CXX are the same compilers and that
+# we can set the same _default_ flags for both.
+#
+SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
+SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
+SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
# TODO: On some systems, -fpic/PIC is implied, so don't set anything to
# avoid a warning.
#
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS "-fpic")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-fpic")
#
#
# Set -pedantic if the compiler supports it.
#
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS "-pedantic")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-pedantic")
#
# Setup various warnings:
#
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS "-Wall")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wall")
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS "-Wpointer-arith")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wpointer-arith")
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS "-Wwrite-strings")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wwrite-strings")
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS "-Wsynth")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wsynth")
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS "-Wsign-compare")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wsign-compare")
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS "-Wswitch")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wswitch")
#
#
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wno-unused-local-typedefs")
+IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ #
+ # Like many other compilers, clang produces warnings for array
+ # accesses out of bounds, even if they are in code that's dead
+ # for this dimension. Suppress this.
+ #
+ # There are a number of other warnings we get that can't easily
+ # be worked around and that are definitely not useful. Suppress
+ # those too.
+ #
+ ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wno-array-bounds")
+ ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wno-parentheses")
+ ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wno-delete-non-virtual-dtor")
+ ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wno-unneeded-internal-declaration")
+ ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wno-unused-function")
+ ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS "-Wno-unused-variable")
+ENDIF()
#
# General optimization flags:
#
-ADD_FLAGS(CMAKE_C_FLAGS_RELEASE "-O2")
ADD_FLAGS(CMAKE_CXX_FLAGS_RELEASE "-O2")
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS_RELEASE "-funroll-loops")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS_RELEASE "-funroll-loops")
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS_RELEASE "-fstrict-aliasing")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS_RELEASE "-fstrict-aliasing")
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS_RELEASE "-felide-constructors")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS_RELEASE "-felide-constructors")
#
ADD_DEFINITIONS("-DDEBUG")
ENDIF()
-ADD_FLAGS(CMAKE_C_FLAGS_DEBUG "-O0")
ADD_FLAGS(CMAKE_CXX_FLAGS_DEBUG "-O0")
-ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS_DEBUG "-ggdb")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS_DEBUG "-ggdb")
ENABLE_IF_AVAILABLE(CMAKE_SHARED_LINKER_FLAGS "-ggdb")
#
# If -ggdb is not available, fall back to -g:
#
IF(NOT DEAL_II_HAVE_FLAG_-ggdb)
- ENABLE_IF_AVAILABLE(CMAKE_C_FLAGS_DEBUG "-g")
ENABLE_IF_AVAILABLE(CMAKE_CXX_FLAGS_DEBUG "-g")
ENABLE_IF_AVAILABLE(CMAKE_SHARED_LINKER_FLAGS "-g")
ENDIF()
MESSAGE("
- * *
- * deal.II successfully configured! *
- * *
+ * *
+ * deal.II successfully configured! *
+ * *
CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}
CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}
CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}
- ( CMAKE_C_COMPILER: ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION} )
General compiler flags (used by all build targets):
- CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}
- ( CMAKE_C_FLAGS: ${CMAKE_C_FLAGS} )
+ CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}
")
IF(CMAKE_BUILD_TYPE MATCHES "Release")
- MESSAGE("
-Additional compiler flags used for the Release target:
+ MESSAGE("Additional compiler flags used for the Release target:
CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}
- ( CMAKE_C_FLAGS_RELEASE: ${CMAKE_C_FLAGS_RELEASE} )
")
ENDIF()
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
- MESSAGE("
-Additional compiler flags used for the Debug target:
+ MESSAGE("Additional compiler flags used for the Debug target:
CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}
- ( CMAKE_C_FLAGS_DEBUG: ${CMAKE_C_FLAGS_DEBUG} )
")
ENDIF()
-MESSAGE("
-Configured linker flags:
+MESSAGE("Configured linker flags:
CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}
+")
+IF(FEATURE_UMFPACK_CONTRIB_CONFIGURED)
+ MESSAGE("The contrib UMFPACK library will be compiled with the following C compiler:
+ CMAKE_C_COMPILER: ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}
+ CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}
+ CMAKE_C_FLAGS_DEBUG: ${CMAKE_C_FLAGS_DEBUG}
+ CMAKE_C_FLAGS_RELEASE: ${CMAKE_C_FLAGS_RELEASE}
+
+")
+ENDIF()
+
+MESSAGE("
Configured Features (DEAL_II_FEATURE_AUTODETECTION = ${DEAL_II_FEATURE_AUTODETECTION}):
")