Skip to content

Commit

Permalink
Merge pull request #1461 from STEllAR-GROUP/fixing_1430
Browse files Browse the repository at this point in the history
Consolidate inconsistent CMake option names
  • Loading branch information
hkaiser committed Apr 28, 2015
2 parents 4119257 + 61d0582 commit 2d50642
Show file tree
Hide file tree
Showing 129 changed files with 878 additions and 890 deletions.
322 changes: 180 additions & 142 deletions CMakeLists.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion circle.yml
Expand Up @@ -19,7 +19,7 @@ dependencies:
- docker pull ${IMAGE_NAME}
- mkdir build
override:
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} cmake .. -DHPX_MALLOC=system -DCMAKE_CXX_FLAGS="-fcolor-diagnostics"
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} cmake .. -DHPX_WITH_MALLOC=system -DCMAKE_CXX_FLAGS="-fcolor-diagnostics"
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 core
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 -k components
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 -k examples
Expand Down
4 changes: 2 additions & 2 deletions cmake/HPX_AddComponent.cmake
Expand Up @@ -101,7 +101,7 @@ macro(add_hpx_component name)
if(${name}_EXCLUDE_FROM_ALL)
set(exclude_from_all EXCLUDE_FROM_ALL)
else()
if(${name}_PLUGIN AND NOT HPX_STATIC_LINKING)
if(${name}_PLUGIN AND NOT HPX_WITH_STATIC_LINKING)
set(install_destination ${LIB}/hpx)
set(${name}_OUTPUT_SUFFIX hpx)
else()
Expand All @@ -124,7 +124,7 @@ macro(add_hpx_component name)
if(${${name}_STATIC})
set(${name}_lib_linktype STATIC)
else()
if(HPX_STATIC_LINKING)
if(HPX_WITH_STATIC_LINKING)
set(${name}_lib_linktype STATIC)
else()
set(${name}_lib_linktype SHARED)
Expand Down
4 changes: 2 additions & 2 deletions cmake/HPX_AddLibrary.cmake
Expand Up @@ -92,7 +92,7 @@ macro(add_hpx_library name)
if(${name}_EXCLUDE_FROM_ALL)
set(exclude_from_all EXCLUDE_FROM_ALL)
else()
if(${name}_PLUGIN AND NOT HPX_STATIC_LINKING)
if(${name}_PLUGIN AND NOT HPX_WITH_STATIC_LINKING)
set(install_destination ${LIB}/hpx)
set(${name}_OUTPUT_SUFFIX hpx)
else()
Expand All @@ -118,7 +118,7 @@ macro(add_hpx_library name)
if(${${name}_STATIC})
set(${name}_lib_linktype STATIC)
else()
if(HPX_STATIC_LINKING)
if(HPX_WITH_STATIC_LINKING)
set(${name}_lib_linktype STATIC)
else()
set(${name}_lib_linktype SHARED)
Expand Down
8 changes: 4 additions & 4 deletions cmake/HPX_AddTest.cmake
Expand Up @@ -52,7 +52,7 @@ macro(add_hpx_test category name)
NAME "${category}.${name}"
COMMAND ${cmd} ${args})
else()
if(HPX_PARCELPORT_IBVERBS)
if(HPX_WITH_PARCELPORT_IBVERBS)
set(_add_test FALSE)
if(DEFINED ${name}_PARCELPORTS)
set(PP_FOUND -1)
Expand All @@ -69,7 +69,7 @@ macro(add_hpx_test category name)
COMMAND ${cmd} "-p" "ibverbs" ${args})
endif()
endif()
if(HPX_PARCELPORT_IPC)
if(HPX_WITH_PARCELPORT_IPC)
set(_add_test FALSE)
if(DEFINED ${name}_PARCELPORTS)
set(PP_FOUND -1)
Expand All @@ -86,7 +86,7 @@ macro(add_hpx_test category name)
COMMAND ${cmd} "-p" "ipc" ${args})
endif()
endif()
if(HPX_PARCELPORT_MPI)
if(HPX_WITH_PARCELPORT_MPI)
set(_add_test FALSE)
if(DEFINED ${name}_PARCELPORTS)
set(PP_FOUND -1)
Expand All @@ -103,7 +103,7 @@ macro(add_hpx_test category name)
COMMAND ${cmd} "-p" "mpi" "-r" "mpi" ${args})
endif()
endif()
if(HPX_PARCELPORT_TCP)
if(HPX_WITH_PARCELPORT_TCP)
set(_add_test FALSE)
if(DEFINED ${name}_PARCELPORTS)
set(PP_FOUND -1)
Expand Down
16 changes: 8 additions & 8 deletions cmake/HPX_Documentation.cmake
Expand Up @@ -4,7 +4,7 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

if(HPX_BUILD_DOCUMENTATION)
if(HPX_WITH_DOCUMENTATION)
find_package(DocBook)
find_package(BoostQuickBook)
find_package(Doxygen)
Expand All @@ -16,19 +16,19 @@ if(HPX_BUILD_DOCUMENTATION)
# issue a meaningful warning if part of the documentation toolchain is not available
if(NOT DOCBOOK_FOUND)
hpx_error("DocBook DTD or XSL is unavailable, documentation generation disabled. Set DOCBOOK_ROOT to your DocBook installation directory.")
set(HPX_BUILD_DOCUMENTATION OFF)
set(HPX_WITH_DOCUMENTATION OFF)
elseif(NOT BOOSTQUICKBOOK_FOUND)
hpx_error("Boost QuickBook tool is unavailable, documentation generation disabled. Set BOOSTQUICKBOOK_ROOT or BOOST_ROOT to your Boost QuickBook installation directory.")
set(HPX_BUILD_DOCUMENTATION OFF)
set(HPX_WITH_DOCUMENTATION OFF)
elseif(NOT XSLTPROC_FOUND)
hpx_error("xsltproc tool is unavailable, documentation generation disabled. Add the xsltproc executable to your path or set XSLTPROC_ROOT.")
set(HPX_BUILD_DOCUMENTATION OFF)
set(HPX_WITH_DOCUMENTATION OFF)
elseif(NOT DOXYGEN_FOUND)
hpx_error("Doxygen tool is unavailable, API reference will be unavailable. Add the doxygen executable to your path or set the DOXYGEN_EXECUTABLE variable manually.")
set(HPX_BUILD_DOCUMENTATION OFF)
set(HPX_WITH_DOCUMENTATION OFF)
elseif(NOT BOOSTAUTOINDEX_FOUND)
hpx_error("Boost auto_index tool is unavailable, index generation will be disabled. Set BOOSTAUTOINDEX_ROOT to your Boost auto_index installation directory.")
set(HPX_BUILD_DOCUMENTATION OFF)
set(HPX_WITH_DOCUMENTATION OFF)
elseif(NOT FOP_FOUND)
hpx_warn("FOP is unavailable, PDF generation will be disabled. Set FOP_ROOT to your FOP installation directory.")
endif()
Expand Down Expand Up @@ -97,8 +97,8 @@ macro(hpx_quickbook_to_boostbook name)
endif()

set(git_commit_option "")
if(HPX_GIT_COMMIT AND NOT ${HPX_GIT_COMMIT} STREQUAL "")
set(git_commit_option "-D__hpx_git_commit__=${HPX_GIT_COMMIT}")
if(HPX_WITH_GIT_COMMIT AND NOT ${HPX_WITH_GIT_COMMIT} STREQUAL "")
set(git_commit_option "-D__hpx_git_commit__=${HPX_WITH_GIT_COMMIT}")
endif()

set(doxygen_option "")
Expand Down
6 changes: 3 additions & 3 deletions cmake/HPX_GitCommit.cmake
Expand Up @@ -11,13 +11,13 @@ if(GIT_FOUND)
execute_process(
COMMAND "${GIT_EXECUTABLE}" "log" "--pretty=%H" "-1" "${hpx_SOURCE_DIR}"
WORKING_DIRECTORY "${hpx_SOURCE_DIR}"
OUTPUT_VARIABLE HPX_GIT_COMMIT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_VARIABLE HPX_WITH_GIT_COMMIT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

if(NOT GIT_FOUND OR NOT HPX_GIT_COMMIT OR "${HPX_GIT_COMMIT}" STREQUAL "None")
if(NOT GIT_FOUND OR NOT HPX_WITH_GIT_COMMIT OR "${HPX_WITH_GIT_COMMIT}" STREQUAL "None")
hpx_warn("GIT commit not found (set to 'unknown').")
set(HPX_GIT_COMMIT "unknown")
else()
hpx_info("GIT commit is ${HPX_GIT_COMMIT}.")
hpx_info("GIT commit is ${HPX_WITH_GIT_COMMIT}.")
endif()

28 changes: 14 additions & 14 deletions cmake/HPX_SetupAllocator.cmake
Expand Up @@ -7,23 +7,23 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

if(NOT HPX_MALLOC)
set(HPX_MALLOC ${DEFAULT_MALLOC})
if(NOT HPX_WITH_MALLOC)
set(HPX_WITH_MALLOC ${DEFAULT_MALLOC})
set(allocator_error
"The default allocator for your system is ${DEFAULT_MALLOC}, but ${DEFAULT_MALLOC} could not be found. "
"The system allocator has poor performance. As such ${DEFAULT_MALLOC} is a strong optional requirement. "
"Being aware of the performance hit, you can override this default and get rid of this dependency by setting -DHPX_MALLOC=system. "
"Valid options for HPX_MALLOC are: system, tcmalloc, jemalloc, tbbmalloc, and custom")
"Being aware of the performance hit, you can override this default and get rid of this dependency by setting -DHPX_WITH_MALLOC=system. "
"Valid options for HPX_WITH_MALLOC are: system, tcmalloc, jemalloc, tbbmalloc, and custom")
else()
set(allocator_error
"HPX_MALLOC was set to ${HPX_MALLOC}, but ${HPX_MALLOC} could not be found. "
"Valid options for HPX_MALLOC are: system, tcmalloc, jemalloc, tbbmalloc, and custom")
"HPX_WITH_MALLOC was set to ${HPX_WITH_MALLOC}, but ${HPX_WITH_MALLOC} could not be found. "
"Valid options for HPX_WITH_MALLOC are: system, tcmalloc, jemalloc, tbbmalloc, and custom")
endif()

string(TOUPPER "${HPX_MALLOC}" HPX_MALLOC_UPPER)
string(TOUPPER "${HPX_WITH_MALLOC}" HPX_WITH_MALLOC_UPPER)

if(NOT HPX_MALLOC_DEFAULT)
if("${HPX_MALLOC_UPPER}" STREQUAL "TCMALLOC")
if(NOT HPX_WITH_MALLOC_DEFAULT)
if("${HPX_WITH_MALLOC_UPPER}" STREQUAL "TCMALLOC")
find_package(TCMalloc)
if(NOT TCMALLOC_LIBRARIES)
hpx_error(${allocator_error})
Expand All @@ -38,7 +38,7 @@ if(NOT HPX_MALLOC_DEFAULT)
set(_use_custom_allocator TRUE)
endif()

if("${HPX_MALLOC_UPPER}" STREQUAL "JEMALLOC")
if("${HPX_WITH_MALLOC_UPPER}" STREQUAL "JEMALLOC")
if(MSVC)
hpx_error("jemalloc is not usable with MSVC")
endif()
Expand All @@ -53,7 +53,7 @@ if(NOT HPX_MALLOC_DEFAULT)
set(_use_custom_allocator TRUE)
endif()

if("${HPX_MALLOC_UPPER}" STREQUAL "TBBMALLOC")
if("${HPX_WITH_MALLOC_UPPER}" STREQUAL "TBBMALLOC")
find_package(TBBmalloc)
if(NOT TBBMALLOC_LIBRARY AND NOT TBBMALLOC_PROXY_LIBRARY)
hpx_error(${allocator_error})
Expand All @@ -68,14 +68,14 @@ if(NOT HPX_MALLOC_DEFAULT)
set(_use_custom_allocator TRUE)
endif()

if("${HPX_MALLOC_UPPER}" STREQUAL "CUSTOM")
if("${HPX_WITH_MALLOC_UPPER}" STREQUAL "CUSTOM")
set(_use_custom_allocator TRUE)
endif()
else()
set(_use_custom_allocator TRUE)
endif()

if("${HPX_MALLOC_UPPER}" MATCHES "SYSTEM")
if("${HPX_WITH_MALLOC_UPPER}" MATCHES "SYSTEM")
if(NOT MSVC)
hpx_warn("HPX will perform poorly without tcmalloc or jemalloc. See docs for more info.")
endif()
Expand All @@ -94,4 +94,4 @@ if(_use_custom_allocator)
hpx_add_compile_flag_if_available(-fno-builtin-posix_memalign LANGUAGES CXX C)
endif()

hpx_info("Using ${HPX_MALLOC} allocator.")
hpx_info("Using ${HPX_WITH_MALLOC} allocator.")
8 changes: 4 additions & 4 deletions cmake/HPX_SetupBoost.cmake
Expand Up @@ -5,7 +5,7 @@

# We first try to find the required minimum set of Boost libraries. This will
# also give us the version of the found boost installation
if(HPX_STATIC_LINKING)
if(HPX_WITH_STATIC_LINKING)
set(Boost_USE_STATIC_LIBS ON)
endif()

Expand Down Expand Up @@ -109,7 +109,7 @@ endif()

# Boost preprocessor definitions
hpx_add_config_define(BOOST_PARAMETER_MAX_ARITY 7)
hpx_add_config_define(HPX_COROUTINE_ARG_MAX 1)
hpx_add_config_define(HPX_HAVE_COROUTINE_ARG_MAX 1)
if(MSVC)
HPX_option(HPX_WITH_BOOST_ALL_DYNAMIC_LINK BOOL "Add BOOST_ALL_DYN_LINK to compile flags" OFF)
if (HPX_WITH_BOOST_ALL_DYNAMIC_LINK)
Expand All @@ -118,8 +118,8 @@ if(MSVC)
else()
hpx_add_config_define(HPX_COROUTINE_NO_SEPARATE_CALL_SITES)
endif()
hpx_add_config_define(HPX_LOG_NO_TSS)
hpx_add_config_define(HPX_LOG_NO_TS)
hpx_add_config_define(HPX_HAVE_LOG_NO_TSS)
hpx_add_config_define(HPX_HAVE_LOG_NO_TS)
hpx_add_config_define(BOOST_BIGINT_HAS_NATIVE_INT64)

# Disable usage of std::atomics in lockfree
Expand Down
2 changes: 1 addition & 1 deletion cmake/HPX_SetupTarget.cmake
Expand Up @@ -65,7 +65,7 @@ function(hpx_setup_target target)
endif()

set(target_STATIC_LINKING OFF)
if(HPX_STATIC_LINKING)
if(HPX_WITH_STATIC_LINKING)
set(target_STATIC_LINKING ON)
else()
if(POLICY CMP0045)
Expand Down
30 changes: 15 additions & 15 deletions cmake/toolchains/BGION-gcc.cmake
Expand Up @@ -19,13 +19,13 @@ set(CMAKE_CXX_COMPILER g++)
set(CMAKE_C_COMPILER gcc)
#set(CMAKE_Fortran_COMPILER)

# Add flags we need for BGAS compilation
set(CMAKE_CXX_FLAGS_INIT
# Add flags we need for BGAS compilation
set(CMAKE_CXX_FLAGS_INIT
"-D__powerpc__ -D__bgion__ -I/gpfs/bbp.cscs.ch/home/biddisco/src/bgas/rdmahelper "
CACHE STRING "Initial compiler flags used to compile for BGAS"
)
# the V1R2M2 includes are necessary for some hardware specific features
#-DHPX_SMALL_STACK_SIZE=0x200000 -DHPX_MEDIUM_STACK_SIZE=0x200000 -DHPX_LARGE_STACK_SIZE=0x200000 -DHPX_HUGE_STACK_SIZE=0x200000
#-DHPX_SMALL_STACK_SIZE=0x200000 -DHPX_MEDIUM_STACK_SIZE=0x200000 -DHPX_LARGE_STACK_SIZE=0x200000 -DHPX_HUGE_STACK_SIZE=0x200000

set(CMAKE_EXE_LINKER_FLAGS_INIT "-L/gpfs/bbp.cscs.ch/apps/bgas/tools/gcc/gcc-4.8.2/install/lib64 -latomic -lrt" CACHE STRING "BGAS flags")

Expand All @@ -41,20 +41,20 @@ set(HPX_PLATFORM "native")
set(HPX_WITH_GENERIC_CONTEXT_COROUTINES OFF CACHE BOOL "diable generic coroutines")

# BGAS nodes support ibverbs
set(HPX_PARCELPORT_IBVERBS ON CACHE BOOL "")
set(HPX_WITH_PARCELPORT_IBVERBS ON CACHE BOOL "")

# Always disable the tcp parcelport as it is nonfunctional on the BGQ.
set(HPX_PARCELPORT_TCP ON CACHE BOOL "")
set(HPX_WITH_PARCELPORT_TCP ON CACHE BOOL "")

# Always enable the tcp parcelport as it is currently the only way to communicate on the BGQ.
set(HPX_PARCELPORT_MPI ON CACHE BOOL "")
set(HPX_WITH_PARCELPORT_MPI ON CACHE BOOL "")

# We have a bunch of cores on the A2 processor ...
set(HPX_MAX_CPU_COUNT "64" CACHE STRING "")
set(HPX_WITH_MAX_CPU_COUNT "64" CACHE STRING "")

# We have no custom malloc yet
if(NOT DEFINED HPX_MALLOC)
set(HPX_MALLOC "system" CACHE STRING "")
if(NOT DEFINED HPX_WITH_MALLOC)
set(HPX_WITH_MALLOC "system" CACHE STRING "")
endif()

set(HPX_HIDDEN_VISIBILITY OFF CACHE BOOL "")
Expand All @@ -72,11 +72,11 @@ set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Default build")
# Testing flags
#
set(BUILD_TESTING ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_BENCHMARKS ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_REGRESSIONS ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_UNIT ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_EXTERNAL_BUILD OFF CACHE BOOL "Turn off build of cmake build tests")
set(HPX_WITH_TESTS ON CACHE BOOL "Testing enabled by default")
set(HPX_WITH_TESTS_BENCHMARKS ON CACHE BOOL "Testing enabled by default")
set(HPX_WITH_TESTS_REGRESSIONS ON CACHE BOOL "Testing enabled by default")
set(HPX_WITH_TESTS_UNIT ON CACHE BOOL "Testing enabled by default")
set(HPX_WITH_TESTS_EXTERNAL_BUILD OFF CACHE BOOL "Turn off build of cmake build tests")
set(DART_TESTING_TIMEOUT 45 CACHE STRING "Life is too short")

#HPX_STATIC_LINKING
# HPX_WITH_STATIC_LINKING
12 changes: 6 additions & 6 deletions cmake/toolchains/BGQ.cmake
Expand Up @@ -48,18 +48,18 @@ set(CMAKE_CROSSCOMPILING ON)
set(HPX_PLATFORM "BlueGeneQ")

# Always disable the ibverbs parcelport as it is nonfunctional on the BGQ.
set(HPX_IBVERBS_PARCELPORT OFF)
set(HPX_WITH_IBVERBS_PARCELPORT OFF)

# Always disable the tcp parcelport as it is nonfunctional on the BGQ.
set(HPX_TCP_PARCELPORT OFF)
set(HPX_WITH_TCP_PARCELPORT OFF)

# Always enable the tcp parcelport as it is currently the only way to communicate on the BGQ.
set(HPX_MPI_PARCELPORT ON)
set(HPX_WITH_MPI_PARCELPORT ON)

# We have a bunch of cores on the BGQ ...
set(HPX_MAX_CPU_COUNT "64")
set(HPX_WITH_MAX_CPU_COUNT "64")

# We default to tbbmalloc as our allocator on the MIC
if(NOT DEFINED HPX_MALLOC)
set(HPX_MALLOC "system")
if(NOT DEFINED HPX_WITH_MALLOC)
set(HPX_WITH_MALLOC "system" CACHE STRING "")
endif()
10 changes: 5 additions & 5 deletions cmake/toolchains/Cray-Intel.cmake
Expand Up @@ -50,13 +50,13 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(HPX_PARCELPORT_TCP OFF CACHE BOOL "")
set(HPX_PARCELPORT_MPI ON CACHE BOOL "")
set(HPX_PARCELPORT_MPI_MULTITHREADED OFF CACHE BOOL "")
set(HPX_WITH_PARCELPORT_TCP OFF CACHE BOOL "")
set(HPX_WITH_PARCELPORT_MPI ON CACHE BOOL "")
set(HPX_WITH_PARCELPORT_MPI_MULTITHREADED OFF CACHE BOOL "")

# We default to system as our allocator on the BGQ
if(NOT DEFINED HPX_MALLOC)
set(HPX_MALLOC "system" CACHE STRING "")
if(NOT DEFINED HPX_WITH_MALLOC)
set(HPX_WITH_MALLOC "system" CACHE STRING "")
endif()

# We do a cross compilation here ...
Expand Down
8 changes: 4 additions & 4 deletions cmake/toolchains/XeonPhi.cmake
Expand Up @@ -36,14 +36,14 @@ set(CMAKE_CROSSCOMPILING ON)
set(HPX_PLATFORM "XeonPhi")

# Always disable the ibverbs parcelport as it is nonfunctional on the BGQ.
set(HPX_PARCELPORT_IBVERBS OFF CACHE BOOL "Enable the ibverbs based parcelport. This is currently an experimental feature")
set(HPX_WITH_PARCELPORT_IBVERBS OFF CACHE BOOL "Enable the ibverbs based parcelport. This is currently an experimental feature")

# We have a bunch of cores on the MIC ... increase the default
set(HPX_MAX_CPU_COUNT "256" CACHE STRING "")
set(HPX_WITH_MAX_CPU_COUNT "256" CACHE STRING "")

# We default to tbbmalloc as our allocator on the MIC
if(NOT DEFINED HPX_MALLOC)
set(HPX_MALLOC "tbbmalloc" CACHE STRING "")
if(NOT DEFINED HPX_WITH_MALLOC)
set(HPX_WITH_MALLOC "tbbmalloc" CACHE STRING "")
endif()

# Set the TBBMALLOC_PLATFORM correctly so that find_package(TBBMalloc) sets the
Expand Down

0 comments on commit 2d50642

Please sign in to comment.