Skip to content

Commit 1e1e56c

Browse files
authored
Merge pull request #584 from GambitBSM/cmake_improvements
Several minor fixes for the cmake system
2 parents 9a665fd + 4d3e37d commit 1e1e56c

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "Release_O3")
5353
SET(CMAKE_BUILD_TYPE Release CACHE STRING "${CMAKE_BUILD_TYPE_STRING}" FORCE)
5454
SET(FORCE_O3 TRUE)
5555
endif()
56-
message("${Yellow}-- Build type is set to ${CMAKE_BUILD_TYPE} ${ColourReset}")
56+
message("-- Build type is set to ${CMAKE_BUILD_TYPE}")
5757

5858
# Set certain policies to NEW
5959
foreach(p
@@ -62,7 +62,7 @@ foreach(p
6262
CMP0022 # CMake 2.8.12
6363
CMP0025 # CMake 3.0
6464
CMP0042 # CMake 3.0
65-
CMP0048 # Cmake 3.0
65+
CMP0048 # CMake 3.0
6666
CMP0051 # CMake 3.1
6767
CMP0054 # CMake 3.1
6868
CMP0060 # CMake 3.16.2
@@ -96,7 +96,7 @@ if (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" AND CMAKE_CXX_COMPILER_VERSION
9696
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS MIN_GCC_VERSION) OR
9797
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS MIN_CLANG_VERSION) OR
9898
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS MIN_APPLECLANG_VERSION))
99-
message(FATAL_ERROR "${BoldRed}\nGAMBIT requires at least g++ ${MIN_GCC_VERSION} or icpc ${MIN_ICC_VERSION}. Please install a newer compiler.${ColourReset}")
99+
message(FATAL_ERROR "${BoldRed}\nGAMBIT requires at least g++ ${MIN_GCC_VERSION}, clang++ ${MIN_CLANG_VERSION}, AppleClang ${MIN_APPLECLANG_VERSION}, or icpc ${MIN_ICC_VERSION}. Please install a newer compiler.${ColourReset}")
100100
endif()
101101

102102
# Don't relink all binaries when shared lib changes (programs will be rebuilt anyway if used headers change)
@@ -123,7 +123,7 @@ string(REGEX MATCH ";pybind;|;pybind11;|;Pybind;|;Pybind11;" DITCH_PYBIND ";${it
123123
# otherwise it seems to get it wrong. Also, we need to add versions of python
124124
# greater than 3.3 manually, for compatibility with CMake 2.8.12.
125125
# If pybind11 is ditched, do not worry about PythonLibs
126-
set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11)
126+
set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13)
127127
find_package(PythonInterp 3) # We require Python 3.
128128
if(PYTHONINTERP_FOUND)
129129
if(NOT DITCH_PYBIND)
@@ -365,7 +365,7 @@ if(EIGEN3_FOUND)
365365
else()
366366
message("${BoldRed} Eigen v3.1.0 or greater not found. FlexibleSUSY and GM2Calc interfaces will be excluded.${ColourReset}")
367367
set(itch "${itch};gm2calc;flexiblesusy")
368-
message(FATAL_ERROR "\nFlexibleSUSY is currently included in the GAMBIT distribution, so in fact it cannot be ditched. Please install Eigen3.\n(Note that this will change in future GAMBIT versions, where FlexibleSUSY will be a 'true' backend.)")
368+
message(FATAL_ERROR "\nFlexibleSUSY is currently included in the GAMBIT distribution, so in fact it cannot be ditched. Please install Eigen3.\nIf Eigen3 is already installed in a non-standard location, you can point CMake to it by passing -DEIGEN3_INCLUDE_DIR=/path/to/eigen on the command line, or by setting the environment variable EIGEN3_ROOT (or EIGEN3_ROOT_DIR).\n(Note that this will change in future GAMBIT versions, where FlexibleSUSY will be a 'true' backend.)")
369369
endif()
370370

371371
# Check for Gnu Scientific Library (GSL)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ GAMBIT is built using the [CMake](https://cmake.org/) system. GAMBIT depends on
6262
- gfortran >= 9 / ifort >=15.0.2
6363
- CMake 3.2.3 or greater
6464
- Python 3
65-
- Python modules: yaml, future, os, re, datetime, sys, getopt, shutil and itertools.
65+
- Python modules: yaml, os, re, datetime, sys, getopt, shutil and itertools.
6666
- git
6767
- Boost 1.48 or greater
6868
- GNU Scientific Library (GSL) 2.1 or greater
@@ -131,7 +131,7 @@ This will happen automatically if you install Python dependencies by our optiona
131131
Memory requirements
132132
--
133133

134-
For building the entirety of GAMBIT without optimisation, at least 10 GB of RAM is required. The build can be completed with less RAM than this if enough modules are ditched when running CMake, with e.g. `cmake -Ditch="ColliderBit;DarkBit" ..`, etc. See the Core paper ("GAMBIT: The Global and Modular Beyond-the-Standard-Model Inference Tool", the first link at the top of this README file) for further details of how to ditch components. For a list of commonly used CMake options, see the file CMAKE_FLAGS.md.
134+
For building the entirety of GAMBIT without optimisation, at least 10 GB of RAM is required. The build can be completed with less RAM than this if enough modules are ditched when running CMake, with e.g. `cmake -Ditch="ColliderBit;DarkBit" ..`, etc. See the Core paper ("GAMBIT: The Global and Modular Beyond-the-Standard-Model Inference Tool", the first link at the top of this README file) for further details of how to ditch components. For a list of commonly used CMake options, see the file BUILD_OPTIONS.md.
135135

136136
Building with optimisation enabled (e.g. using `-DCMAKE_BUILD_TYPE=Release`) may require more than 20 GB of RAM, depending on the compiler in use and precisely which optimisations it employs. Interprocedural optimisation in particular requires very large amounts of RAM. In general, Release mode is only intended for performance-critical applications, such as when running on supercomputer architectures. It is not advised for laptops.
137137

README_OSX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Configure GAMBIT. Key optional extras:
7474
cmake -D PYTHON_EXECUTABLE=/usr/bin/python3 -D PYTHON_LIBRARY=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/Current/Python3 -D PYTHON_INCLUDE_DIR=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Headers ..
7575
```
7676

77-
Now, see the instructions in the main README.md for possible make targets, and CMAKE_FLAGS.md for other cmake options.
77+
Now, see the instructions in the main README.md for possible make targets, and BUILD_OPTIONS.md for other cmake options.
7878

7979

8080
If you want to use Restframes, GReAT or the HepLike backend, prepare for some pain: you also need ROOT.

cmake/optional.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if(WITH_MPI)
7171
list(APPEND MPI_C_LIBRARIES "-L${GCC_LIB_DIR}")
7272
if (NOT MPI_CXX_FOUND)
7373
message("${Red}-- Warning: C MPI libraries found, but not C++ MPI libraries. Usually that's OK, but")
74-
message(" if you experience MPI linking errors, please install C++ MPI libraries as well.${CoulourReset}")
74+
message(" if you experience MPI linking errors, please install C++ MPI libraries as well.${ColourReset}")
7575
endif()
7676
endif()
7777

@@ -208,7 +208,6 @@ endif()
208208
if(NOT LAPACK_LINKLIBS AND NOT LAPACK_FOUND)
209209
# In future MN and FS need to be ditched if lapack cannot be found, and the build allowed to continue.
210210
message(FATAL_ERROR "${BoldRed}LAPACK shared library not found.${ColourReset}")
211-
message("${BoldCyan} X LAPACK shared library not found. Excluding FlexibleSUSY and MultiNest from GAMBIT configuration.${ColourReset}")
212211
endif()
213212

214213
# Helper function to check if ROOT has been compiled with the same standard as we are using here. If not, downgrade to the standard that ROOT was compiled with.
@@ -292,11 +291,12 @@ if(WITH_ROOT)
292291
if (ROOT_VERSION VERSION_LESS 6)
293292
set (ROOT_FOUND FALSE)
294293
endif()
294+
if(NOT ROOT_FOUND)
295+
message("${BoldCyan} X ROOT 6 not found at ROOTSYS=$ENV{ROOTSYS}. ROOT support will be disabled.${ColourReset}")
296+
endif()
295297
else()
296298
set (ROOT_FOUND FALSE)
297-
endif()
298-
if(NOT ROOT_FOUND)
299-
message("${BoldCyan} X ROOT 6 not found. ROOT support will be disabled.${ColourReset}")
299+
message("${BoldCyan} X ROOTSYS environment variable is not set. Please source ROOT's thisroot.sh setup script before running cmake. ROOT support will be disabled.${ColourReset}")
300300
endif()
301301
else()
302302
message("${BoldCyan} X ROOT support is deactivated. Set -DWITH_ROOT=ON to activate ROOT support in GAMBIT.${ColourReset}")

cmake/warnings.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ macro(set_compiler_warning warning current_flags)
3434
endmacro()
3535

3636
if(${WERROR})
37-
set_compiler_warning("error")
37+
set_compiler_warning("error" CMAKE_CXX_FLAGS)
3838
else()
3939
message(STATUS "Werror is disabled")
4040
endif()

0 commit comments

Comments
 (0)