CMakeLists.txt 16.7 KB
Newer Older
1 2 3 4 5 6 7 8 9
###############################################################################
#                      Cmake project script for TNL
#                             -------------------
#    begin               : Dec 8, 2010
#    copyright           : (C) 2010 by Tomas Oberhuber et al.
#    email               : tomas.oberhuber@fjfi.cvut.cz
#
###############################################################################

10 11 12
# cmake 3.12.2 is required due to compatibility with CUDA 10
# (see the issue reported here: https://github.com/clab/dynet/issues/1457 )
cmake_minimum_required( VERSION 3.12.2 )
13

14 15
project( tnl )

16
set( tnlVersion "0.1" )
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
17

18 19 20 21 22
# declare all custom build options
option(OFFLINE_BUILD "Offline build (i.e. without downloading libraries such as pybind11)" OFF)
option(WITH_CUDA "Build with CUDA support" ON)
set(WITH_CUDA_ARCH "auto" CACHE STRING "Build for these CUDA architectures")
option(WITH_OPENMP "Build with OpenMP support" ON)
23
option(WITH_MPI "Build with MPI support" ON)
24
option(WITH_GMP "Build with GMP support" OFF)
25
option(WITH_TESTS "Build tests" ON)
26
option(WITH_MATRIX_TESTS "Build tests for matrices" ON)
27
option(WITH_PROFILING "Enable code profiling compiler flags" OFF )
28
option(WITH_COVERAGE "Enable code coverage reports from unit tests" OFF)
29
option(WITH_EXAMPLES "Compile the 'src/Examples' directory" ON)
30
option(WITH_TOOLS "Compile the 'src/Tools' directory" ON)
31
option(WITH_BENCHMARKS "Compile the 'src/Benchmarks' directory" ON)
32
option(WITH_PYTHON "Compile the Python bindings" ON)
33
option(WITH_DOC "Build examples included in the documentation" ON)
34 35 36 37 38

# install paths relative to the cmake's prefix
set( TNL_TARGET_INCLUDE_DIRECTORY "include/TNL" )
set( TNL_TARGET_DATA_DIRECTORY "share/TNL" )

39 40 41
# set cmake's include path so that we can include modules from
# the cmake directory in the TNL repository
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" )
42

43
# Note that in cmake 3.10 the FindOpenMP and FindMPI modules are broken - they do not work when
44
# CMAKE_EXECUTABLE_SUFFIX is not empty, see https://www.mail-archive.com/cmake@cmake.org/msg56886.html
45
# Hence, we find OpenMP and MPI before setting CMAKE_EXECUTABLE_SUFFIX.
46
find_package( OpenMP )
47
find_package( MPI )
48

Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
49 50 51
####
# Settings for debug/release version
#
52
if( CMAKE_BUILD_TYPE STREQUAL "Debug")
53
    set( PROJECT_BUILD_PATH ${PROJECT_SOURCE_DIR}/Debug/src )
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
54
    set( PROJECT_TOOLS_PATH ${PROJECT_SOURCE_DIR}/Debug/bin )
55 56
    set( LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/Debug/lib )
    set( EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/Debug/bin )
57 58
    set( CMAKE_EXECUTABLE_SUFFIX "-dbg${CMAKE_EXECUTABLE_SUFFIX}" )  # suffix for executables
    set( CMAKE_DEBUG_POSTFIX "-dbg" )  # suffix for libraries
59
else()
60
    set( PROJECT_BUILD_PATH ${PROJECT_SOURCE_DIR}/Release/src )
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
61
    set( PROJECT_TOOLS_PATH ${PROJECT_SOURCE_DIR}/Release/bin )
62 63
    set( LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/Release/lib )
    set( EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/Release/bin )
64
endif()
65

66 67
# check if the compiler is good enough
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Jakub Klinkovský's avatar
Jakub Klinkovský committed
68 69
   # GCC 5.0 is the first release with full C++11 support (due to libstdc++) as
   # well as full C++14 support: https://gcc.gnu.org/gcc-5/changes.html
70 71 72 73 74 75 76 77 78 79
   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")
      message(FATAL_ERROR "Insufficient GCC version")
   endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   # Clang 3.4 has full C++14 support: http://clang.llvm.org/cxx_status.html
   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.4")
      message(FATAL_ERROR "Insufficient Clang version")
   endif()
endif()

Jakub Klinkovský's avatar
Jakub Klinkovský committed
80 81 82 83 84
# set C++ standard
set( CMAKE_CXX_STANDARD 14 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF )

85
# set default build options
86
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Wall -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unknown-pragmas" )
Jakub Klinkovský's avatar
Jakub Klinkovský committed
87
set( CMAKE_CXX_FLAGS_DEBUG "-g" )
88
set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" )
89
# pass -rdynamic only in Debug mode
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
90 91 92
set( CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "" )
set( CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_DEBUG "-rdynamic" )
set( CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_RELEASE "" )
93 94 95 96 97 98
set( CMAKE_EXE_LINKER_FLAGS "" )
set( CMAKE_EXE_LINKER_FLAGS_DEBUG "-rdynamic" )
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "" )
set( CMAKE_SHARED_LINKER_FLAGS "" )
set( CMAKE_SHARED_LINKER_FLAGS_DEBUG "-rdynamic" )
set( CMAKE_SHARED_LINKER_FLAGS_RELEASE "" )
99

100 101 102 103 104
if( ${WITH_CI_FLAGS} )
   # enforce (more or less) warning-free builds
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=deprecated -Wno-error=deprecated-declarations -Wno-error=uninitialized -Wno-error=vla" )
endif()

105 106 107 108 109 110 111
# set additional Debug/Release options using generator expressions
# (that way we can exclude some options for specific targets, see https://stackoverflow.com/a/59734798 for details)
add_compile_options(
   # GOTCHA: CMake uses semicolons as list item separator, spaces would lead to a single argument inside double-quotes on the command line
   "$<$<CONFIG:RELEASE>:-march=native;-mtune=native>"
)

112 113 114 115 116
# disable GCC's infamous "maybe-uninitialized" warning (it produces mostly false positives)
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized" )
endif()

117 118 119 120 121
# disable false Clang warning: https://stackoverflow.com/q/57645872
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-self-assign-overloaded" )
endif()

122 123 124
# enable link time optimizations (but not in continuous integration)
if( NOT DEFINED ENV{CI_JOB_NAME} )
   if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
125 126 127 128
      # LTO with GCC 9.1.0 and Debug build = internal compiler error
      # LTO with GCC 9.1.0 and nvcc 10.1 and Release build = fatal error: bytecode stream in file `blabla` generated with LTO version 7.1 instead of the expected 8.0
#      add_compile_options( "-flto" )
#      add_link_options( "-flto" )
129 130 131 132 133 134
   elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
      add_compile_options( "-flto=thin" )
      add_link_options( "-flto=thin" )
   endif()
endif()

135
# force colorized output in continuous integration
136 137
if( DEFINED ENV{CI_JOB_NAME} OR ${CMAKE_GENERATOR} STREQUAL "Ninja" )
   message(STATUS "Continuous integration or Ninja detected -- forcing compilers to produce colorized output.")
138 139
   if( CXX_COMPILER_NAME MATCHES "clang" )
      set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics" )
140
   else()
141 142
      set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color" )
   endif()
143 144
endif()

145
# gtest has to be built before we add the MPI flags
146
if( ${WITH_TESTS} OR ${WITH_MATRIX_TESTS} )
147 148 149 150 151 152 153 154 155 156 157 158 159
   enable_testing()

   # build gtest libs
   include( BuildGtest )

   if( ${WITH_COVERAGE} AND CMAKE_BUILD_TYPE STREQUAL "Debug" )
      # enable code coverage reports
      include( UseCodeCoverage )
   endif()
endif()

####
# Check for OpenMP
160
#
161 162
if( OPENMP_FOUND AND ${WITH_OPENMP} )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_OPENMP ${OpenMP_CXX_FLAGS}" )
163 164 165
endif()

####
166
# Check for MPI
167
#
168 169 170 171 172 173 174 175 176 177 178
if( MPI_CXX_FOUND AND ${WITH_MPI} )
   set( BUILD_MPI TRUE)
   # add the appropriate flags to all targets (will be hidden from the CMAKE_CXX_* variables)
   include_directories( ${MPI_CXX_INCLUDE_DIRS} )
   add_compile_options( ${MPI_CXX_COMPILE_OPTIONS} )
   add_compile_definitions( ${MPI_CXX_COMPILE_DEFINITIONS} )
   add_link_options( "SHELL:${MPI_CXX_LINK_FLAGS}" )
   link_libraries( ${MPI_CXX_LIBRARIES} )
   # enable MPI in TNL
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_MPI" )
endif()
179

180 181 182
#####
# Check for CUDA
#
183
if( ${WITH_CUDA} )
184
    find_package( CUDA 9.0 )
185 186
    if( CUDA_FOUND )
        set( BUILD_CUDA TRUE)
187
        set(CUDA_SEPARABLE_COMPILATION ON)
188 189 190 191 192
        # Use the CUDA_HOST_COMPILER environment variable if the user specified it.
        if( NOT $ENV{CUDA_HOST_COMPILER} STREQUAL "" )
            message( "-- Setting CUDA_HOST_COMPILER to '$ENV{CUDA_HOST_COMPILER}'" )
            set( CUDA_HOST_COMPILER $ENV{CUDA_HOST_COMPILER} )
        else()
193 194 195 196 197 198 199
            if( EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/bin/g++" )
               message( "-- Setting CUDA_HOST_COMPILER to '${CUDA_TOOLKIT_ROOT_DIR}/bin/g++'" )
               set( CUDA_HOST_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/g++" )
            else()
               message( "-- Setting CUDA_HOST_COMPILER to '${CMAKE_CXX_COMPILER}'" )
               set( CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} )
            endif()
200
        endif()
201
        set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ;-DHAVE_CUDA)
202
        # disable false compiler warnings
203 204
        #   reference for the -Xcudafe --diag_suppress and --display_error_number flags: https://stackoverflow.com/a/54142937
        #   incomplete list of tokens: http://www.ssl.berkeley.edu/~jimm/grizzly_docs/SSL/opt/intel/cc/9.0/lib/locale/en_US/mcpcom.msg
205
        set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ; -Wno-deprecated-gpu-targets --expt-relaxed-constexpr --expt-extended-lambda -Xcudafe "\"--diag_suppress=code_is_unreachable --diag_suppress=implicit_return_from_non_void_function --diag_suppress=unsigned_compare_with_zero --diag_suppress=2906 --diag_suppress=2913 --diag_suppress=2886 --diag_suppress=2929 --diag_suppress=2977 --display_error_number\"")
206 207
        # temporarily disable host-compler warnings about VLAs, which are caused by nvcc's modifications to the source code
        set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ; -Xcompiler -Wno-vla)
208 209 210 211 212
        # Select GPU architecture
        ## cmake bug: cuda_select_nvcc_arch_flags does not work with CMAKE_EXECUTABLE_SUFFIX
        ## see https://gitlab.kitware.com/cmake/cmake/issues/19636
        set( executable_suffix_backup "${CMAKE_EXECUTABLE_SUFFIX}" )
        set( CMAKE_EXECUTABLE_SUFFIX "" )
213
        if( WITH_CUDA_ARCH STREQUAL "all" )
214 215 216 217 218 219 220 221
           CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS "All")
           LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS})
        elseif( WITH_CUDA_ARCH STREQUAL "auto" )
           CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS "Auto")
           LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS})
        elseif( NOT WITH_CUDA_ARCH STREQUAL "" )
            CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS ${WITH_CUDA_ARCH})
            LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS})
222
        else()
223
            message( FATAL_ERROR "\$WITH_CUDA_ARCH cannot be empty." )
224
        endif()
225
        set( CMAKE_EXECUTABLE_SUFFIX "${executable_suffix_backup}" )
226 227
    endif()
endif()
228

229

230 231 232 233 234
if( ${WITH_PROFILING} )
    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" )
    set( CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-line-info")
endif()

Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
235 236
find_package( DCMTK )
if( DCMTK_FOUND )
237
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_DCMTK_H" )
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
238 239 240 241
   include_directories( ${DCMTK_INCLUDE_DIRS} )
endif()

find_package( PNG )
242 243
if( PNG_FOUND )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_PNG_H" )
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
244 245 246
   include_directories( ${PNG_INCLUDE_DIRS} )
endif()

247
find_package( JPEG )
248 249
if( JPEG_FOUND )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_JPEG_H" )
250 251 252
   include_directories( ${JPEG_INCLUDE_DIRS} )
endif()

253 254 255
####
# Test for GMP 
#
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
if( ${WITH_GMP} )
   if (GMP_INCLUDES AND GMP_LIBRARIES)
      set(GMP_FIND_QUIETLY TRUE)
   endif (GMP_INCLUDES AND GMP_LIBRARIES)

   find_path(GMP_INCLUDES
      NAMES
      gmp.h
      PATHS
      $ENV{GMPDIR}
      ${INCLUDE_INSTALL_DIR}
   )

   find_library(GMP_LIBRARIES gmp PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR})

   include(FindPackageHandleStandardArgs)
   find_package_handle_standard_args(GMP DEFAULT_MSG
                                      GMP_INCLUDES GMP_LIBRARIES)
   if( ${GMP_INCLUDES} STREQUAL "GMP_INCLUDES-NOTFOUND" OR ${GMP_LIBRARIES} STREQUAL "GMP_LIBRARIES-NOTFOUND" )
      message( "GMP was not found. Some tests for higher precision arithmetics will not be passed." )
   else()
      set( HAVE_GMP )
      set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${GMP_INCLUDES} -DHAVE_GMP" )
      set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GMP_LIBRARIES}" )
      mark_as_advanced(GMP_INCLUDES GMP_LIBRARIES)
   endif()
282
endif()
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
283

Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
#if( BUILD_MPI )
#   FIND_PATH( PETSC_INCLUDE_DIR petsc.h
#     /usr/include/petsc
#     ${PETSC_DIR}/${PETSC_ARCH}/include
#     ${PETSC_DIR}/include
#     DOC "PETSC headers."
#   )
#   if( ${PETSC_INCLUDE_DIR} STREQUAL "PETSC_INCLUDE_DIR-NOTFOUND" )
#      message( "PETSC not found." ) 
#   else()
#      message( "PETSC headers found -- ${PETSC_INCLUDE_DIR}" )
#      FIND_LIBRARY(PETSC_LIBRARY petsc
#                  ${PETSC_INCLUDE_DIR}/../lib
#                  /usr/local/lib
#                  /usr/lib)
#      if( PETSC_LIBRARY )
#         #string( REPLACE ";" " " MPI_LIBRARIES "${MPI_CXX_LIBRARIES}" )
#         #set( PETSC_LIBRARY "${MPI_LIBRARIES} ${PETSC_LIBRARY}")
#         message( "PETSC library found -- ${PETSC_LIBRARY}")
#         list( GET MPI_CXX_INCLUDE_PATH 0 MPI_CXX_PATH )
#         set(PETSC_CXX_FLAGS "-DHAVE_PETSC -I${PETSC_INCLUDE_DIR} -DHAVE_MPI -I${MPI_CXX_PATH}")                     
#      endif()
#   endif()
#endif()
308

309 310 311
INCLUDE_DIRECTORIES( src )
INCLUDE_DIRECTORIES( ${PROJECT_BUILD_PATH} )
LINK_DIRECTORIES( ${LIBRARY_OUTPUT_PATH} )
312

313
# Add all subdirectories
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
314
add_subdirectory( src )
315
add_subdirectory( share )
316

317
# Add subdirectories for examples included in the documentation
318
if( ${WITH_DOC} )
319 320 321 322
   set( TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH "${CMAKE_SOURCE_DIR}/Documentation/output_snippets" )
   file(MAKE_DIRECTORY ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH})
   add_subdirectory( Documentation/Examples )
   add_subdirectory( Documentation/Tutorials )
323
endif()
324

325 326 327 328 329 330 331 332 333
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Template Numerical Library")
set(CPACK_PACKAGE_VENDOR "MMG")
#set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
#set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "1")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
if(WIN32 AND NOT UNIX)
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
334 335
  # There is a bug in NSI that does not handle full unix paths properly. Make
  # sure there is at least one set of four (4) backlasshes.
336 337 338 339 340 341 342 343 344 345
  #set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
  #set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
  set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} Template Numerical Library")
  set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\geraldine.fjfi.cvut.cz/~oberhuber/doku-wiki-tnl")
  set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\geraldine.fjfi.cvut.cz/~oberhuber/doku-wiki-tnl")
  set(CPACK_NSIS_CONTACT "tomas.oberhuber@fjfi.cvut.cz")
  set(CPACK_NSIS_MODIFY_PATH ON)
else(WIN32 AND NOT UNIX)
#  set(CPACK_STRIP_FILES "bin/MyExecutable")
endif(WIN32 AND NOT UNIX)
346 347 348 349

set(CPACK_SOURCE_STRIP_FILES "Debug")
set(CPACK_SOURCE_STRIP_FILES "Release")

350
#set(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable")
Tomáš Oberhuber's avatar
Tomáš Oberhuber committed
351
INCLUDE( CPack )
352

353 354
# Print custom build options
message( "-- Build options:" )
355 356 357 358
message( "   OFFLINE_BUILD = ${OFFLINE_BUILD}" )
message( "   WITH_CUDA = ${WITH_CUDA}" )
message( "   WITH_CUDA_ARCH = ${WITH_CUDA_ARCH}" )
message( "   WITH_OPENMP = ${WITH_OPENMP}" )
359
message( "   WITH_MPI = ${WITH_MPI}" )
360 361
message( "   WITH_GMP = ${WITH_GMP}" )
message( "   WITH_TESTS = ${WITH_TESTS}" )
362
message( "   WITH_MATRIX_TESTS = ${WITH_MATRIX_TESTS}" )
363
message( "   WITH_PROFILING = ${WITH_PROFILING}" )
364 365 366 367 368
message( "   WITH_COVERAGE = ${WITH_COVERAGE}" )
message( "   WITH_EXAMPLES = ${WITH_EXAMPLES}" )
message( "   WITH_TOOLS = ${WITH_TOOLS}" )
message( "   WITH_BENCHMARKS = ${WITH_BENCHMARKS}" )
message( "   WITH_PYTHON = ${WITH_PYTHON}" )
369 370 371 372 373 374 375 376
# Print compiler options
message( "-- Compiler options:" )
message( "   CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}" )
message( "   CMAKE_CXX_FLAGS_DEBUG = ${CMAKE_CXX_FLAGS_DEBUG}" )
message( "   CMAKE_CXX_FLAGS_RELEASE = ${CMAKE_CXX_FLAGS_RELEASE}" )
message( "   CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}" )
message( "   CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_DEBUG = ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_DEBUG}" )
message( "   CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_RELEASE = ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_RELEASE}" )
377 378 379 380 381 382
message( "   CMAKE_EXE_LINKER_FLAGS = ${CMAKE_EXE_LINKER_FLAGS}" )
message( "   CMAKE_EXE_LINKER_FLAGS_DEBUG = ${CMAKE_EXE_LINKER_FLAGS_DEBUG}" )
message( "   CMAKE_EXE_LINKER_FLAGS_RELEASE = ${CMAKE_EXE_LINKER_FLAGS_RELEASE}" )
message( "   CMAKE_SHARED_LINKER_FLAGS = ${CMAKE_SHARED_LINKER_FLAGS}" )
message( "   CMAKE_SHARED_LINKER_FLAGS_DEBUG = ${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" )
message( "   CMAKE_SHARED_LINKER_FLAGS_RELEASE = ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" )
383
message( "   CUDA_NVCC_FLAGS = ${CUDA_NVCC_FLAGS}" )
384
message( "   GMP_LIBRARIES = ${GMP_LIBRARIES}" )
385 386 387 388 389 390 391
if( MPI_CXX_FOUND AND ${WITH_MPI} )
   message( "   MPI_CXX_COMPILE_OPTIONS = ${MPI_CXX_COMPILE_OPTIONS}" )
   message( "   MPI_CXX_COMPILE_DEFINITIONS = ${MPI_CXX_COMPILE_DEFINITIONS}" )
   message( "   MPI_CXX_INCLUDE_DIRS = ${MPI_CXX_INCLUDE_DIRS}" )
   message( "   MPI_CXX_LINK_FLAGS = ${MPI_CXX_LINK_FLAGS}" )
   message( "   MPI_CXX_LIBRARIES = ${MPI_CXX_LIBRARIES}" )
endif()