mirror of
https://github.com/triqs/dft_tools
synced 2024-12-25 13:53:40 +01:00
- C++14 mode not automatic. Was based on compiler version, but the version of the C++ lib also matters.... Now, there is an explicit USE_CPP14 option [default =OFF] to set to compile in c++1y mode. Solve also #89, i.e. the flags is now in TRIQS_CXX_DEFINITIONS and therefore pass to applications (including ipython magic). - Python_use_mpi4py is now ON by default. Rational : it has been used for a while by e.g. Thomas, and it is necessary on OS X (boost.mpi.python raises a lot of issues). Hence we put it as default. - Rename the option Build_Triqs_General_Tools_Test to a simpler Build_Tests
This commit is contained in:
parent
9583afc671
commit
fcfcce8d61
@ -63,12 +63,15 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|||||||
find_package(CompilerCheck)
|
find_package(CompilerCheck)
|
||||||
|
|
||||||
# Add C11 or C14 flag depending on compiler detection
|
# Add C11 or C14 flag depending on compiler detection
|
||||||
if (NOT compiler_is_c14)
|
option(USE_CPP14 "Use C++14 mode " OFF)
|
||||||
|
if (NOT USE_CPP14)
|
||||||
MESSAGE(STATUS "Compiling in C++11 mode")
|
MESSAGE(STATUS "Compiling in C++11 mode")
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(TRIQS_CXX_DEFINITIONS ${TRIQS_CXX_DEFINITIONS} " -std=c++11 ")
|
||||||
|
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
else()
|
else()
|
||||||
MESSAGE(STATUS "Compiling in C++14 mode")
|
MESSAGE(STATUS "Compiling in C++14 mode")
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
|
set(TRIQS_CXX_DEFINITIONS ${TRIQS_CXX_DEFINITIONS} " -std=c++1y ")
|
||||||
|
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Include TRIQS cmake macros
|
# Include TRIQS cmake macros
|
||||||
@ -392,8 +395,8 @@ endif( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|||||||
# tests
|
# tests
|
||||||
#------------------------
|
#------------------------
|
||||||
|
|
||||||
option(Build_Triqs_General_Tools_Test "Build the test of the general tool ? ( array class , ... ) " ON)
|
option(Build_Tests "Build the tests of the library " ON)
|
||||||
if (Build_Triqs_General_Tools_Test)
|
if (Build_Tests)
|
||||||
message( STATUS "-------- Preparing tests -------------")
|
message( STATUS "-------- Preparing tests -------------")
|
||||||
add_subdirectory(${TRIQS_SOURCE_DIR}/test )
|
add_subdirectory(${TRIQS_SOURCE_DIR}/test )
|
||||||
endif()
|
endif()
|
||||||
|
@ -21,9 +21,9 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
|||||||
set(compiler_name "gcc")
|
set(compiler_name "gcc")
|
||||||
string(REGEX REPLACE ".*([2-5]\\.[0-9]\\.[0-9]).*" "\\1" compiler_version ${_compiler_output})
|
string(REGEX REPLACE ".*([2-5]\\.[0-9]\\.[0-9]).*" "\\1" compiler_version ${_compiler_output})
|
||||||
|
|
||||||
if(NOT compiler_version VERSION_LESS "4.9.0")
|
#if(NOT compiler_version VERSION_LESS "4.9.0")
|
||||||
set (compiler_is_c14 ON)
|
# set (compiler_is_c14 ON)
|
||||||
endif()
|
#endif()
|
||||||
|
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
|
|
||||||
@ -46,9 +46,9 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
|||||||
set( compiler_version_min "3.2")
|
set( compiler_version_min "3.2")
|
||||||
|
|
||||||
# does not always work ... To be fixed when clang 3.4 officially released and on OS X.
|
# does not always work ... To be fixed when clang 3.4 officially released and on OS X.
|
||||||
if(NOT compiler_version VERSION_LESS "3.4")
|
#if(NOT compiler_version VERSION_LESS "3.4")
|
||||||
set (compiler_is_c14 ON)
|
# set (compiler_is_c14 ON)
|
||||||
endif()
|
#endif()
|
||||||
|
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
option(Python_use_mpi4py "Use mpi4py (if OFF, use boost.mpi)" OFF)
|
option(Python_use_mpi4py "Use mpi4py (if OFF, use boost.mpi)" ON)
|
||||||
if (Python_use_mpi4py)
|
if (Python_use_mpi4py)
|
||||||
SET (TRIQS_PYTHON_MPI_USE_MPI4PY 1)
|
SET (TRIQS_PYTHON_MPI_USE_MPI4PY 1)
|
||||||
else()
|
else()
|
||||||
|
Loading…
Reference in New Issue
Block a user