Enable parallel tests.
[hoomd-blue.git] / CMake_build_options.cmake
blobe8ee89c19797df82facf6084950a0fa77fa04cfd
1 # Maintainer: joaander
3 #################################
4 ## Optional use of zlib to compress binary output files (defaults to off on windows)
5 if (WIN32)
6 option(ENABLE_ZLIB "When set to ON, a gzip compression option for binary output files is available" OFF)
7 else (WIN32)
8 option(ENABLE_ZLIB "When set to ON, a gzip compression option for binary output files is available" ON)
9 endif (WIN32)
11 #################################
12 ## Optional static build
13 ## ENABLE_STATIC is an option to control whether HOOMD is built as a statically linked exe or as a python module.
14 if (WIN32)
15 OPTION(ENABLE_STATIC "Link as many libraries as possible statically, cannot be changed after the first run of CMake" ON)
16 else (WIN32)
17 OPTION(ENABLE_STATIC "Link as many libraries as possible statically, cannot be changed after the first run of CMake" OFF)
18 endif (WIN32)
20 mark_as_advanced(ENABLE_STATIC)
22 #################################
23 ## Optional single/double precision build
24 option(SINGLE_PRECISION "Use single precision math" ON)
26 #####################3
27 ## CUDA related options
28 find_package(CUDA QUIET)
29 if (CUDA_FOUND)
30 option(ENABLE_CUDA "Enable the compilation of the CUDA GPU code" on)
31 else (CUDA_FOUND)
32 option(ENABLE_CUDA "Enable the compilation of the CUDA GPU code" off)
33 endif (CUDA_FOUND)
35 # disable CUDA if the intel compiler is detected
36 if (CMAKE_CXX_COMPILER MATCHES "icpc")
37     set(ENABLE_CUDA OFF CACHE BOOL "Forced OFF by the use of the intel c++ compiler" FORCE)
38 endif (CMAKE_CXX_COMPILER MATCHES "icpc")
40 if (ENABLE_CUDA)
41     # optional ocelot emulation mode (not tested any more)
42     # option(ENABLE_OCELOT "Enable ocelot emulation for CUDA GPU code" off)
43     # if (ENABLE_OCELOT)
44     #     set(CUDA_ARCH "11")
45     #     add_definitions(-DCUDA_ARCH=${CUDA_ARCH})
46     #     list(APPEND CUDA_NVCC_FLAGS -arch "sm_${CUDA_ARCH}")
47     # endif (ENABLE_OCELOT)
49     option(ENABLE_NVTOOLS "Enable NVTools profiler integration" off)
50 endif (ENABLE_CUDA)
52 ############################
53 ## MPI related options
54 find_package(MPI)
55 if (MPI_FOUND OR MPI_C_FOUND OR MPI_CXX_FOUND)
56 option(ENABLE_MPI "Enable the compilation of the MPI communication code" on)
57 else ()
58 option (ENABLE_MPI "Enable the compilation of the MPI communication code" off)
59 endif ()
61 #################################
62 ## Optionally enable documentation build
63 OPTION(ENABLE_DOXYGEN "Enables building of documentation with doxygen" OFF)
64 if (ENABLE_DOXYGEN)
65     find_package(Doxygen)
66     if (DOXYGEN_FOUND)
67         # get the doxygen version
68         exec_program(${DOXYGEN_EXECUTABLE} ${HOOMD_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE DOXYGEN_VERSION)
70         if (${DOXYGEN_VERSION} VERSION_GREATER 1.8.4)
71         else (${DOXYGEN_VERSION} VERSION_GREATER 1.8.4)
72             message(STATUS "Doxygen version less than 1.8.5, documentation may not build correctly")
73         endif (${DOXYGEN_VERSION} VERSION_GREATER 1.8.4)
74     endif ()
75 endif ()
77 ###############################
78 ## install python code into the system site dir, if a system python installation is desired
79 SET(PYTHON_SITEDIR "" CACHE STRING "System python site-packages directory to install python module code to. If unspecified, install to lib/hoomd/python-module")
80 if (PYTHON_SITEDIR)
81     set(HOOMD_PYTHON_MODULE_DIR ${PYTHON_SITEDIR})
82 else (PYTHON_SITEDIR)
83     set(HOOMD_PYTHON_MODULE_DIR ${LIB_INSTALL_DIR}/python-module)
84 endif (PYTHON_SITEDIR)
85 mark_as_advanced(PYTHON_SITEDIR)