@@ -7,10 +7,10 @@ cmake_minimum_required(VERSION 3.15...3.15)
77
88# Warning. This must be consistent with src/nomad_version.hpp
99set (NOMAD_VERSION_MAJOR 4)
10- set (NOMAD_VERSION_MINOR 4)
11- set (NOMAD_VERSION_PATCH 0)
12- set (NOMAD_VERSION ${NOMAD_VERSION_MAJOR} .${NOMAD_VERSION_MINOR} .${NOMAD_VERSION_PATCH} )
10+ set (NOMAD_VERSION_MINOR 5)
11+ set (NOMAD_VERSION_PATCH 0)
1312
13+ set (NOMAD_VERSION ${NOMAD_VERSION_MAJOR} .${NOMAD_VERSION_MINOR} .${NOMAD_VERSION_PATCH} )
1414
1515# name of the project
1616# Need to update when version changes
@@ -29,8 +29,8 @@ endif()
2929# Need to update when version changes
3030set (NOMAD_SRC_TEMPLATE NOMAD_${NOMAD_VERSION_MAJOR} _${NOMAD_VERSION_MINOR} )
3131
32- # use standard compilers parameters for c++14
33- SET (CMAKE_CXX_STANDARD 14 )
32+ # use standard compilers parameters for c++17
33+ SET (CMAKE_CXX_STANDARD 17 )
3434SET (CMAKE_CXX_STANDARD_REQUIRED ON )
3535
3636# Disable in-source builds to prevent source tree corruption.
@@ -42,7 +42,7 @@ endif()
4242
4343#check compiler version
4444if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" )
45- # require at least gcc 4
45+ # require at least gcc 8
4646 if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8)
4747 message (FATAL_ERROR "GCC version < 8 has not been tested for Nomad" )
4848 endif ()
@@ -53,7 +53,7 @@ elseif (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
5353 message (FATAL_ERROR "Clang version has not been tested for Nomad" )
5454 endif ()
5555elseif ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "MSVC" )
56- # require at least 15.0 (MSVC 2017) for C++14 support
56+ # require at least 15.8 (MSVC 2017) for C++17 support
5757 if (MSVC_TOOLSET_VERSION VERSION_LESS 141)
5858 message (FATAL_ERROR "MSVC version ${CMAKE_CXX_COMPILER_VERSION} has not been tested for Nomad" )
5959 endif ()
@@ -72,9 +72,25 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
7272#
7373# Message for starting configuration
7474#
75- message (CHECK_START " Configuring custom options" )
75+ message (CHECK_START "Configuring custom options" )
7676list (APPEND CMAKE_MESSAGE_INDENT " " )
7777
78+ #
79+ # Modify the build type if not specified on the command
80+ #
81+ if (CMAKE_CONFIGURATION_TYPES )
82+ message (STATUS " Multi-configuration generator detected. Use the --config option during build to specify the build type (Release, Debug, ...)." )
83+ else ()
84+ if (NOT CMAKE_BUILD_TYPE )
85+ set (CMAKE_BUILD_TYPE "Release" CACHE PATH "..." FORCE)
86+ message (STATUS " Build type not set explicitly. Default is set to Release. To force build type selection, use --DCMAKE_BUILD_TYPE=xxx, options are Debug Release RelWithDebInfo MinSizeRel." )
87+ else ()
88+ message (STATUS " Build type is ${CMAKE_BUILD_TYPE} " )
89+ endif ()
90+ endif ()
91+
92+
93+
7894#
7995# Modify the install prefix if not specified on the command
8096#
@@ -83,6 +99,7 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
8399endif ()
84100message (STATUS " Installation prefix set to ${CMAKE_INSTALL_PREFIX} " )
85101
102+
86103#
87104# Choose to build with time stats enabled
88105#
@@ -123,6 +140,7 @@ else()
123140 message (STATUS " Examples NOT built" )
124141endif ()
125142
143+
126144#
127145# Choose to build the C interface
128146#
@@ -140,15 +158,11 @@ endif()
140158#
141159option (BUILD_INTERFACE_PYTHON "Option to build Python interface to Nomad" OFF )
142160if (BUILD_INTERFACE_PYTHON MATCHES ON )
143- if (OpenMP_FOUND)
144- message (STATUS " Warning: Cannot build Python interface with OpenMP enabled" )
145- else ()
146- set (Python3_FIND_VIRTUALENV "First" )
147- find_package (Python 3.6 QUIET REQUIRED)
161+ set (Python3_FIND_VIRTUALENV "First" ) # Using virtualenv to have cython and wheel is easy
162+ find_package (Python 3.8 QUIET REQUIRED)
148163 message (CHECK_START " Configuring build for Python interface (Python ${Python_VERSION} )" )
149164 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /interfaces/PyNomad)
150165 message (CHECK_PASS " done" )
151- endif ()
152166else ()
153167 message (STATUS " Python interface to Nomad NOT built" )
154168endif ()
@@ -240,14 +254,13 @@ else()
240254 message (STATUS " Sgtelib library will NOT be used\n " )
241255endif ()
242256
243-
244-
245257#
246258# Custom options final message
247259#
248260list (REMOVE_ITEM CMAKE_MESSAGE_INDENT " " )
249261message (CHECK_PASS " done" )
250262
263+
251264#
252265# Add nomad app directory for building
253266#
0 commit comments