diff --git a/CMakeLists.txt b/CMakeLists.txt index af7e2ea74173..924c1eaf830d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1265,7 +1265,7 @@ hpx_option( ) if(HPX_WITH_EXAMPLES_TBB) find_package(TBB) - if(NOT TBB_FOUND) + if(NOT Tbb_FOUND) set(HPX_WITH_EXAMPLES_TBB OFF) endif() endif() @@ -1277,7 +1277,7 @@ hpx_option( ) if(HPX_WITH_EXAMPLES_QTHREADS) find_package(QThreads) - if(NOT QTHREADS_FOUND) + if(NOT Qthreads_FOUND) set(HPX_WITH_EXAMPLES_QTHREADS OFF) endif() endif() @@ -1290,7 +1290,7 @@ hpx_option( ) if(HPX_WITH_EXAMPLES_HDF5) find_package(HDF5 COMPONENTS CXX) - if(NOT HDF5_FOUND) + if(NOT Hdf5_FOUND) set(HPX_WITH_EXAMPLES_HDF5 OFF) endif() endif() @@ -1305,7 +1305,7 @@ if(NOT "${HPX_PLATFORM_UC}" STREQUAL "BLUEGENEQ") ) if(HPX_WITH_EXAMPLES_QT4) find_package(Qt4) - if(NOT QT4_FOUND) + if(NOT Qt4_FOUND) set(HPX_WITH_EXAMPLES_QT4 OFF) endif() endif() @@ -2295,12 +2295,23 @@ add_subdirectory(components) # ############################################################################## # Tests # ############################################################################## -find_package(PythonInterp) +if(POLICY CMP0148) + find_package(Python COMPONENTS Interpreter) + if(NOT Python_FOUND) + hpx_warn( + "A python interpreter could not be found. The test suite can not be run automatically." + ) + endif() -if(NOT PYTHONINTERP_FOUND) - hpx_warn( - "A python interpreter could not be found. The test suite can not be run automatically." - ) +else() + find_package(PythonInterp) + if(NOT PYTHONINTERP_FOUND) + hpx_warn( + "A python interpreter could not be found. The test suite can not be run automatically." + ) + else() + set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) + endif() endif() if(HPX_WITH_TESTS) @@ -2326,7 +2337,7 @@ if(HPX_WITH_TOOLS OR HPX_WITH_TESTS_BENCHMARKS) endif() # Configure hpxrun.py -if(PYTHONINTERP_FOUND) +if(PYTHONINTERP_FOUND OR Python_FOUND) configure_file( "${PROJECT_SOURCE_DIR}/cmake/templates/hpxrun.py.in" "${PROJECT_BINARY_DIR}/bin/hpxrun.py" @ONLY @@ -2451,7 +2462,7 @@ endif() # ############################################################################## # installation instructions # ############################################################################## -if(PYTHONINTERP_FOUND) +if(PYTHONINTERP_FOUND OR Python_FOUND) install( FILES "${PROJECT_BINARY_DIR}/bin/hpxrun.py" DESTINATION ${CMAKE_INSTALL_BINDIR} diff --git a/cmake/FindAmplifier.cmake b/cmake/FindAmplifier.cmake index abdacd13ac93..41ffbf74434e 100644 --- a/cmake/FindAmplifier.cmake +++ b/cmake/FindAmplifier.cmake @@ -1,64 +1,73 @@ # Copyright (c) 2014 Thomas Heller -# Copyright (c) 2012 Hartmut Kaiser +# Copyright (c) 2012-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # 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 TARGET Amplifier::amplifier) + # compatibility with older CMake versions + if(AMPLIFIER_ROOT AND NOT Amplifier_ROOT) + set(Amplifier_ROOT + ${AMPLIFIER_ROOT} + CACHE PATH "Amplifier base directory" + ) + unset(AMPLIFIER_ROOT CACHE) + endif() + find_package(PkgConfig QUIET) pkg_check_modules(PC_AMPLIFIER QUIET amplifier) find_path( - AMPLIFIER_INCLUDE_DIR ittnotify.h - HINTS ${AMPLIFIER_ROOT} ENV AMPLIFIER_ROOT ${PC_AMPLIFIER_INCLUDEDIR} - ${PC_AMPLIFIER_INCLUDE_DIRS} + Amplifier_INCLUDE_DIR ittnotify.h + HINTS ${Amplifier_ROOT} ENV AMPLIFIER_ROOT ${PC_Amplifier_INCLUDEDIR} + ${PC_Amplifier_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - AMPLIFIER_LIBRARY + Amplifier_LIBRARY NAMES ittnotify libittnotify - HINTS ${AMPLIFIER_ROOT} ENV AMPLIFIER_ROOT ${PC_AMPLIFIER_LIBDIR} - ${PC_AMPLIFIER_LIBRARY_DIRS} + HINTS ${Amplifier_ROOT} ENV AMPLIFIER_ROOT ${PC_Amplifier_LIBDIR} + ${PC_Amplifier_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) - # Set AMPLIFIER_ROOT in case the other hints are used - if(AMPLIFIER_ROOT) + # Set Amplifier_ROOT in case the other hints are used + if(Amplifier_ROOT) # The call to file is for compatibility for windows paths - file(TO_CMAKE_PATH ${AMPLIFIER_ROOT} AMPLIFIER_ROOT) + file(TO_CMAKE_PATH ${Amplifier_ROOT} Amplifier_ROOT) elseif("$ENV{AMPLIFIER_ROOT}") - file(TO_CMAKE_PATH $ENV{AMPLIFIER_ROOT} AMPLIFIER_ROOT) + file(TO_CMAKE_PATH $ENV{AMPLIFIER_ROOT} Amplifier_ROOT) else() - file(TO_CMAKE_PATH "${AMPLIFIER_INCLUDE_DIR}" AMPLIFIER_INCLUDE_DIR) - string(REPLACE "/include" "" AMPLIFIER_ROOT "${AMPLIFIER_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Amplifier_INCLUDE_DIR}" Amplifier_INCLUDE_DIR) + string(REPLACE "/include" "" Amplifier_ROOT "${Amplifier_INCLUDE_DIR}") endif() - set(AMPLIFIER_LIBRARIES ${AMPLIFIER_LIBRARY}) - set(AMPLIFIER_INCLUDE_DIRS ${AMPLIFIER_INCLUDE_DIR}) + set(Amplifier_LIBRARIES ${Amplifier_LIBRARY}) + set(Amplifier_INCLUDE_DIRS ${Amplifier_INCLUDE_DIR}) find_package_handle_standard_args( - Amplifier DEFAULT_MSG AMPLIFIER_LIBRARY AMPLIFIER_INCLUDE_DIR + Amplifier DEFAULT_MSG Amplifier_LIBRARY Amplifier_INCLUDE_DIR ) get_property( _type - CACHE AMPLIFIER_ROOT + CACHE Amplifier_ROOT PROPERTY TYPE ) if(_type) - set_property(CACHE AMPLIFIER_ROOT PROPERTY ADVANCED 1) + set_property(CACHE Amplifier_ROOT PROPERTY ADVANCED 1) if("x${_type}" STREQUAL "xUNINITIALIZED") - set_property(CACHE AMPLIFIER_ROOT PROPERTY TYPE PATH) + set_property(CACHE Amplifier_ROOT PROPERTY TYPE PATH) endif() endif() - mark_as_advanced(AMPLIFIER_ROOT AMPLIFIER_LIBRARY AMPLIFIER_INCLUDE_DIR) + mark_as_advanced(Amplifier_ROOT Amplifier_LIBRARY Amplifier_INCLUDE_DIR) add_library(Amplifier::amplifier INTERFACE IMPORTED) target_include_directories( - Amplifier::amplifier SYSTEM INTERFACE ${AMPLIFIER_INCLUDE_DIR} + Amplifier::amplifier SYSTEM INTERFACE ${Amplifier_INCLUDE_DIR} ) - target_link_libraries(Amplifier::amplifier INTERFACE ${AMPLIFIER_LIBRARIES}) + target_link_libraries(Amplifier::amplifier INTERFACE ${Amplifier_LIBRARIES}) endif() diff --git a/cmake/FindAsio.cmake b/cmake/FindAsio.cmake index d66bcff352e5..76fea2033ddd 100644 --- a/cmake/FindAsio.cmake +++ b/cmake/FindAsio.cmake @@ -8,57 +8,67 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) if(NOT TARGET Asio::asio) + # compatibility with older CMake versions + if(ASIO_ROOT AND NOT Asio_ROOT) + set(Asio_ROOT + ${ASIO_ROOT} + CACHE PATH "Asio base directory" + ) + unset(ASIO_ROOT CACHE) + endif() + find_path( - ASIO_INCLUDE_DIR asio.hpp - HINTS "${ASIO_ROOT}" ENV ASIO_ROOT "${HPX_ASIO_ROOT}" + Asio_INCLUDE_DIR asio.hpp + HINTS "${Asio_ROOT}" ENV ASIO_ROOT "${HPX_ASIO_ROOT}" PATH_SUFFIXES include ) - if(NOT ASIO_INCLUDE_DIR) + if(NOT Asio_INCLUDE_DIR) hpx_error( - "Could not find Asio. Set ASIO_ROOT as a CMake or environment variable to point to the Asio root install directory. Alternatively, set HPX_WITH_FETCH_ASIO=ON to fetch Asio using CMake's FetchContent (when using this option Asio will be installed together with HPX, be careful about conflicts with separately installed versions of Asio)." + "Could not find Asio. Set Asio_ROOT as a CMake or environment variable to point to the Asio root install directory. Alternatively, set HPX_WITH_FETCH_ASIO=ON to fetch Asio using CMake's FetchContent (when using this option Asio will be installed together with HPX, be careful about conflicts with separately installed versions of Asio)." ) endif() - # Set ASIO_ROOT in case the other hints are used - if(ASIO_ROOT) + # Set Asio_ROOT in case the other hints are used + if(Asio_ROOT) # The call to file is for compatibility with windows paths - file(TO_CMAKE_PATH ${ASIO_ROOT} ASIO_ROOT) + file(TO_CMAKE_PATH ${Asio_ROOT} Asio_ROOT) elseif("$ENV{ASIO_ROOT}") - file(TO_CMAKE_PATH $ENV{ASIO_ROOT} ASIO_ROOT) + file(TO_CMAKE_PATH $ENV{ASIO_ROOT} Asio_ROOT) else() - file(TO_CMAKE_PATH "${ASIO_INCLUDE_DIR}" ASIO_INCLUDE_DIR) - string(REPLACE "/include" "" ASIO_ROOT "${ASIO_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Asio_INCLUDE_DIR}" Asio_INCLUDE_DIR) + string(REPLACE "/include" "" Asio_ROOT "${Asio_INCLUDE_DIR}") endif() - if(ASIO_INCLUDE_DIR AND EXISTS "${ASIO_INCLUDE_DIR}/asio/version.hpp") + if(Asio_INCLUDE_DIR AND EXISTS "${Asio_INCLUDE_DIR}/asio/version.hpp") # Matches a line of the form: # # #define ASIO_VERSION XXYYZZ // XX.YY.ZZ # # with arbitrary whitespace between the tokens file( - STRINGS "${ASIO_INCLUDE_DIR}/asio/version.hpp" ASIO_VERSION_DEFINE_LINE + STRINGS "${Asio_INCLUDE_DIR}/asio/version.hpp" Asio_VERSION_DEFINE_LINE REGEX "#define[ \t]+ASIO_VERSION[ \t]+[0-9]+[ \t]+//[ \t]+[0-9]+\.[0-9]+\.[0-9]+[ \t]*" ) # Extracts the dotted version number after the comment as - # ASIO_VERSION_STRING + # Asio_VERSION_STRING string(REGEX REPLACE "#define ASIO_VERSION [0-9]+ // ([0-9]+\.[0-9]+\.[0-9]+)" - "\\1" ASIO_VERSION_STRING "${ASIO_VERSION_DEFINE_LINE}" + "\\1" Asio_VERSION_STRING "${Asio_VERSION_DEFINE_LINE}" ) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args( Asio - REQUIRED_VARS ASIO_INCLUDE_DIR - VERSION_VAR ASIO_VERSION_STRING + REQUIRED_VARS Asio_INCLUDE_DIR + VERSION_VAR Asio_VERSION_STRING + FOUND_VAR Asio_FOUND ) add_library(Asio::asio INTERFACE IMPORTED) - target_include_directories(Asio::asio SYSTEM INTERFACE ${ASIO_INCLUDE_DIR}) + target_include_directories(Asio::asio SYSTEM INTERFACE ${Asio_INCLUDE_DIR}) - mark_as_advanced(ASIO_ROOT ASIO_INCLUDE_DIR ASIO_VERSION_STRING) + mark_as_advanced(Asio_ROOT Asio_INCLUDE_DIR Asio_VERSION_STRING) endif() diff --git a/cmake/FindBreathe.cmake b/cmake/FindBreathe.cmake index f8fc8bc14d74..a43963c2bba5 100644 --- a/cmake/FindBreathe.cmake +++ b/cmake/FindBreathe.cmake @@ -4,16 +4,25 @@ # 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) +# compatibility with older CMake versions +if(BREATHE_APIDOC_ROOT AND NOT Breathe_APIDOC_ROOT) + set(Breathe_APIDOC_ROOT + ${BREATHE_APIDOC_ROOT} + CACHE PATH "Breathe base directory" + ) + unset(BREATHE_ROOT CACHE) +endif() + find_program( - BREATHE_APIDOC_EXECUTABLE + Breathe_APIDOC_EXECUTABLE NAMES breathe-apidoc - PATHS ${BREATHE_APIDOC_ROOT} ENV BREATHE_APIDOC_ROOT + PATHS ${Breathe_APIDOC_ROOT} ENV Breathe_APIDOC_ROOT DOC "Path to breathe-apidoc executable" ) -if(BREATHE_APIDOC_EXECUTABLE) +if(Breathe_APIDOC_EXECUTABLE) include(FindPackageHandleStandardArgs) find_package_handle_standard_args( - Breathe DEFAULT_MESSAGE BREATHE_APIDOC_EXECUTABLE + Breathe DEFAULT_MESSAGE Breathe_APIDOC_EXECUTABLE ) endif() diff --git a/cmake/FindHwloc.cmake b/cmake/FindHwloc.cmake index cdede78fb68b..ad52ce4af7d7 100644 --- a/cmake/FindHwloc.cmake +++ b/cmake/FindHwloc.cmake @@ -1,5 +1,5 @@ # Copyright (c) 2014 Thomas Heller -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2010-2011 Matt Anderson # Copyright (c) 2011 Bryce Lelbach # @@ -8,69 +8,78 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) if(NOT TARGET Hwloc::hwloc) + # compatibility with older CMake versions + if(HWLOC_ROOT AND NOT Hwloc_ROOT) + set(Hwloc_ROOT + ${HWLOC_ROOT} + CACHE PATH "Hwloc base directory" + ) + unset(HWLOC_ROOT CACHE) + endif() + find_package(PkgConfig QUIET) pkg_check_modules(PC_HWLOC QUIET hwloc) find_path( - HWLOC_INCLUDE_DIR hwloc.h - HINTS ${HWLOC_ROOT} + Hwloc_INCLUDE_DIR hwloc.h + HINTS ${Hwloc_ROOT} ENV HWLOC_ROOT ${HPX_HWLOC_ROOT} - ${PC_HWLOC_MINIMAL_INCLUDEDIR} - ${PC_HWLOC_MINIMAL_INCLUDE_DIRS} - ${PC_HWLOC_INCLUDEDIR} - ${PC_HWLOC_INCLUDE_DIRS} + ${PC_Hwloc_MINIMAL_INCLUDEDIR} + ${PC_Hwloc_MINIMAL_INCLUDE_DIRS} + ${PC_Hwloc_INCLUDEDIR} + ${PC_Hwloc_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - HWLOC_LIBRARY + Hwloc_LIBRARY NAMES hwloc libhwloc - HINTS ${HWLOC_ROOT} + HINTS ${Hwloc_ROOT} ENV HWLOC_ROOT - ${HPX_HWLOC_ROOT} - ${PC_HWLOC_MINIMAL_LIBDIR} - ${PC_HWLOC_MINIMAL_LIBRARY_DIRS} - ${PC_HWLOC_LIBDIR} - ${PC_HWLOC_LIBRARY_DIRS} + ${HPX_Hwloc_ROOT} + ${PC_Hwloc_MINIMAL_LIBDIR} + ${PC_Hwloc_MINIMAL_LIBRARY_DIRS} + ${PC_Hwloc_LIBDIR} + ${PC_Hwloc_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) - # Set HWLOC_ROOT in case the other hints are used - if(HWLOC_ROOT) + # Set Hwloc_ROOT in case the other hints are used + if(Hwloc_ROOT) # The call to file is for compatibility with windows paths - file(TO_CMAKE_PATH ${HWLOC_ROOT} HWLOC_ROOT) + file(TO_CMAKE_PATH ${Hwloc_ROOT} Hwloc_ROOT) elseif("$ENV{HWLOC_ROOT}") - file(TO_CMAKE_PATH $ENV{HWLOC_ROOT} HWLOC_ROOT) + file(TO_CMAKE_PATH $ENV{HWLOC_ROOT} Hwloc_ROOT) else() - file(TO_CMAKE_PATH "${HWLOC_INCLUDE_DIR}" HWLOC_INCLUDE_DIR) - string(REPLACE "/include" "" HWLOC_ROOT "${HWLOC_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Hwloc_INCLUDE_DIR}" Hwloc_INCLUDE_DIR) + string(REPLACE "/include" "" Hwloc_ROOT "${Hwloc_INCLUDE_DIR}") endif() - set(HWLOC_LIBRARIES ${HWLOC_LIBRARY}) - set(HWLOC_INCLUDE_DIRS ${HWLOC_INCLUDE_DIR}) + set(Hwloc_LIBRARIES ${Hwloc_LIBRARY}) + set(Hwloc_INCLUDE_DIRS ${Hwloc_INCLUDE_DIR}) find_package_handle_standard_args( - Hwloc DEFAULT_MSG HWLOC_LIBRARY HWLOC_INCLUDE_DIR + Hwloc DEFAULT_MSG Hwloc_LIBRARY Hwloc_INCLUDE_DIR ) get_property( _type - CACHE HWLOC_ROOT + CACHE Hwloc_ROOT PROPERTY TYPE ) if(_type) - set_property(CACHE HWLOC_ROOT PROPERTY ADVANCED 1) + set_property(CACHE Hwloc_ROOT PROPERTY ADVANCED 1) if("x${_type}" STREQUAL "xUNINITIALIZED") - set_property(CACHE HWLOC_ROOT PROPERTY TYPE PATH) + set_property(CACHE Hwloc_ROOT PROPERTY TYPE PATH) endif() endif() add_library(Hwloc::hwloc INTERFACE IMPORTED) - target_include_directories(Hwloc::hwloc SYSTEM INTERFACE ${HWLOC_INCLUDE_DIR}) - target_link_libraries(Hwloc::hwloc INTERFACE ${HWLOC_LIBRARIES}) + target_include_directories(Hwloc::hwloc SYSTEM INTERFACE ${Hwloc_INCLUDE_DIR}) + target_link_libraries(Hwloc::hwloc INTERFACE ${Hwloc_LIBRARIES}) - mark_as_advanced(HWLOC_ROOT HWLOC_LIBRARY HWLOC_INCLUDE_DIR) + mark_as_advanced(Hwloc_ROOT Hwloc_LIBRARY Hwloc_INCLUDE_DIR) endif() diff --git a/cmake/FindJemalloc.cmake b/cmake/FindJemalloc.cmake index facccbbb7ca5..e828a39b5170 100644 --- a/cmake/FindJemalloc.cmake +++ b/cmake/FindJemalloc.cmake @@ -1,5 +1,5 @@ # Copyright (c) 2014 Thomas Heller -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2010-2011 Matt Anderson # Copyright (c) 2011 Bryce Lelbach # @@ -7,19 +7,28 @@ # 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) +# compatibility with older CMake versions +if(JEMALLOC_ROOT AND NOT Jemalloc_ROOT) + set(Jemalloc_ROOT + ${JEMALLOC_ROOT} + CACHE PATH "Jemalloc base directory" + ) + unset(JEMALLOC_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) pkg_check_modules(PC_JEMALLOC QUIET jemalloc) find_path( - JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h - HINTS ${JEMALLOC_ROOT} + Jemalloc_INCLUDE_DIR jemalloc/jemalloc.h + HINTS ${Jemalloc_ROOT} ENV - JEMALLOC_ROOT - ${HPX_JEMALLOC_ROOT} - ${PC_JEMALLOC_MINIMAL_INCLUDEDIR} - ${PC_JEMALLOC_MINIMAL_INCLUDE_DIRS} - ${PC_JEMALLOC_INCLUDEDIR} - ${PC_JEMALLOC_INCLUDE_DIRS} + Jemalloc_ROOT + ${HPX_Jemalloc_ROOT} + ${PC_Jemalloc_MINIMAL_INCLUDEDIR} + ${PC_Jemalloc_MINIMAL_INCLUDE_DIRS} + ${PC_Jemalloc_INCLUDEDIR} + ${PC_Jemalloc_INCLUDE_DIRS} PATH_SUFFIXES include ) @@ -27,68 +36,68 @@ if(MSVC) # MSVC needs additional header files provided by jemalloc to compensate for # missing posix headers find_path( - JEMALLOC_ADDITIONAL_INCLUDE_DIR msvc_compat/strings.h - HINTS ${JEMALLOC_ROOT} + Jemalloc_ADDITIONAL_INCLUDE_DIR msvc_compat/strings.h + HINTS ${Jemalloc_ROOT} ENV - JEMALLOC_ROOT - ${HPX_JEMALLOC_ROOT} - ${PC_JEMALLOC_MINIMAL_INCLUDEDIR} - ${PC_JEMALLOC_MINIMAL_INCLUDE_DIRS} - ${PC_JEMALLOC_INCLUDEDIR} - ${PC_JEMALLOC_INCLUDE_DIRS} + Jemalloc_ROOT + ${HPX_Jemalloc_ROOT} + ${PC_Jemalloc_MINIMAL_INCLUDEDIR} + ${PC_Jemalloc_MINIMAL_INCLUDE_DIRS} + ${PC_Jemalloc_INCLUDEDIR} + ${PC_Jemalloc_INCLUDE_DIRS} PATH_SUFFIXES include ) endif() -# Set JEMALLOC_ROOT in case the other hints are used -if(JEMALLOC_ROOT) +# Set Jemalloc_ROOT in case the other hints are used +if(Jemalloc_ROOT) # The call to file is for compatibility with windows paths - file(TO_CMAKE_PATH ${JEMALLOC_ROOT} JEMALLOC_ROOT) + file(TO_CMAKE_PATH ${Jemalloc_ROOT} Jemalloc_ROOT) elseif("$ENV{JEMALLOC_ROOT}") - file(TO_CMAKE_PATH $ENV{JEMALLOC_ROOT} JEMALLOC_ROOT) + file(TO_CMAKE_PATH $ENV{JEMALLOC_ROOT} Jemalloc_ROOT) else() - file(TO_CMAKE_PATH "${JEMALLOC_INCLUDE_DIR}" JEMALLOC_INCLUDE_DIR) - string(REPLACE "/include" "" JEMALLOC_ROOT "${JEMALLOC_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Jemalloc_INCLUDE_DIR}" Jemalloc_INCLUDE_DIR) + string(REPLACE "/include" "" Jemalloc_ROOT "${Jemalloc_INCLUDE_DIR}") endif() find_library( - JEMALLOC_LIBRARY + Jemalloc_LIBRARY NAMES jemalloc libjemalloc - HINTS ${JEMALLOC_ROOT} + HINTS ${Jemalloc_ROOT} ENV - JEMALLOC_ROOT - ${HPX_JEMALLOC_ROOT} - ${PC_JEMALLOC_MINIMAL_LIBDIR} - ${PC_JEMALLOC_MINIMAL_LIBRARY_DIRS} - ${PC_JEMALLOC_LIBDIR} - ${PC_JEMALLOC_LIBRARY_DIRS} + Jemalloc_ROOT + ${HPX_Jemalloc_ROOT} + ${PC_Jemalloc_MINIMAL_LIBDIR} + ${PC_Jemalloc_MINIMAL_LIBRARY_DIRS} + ${PC_Jemalloc_LIBDIR} + ${PC_Jemalloc_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) -# Set JEMALLOC_ROOT in case the other hints are used -if(NOT JEMALLOC_ROOT AND "$ENV{JEMALLOC_ROOT}") - set(JEMALLOC_ROOT $ENV{JEMALLOC_ROOT}) -elseif(NOT JEMALLOC_ROOT) - string(REPLACE "/include" "" JEMALLOC_ROOT "${JEMALLOC_INCLUDE_DIR}") +# Set Jemalloc_ROOT in case the other hints are used +if(NOT Jemalloc_ROOT AND "$ENV{JEMALLOC_ROOT}") + set(Jemalloc_ROOT $ENV{JEMALLOC_ROOT}) +elseif(NOT Jemalloc_ROOT) + string(REPLACE "/include" "" Jemalloc_ROOT "${Jemalloc_INCLUDE_DIR}") endif() -set(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY}) -set(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR}) +set(Jemalloc_LIBRARIES ${Jemalloc_LIBRARY}) +set(Jemalloc_INCLUDE_DIRS ${Jemalloc_INCLUDE_DIR}) find_package_handle_standard_args( - Jemalloc DEFAULT_MSG JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR + Jemalloc DEFAULT_MSG Jemalloc_LIBRARY Jemalloc_INCLUDE_DIR ) get_property( _type - CACHE JEMALLOC_ROOT + CACHE Jemalloc_ROOT PROPERTY TYPE ) if(_type) - set_property(CACHE JEMALLOC_ROOT PROPERTY ADVANCED 1) + set_property(CACHE Jemalloc_ROOT PROPERTY ADVANCED 1) if("x${_type}" STREQUAL "xUNINITIALIZED") - set_property(CACHE JEMALLOC_ROOT PROPERTY TYPE PATH) + set_property(CACHE Jemalloc_ROOT PROPERTY TYPE PATH) endif() endif() -mark_as_advanced(JEMALLOC_ROOT JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR) +mark_as_advanced(Jemalloc_ROOT Jemalloc_LIBRARY Jemalloc_INCLUDE_DIR) diff --git a/cmake/FindLibSigSegv.cmake b/cmake/FindLibSigSegv.cmake index 150c31965660..e37bac02a0b6 100644 --- a/cmake/FindLibSigSegv.cmake +++ b/cmake/FindLibSigSegv.cmake @@ -1,64 +1,74 @@ # Copyright (c) 2017 Abhimanyu Rawat +# # SPDX-License-Identifier: BSL-1.0 # 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) +# compatibility with older CMake versions +if(LIBSIGSEGV_ROOT AND NOT Libsigsegv_ROOT) + set(Libsigsegv_ROOT + ${LIBSIGSEGV_ROOT} + CACHE PATH "Libsigsegv base directory" + ) + unset(LIBSIGSEGV_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) pkg_check_modules(PC_LIBSIGSEGV QUIET libsigsegv) find_path( - LIBSIGSEGV_INCLUDE_DIR sigsegv.h - HINTS ${LIBSIGSEGV_ROOT} + Libsigsegv_INCLUDE_DIR sigsegv.h + HINTS ${Libsigsegv_ROOT} ENV - LIBSIGSEGV_ROOT - ${PC_LIBSIGSEGV_MINIMAL_INCLUDEDIR} - ${PC_LIBSIGSEGV_MINIMAL_INCLUDE_DIRS} - ${PC_LIBSIGSEGV_INCLUDEDIR} - ${PC_LIBSIGSEGV_INCLUDE_DIRS} + Libsigsegv_ROOT + ${PC_Libsigsegv_MINIMAL_INCLUDEDIR} + ${PC_Libsigsegv_MINIMAL_INCLUDE_DIRS} + ${PC_Libsigsegv_INCLUDEDIR} + ${PC_Libsigsegv_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - LIBSIGSEGV_LIBRARY + Libsigsegv_LIBRARY NAMES sigsegv libsigsegv - HINTS ${LIBSIGSEGV_ROOT} + HINTS ${Libsigsegv_ROOT} ENV - LIBSIGSEGV_ROOT - ${PC_LIBSIGSEGV_MINIMAL_LIBDIR} - ${PC_LIBSIGSEGV_MINIMAL_LIBRARY_DIRS} - ${PC_LIBSIGSEGV_LIBDIR} - ${PC_LIBSIGSEGV_LIBRARY_DIRS} + Libsigsegv_ROOT + ${PC_Libsigsegv_MINIMAL_LIBDIR} + ${PC_Libsigsegv_MINIMAL_LIBRARY_DIRS} + ${PC_Libsigsegv_LIBDIR} + ${PC_Libsigsegv_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) -# Set LIBSIGSEGV_ROOT in case the other hints are used -if(LIBSIGSEGV_ROOT) +# Set Libsigsegv_ROOT in case the other hints are used +if(Libsigsegv_ROOT) # The call to file is for compatibility with windows paths - file(TO_CMAKE_PATH ${LIBSIGSEGV_ROOT} LIBSIGSEGV_ROOT) + file(TO_CMAKE_PATH ${Libsigsegv_ROOT} Libsigsegv_ROOT) elseif("$ENV{LIBSIGSEGV_ROOT}") - file(TO_CMAKE_PATH $ENV{LIBSIGSEGV_ROOT} LIBSIGSEGV_ROOT) + file(TO_CMAKE_PATH $ENV{LIBSIGSEGV_ROOT} Libsigsegv_ROOT) else() - file(TO_CMAKE_PATH "${LIBSIGSEGV_INCLUDE_DIR}" LIBSIGSEGV_INCLUDE_DIR) - string(REPLACE "/include" "" LIBSIGSEGV_ROOT "${LIBSIGSEGV_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Libsigsegv_INCLUDE_DIR}" Libsigsegv_INCLUDE_DIR) + string(REPLACE "/include" "" Libsigsegv_ROOT "${Libsigsegv_INCLUDE_DIR}") endif() -set(LIBSIGSEGV_LIBRARIES ${LIBSIGSEGV_LIBRARY}) -set(LIBSIGSEGV_INCLUDE_DIRS ${LIBSIGSEGV_INCLUDE_DIR}) +set(Libsigsegv_LIBRARIES ${Libsigsegv_LIBRARY}) +set(Libsigsegv_INCLUDE_DIRS ${Libsigsegv_INCLUDE_DIR}) find_package_handle_standard_args( - LibSigSegv DEFAULT_MSG LIBSIGSEGV_LIBRARY LIBSIGSEGV_INCLUDE_DIR + LibSigSegv DEFAULT_MSG Libsigsegv_LIBRARY Libsigsegv_INCLUDE_DIR ) get_property( _type - CACHE LIBSIGSEGV_ROOT + CACHE Libsigsegv_ROOT PROPERTY TYPE ) if(_type) - set_property(CACHE LIBSIGSEGV_ROOT PROPERTY ADVANCED 1) + set_property(CACHE Libsigsegv_ROOT PROPERTY ADVANCED 1) if("x${_type}" STREQUAL "xUNINITIALIZED") - set_property(CACHE LIBSIGSEGV_ROOT PROPERTY TYPE PATH) + set_property(CACHE Libsigsegv_ROOT PROPERTY TYPE PATH) endif() endif() -mark_as_advanced(LIBSIGSEGV_ROOT LIBSIGSEGV_LIBRARY LIBSIGSEGV_INCLUDE_DIR) +mark_as_advanced(Libsigsegv_ROOT Libsigsegv_LIBRARY Libsigsegv_INCLUDE_DIR) diff --git a/cmake/FindLibfabric.cmake b/cmake/FindLibfabric.cmake index d5a9ae06408a..ce6a3a247835 100644 --- a/cmake/FindLibfabric.cmake +++ b/cmake/FindLibfabric.cmake @@ -4,42 +4,51 @@ # 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) +# compatibility with older CMake versions +if(LIBFABRIC_ROOT AND NOT Libfabric_ROOT) + set(Libfabric_ROOT + ${LIBFABRIC_ROOT} + CACHE PATH "Libfabric base directory" + ) + unset(LIBFABRIC_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) pkg_check_modules(PC_LIBFABRIC QUIET libfabric) find_path( - LIBFABRIC_INCLUDE_DIR rdma/fabric.h - HINTS ${LIBFABRIC_ROOT} ENV LIBFABRIC_ROOT ${LIBFABRIC_DIR} ENV LIBFABRIC_DIR + Libfabric_INCLUDE_DIR rdma/fabric.h + HINTS ${Libfabric_ROOT} ENV LIBFABRIC_ROOT ${Libfabric_DIR} ENV LIBFABRIC_DIR PATH_SUFFIXES include ) find_library( - LIBFABRIC_LIBRARY + Libfabric_LIBRARY NAMES fabric - HINTS ${LIBFABRIC_ROOT} ENV LIBFABRIC_ROOT + HINTS ${Libfabric_ROOT} ENV LIBFABRIC_ROOT PATH_SUFFIXES lib lib64 ) -# Set LIBFABRIC_ROOT in case the other hints are used -if(LIBFABRIC_ROOT) +# Set Libfabric_ROOT in case the other hints are used +if(Libfabric_ROOT) # The call to file is for compatibility with windows paths - file(TO_CMAKE_PATH ${LIBFABRIC_ROOT} LIBFABRIC_ROOT) + file(TO_CMAKE_PATH ${Libfabric_ROOT} Libfabric_ROOT) elseif("$ENV{LIBFABRIC_ROOT}") - file(TO_CMAKE_PATH $ENV{LIBFABRIC_ROOT} LIBFABRIC_ROOT) + file(TO_CMAKE_PATH $ENV{LIBFABRIC_ROOT} Libfabric_ROOT) else() - file(TO_CMAKE_PATH "${LIBFABRIC_INCLUDE_DIR}" LIBFABRIC_INCLUDE_DIR) - string(REPLACE "/include" "" LIBFABRIC_ROOT "${LIBFABRIC_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Libfabric_INCLUDE_DIR}" Libfabric_INCLUDE_DIR) + string(REPLACE "/include" "" Libfabric_ROOT "${Libfabric_INCLUDE_DIR}") endif() -if(NOT LIBFABRIC_INCLUDE_DIR OR NOT LIBFABRIC_LIBRARY) - hpx_error("Could not find LIBFABRIC_INCLUDE_DIR or LIBFABRIC_LIBRARY please \ - set the LIBFABRIC_ROOT environment variable" +if(NOT Libfabric_INCLUDE_DIR OR NOT Libfabric_LIBRARY) + hpx_error("Could not find Libfabric_INCLUDE_DIR or Libfabric_LIBRARY please \ + set the Libfabric_ROOT environment variable" ) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args( - Libfabric DEFAULT_MSG LIBFABRIC_LIBRARY LIBFABRIC_INCLUDE_DIR + Libfabric DEFAULT_MSG Libfabric_LIBRARY Libfabric_INCLUDE_DIR ) -mark_as_advanced(LIBFABRIC_ROOT) +mark_as_advanced(Libfabric_ROOT) diff --git a/cmake/FindMSR.cmake b/cmake/FindMSR.cmake index 13edbd17aa0e..fb7c2a41526c 100644 --- a/cmake/FindMSR.cmake +++ b/cmake/FindMSR.cmake @@ -8,48 +8,57 @@ # 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) +# compatibility with older CMake versions +if(MSR_ROOT AND NOT Msr_ROOT) + set(Msr_ROOT + ${MSR_ROOT} + CACHE PATH "Msr base directory" + ) + unset(MSR_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) pkg_check_modules(PC_MSR QUIET libmsr) find_path( - MSR_INCLUDE_DIR msr_core.h - HINTS ${MSR_ROOT} ENV MSR_ROOT ${PC_MSR_INCLUDEDIR} ${PC_MSR_INCLUDE_DIRS} + Msr_INCLUDE_DIR msr_core.h + HINTS ${Msr_ROOT} ENV MSR_ROOT ${PC_Msr_INCLUDEDIR} ${PC_Msr_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - MSR_LIBRARY + Msr_LIBRARY NAMES msr libmsr - HINTS ${MSR_ROOT} ENV MSR_ROOT ${PC_MSR_LIBDIR} ${PC_MSR_LIBRARY_DIRS} + HINTS ${Msr_ROOT} ENV MSR_ROOT ${PC_Msr_LIBDIR} ${PC_Msr_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) -# Set MSR_ROOT in case the other hints are used -if(MSR_ROOT) +# Set Msr_ROOT in case the other hints are used +if(Msr_ROOT) # The call to file is for compatibility with windows paths - file(TO_CMAKE_PATH ${MSR_ROOT} MSR_ROOT) + file(TO_CMAKE_PATH ${Msr_ROOT} Msr_ROOT) elseif("$ENV{MSR_ROOT}") - file(TO_CMAKE_PATH $ENV{MSR_ROOT} MSR_ROOT) + file(TO_CMAKE_PATH $ENV{MSR_ROOT} Msr_ROOT) else() - file(TO_CMAKE_PATH "${MSR_INCLUDE_DIR}" MSR_INCLUDE_DIR) - string(REPLACE "/include" "" MSR_ROOT "${MSR_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Msr_INCLUDE_DIR}" Msr_INCLUDE_DIR) + string(REPLACE "/include" "" Msr_ROOT "${Msr_INCLUDE_DIR}") endif() -set(MSR_LIBRARIES ${MSR_LIBRARY}) -set(MSR_INCLUDE_DIRS ${MSR_INCLUDE_DIR}) +set(Msr_LIBRARIES ${Msr_LIBRARY}) +set(Msr_INCLUDE_DIRS ${Msr_INCLUDE_DIR}) -find_package_handle_standard_args(MSR DEFAULT_MSG MSR_LIBRARY MSR_INCLUDE_DIR) +find_package_handle_standard_args(MSR DEFAULT_MSG Msr_LIBRARY Msr_INCLUDE_DIR) get_property( _type - CACHE MSR_ROOT + CACHE Msr_ROOT PROPERTY TYPE ) if(_type) - set_property(CACHE MSR_ROOT PROPERTY ADVANCED 1) + set_property(CACHE Msr_ROOT PROPERTY ADVANCED 1) if("x${_type}" STREQUAL "xUNINITIALIZED") - set_property(CACHE MSR_ROOT PROPERTY TYPE PATH) + set_property(CACHE Msr_ROOT PROPERTY TYPE PATH) endif() endif() -mark_as_advanced(MSR_ROOT MSR_LIBRARY MSR_INCLUDE_DIR) +mark_as_advanced(Msr_ROOT Msr_LIBRARY Msr_INCLUDE_DIR) diff --git a/cmake/FindOrangeFS.cmake b/cmake/FindOrangeFS.cmake index df968570217d..36caaaaa0f26 100644 --- a/cmake/FindOrangeFS.cmake +++ b/cmake/FindOrangeFS.cmake @@ -5,44 +5,53 @@ # 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) +# compatibility with older CMake versions +if(ORANGEFS_ROOT AND NOT Orangefs_ROOT) + set(Orangefs_ROOT + ${ORANGEFS_ROOT} + CACHE PATH "OrangeFS base directory" + ) + unset(ORANGEFS_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) -pkg_check_modules(PC_ORANGEFS QUIET orangefs) +pkg_check_modules(PC_Orangefs QUIET orangefs) find_path( - ORANGEFS_INCLUDE_DIR + Orangefs_INCLUDE_DIR NAMES pxfs.h orange.h - HINTS ${ORANGEFS_ROOT} ENV ORANGEFS_ROOT ${PC_ORANGEFS_INCLUDEDIR} - ${PC_ORANGEFS_INCLUDE_DIRS} + HINTS ${Orangefs_ROOT} ENV Orangefs_ROOT ${PC_Orangefs_INCLUDEDIR} + ${PC_Orangefs_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - ORANGEFS_LIBRARY + Orangefs_LIBRARY NAMES pvfs2 # orangefs pvfs2 orangefsposix - HINTS ${ORANGEFS_ROOT} ENV ORANGEFS_ROOT ${PC_ORANGEFS_LIBDIR} - ${PC_ORANGEFS_LIBRARY_DIRS} + HINTS ${Orangefs_ROOT} ENV ORANGEFS_ROOT ${PC_Orangefs_LIBDIR} + ${PC_Orangefs_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) -# Set ORANGEFS_ROOT in case the other hints are used -if(ORANGEFS_ROOT) +# Set Orangefs_ROOT in case the other hints are used +if(Orangefs_ROOT) # The call to file is for compatibility with windows paths - file(TO_CMAKE_PATH ${ORANGEFS_ROOT} ORANGEFS_ROOT) + file(TO_CMAKE_PATH ${Orangefs_ROOT} Orangefs_ROOT) elseif("$ENV{ORANGEFS_ROOT}") - file(TO_CMAKE_PATH $ENV{ORANGEFS_ROOT} ORANGEFS_ROOT) + file(TO_CMAKE_PATH $ENV{ORANGEFS_ROOT} Orangefs_ROOT) else() - file(TO_CMAKE_PATH "${ORANGEFS_INCLUDE_DIR}" ORANGEFS_INCLUDE_DIR) - string(REPLACE "/include" "" ORANGEFS_ROOT "${ORANGEFS_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Orangefs_INCLUDE_DIR}" Orangefs_INCLUDE_DIR) + string(REPLACE "/include" "" Orangefs_ROOT "${Orangefs_INCLUDE_DIR}") endif() -set(ORANGEFS_LIBRARIES ${ORANGEFS_LIBRARY}) -set(ORANGEFS_INCLUDE_DIRS ${ORANGEFS_INCLUDE_DIR}) +set(Orangefs_LIBRARIES ${Orangefs_LIBRARY}) +set(Orangefs_INCLUDE_DIRS ${Orangefs_INCLUDE_DIR}) find_package_handle_standard_args( - OrangeFS DEFAULT_MSG ORANGEFS_LIBRARY ORANGEFS_INCLUDE_DIR + OrangeFS DEFAULT_MSG Orangefs_LIBRARY Orangefs_INCLUDE_DIR ) -foreach(v ORANGEFS_ROOT) +foreach(v Orangefs_ROOT) get_property( _type CACHE ${v} @@ -56,4 +65,4 @@ foreach(v ORANGEFS_ROOT) endif() endforeach() -mark_as_advanced(ORANGEFS_ROOT ORANGEFS_LIBRARY ORANGEFS_INCLUDE_DIR) +mark_as_advanced(Orangefs_ROOT Orangefs_LIBRARY Orangefs_INCLUDE_DIR) diff --git a/cmake/FindPAPI.cmake b/cmake/FindPAPI.cmake index 9f6d906b023e..ed90941d7c14 100644 --- a/cmake/FindPAPI.cmake +++ b/cmake/FindPAPI.cmake @@ -1,5 +1,5 @@ # Copyright (c) 2014 Thomas Heller -# Copyright (c) 2007-2011 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # Copyright (c) 2011 Maciej Brodowicz # @@ -8,64 +8,73 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) if(NOT TARGET Papi::papi) + # compatibility with older CMake versions + if(PAPI_ROOT AND NOT Papi_ROOT) + set(Papi_ROOT + ${PAPI_ROOT} + CACHE PATH "PAPI base directory" + ) + unset(PAPI_ROOT CACHE) + endif() + find_package(PkgConfig QUIET) - pkg_check_modules(PC_PAPI QUIET papi) + pkg_check_modules(PC_Papi QUIET papi) find_path( - PAPI_INCLUDE_DIR papi.h - HINTS ${PAPI_ROOT} ENV PAPI_ROOT ${HPX_PAPI_ROOT} ${PC_PAPI_INCLUDEDIR} - ${PC_PAPI_INCLUDE_DIRS} + Papi_INCLUDE_DIR papi.h + HINTS ${Papi_ROOT} ENV PAPI_ROOT ${HPX_PAPI_ROOT} ${PC_Papi_INCLUDEDIR} + ${PC_Papi_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - PAPI_LIBRARY + Papi_LIBRARY NAMES papi libpapi - HINTS ${PAPI_ROOT} ENV PAPI_ROOT ${HPX_PAPI_ROOT} ${PC_PAPI_LIBDIR} - ${PC_PAPI_LIBRARY_DIRS} + HINTS ${Papi_ROOT} ENV PAPI_ROOT ${HPX_Papi_ROOT} ${PC_Papi_LIBDIR} + ${PC_Papi_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) - # Set PAPI_ROOT in case the other hints are used - if(NOT PAPI_ROOT AND "$ENV{PAPI_ROOT}") - set(PAPI_ROOT $ENV{PAPI_ROOT}) - elseif(NOT PAPI_ROOT) - string(REPLACE "/include" "" PAPI_ROOT "${PAPI_INCLUDE_DIR}") + # Set Papi_ROOT in case the other hints are used + if(NOT Papi_ROOT AND "$ENV{PAPI_ROOT}") + set(Papi_ROOT $ENV{PAPI_ROOT}) + elseif(NOT Papi_ROOT) + string(REPLACE "/include" "" Papi_ROOT "${Papi_INCLUDE_DIR}") endif() - # Set PAPI_ROOT in case the other hints are used - if(PAPI_ROOT) + # Set Papi_ROOT in case the other hints are used + if(Papi_ROOT) # The call to file is for compatibility with windows paths - file(TO_CMAKE_PATH ${PAPI_ROOT} PAPI_ROOT) - elseif("$ENV{PAPI_ROOT}") - file(TO_CMAKE_PATH $ENV{PAPI_ROOT} PAPI_ROOT) + file(TO_CMAKE_PATH ${Papi_ROOT} Papi_ROOT) + elseif("$ENV{Papi_ROOT}") + file(TO_CMAKE_PATH $ENV{Papi_ROOT} Papi_ROOT) else() - file(TO_CMAKE_PATH "${PAPI_INCLUDE_DIR}" PAPI_INCLUDE_DIR) - string(REPLACE "/include" "" PAPI_ROOT "${PAPI_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Papi_INCLUDE_DIR}" Papi_INCLUDE_DIR) + string(REPLACE "/include" "" Papi_ROOT "${Papi_INCLUDE_DIR}") endif() - set(PAPI_LIBRARIES ${PAPI_LIBRARY}) - set(PAPI_INCLUDE_DIRS ${PAPI_INCLUDE_DIR}) + set(Papi_LIBRARIES ${Papi_LIBRARY}) + set(Papi_INCLUDE_DIRS ${Papi_INCLUDE_DIR}) find_package_handle_standard_args( - PAPI DEFAULT_MSG PAPI_LIBRARY PAPI_INCLUDE_DIR + PAPI DEFAULT_MSG Papi_LIBRARY Papi_INCLUDE_DIR ) get_property( _type - CACHE PAPI_ROOT + CACHE Papi_ROOT PROPERTY TYPE ) if(_type) - set_property(CACHE PAPI_ROOT PROPERTY ADVANCED 1) + set_property(CACHE Papi_ROOT PROPERTY ADVANCED 1) if("x${_type}" STREQUAL "xUNINITIALIZED") - set_property(CACHE PAPI_ROOT PROPERTY TYPE PATH) + set_property(CACHE Papi_ROOT PROPERTY TYPE PATH) endif() endif() - mark_as_advanced(PAPI_ROOT PAPI_LIBRARY PAPI_INCLUDE_DIR) + mark_as_advanced(Papi_ROOT Papi_LIBRARY Papi_INCLUDE_DIR) add_library(Papi::papi INTERFACE IMPORTED) - target_include_directories(Papi::papi SYSTEM INTERFACE ${PAPI_INCLUDE_DIR}) - target_link_libraries(Papi::papi INTERFACE ${PAPI_LIBRARY}) + target_include_directories(Papi::papi SYSTEM INTERFACE ${Papi_INCLUDE_DIR}) + target_link_libraries(Papi::papi INTERFACE ${Papi_LIBRARY}) endif() diff --git a/cmake/FindPWR.cmake b/cmake/FindPWR.cmake index edcadc73cf79..0007fa6008dc 100644 --- a/cmake/FindPWR.cmake +++ b/cmake/FindPWR.cmake @@ -8,70 +8,79 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) if(NOT TARGET PWR::pwr) + # compatibility with older CMake versions + if(PWR_ROOT AND NOT Pwr_ROOT) + set(Pwr_ROOT + ${PWR_ROOT} + CACHE PATH "PWR base directory" + ) + unset(PWR_ROOT CACHE) + endif() + find_package(PkgConfig QUIET) - pkg_check_modules(PC_PWR QUIET pwr) - if(NOT PC_PWR_FOUND) - pkg_check_modules(PC_PWR pwrapi QUIET) + pkg_check_modules(PC_Pwr QUIET pwr) + if(NOT PC_Pwr_FOUND) + pkg_check_modules(PC_Pwr pwrapi QUIET) endif() find_path( - PWR_INCLUDE_DIR pwr.h - HINTS ${PWR_ROOT} + Pwr_INCLUDE_DIR pwr.h + HINTS ${Pwr_ROOT} ENV PWR_ROOT - ${HPX_PWR_ROOT} - ${PC_PWR_MINIMAL_INCLUDEDIR} - ${PC_PWR_MINIMAL_INCLUDE_DIRS} - ${PC_PWR_INCLUDEDIR} - ${PC_PWR_INCLUDE_DIRS} + ${HPX_Pwr_ROOT} + ${PC_Pwr_MINIMAL_INCLUDEDIR} + ${PC_Pwr_MINIMAL_INCLUDE_DIRS} + ${PC_Pwr_INCLUDEDIR} + ${PC_Pwr_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - PWR_LIBRARY + Pwr_LIBRARY NAMES pwr libpwr - HINTS ${PWR_ROOT} + HINTS ${Pwr_ROOT} ENV PWR_ROOT - ${HPX_PWR_ROOT} - ${PC_PWR_MINIMAL_LIBDIR} - ${PC_PWR_MINIMAL_LIBRARY_DIRS} - ${PC_PWR_LIBDIR} - ${PC_PWR_LIBRARY_DIRS} + ${HPX_Pwr_ROOT} + ${PC_Pwr_MINIMAL_LIBDIR} + ${PC_Pwr_MINIMAL_LIBRARY_DIRS} + ${PC_Pwr_LIBDIR} + ${PC_Pwr_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) - # Set PWR_ROOT in case the other hints are used - if(PWR_ROOT) + # Set Pwr_ROOT in case the other hints are used + if(Pwr_ROOT) # The call to file is for compatibility with windows paths - file(TO_CMAKE_PATH ${PWR_ROOT} PWR_ROOT) + file(TO_CMAKE_PATH ${Pwr_ROOT} Pwr_ROOT) elseif("$ENV{PWR_ROOT}") - file(TO_CMAKE_PATH $ENV{PWR_ROOT} PWR_ROOT) + file(TO_CMAKE_PATH $ENV{PWR_ROOT} Pwr_ROOT) else() - file(TO_CMAKE_PATH "${PWR_INCLUDE_DIR}" PWR_INCLUDE_DIR) - string(REPLACE "/include" "" PWR_ROOT "${PWR_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Pwr_INCLUDE_DIR}" Pwr_INCLUDE_DIR) + string(REPLACE "/include" "" Pwr_ROOT "${Pwr_INCLUDE_DIR}") endif() - set(PWR_LIBRARIES ${PWR_LIBRARY}) - set(PWR_INCLUDE_DIRS ${PWR_INCLUDE_DIR}) + set(Pwr_LIBRARIES ${Pwr_LIBRARY}) + set(Pwr_INCLUDE_DIRS ${Pwr_INCLUDE_DIR}) - find_package_handle_standard_args(PWR DEFAULT_MSG PWR_LIBRARY PWR_INCLUDE_DIR) + find_package_handle_standard_args(PWR DEFAULT_MSG Pwr_LIBRARY Pwr_INCLUDE_DIR) get_property( _type - CACHE PWR_ROOT + CACHE Pwr_ROOT PROPERTY TYPE ) if(_type) - set_property(CACHE PWR_ROOT PROPERTY ADVANCED 1) + set_property(CACHE Pwr_ROOT PROPERTY ADVANCED 1) if("x${_type}" STREQUAL "xUNINITIALIZED") - set_property(CACHE PWR_ROOT PROPERTY TYPE PATH) + set_property(CACHE Pwr_ROOT PROPERTY TYPE PATH) endif() endif() add_library(PWR::pwr INTERFACE IMPORTED) - target_include_directories(PWR::pwr SYSTEM INTERFACE ${PWR_INCLUDE_DIR}) - target_link_libraries(PWR::pwr INTERFACE ${PWR_LIBRARIES}) + target_include_directories(PWR::pwr SYSTEM INTERFACE ${Pwr_INCLUDE_DIR}) + target_link_libraries(PWR::pwr INTERFACE ${Pwr_LIBRARIES}) - mark_as_advanced(PWR_ROOT PWR_LIBRARY PWR_INCLUDE_DIR) + mark_as_advanced(Pwr_ROOT Pwr_LIBRARY Pwr_INCLUDE_DIR) endif() diff --git a/cmake/FindQThreads.cmake b/cmake/FindQThreads.cmake index d731aab6b8ba..08e2342521fb 100644 --- a/cmake/FindQThreads.cmake +++ b/cmake/FindQThreads.cmake @@ -5,43 +5,52 @@ # 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) +# compatibility with older CMake versions +if(QTHREADS_ROOT AND NOT Qthreads_ROOT) + set(Qthreads_ROOT + ${QTHREADS_ROOT} + CACHE PATH "QThreads base directory" + ) + unset(QTHREADS_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) -pkg_check_modules(PC_QTHREADS QUIET swarm) +pkg_check_modules(PC_Qthreads QUIET swarm) find_path( - QTHREADS_INCLUDE_DIR qthread/qthread.h - HINTS ${QTHREADS_ROOT} ENV QTHREADS_ROOT ${PC_QTHREADS_INCLUDEDIR} - ${PC_QTHREADS_INCLUDE_DIRS} + Qthreads_INCLUDE_DIR qthread/qthread.h + HINTS ${Qthreads_ROOT} ENV QTHREADS_ROOT ${PC_Qthreads_INCLUDEDIR} + ${PC_Qthreads_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - QTHREADS_LIBRARY + Qthreads_LIBRARY NAMES qthread libqthread - HINTS ${QTHREADS_ROOT} ENV QTHREADS_ROOT ${PC_QTHREADS_LIBDIR} - ${PC_QTHREADS_LIBRARY_DIRS} + HINTS ${Qthreads_ROOT} ENV QTHREADS_ROOT ${PC_Qthreads_LIBDIR} + ${PC_Qthreads_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) -# Set QTHREADS_ROOT in case the other hints are used -if(QTHREADS_ROOT) +# Set Qthreads_ROOT in case the other hints are used +if(Qthreads_ROOT) # The call to file is for compatibility with windows paths - file(TO_CMAKE_PATH ${QTHREADS_ROOT} QTHREADS_ROOT) + file(TO_CMAKE_PATH ${Qthreads_ROOT} Qthreads_ROOT) elseif("$ENV{QTHREADS_ROOT}") - file(TO_CMAKE_PATH $ENV{QTHREADS_ROOT} QTHREADS_ROOT) + file(TO_CMAKE_PATH $ENV{QTHREADS_ROOT} Qthreads_ROOT) else() - file(TO_CMAKE_PATH "${QTHREADS_INCLUDE_DIR}" QTHREADS_INCLUDE_DIR) - string(REPLACE "/include" "" QTHREADS_ROOT "${QTHREADS_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Qthreads_INCLUDE_DIR}" Qthreads_INCLUDE_DIR) + string(REPLACE "/include" "" Qthreads_ROOT "${Qthreads_INCLUDE_DIR}") endif() -set(QTHREADS_LIBRARIES ${QTHREADS_LIBRARY}) -set(QTHREADS_INCLUDE_DIRS ${QTHREADS_INCLUDE_DIR}) +set(Qthreads_LIBRARIES ${Qthreads_LIBRARY}) +set(Qthreads_INCLUDE_DIRS ${Qthreads_INCLUDE_DIR}) find_package_handle_standard_args( - QThreads DEFAULT_MSG QTHREADS_LIBRARY QTHREADS_INCLUDE_DIR + QThreads DEFAULT_MSG Qthreads_LIBRARY Qthreads_INCLUDE_DIR ) -foreach(v QTHREADS_ROOT) +foreach(v Qthreads_ROOT) get_property( _type CACHE ${v} @@ -55,4 +64,4 @@ foreach(v QTHREADS_ROOT) endif() endforeach() -mark_as_advanced(QTHREADS_ROOT QTHREADS_LIBRARY QTHREADS_INCLUDE_DIR) +mark_as_advanced(Qthreads_ROOT Qthreads_LIBRARY Qthreads_INCLUDE_DIR) diff --git a/cmake/FindRDMA_CM.cmake b/cmake/FindRDMA_CM.cmake index 1a33f36e5db3..3f0d210a4213 100644 --- a/cmake/FindRDMA_CM.cmake +++ b/cmake/FindRDMA_CM.cmake @@ -6,28 +6,38 @@ # # - Try to find RDMA CM # Once done this will define -# RDMA_CM_FOUND - System has RDMA CM -# RDMA_CM_INCLUDE_DIRS - The RDMA CM include directories -# RDMA_CM_LIBRARIES - The libraries needed to use RDMA CM +# Rdma_CM_FOUND - System has RDMA CM +# Rdma_CM_INCLUDE_DIRS - The RDMA CM include directories +# Rdma_CM_LIBRARIES - The libraries needed to use RDMA CM -find_path(RDMA_CM_INCLUDE_DIR rdma_cma.h HINTS /usr/local/include +# compatibility with older CMake versions +if(RDMA_ROOT AND NOT Rdma_ROOT) + set(Rdma_ROOT + ${RDMA_ROOT} + CACHE PATH "RDMA base directory" + ) + unset(RDMA_ROOT CACHE) +endif() + +find_path(Rdma_CM_INCLUDE_DIR rdma_cma.h HINTS /usr/local/include /usr/include/rdma ) find_library( - RDMA_CM_LIBRARY + Rdma_CM_LIBRARY NAMES rdmacm PATHS /usr/local/lib /usr/lib ) -set(RDMA_CM_INCLUDE_DIRS ${RDMA_CM_INCLUDE_DIR}) -set(RDMA_CM_LIBRARIES ${RDMA_CM_LIBRARY}) +set(Rdma_CM_INCLUDE_DIRS ${Rdma_CM_INCLUDE_DIR}) +set(Rdma_CM_LIBRARIES ${Rdma_CM_LIBRARY}) include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set RDMA_CM_FOUND to TRUE if all + +# handle the QUIETLY and REQUIRED arguments and set Rdma_CM_FOUND to TRUE if all # listed variables are TRUE find_package_handle_standard_args( - RDMA_CM DEFAULT_MSG RDMA_CM_INCLUDE_DIR RDMA_CM_LIBRARY + Rdma_CM DEFAULT_MSG Rdma_CM_INCLUDE_DIR Rdma_CM_LIBRARY ) -mark_as_advanced(RDMA_CM_INCLUDE_DIR RDMA_CM_LIBRARY) +mark_as_advanced(Rdma_CM_INCLUDE_DIR Rdma_CM_LIBRARY) diff --git a/cmake/FindRdmacm.cmake b/cmake/FindRdmacm.cmake index 2eb9896125e6..5513ea4bd646 100644 --- a/cmake/FindRdmacm.cmake +++ b/cmake/FindRdmacm.cmake @@ -7,38 +7,47 @@ # 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) +# compatibility with older CMake versions +if(RDMACM_ROOT AND NOT Rdmacm_ROOT) + set(Rdmacm_ROOT + ${RDMACM_ROOT} + CACHE PATH "RDMACM base directory" + ) + unset(RDMACM_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) -pkg_check_modules(PC_RDMACM QUIET libibverbs) +pkg_check_modules(PC_Rdmacm QUIET libibverbs) find_path( - RDMACM_INCLUDE_DIR rdma/rdma_cma.h - HINTS ${RDMACM_ROOT} ENV RDMACM_ROOT ${PC_RDMACM_INCLUDEDIR} - ${PC_RDMACM_INCLUDE_DIRS} + Rdmacm_INCLUDE_DIR rdma/rdma_cma.h + HINTS ${Rdmacm_ROOT} ENV RDMACM_ROOT ${PC_Rdmacm_INCLUDEDIR} + ${PC_Rdmacm_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - RDMACM_LIBRARY + Rdmacm_LIBRARY NAMES rdmacm librdmacm - HINTS ${RDMACM_ROOT} ENV RDMACM_ROOT ${PC_RDMACM_LIBDIR} - ${PC_RDMACM_LIBRARY_DIRS} + HINTS ${Rdmacm_ROOT} ENV RDMACM_ROOT ${PC_Rdmacm_LIBDIR} + ${PC_Rdmacm_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) -set(RDMACM_LIBRARIES - ${RDMACM_LIBRARY} +set(Rdmacm_LIBRARIES + ${Rdmacm_LIBRARY} CACHE INTERNAL "" ) -set(RDMACM_INCLUDE_DIRS - ${RDMACM_INCLUDE_DIR} +set(Rdmacm_INCLUDE_DIRS + ${Rdmacm_INCLUDE_DIR} CACHE INTERNAL "" ) find_package_handle_standard_args( - Rdmacm DEFAULT_MSG RDMACM_LIBRARY RDMACM_INCLUDE_DIR + Rdmacm DEFAULT_MSG Rdmacm_LIBRARY Rdmacm_INCLUDE_DIR ) -foreach(v RDMACM_ROOT) +foreach(v Rdmacm_ROOT) get_property( _type CACHE ${v} @@ -52,4 +61,4 @@ foreach(v RDMACM_ROOT) endif() endforeach() -mark_as_advanced(RDMACM_ROOT RDMACM_LIBRARY RDMACM_INCLUDE_DIR) +mark_as_advanced(Rdmacm_ROOT Rdmacm_LIBRARY Rdmacm_INCLUDE_DIR) diff --git a/cmake/FindSnappy.cmake b/cmake/FindSnappy.cmake index 58cee9ca47e0..0374be7dff41 100644 --- a/cmake/FindSnappy.cmake +++ b/cmake/FindSnappy.cmake @@ -1,55 +1,64 @@ # Copyright (c) 2014 Thomas Heller -# Copyright (c) 2013 Hartmut Kaiser +# Copyright (c) 2013-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # 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) +# compatibility with older CMake versions +if(SNAPPY_ROOT AND NOT Snappy_ROOT) + set(Snappy_ROOT + ${SNAPPY_ROOT} + CACHE PATH "Snappy base directory" + ) + unset(SNAPPY_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) pkg_check_modules(PC_SNAPPY QUIET snappy) find_path( - SNAPPY_INCLUDE_DIR snappy.h - HINTS ${SNAPPY_ROOT} + Snappy_INCLUDE_DIR snappy.h + HINTS ${Snappy_ROOT} ENV SNAPPY_ROOT - ${PC_SNAPPY_MINIMAL_INCLUDEDIR} - ${PC_SNAPPY_MINIMAL_INCLUDE_DIRS} - ${PC_SNAPPY_INCLUDEDIR} - ${PC_SNAPPY_INCLUDE_DIRS} + ${PC_Snappy_MINIMAL_INCLUDEDIR} + ${PC_Snappy_MINIMAL_INCLUDE_DIRS} + ${PC_Snappy_INCLUDEDIR} + ${PC_Snappy_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - SNAPPY_LIBRARY + Snappy_LIBRARY NAMES snappy libsnappy - HINTS ${SNAPPY_ROOT} + HINTS ${Snappy_ROOT} ENV SNAPPY_ROOT - ${PC_SNAPPY_MINIMAL_LIBDIR} - ${PC_SNAPPY_MINIMAL_LIBRARY_DIRS} - ${PC_SNAPPY_LIBDIR} - ${PC_SNAPPY_LIBRARY_DIRS} + ${PC_Snappy_MINIMAL_LIBDIR} + ${PC_Snappy_MINIMAL_LIBRARY_DIRS} + ${PC_Snappy_LIBDIR} + ${PC_Snappy_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) -set(SNAPPY_LIBRARIES ${SNAPPY_LIBRARY}) -set(SNAPPY_INCLUDE_DIRS ${SNAPPY_INCLUDE_DIR}) +set(Snappy_LIBRARIES ${Snappy_LIBRARY}) +set(Snappy_INCLUDE_DIRS ${Snappy_INCLUDE_DIR}) find_package_handle_standard_args( - Snappy DEFAULT_MSG SNAPPY_LIBRARY SNAPPY_INCLUDE_DIR + Snappy DEFAULT_MSG Snappy_LIBRARY Snappy_INCLUDE_DIR ) get_property( _type - CACHE SNAPPY_ROOT + CACHE Snappy_ROOT PROPERTY TYPE ) if(_type) - set_property(CACHE SNAPPY_ROOT PROPERTY ADVANCED 1) + set_property(CACHE Snappy_ROOT PROPERTY ADVANCED 1) if("x${_type}" STREQUAL "xUNINITIALIZED") - set_property(CACHE SNAPPY_ROOT PROPERTY TYPE PATH) + set_property(CACHE Snappy_ROOT PROPERTY TYPE PATH) endif() endif() -mark_as_advanced(SNAPPY_ROOT SNAPPY_LIBRARY SNAPPY_INCLUDE_DIR) +mark_as_advanced(Snappy_ROOT Snappy_LIBRARY Snappy_INCLUDE_DIR) diff --git a/cmake/FindSphinx.cmake b/cmake/FindSphinx.cmake index 9c5f66180e97..9b9e58ec6edd 100644 --- a/cmake/FindSphinx.cmake +++ b/cmake/FindSphinx.cmake @@ -4,14 +4,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) +# compatibility with older CMake versions +if(SPHINX_ROOT AND NOT Sphinx_ROOT) + set(Sphinx_ROOT + ${SPHINX_ROOT} + CACHE PATH "Sphinx base directory" + ) + unset(SPHINX_ROOT CACHE) +endif() + find_program( - SPHINX_EXECUTABLE + Sphinx_EXECUTABLE NAMES sphinx-build sphinx-build2 - PATHS ${SPHINX_ROOT} ENV SPHINX_ROOT + PATHS ${Sphinx_ROOT} ENV SPHINX_ROOT DOC "Path to sphinx-build executable" ) -if(SPHINX_EXECUTABLE) +if(Sphinx_EXECUTABLE) include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Sphinx DEFAULT_MESSAGE SPHINX_EXECUTABLE) + find_package_handle_standard_args(Sphinx DEFAULT_MESSAGE Sphinx_EXECUTABLE) endif() diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake index 648e9587f43b..821117c52aba 100644 --- a/cmake/FindTBB.cmake +++ b/cmake/FindTBB.cmake @@ -5,38 +5,47 @@ # 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) +# compatibility with older CMake versions +if(TBB_ROOT AND NOT Tbb_ROOT) + set(Tbb_ROOT + ${TBB_ROOT} + CACHE PATH "TBB base directory" + ) + unset(TBB_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) -pkg_check_modules(PC_TBB QUIET libtbb) +pkg_check_modules(PC_Tbb QUIET libtbb) find_path( - TBB_INCLUDE_DIR tbb/tbb.h - HINTS ${TBB_ROOT} ENV TBB_ROOT ${PC_TBB_INCLUDEDIR} ${PC_TBB_INCLUDE_DIRS} + Tbb_INCLUDE_DIR tbb/tbb.h + HINTS ${Tbb_ROOT} ENV TBB_ROOT ${PC_Tbb_INCLUDEDIR} ${PC_Tbb_INCLUDE_DIRS} PATH_SUFFIXES include ) -set(TBB_PATH_SUFFIX "lib/intel64" "lib/intel64/gcc4.4") -if(TBB_PLATFORM STREQUAL "mic") - set(TBB_PATH_SUFFIX "lib/mic") +set(Tbb_PATH_SUFFIX "lib/intel64" "lib/intel64/gcc4.4") +if(Tbb_PLATFORM STREQUAL "mic") + set(Tbb_PATH_SUFFIX "lib/mic") endif() -if(TBB_PLATFORM STREQUAL "mic-knl") - set(TBB_PATH_SUFFIX "lib/intel64_lin_mic") +if(Tbb_PLATFORM STREQUAL "mic-knl") + set(Tbb_PATH_SUFFIX "lib/intel64_lin_mic") endif() find_library( - TBB_PROXY_LIBRARY + Tbb_PROXY_LIBRARY NAMES tbb libtbb - HINTS ${TBB_ROOT} ENV TBB_ROOT ${PC_TBB_LIBDIR} ${PC_TBB_LIBRARY_DIRS} - PATH_SUFFIXES ${TBB_PATH_SUFFIX} lib lib64 + HINTS ${Tbb_ROOT} ENV TBB_ROOT ${PC_Tbb_LIBDIR} ${PC_Tbb_LIBRARY_DIRS} + PATH_SUFFIXES ${Tbb_PATH_SUFFIX} lib lib64 ) -set(TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_PROXY_LIBRARY}) -set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR}) +set(Tbb_LIBRARIES ${Tbb_LIBRARY} ${Tbb_PROXY_LIBRARY}) +set(Tbb_INCLUDE_DIRS ${Tbb_INCLUDE_DIR}) find_package_handle_standard_args( - TBBmalloc DEFAULT_MSG TBB_LIBRARY TBB_PROXY_LIBRARY TBB_INCLUDE_DIR + TBBmalloc DEFAULT_MSG Tbb_LIBRARY Tbb_PROXY_LIBRARY Tbb_INCLUDE_DIR ) -foreach(v TBB_ROOT TBB_PLATFORM) +foreach(v Tbb_ROOT Tbb_PLATFORM) get_property( _type CACHE ${v} @@ -50,4 +59,4 @@ foreach(v TBB_ROOT TBB_PLATFORM) endif() endforeach() -mark_as_advanced(TBB_ROOT TBB_LIBRARY TBB_PROXY_LIBRARY TBB_INCLUDE_DIR) +mark_as_advanced(Tbb_ROOT Tbb_LIBRARY Tbb_PROXY_LIBRARY Tbb_INCLUDE_DIR) diff --git a/cmake/FindTBBmalloc.cmake b/cmake/FindTBBmalloc.cmake index 1329597fba40..9b029ac51068 100644 --- a/cmake/FindTBBmalloc.cmake +++ b/cmake/FindTBBmalloc.cmake @@ -7,58 +7,67 @@ # 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) +# compatibility with older CMake versions +if(TBBMALLOC_ROOT AND NOT Tbbmalloc_ROOT) + set(Tbbmalloc_ROOT + ${TBBMALLOC_ROOT} + CACHE PATH "TBBMalloc base directory" + ) + unset(TBBMALLOC_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) -pkg_check_modules(PC_TBBMALLOC QUIET libtbbmalloc) +pkg_check_modules(PC_Tbbmalloc QUIET libtbbmalloc) find_path( - TBBMALLOC_INCLUDE_DIR tbb/scalable_allocator.h - HINTS ${TBBMALLOC_ROOT} ENV TBBMALLOC_ROOT ${HPX_TBBMALLOC_ROOT} - ${PC_TBBMALLOC_INCLUDEDIR} ${PC_TBBMALLOC_INCLUDE_DIRS} + Tbbmalloc_INCLUDE_DIR tbb/scalable_allocator.h + HINTS ${Tbbmalloc_ROOT} ENV TBBMALLOC_ROOT ${HPX_TBBMALLOC_ROOT} + ${PC_Tbbmalloc_INCLUDEDIR} ${PC_Tbbmalloc_INCLUDE_DIRS} PATH_SUFFIXES include ) -set(TBBMALLOC_PATH_SUFFIX "lib/intel64" "lib/intel64/gcc4.4") -if(TBBMALLOC_PLATFORM STREQUAL "mic") - set(TBBMALLOC_PATH_SUFFIX "lib/mic") +set(Tbbmalloc_PATH_SUFFIX "lib/intel64" "lib/intel64/gcc4.4") +if(Tbbmalloc_PLATFORM STREQUAL "mic") + set(Tbbmalloc_PATH_SUFFIX "lib/mic") endif() -if(TBBMALLOC_PLATFORM STREQUAL "mic-knl") - set(TBBMALLOC_PATH_SUFFIX "lib/intel64_lin_mic") +if(Tbbmalloc_PLATFORM STREQUAL "mic-knl") + set(Tbbmalloc_PATH_SUFFIX "lib/intel64_lin_mic") endif() -message("${TBBMALLOC_ROOT} ${TBBMALLOC_PATH_SUFFIX} ${TBBMALLOC_PLATFORM}") +message("${Tbbmalloc_ROOT} ${Tbbmalloc_PATH_SUFFIX} ${Tbbmalloc_PLATFORM}") find_library( - TBBMALLOC_LIBRARY + Tbbmalloc_LIBRARY NAMES tbbmalloc libtbbmalloc - HINTS ${TBBMALLOC_ROOT} ENV TBBMALLOC_ROOT ${HPX_TBBMALLOC_ROOT} - ${PC_TBBMALLOC_LIBDIR} ${PC_TBBMALLOC_LIBRARY_DIRS} - PATH_SUFFIXES ${TBBMALLOC_PATH_SUFFIX} lib lib64 + HINTS ${Tbbmalloc_ROOT} ENV TBBMALLOC_ROOT ${HPX_TBBMALLOC_ROOT} + ${PC_Tbbmalloc_LIBDIR} ${PC_Tbbmalloc_LIBRARY_DIRS} + PATH_SUFFIXES ${Tbbmalloc_PATH_SUFFIX} lib lib64 ) find_library( - TBBMALLOC_PROXY_LIBRARY + Tbbmalloc_PROXY_LIBRARY NAMES tbbmalloc_proxy libtbbmalloc_proxy - HINTS ${TBBMALLOC_ROOT} ENV TBBMALLOC_ROOT ${HPX_TBBMALLOC_ROOT} - ${PC_TBBMALLOC_LIBDIR} ${PC_TBBMALLOC_LIBRARY_DIRS} - PATH_SUFFIXES ${TBBMALLOC_PATH_SUFFIX} lib lib64 + HINTS ${Tbbmalloc_ROOT} ENV TBBMALLOC_ROOT ${HPX_TBBMALLOC_ROOT} + ${PC_Tbbmalloc_LIBDIR} ${PC_Tbbmalloc_LIBRARY_DIRS} + PATH_SUFFIXES ${Tbbmalloc_PATH_SUFFIX} lib lib64 ) -# Set TBBMALLOC_ROOT in case the other hints are used -if(NOT TBBMALLOC_ROOT AND "$ENV{TBBMALLOC_ROOT}") - set(TBBMALLOC_ROOT $ENV{TBBMALLOC_ROOT}) -elseif(NOT TBBMALLOC_ROOT) - string(REPLACE "/include" "" TBBMALLOC_ROOT "${TBBMALLOC_INCLUDE_DIR}") +# Set Tbbmalloc_ROOT in case the other hints are used +if(NOT Tbbmalloc_ROOT AND "$ENV{TBBMALLOC_ROOT}") + set(Tbbmalloc_ROOT $ENV{TBBMALLOC_ROOT}) +elseif(NOT Tbbmalloc_ROOT) + string(REPLACE "/include" "" Tbbmalloc_ROOT "${Tbbmalloc_INCLUDE_DIR}") endif() -set(TBBMALLOC_LIBRARIES ${TBBMALLOC_LIBRARY} ${TBBMALLOC_PROXY_LIBRARY}) -set(TBBMALLOC_INCLUDE_DIRS ${TBBMALLOC_INCLUDE_DIR}) +set(Tbbmalloc_LIBRARIES ${Tbbmalloc_LIBRARY} ${Tbbmalloc_PROXY_LIBRARY}) +set(Tbbmalloc_INCLUDE_DIRS ${Tbbmalloc_INCLUDE_DIR}) find_package_handle_standard_args( - TBBmalloc DEFAULT_MSG TBBMALLOC_LIBRARY TBBMALLOC_PROXY_LIBRARY - TBBMALLOC_INCLUDE_DIR + TBBmalloc DEFAULT_MSG Tbbmalloc_LIBRARY Tbbmalloc_PROXY_LIBRARY + Tbbmalloc_INCLUDE_DIR ) -foreach(v TBBMALLOC_ROOT TBBMALLOC_PLATFORM) +foreach(v Tbbmalloc_ROOT Tbbmalloc_PLATFORM) get_property( _type CACHE ${v} @@ -73,6 +82,6 @@ foreach(v TBBMALLOC_ROOT TBBMALLOC_PLATFORM) endforeach() mark_as_advanced( - TBBMALLOC_ROOT TBBMALLOC_LIBRARY TBBMALLOC_PROXY_LIBRARY - TBBMALLOC_INCLUDE_DIR + Tbbmalloc_ROOT Tbbmalloc_LIBRARY Tbbmalloc_PROXY_LIBRARY + Tbbmalloc_INCLUDE_DIR ) diff --git a/cmake/FindTCMalloc.cmake b/cmake/FindTCMalloc.cmake index 9d33a5559150..8503410b8d94 100644 --- a/cmake/FindTCMalloc.cmake +++ b/cmake/FindTCMalloc.cmake @@ -7,61 +7,70 @@ # 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) +# compatibility with older CMake versions +if(TCMALLOC_ROOT AND NOT Tcmalloc_ROOT) + set(Tcmalloc_ROOT + ${TCMALLOC_ROOT} + CACHE PATH "TcMalloc base directory" + ) + unset(TCMALLOC_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) -pkg_check_modules(PC_TCMALLOC_MINIMAL QUIET libtcmalloc_minimal) -pkg_check_modules(PC_TCMALLOC QUIET libtcmalloc) +pkg_check_modules(PC_Tcmalloc_MINIMAL QUIET libtcmalloc_minimal) +pkg_check_modules(PC_Tcmalloc QUIET libtcmalloc) find_path( - TCMALLOC_INCLUDE_DIR google/tcmalloc.h - HINTS ${TCMALLOC_ROOT} + Tcmalloc_INCLUDE_DIR google/tcmalloc.h + HINTS ${Tcmalloc_ROOT} ENV TCMALLOC_ROOT ${HPX_TCMALLOC_ROOT} - ${PC_TCMALLOC_MINIMAL_INCLUDEDIR} - ${PC_TCMALLOC_MINIMAL_INCLUDE_DIRS} - ${PC_TCMALLOC_INCLUDEDIR} - ${PC_TCMALLOC_INCLUDE_DIRS} + ${PC_Tcmalloc_MINIMAL_INCLUDEDIR} + ${PC_Tcmalloc_MINIMAL_INCLUDE_DIRS} + ${PC_Tcmalloc_INCLUDEDIR} + ${PC_Tcmalloc_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - TCMALLOC_LIBRARY + Tcmalloc_LIBRARY NAMES tcmalloc_minimal libtcmalloc_minimal tcmalloc libtcmalloc - HINTS ${TCMALLOC_ROOT} + HINTS ${Tcmalloc_ROOT} ENV TCMALLOC_ROOT ${HPX_TCMALLOC_ROOT} - ${PC_TCMALLOC_MINIMAL_LIBDIR} - ${PC_TCMALLOC_MINIMAL_LIBRARY_DIRS} - ${PC_TCMALLOC_LIBDIR} - ${PC_TCMALLOC_LIBRARY_DIRS} + ${PC_Tcmalloc_MINIMAL_LIBDIR} + ${PC_Tcmalloc_MINIMAL_LIBRARY_DIRS} + ${PC_Tcmalloc_LIBDIR} + ${PC_Tcmalloc_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) -# Set TCMALLOC_ROOT in case the other hints are used -if(NOT TCMALLOC_ROOT AND "$ENV{TCMALLOC_ROOT}") - set(TCMALLOC_ROOT $ENV{TCMALLOC_ROOT}) -elseif(NOT TCMALLOC_ROOT) - string(REPLACE "/include" "" TCMALLOC_ROOT "${TCMALLOC_INCLUDE_DIR}") +# Set Tcmalloc_ROOT in case the other hints are used +if(NOT Tcmalloc_ROOT AND "$ENV{TCMALLOC_ROOT}") + set(Tcmalloc_ROOT $ENV{TCMALLOC_ROOT}) +elseif(NOT Tcmalloc_ROOT) + string(REPLACE "/include" "" Tcmalloc_ROOT "${Tcmalloc_INCLUDE_DIR}") endif() -set(TCMALLOC_LIBRARIES ${TCMALLOC_LIBRARY}) -set(TCMALLOC_INCLUDE_DIRS ${TCMALLOC_INCLUDE_DIR}) +set(Tcmalloc_LIBRARIES ${Tcmalloc_LIBRARY}) +set(Tcmalloc_INCLUDE_DIRS ${Tcmalloc_INCLUDE_DIR}) find_package_handle_standard_args( - TCMalloc DEFAULT_MSG TCMALLOC_LIBRARY TCMALLOC_INCLUDE_DIR + TCMalloc DEFAULT_MSG Tcmalloc_LIBRARY Tcmalloc_INCLUDE_DIR ) get_property( _type - CACHE TCMALLOC_ROOT + CACHE Tcmalloc_ROOT PROPERTY TYPE ) if(_type) - set_property(CACHE TCMALLOC_ROOT PROPERTY ADVANCED 1) + set_property(CACHE Tcmalloc_ROOT PROPERTY ADVANCED 1) if("x${_type}" STREQUAL "xUNINITIALIZED") - set_property(CACHE TCMALLOC_ROOT PROPERTY TYPE PATH) + set_property(CACHE Tcmalloc_ROOT PROPERTY TYPE PATH) endif() endif() -mark_as_advanced(TCMALLOC_ROOT TCMALLOC_LIBRARY TCMALLOC_INCLUDE_DIR) +mark_as_advanced(Tcmalloc_ROOT Tcmalloc_LIBRARY Tcmalloc_INCLUDE_DIR) diff --git a/cmake/FindValgrind.cmake b/cmake/FindValgrind.cmake index 862901014333..f473ac321bc9 100644 --- a/cmake/FindValgrind.cmake +++ b/cmake/FindValgrind.cmake @@ -7,30 +7,39 @@ # 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) +# compatibility with older CMake versions +if(VALGRIND_ROOT AND NOT Valgrind_ROOT) + set(Valgrind_ROOT + ${VALGRIND_ROOT} + CACHE PATH "Valgrind base directory" + ) + unset(VALGRIND_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) pkg_check_modules(PC_VALGRIND QUIET valgrind) find_path( - VALGRIND_INCLUDE_DIR valgrind/valgrind.h - HINTS ${VALGRIND_ROOT} ENV VALGRIND_ROOT ${PC_VALGRIND_INCLUDEDIR} - ${PC_VALGRIND_INCLUDE_DIRS} + Valgrind_INCLUDE_DIR valgrind/valgrind.h + HINTS ${Valgrind_ROOT} ENV VALGRIND_ROOT ${PC_Valgrind_INCLUDEDIR} + ${PC_Valgrind_INCLUDE_DIRS} PATH_SUFFIXES include ) -set(VALGRIND_INCLUDE_DIRS ${VALGRIND_INCLUDE_DIR}) +set(Valgrind_INCLUDE_DIRS ${Valgrind_INCLUDE_DIR}) -find_package_handle_standard_args(Valgrind DEFAULT_MSG VALGRIND_INCLUDE_DIR) +find_package_handle_standard_args(Valgrind DEFAULT_MSG Valgrind_INCLUDE_DIR) get_property( _type - CACHE VALGRIND_ROOT + CACHE Valgrind_ROOT PROPERTY TYPE ) if(_type) - set_property(CACHE VALGRIND_ROOT PROPERTY ADVANCED 1) + set_property(CACHE Valgrind_ROOT PROPERTY ADVANCED 1) if("x${_type}" STREQUAL "xUNINITIALIZED") - set_property(CACHE VALGRIND_ROOT PROPERTY TYPE PATH) + set_property(CACHE Valgrind_ROOT PROPERTY TYPE PATH) endif() endif() -mark_as_advanced(VALGRIND_ROOT VALGRIND_INCLUDE_DIR) +mark_as_advanced(Valgrind_ROOT Valgrind_INCLUDE_DIR) diff --git a/cmake/HPX_AddTest.cmake b/cmake/HPX_AddTest.cmake index 738b529ccfe5..d416d99fe3ce 100644 --- a/cmake/HPX_AddTest.cmake +++ b/cmake/HPX_AddTest.cmake @@ -82,9 +82,13 @@ function(add_hpx_test category name) set(_script_location ${PROJECT_BINARY_DIR}) endif() + if(PYTHON_EXECUTABLE AND NOT Python_EXECUTABLE) + set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) + endif() + # cmake-format: off set(cmd - "${PYTHON_EXECUTABLE}" + "${Python_EXECUTABLE}" "${_script_location}/bin/hpxrun.py" ${CMAKE_CROSSCOMPILING_EMULATOR} ${_exe} diff --git a/cmake/HPX_Documentation.cmake b/cmake/HPX_Documentation.cmake index fe9b38887fcb..c6530c04207b 100644 --- a/cmake/HPX_Documentation.cmake +++ b/cmake/HPX_Documentation.cmake @@ -11,14 +11,14 @@ if(HPX_WITH_DOCUMENTATION) find_package(Sphinx) find_package(Breathe) - if(NOT SPHINX_FOUND) + if(NOT Sphinx_FOUND) hpx_error( - "Sphinx is unavailable, sphinx documentation generation disabled. Set SPHINX_ROOT to your sphinx-build installation directory." + "Sphinx is unavailable, sphinx documentation generation disabled. Set Sphinx_ROOT to your sphinx-build installation directory." ) set(HPX_WITH_DOCUMENTATION OFF) - elseif(NOT BREATHE_FOUND) + elseif(NOT Breathe_FOUND) hpx_error( - "Breathe is unavailable, sphinx documentation generation disabled. Set BREATHE_APIDOC_ROOT to your breathe-apidoc installation directory." + "Breathe is unavailable, sphinx documentation generation disabled. Set Breathe_APIDOC_ROOT to your breathe-apidoc installation directory." ) set(HPX_WITH_DOCUMENTATION OFF) elseif(NOT DOXYGEN_FOUND) diff --git a/cmake/HPX_SetupAllocator.cmake b/cmake/HPX_SetupAllocator.cmake index 2e9d760a7781..4770573eef5a 100644 --- a/cmake/HPX_SetupAllocator.cmake +++ b/cmake/HPX_SetupAllocator.cmake @@ -43,12 +43,12 @@ if(NOT TARGET hpx_dependencies_allocator) # TCMALLOC if("${HPX_WITH_MALLOC_UPPER}" STREQUAL "TCMALLOC") find_package(TCMalloc) - if(NOT TCMALLOC_LIBRARIES) + if(NOT Tcmalloc_LIBRARIES) hpx_error(${allocator_error}) endif() target_link_libraries( - hpx_dependencies_allocator INTERFACE ${TCMALLOC_LIBRARIES} + hpx_dependencies_allocator INTERFACE ${Tcmalloc_LIBRARIES} ) if(MSVC) @@ -63,15 +63,15 @@ if(NOT TARGET hpx_dependencies_allocator) # JEMALLOC if("${HPX_WITH_MALLOC_UPPER}" STREQUAL "JEMALLOC") find_package(Jemalloc) - if(NOT JEMALLOC_LIBRARIES) + if(NOT Jemalloc_LIBRARIES) hpx_error(${allocator_error}) endif() target_include_directories( - hpx_dependencies_allocator INTERFACE ${JEMALLOC_INCLUDE_DIR} - ${JEMALLOC_ADDITIONAL_INCLUDE_DIR} + hpx_dependencies_allocator INTERFACE ${Jemalloc_INCLUDE_DIR} + ${Jemalloc_ADDITIONAL_INCLUDE_DIR} ) target_link_libraries( - hpx_dependencies_allocator INTERFACE ${JEMALLOC_LIBRARIES} + hpx_dependencies_allocator INTERFACE ${Jemalloc_LIBRARIES} ) endif() @@ -96,7 +96,7 @@ if(NOT TARGET hpx_dependencies_allocator) # TBBMALLOC if("${HPX_WITH_MALLOC_UPPER}" STREQUAL "TBBMALLOC") find_package(TBBmalloc) - if(NOT TBBMALLOC_LIBRARY AND NOT TBBMALLOC_PROXY_LIBRARY) + if(NOT Tbbmalloc_LIBRARY AND NOT Tbbmalloc_PROXY_LIBRARY) hpx_error(${allocator_error}) endif() if(MSVC) @@ -105,8 +105,8 @@ if(NOT TARGET hpx_dependencies_allocator) ) endif() target_link_libraries( - hpx_dependencies_allocator INTERFACE ${TBBMALLOC_LIBRARY} - ${TBBMALLOC_PROXY_LIBRARY} + hpx_dependencies_allocator INTERFACE ${Tbbmalloc_LIBRARY} + ${Tbbmalloc_PROXY_LIBRARY} ) endif() @@ -135,9 +135,9 @@ if(NOT TARGET hpx_dependencies_allocator) if((NOT HPX_WITH_APEX) AND HPX_WITH_ITTNOTIFY) find_package(Amplifier) - if(NOT AMPLIFIER_FOUND) + if(NOT Amplifier_FOUND) hpx_error( - "Intel Amplifier could not be found and HPX_WITH_ITTNOTIFY=On, please specify AMPLIFIER_ROOT to point to the root of your Amplifier installation" + "Intel Amplifier could not be found and HPX_WITH_ITTNOTIFY=On, please specify Amplifier_ROOT to point to the root of your Amplifier installation" ) endif() diff --git a/cmake/HPX_SetupApex.cmake b/cmake/HPX_SetupApex.cmake index 39cb573f3ad4..01d9b96a844c 100644 --- a/cmake/HPX_SetupApex.cmake +++ b/cmake/HPX_SetupApex.cmake @@ -15,20 +15,43 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) if(HPX_WITH_APEX AND NOT TARGET APEX::apex) + # compatibility with older CMake versions + if(APEX_ROOT AND NOT Apex_ROOT) + set(Apex_ROOT + ${APEX_ROOT} + CACHE PATH "Apex base directory" + ) + unset(APEX_ROOT CACHE) + endif() + if(MSR_ROOT AND NOT Msr_ROOT) + set(Msr_ROOT + ${MSR_ROOT} + CACHE PATH "MSR base directory" + ) + unset(MSR_ROOT CACHE) + endif() + if(OTF2_ROOT AND NOT Otf2_ROOT) + set(Otf2_ROOT + ${OTF2_ROOT} + CACHE PATH "OTF2 base directory" + ) + unset(OTF2_ROOT CACHE) + endif() + if(NOT HPX_FIND_PACKAGE) - if(NOT "${APEX_ROOT}" AND "$ENV{APEX_ROOT}") - set(APEX_ROOT "$ENV{APEX_ROOT}") + if(NOT "${Apex_ROOT}" AND "$ENV{APEX_ROOT}") + set(Apex_ROOT "$ENV{APEX_ROOT}") endif() # We want to track parent dependencies hpx_add_config_define(HPX_HAVE_THREAD_PARENT_REFERENCE) - if(APEX_ROOT) + if(Apex_ROOT) # Use given (external) APEX - set(HPX_APEX_ROOT ${APEX_ROOT}) + set(HPX_APEX_ROOT ${Apex_ROOT}) else() - # If APEX_ROOT not specified, local clone into hpx source dir + # If Apex_ROOT not specified, local clone into hpx source dir include(FetchContent) fetchcontent_declare( apex @@ -50,15 +73,15 @@ if(HPX_WITH_APEX AND NOT TARGET APEX::apex) if(NOT apex_POPULATED) hpx_error("APEX could not be populated with HPX_WITH_APEX=On") endif() - set(APEX_ROOT ${apex_SOURCE_DIR}) + set(Apex_ROOT ${apex_SOURCE_DIR}) - hpx_info("APEX_ROOT is not set. Cloning APEX into ${apex_SOURCE_DIR}.") + hpx_info("Apex_ROOT is not set. Cloning APEX into ${apex_SOURCE_DIR}.") endif() - list(APPEND CMAKE_MODULE_PATH "${APEX_ROOT}/cmake/Modules") - add_subdirectory(${APEX_ROOT}/src/apex ${CMAKE_BINARY_DIR}/apex/src/apex) - if(AMPLIFIER_FOUND) - hpx_error("AMPLIFIER_FOUND has been set. Please disable the use of the \ + list(APPEND CMAKE_MODULE_PATH "${Apex_ROOT}/cmake/Modules") + add_subdirectory(${Apex_ROOT}/src/apex ${CMAKE_BINARY_DIR}/apex/src/apex) + if(Amplifier_FOUND) + hpx_error("Amplifier_FOUND has been set. Please disable the use of the \ Intel Amplifier (WITH_AMPLIFIER=Off) in order to use APEX" ) endif() @@ -86,14 +109,14 @@ if(HPX_WITH_APEX AND NOT TARGET APEX::apex) # handle optional ITTNotify library (private dependency, skip when called in # find_package(HPX)) if(HPX_WITH_ITTNOTIFY AND NOT HPX_FIND_PACKAGE) - add_subdirectory(${APEX_ROOT}/src/ITTNotify) - if(NOT ITTNOTIFY_FOUND) + add_subdirectory(${Apex_ROOT}/src/ITTNotify) + if(NOT Ittnotify_FOUND) hpx_error("ITTNotify could not be found and HPX_WITH_ITTNOTIFY=On") endif() add_library(ITTNotify::ittnotify INTERFACE IMPORTED) target_include_directories( - ITTNotify::ittnotify SYSTEM INTERFACE ${ITTNOTIFY_SOURCE_DIR} + ITTNotify::ittnotify SYSTEM INTERFACE ${Ittnotify_SOURCE_DIR} ) target_link_libraries(APEX::apex INTERFACE ITTNotify::ittnotify) hpx_add_config_define(HPX_HAVE_ITTNOTIFY 1) diff --git a/cmake/HPX_SetupAsio.cmake b/cmake/HPX_SetupAsio.cmake index 1dfbdd9416d6..86a33a635f08 100644 --- a/cmake/HPX_SetupAsio.cmake +++ b/cmake/HPX_SetupAsio.cmake @@ -4,6 +4,15 @@ # 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) +# compatibility with older CMake versions +if(ASIO_ROOT AND NOT Asio_ROOT) + set(Asio_ROOT + ${ASIO_ROOT} + CACHE PATH "ASIO base directory" + ) + unset(ASIO_ROOT CACHE) +endif() + if(NOT HPX_WITH_FETCH_ASIO) find_package(Asio 1.12.0 REQUIRED) elseif(NOT TARGET Asio::asio AND NOT HPX_FIND_PACKAGE) @@ -27,11 +36,11 @@ elseif(NOT TARGET Asio::asio AND NOT HPX_FIND_PACKAGE) if(NOT asio_POPULATED) fetchcontent_populate(asio) endif() - set(ASIO_ROOT ${asio_SOURCE_DIR}) + set(Asio_ROOT ${asio_SOURCE_DIR}) add_library(asio INTERFACE) target_include_directories( - asio SYSTEM INTERFACE $ + asio SYSTEM INTERFACE $ $ ) @@ -42,7 +51,7 @@ elseif(NOT TARGET Asio::asio AND NOT HPX_FIND_PACKAGE) ) install( - DIRECTORY ${ASIO_ROOT}/asio/include/ + DIRECTORY ${Asio_ROOT}/asio/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT core FILES_MATCHING @@ -72,17 +81,22 @@ if(NOT HPX_FIND_PACKAGE) if(NOT HPX_WITH_CXX17_ALIGNED_NEW) hpx_add_config_cond_define(ASIO_DISABLE_STD_ALIGNED_ALLOC) endif() + # Asio does not detect that invoke_result is available, but we assume it # always is since we require C++17. hpx_add_config_cond_define(ASIO_HAS_STD_INVOKE_RESULT 1) + # Asio should not use Boost exceptions hpx_add_config_cond_define(ASIO_HAS_BOOST_THROW_EXCEPTION 0) + # Disable concepts support in Asio as a workaround to # https://github.com/boostorg/asio/issues/312 hpx_add_config_cond_define(ASIO_DISABLE_CONCEPTS) + # Disable experimental std::string_view support as a workaround to # https://github.com/chriskohlhoff/asio/issues/597 hpx_add_config_cond_define(ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW) + # Disable Asio's definition of NOMINMAX hpx_add_config_cond_define(ASIO_NO_NOMINMAX) endif() diff --git a/cmake/HPX_SetupBoost.cmake b/cmake/HPX_SetupBoost.cmake index 39b754606a05..873d7724a714 100644 --- a/cmake/HPX_SetupBoost.cmake +++ b/cmake/HPX_SetupBoost.cmake @@ -58,22 +58,31 @@ if(NOT TARGET hpx_dependencies_boost) list(REMOVE_DUPLICATES __boost_libraries) + # compatibility with older CMake versions + if(BOOST_ROOT AND NOT Boost_ROOT) + set(Boost_ROOT + ${BOOST_ROOT} + CACHE PATH "Boost base directory" + ) + unset(BOOST_ROOT CACHE) + endif() + find_package( - Boost ${Boost_MINIMUM_VERSION} MODULE REQUIRED + Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE MODULE REQUIRED COMPONENTS ${__boost_libraries} ) if(NOT Boost_FOUND) hpx_error( - "Could not find Boost. Please set BOOST_ROOT to point to your Boost installation." + "Could not find Boost. Please set Boost_ROOT to point to your Boost installation." ) endif() # We are assuming that there is only one Boost Root - if(NOT BOOST_ROOT AND "$ENV{BOOST_ROOT}") - set(BOOST_ROOT $ENV{BOOST_ROOT}) - elseif(NOT BOOST_ROOT) - string(REPLACE "/include" "" BOOST_ROOT "${Boost_INCLUDE_DIRS}") + if(NOT Boost_ROOT AND "$ENV{BOOST_ROOT}") + set(Boost_ROOT $ENV{BOOST_ROOT}) + elseif(NOT Boost_ROOT) + string(REPLACE "/include" "" Boost_ROOT "${Boost_INCLUDE_DIRS}") endif() add_library(hpx_dependencies_boost INTERFACE IMPORTED) diff --git a/cmake/HPX_SetupBoostFilesystem.cmake b/cmake/HPX_SetupBoostFilesystem.cmake index 661099bbd949..44cc5f4531a3 100644 --- a/cmake/HPX_SetupBoostFilesystem.cmake +++ b/cmake/HPX_SetupBoostFilesystem.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2019 The STE||AR-Group +# Copyright (c) 2019-2023 The STE||AR-Group # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -7,7 +7,10 @@ if(HPX_FILESYSTEM_WITH_BOOST_FILESYSTEM_COMPATIBILITY) # In case find_package(HPX) is called multiple times if(NOT TARGET Boost::filesystem) - find_package(Boost ${Boost_MINIMUM_VERSION} MODULE COMPONENTS filesystem) + find_package( + Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE MODULE + COMPONENTS filesystem + ) if(NOT Boost_FILESYSTEM_FOUND) hpx_error( diff --git a/cmake/HPX_SetupBoostIostreams.cmake b/cmake/HPX_SetupBoostIostreams.cmake index 033c4f15e807..77784cd073c0 100644 --- a/cmake/HPX_SetupBoostIostreams.cmake +++ b/cmake/HPX_SetupBoostIostreams.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2019 The STE||AR-Group +# Copyright (c) 2019-2023 The STE||AR-Group # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -9,7 +9,9 @@ if((HPX_WITH_COMPRESSION_BZIP2 OR HPX_WITH_COMPRESSION_ZLIB) AND NOT TARGET Boost::iostreams ) - find_package(Boost ${Boost_MINIMUM_VERSION} MODULE COMPONENTS iostreams) + find_package( + Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE MODULE COMPONENTS iostreams + ) if(Boost_IOSTREAMS_FOUND) hpx_info(" iostreams") diff --git a/cmake/HPX_SetupBoostRegex.cmake b/cmake/HPX_SetupBoostRegex.cmake index 903810bc57e9..5ea12927da37 100644 --- a/cmake/HPX_SetupBoostRegex.cmake +++ b/cmake/HPX_SetupBoostRegex.cmake @@ -1,11 +1,13 @@ -# Copyright (c) 2019 The STE||AR-Group +# Copyright (c) 2019-2023 The STE||AR-Group # # SPDX-License-Identifier: BSL-1.0 # 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 TARGET Boost::regex) - find_package(Boost ${Boost_MINIMUM_VERSION} MODULE COMPONENTS regex) + find_package( + Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE MODULE COMPONENTS regex + ) if(Boost_REGEX_FOUND) hpx_info(" regex") diff --git a/cmake/HPX_SetupEve.cmake b/cmake/HPX_SetupEve.cmake index 9dff0f454a4d..884ef9b6793e 100644 --- a/cmake/HPX_SetupEve.cmake +++ b/cmake/HPX_SetupEve.cmake @@ -5,6 +5,16 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "EVE") AND NOT TARGET eve::eve) + + # compatibility with older CMake versions + if(EVE_ROOT AND NOT Eve_ROOT) + set(Eve_ROOT + ${EVE_ROOT} + CACHE PATH "Eve base directory" + ) + unset(EVE_ROOT CACHE) + endif() + if(HPX_WITH_FETCH_EVE) if(FETCHCONTENT_SOURCE_DIR_EVE) hpx_info( @@ -12,7 +22,7 @@ if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "EVE") AND NOT TARGET eve::eve) ) else() hpx_info( - "HPX_WITH_FETCH_EVE=${HPX_WITH_FETCH_EVE}, EVE will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_EVE_TAG=${HPX_WITH_EVE_TAG})" + "HPX_WITH_FETCH_EVE=${HPX_WITH_FETCH_EVE}, EVE will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_Eve_TAG=${HPX_WITH_Eve_TAG})" ) endif() include(FetchContent) @@ -26,11 +36,11 @@ if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "EVE") AND NOT TARGET eve::eve) if(NOT eve_POPULATED) fetchcontent_populate(eve) endif() - set(EVE_ROOT ${eve_SOURCE_DIR}) + set(Eve_ROOT ${eve_SOURCE_DIR}) add_library(eve INTERFACE) target_include_directories( - eve SYSTEM INTERFACE $ + eve SYSTEM INTERFACE $ $ ) @@ -41,7 +51,7 @@ if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "EVE") AND NOT TARGET eve::eve) ) install( - DIRECTORY ${EVE_ROOT}/include/ + DIRECTORY ${Eve_ROOT}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT core FILES_MATCHING @@ -66,10 +76,10 @@ if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "EVE") AND NOT TARGET eve::eve) add_library(eve::eve ALIAS eve) else() - if(EVE_ROOT) - find_package(eve REQUIRED PATHS ${EVE_ROOT}) + if(Eve_ROOT) + find_package(eve REQUIRED PATHS ${Eve_ROOT}) else() - hpx_error("EVE_ROOT not set") + hpx_error("Eve_ROOT not set") endif() endif() endif() diff --git a/cmake/HPX_SetupHIP.cmake b/cmake/HPX_SetupHIP.cmake index e19b78c7e271..2b2a42ae346f 100644 --- a/cmake/HPX_SetupHIP.cmake +++ b/cmake/HPX_SetupHIP.cmake @@ -23,7 +23,7 @@ if(HPX_WITH_HIP AND NOT TARGET roc::hipblas) if(NOT hipblas_FOUND) hpx_warn( "Hipblas could not be found, the blas parts will therefore be disabled.\n\ - You can reconfigure specifying HIPBLAS_ROOT to enable hipblas" + You can reconfigure specifying HIPBLAS_ROOT environment variable to enable hipblas" ) set(HPX_WITH_GPUBLAS OFF) else() diff --git a/cmake/HPX_SetupHwloc.cmake b/cmake/HPX_SetupHwloc.cmake index edbf001a8cfc..12ce52247a36 100644 --- a/cmake/HPX_SetupHwloc.cmake +++ b/cmake/HPX_SetupHwloc.cmake @@ -14,8 +14,8 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) find_package(Hwloc) -if(NOT HWLOC_FOUND) +if(NOT Hwloc_FOUND) hpx_error( - "Hwloc could not be found, please specify HWLOC_ROOT to point to the correct location" + "Hwloc could not be found, please specify Hwloc_ROOT to point to the correct location" ) endif() diff --git a/cmake/HPX_SetupLCI.cmake b/cmake/HPX_SetupLCI.cmake index 98a01ea68205..26b1ecd18076 100644 --- a/cmake/HPX_SetupLCI.cmake +++ b/cmake/HPX_SetupLCI.cmake @@ -9,13 +9,23 @@ macro(hpx_setup_lci) if(NOT TARGET LCI::LCI) + + # compatibility with older CMake versions + if(LCI_ROOT AND NOT Lci_ROOT) + set(Lci_ROOT + ${LCI_ROOT} + CACHE PATH "LCI base directory" + ) + unset(LCI_ROOT CACHE) + endif() + if(NOT HPX_WITH_FETCH_LCI) find_package( LCI CONFIG REQUIRED HINTS - ${LCI_ROOT} + ${Lci_ROOT} $ENV{LCI_ROOT} PATH_SUFFIXES lib/cmake @@ -28,14 +38,14 @@ macro(hpx_setup_lci) ) else() hpx_info( - "HPX_WITH_FETCH_LCI=${HPX_WITH_FETCH_LCI}, LCI will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_LCI_TAG=${HPX_WITH_LCI_TAG})" + "HPX_WITH_FETCH_LCI=${HPX_WITH_FETCH_LCI}, LCI will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_Lci_TAG=${HPX_WITH_Lci_TAG})" ) endif() include(FetchContent) fetchcontent_declare( lci GIT_REPOSITORY https://github.com/uiuc-hpc/LC.git - GIT_TAG ${HPX_WITH_LCI_TAG} + GIT_TAG ${HPX_WITH_Lci_TAG} ) fetchcontent_getproperties(lci) diff --git a/cmake/HPX_SetupPapi.cmake b/cmake/HPX_SetupPapi.cmake index 300c41507d65..a091be1cb110 100644 --- a/cmake/HPX_SetupPapi.cmake +++ b/cmake/HPX_SetupPapi.cmake @@ -14,10 +14,10 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) if(HPX_WITH_PAPI) - find_package(PAPI) - if(NOT PAPI_FOUND) + find_package(Papi) + if(NOT Papi_FOUND) hpx_error("PAPI could not be found and HPX_WITH_PAPI=On, please specify \ - PAPI_ROOT to point to the root of your PAPI installation" + Papi_ROOT to point to the root of your PAPI installation" ) endif() endif() diff --git a/cmake/HPX_SetupSVE.cmake b/cmake/HPX_SetupSVE.cmake index c85b69c51104..467a6b048f6e 100644 --- a/cmake/HPX_SetupSVE.cmake +++ b/cmake/HPX_SetupSVE.cmake @@ -5,6 +5,16 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "SVE") AND NOT TARGET SVE::sve) + + # compatibility with older CMake versions + if(SVE_ROOT AND NOT Sve_ROOT) + set(Sve_ROOT + ${SVE_ROOT} + CACHE PATH "SVE base directory" + ) + unset(SVE_ROOT CACHE) + endif() + if(HPX_WITH_FETCH_SVE) if(FETCHCONTENT_SOURCE_DIR_SVE) hpx_info( @@ -12,7 +22,7 @@ if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "SVE") AND NOT TARGET SVE::sve) ) else() hpx_info( - "HPX_WITH_FETCH_SVE=${HPX_WITH_FETCH_SVE}, SVE will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_SVE_TAG=${HPX_WITH_SVE_TAG})" + "HPX_WITH_FETCH_SVE=${HPX_WITH_FETCH_SVE}, SVE will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_Sve_TAG=${HPX_WITH_Sve_TAG})" ) endif() @@ -22,7 +32,7 @@ if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "SVE") AND NOT TARGET SVE::sve) ) endif() - set(SVE_LENGTH "${HPX_WITH_SVE_LENGTH}") + set(Sve_LENGTH "${HPX_WITH_SVE_LENGTH}") include(FetchContent) fetchcontent_declare( @@ -33,7 +43,7 @@ if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "SVE") AND NOT TARGET SVE::sve) fetchcontent_makeavailable(sve) - set(SVE_ROOT ${sve_SOURCE_DIR}) + set(Sve_ROOT ${sve_SOURCE_DIR}) install( TARGETS sve @@ -42,7 +52,7 @@ if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "SVE") AND NOT TARGET SVE::sve) ) install( - DIRECTORY ${SVE_ROOT}/include/ + DIRECTORY ${Sve_ROOT}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT core FILES_MATCHING @@ -65,10 +75,10 @@ if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "SVE") AND NOT TARGET SVE::sve) ) else() - if(SVE_ROOT) - find_package(SVE REQUIRED PATHS ${SVE_ROOT}) + if(Sve_ROOT) + find_package(SVE REQUIRED PATHS ${Sve_ROOT}) else() - hpx_error("SVE_ROOT not set") + hpx_error("Sve_ROOT not set") endif() endif() endif() diff --git a/cmake/HPX_SetupValgrind.cmake b/cmake/HPX_SetupValgrind.cmake index f858a9186350..6c5295082610 100644 --- a/cmake/HPX_SetupValgrind.cmake +++ b/cmake/HPX_SetupValgrind.cmake @@ -16,9 +16,9 @@ if(HPX_WITH_VALGRIND AND NOT TARGET Valgrind::valgrind) find_package(Valgrind) - if(NOT VALGRIND_FOUND) + if(NOT Valgrind_FOUND) hpx_error("Valgrind could not be found and HPX_WITH_VALGRIND=On, please \ - specify VALGRIND_ROOT to point to the root of your Valgrind installation" + specify Valgrind_ROOT to point to the root of your Valgrind installation" ) endif() diff --git a/cmake/installed_hpx.cmake b/cmake/installed_hpx.cmake index 506fe121f0b8..5f079d802114 100644 --- a/cmake/installed_hpx.cmake +++ b/cmake/installed_hpx.cmake @@ -127,11 +127,20 @@ if(HPX_WITH_TESTS) include(CTest) # find Python interpreter (needed to run tests) - find_package(PythonInterp) - if(NOT PYTHONINTERP_FOUND) - hpx_warn( - "A python interpreter could not be found. The test suite can not be run automatically." - ) + if(POLICY CMP0148) + find_package(Python COMPONENTS Interpreter) + if(NOT Python_FOUND) + hpx_warn( + "A python interpreter could not be found. The test suite can not be run automatically." + ) + endif() + else() + find_package(PythonInterp) + if(NOT PYTHONINTERP_FOUND) + hpx_warn( + "A python interpreter could not be found. The test suite can not be run automatically." + ) + endif() endif() # add actual tests, first iterate through all modules diff --git a/cmake/templates/HPXConfig.cmake.in b/cmake/templates/HPXConfig.cmake.in index 0996804504b9..257e52a1415f 100644 --- a/cmake/templates/HPXConfig.cmake.in +++ b/cmake/templates/HPXConfig.cmake.in @@ -23,7 +23,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/HPXMacros.cmake") if(HPX_WITH_FETCH_ASIO) include("${CMAKE_CURRENT_LIST_DIR}/HPXAsioTarget.cmake") else() - set(HPX_ASIO_ROOT "@ASIO_ROOT@") + set(HPX_ASIO_ROOT "@Asio_ROOT@") include(HPX_SetupAsio) endif() @@ -34,7 +34,7 @@ if(HPX_COMMAND_LINE_HANDLING_WITH_JSON_CONFIGURATION_FILES) if(HPX_WITH_FETCH_JSON) include("${CMAKE_CURRENT_LIST_DIR}/HPXJSONTarget.cmake") else() - set(HPX_JSON_ROOT "@JSON_ROOT@") + set(HPX_JSON_ROOT "@Json_ROOT@") include(HPX_SetupJSON) endif() endif() @@ -46,7 +46,7 @@ if(HPX_WITH_NETWORKING AND HPX_WITH_PARCELPORT_LCI) find_dependency(@LCI_FABRIC@) include("${CMAKE_CURRENT_LIST_DIR}/HPXLCITarget.cmake") else() - set(LCI_ROOT "@LCI_ROOT@") + set(Lci_ROOT "@Lci_ROOT@") include(HPX_SetupLCI) hpx_setup_lci() endif() @@ -58,7 +58,7 @@ if("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "EVE") if(HPX_WITH_FETCH_EVE) include("${CMAKE_CURRENT_LIST_DIR}/HPXEveTarget.cmake") else() - set(EVE_ROOT "@EVE_ROOT@") + set(Eve_ROOT "@Eve_ROOT@") include(HPX_SetupEve) endif() endif() @@ -67,7 +67,7 @@ if("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "SVE") if(HPX_WITH_FETCH_SVE) include("${CMAKE_CURRENT_LIST_DIR}/HPXSVETarget.cmake") else() - set(SVE_ROOT "@SVE_ROOT@") + set(Sve_ROOT "@Sve_ROOT@") include(HPX_SetupSVE) endif() endif() @@ -118,31 +118,31 @@ set(HPX_CXX_COMPILER_VERSION # Propagate Amplifier settings, if needed if(HPX_WITH_ITTNOTIFY) - set(AMPLIFIER_INCLUDE_DIR "@AMPLIFIER_INCLUDE_DIR@") - set(AMPLIFIER_LIBRARY "@AMPLIFIER_LIBRARY@") - set(AMPLIFIER_ROOT "@AMPLIFIER_ROOT@") + set(Amplifier_INCLUDE_DIR "@Amplifier_INCLUDE_DIR@") + set(Amplifier_LIBRARY "@Amplifier_LIBRARY@") + set(Amplifier_ROOT "@Amplifier_ROOT@") endif() # Allocator -set(HPX_JEMALLOC_ROOT "@JEMALLOC_ROOT@") -set(HPX_TCMALLOC_ROOT "@TCMALLOC_ROOT@") -set(HPX_TBBMALLOC_ROOT "@TBBMALLOC_ROOT@") +set(HPX_JEMALLOC_ROOT "@Jemalloc_ROOT@") +set(HPX_TCMALLOC_ROOT "@Tcmalloc_ROOT@") +set(HPX_TBBMALLOC_ROOT "@Tbbmalloc_ROOT@") # Special handle for mimalloc cause we can't specify HPX_MIMALLOC_ROOT as a HINT # to find_package -set(HPX_MIMALLOC_ROOT "@MIMALLOC_ROOT@") -if(NOT MIMALLOC_ROOT AND NOT "$ENV{MIMALLOC_ROOT}") - set(MIMALLOC_ROOT ${HPX_MIMALLOC_ROOT}) +set(HPX_MIMALLOC_ROOT "@Mimalloc_ROOT@") +if(NOT Mimalloc_ROOT AND NOT "$ENV{MIMALLOC_ROOT}") + set(Mimalloc_ROOT ${HPX_MIMALLOC_ROOT}) endif() include(HPX_SetupAllocator) include(HPX_SetupThreads) # Boost Separate boost targets to be unarily linked to some modules -set(HPX_BOOST_ROOT "@BOOST_ROOT@") -# By default BOOST_ROOT is set to HPX_BOOST_ROOT (not necessary for PAPI or +set(HPX_BOOST_ROOT "@Boost_ROOT@") +# By default Boost_ROOT is set to HPX_BOOST_ROOT (not necessary for PAPI or # HWLOC cause we are specifying HPX__ROOT as an HINT to find_package) -if(NOT BOOST_ROOT AND NOT "$ENV{BOOST_ROOT}") - set(BOOST_ROOT ${HPX_BOOST_ROOT}) +if(NOT Boost_ROOT AND NOT "$ENV{BOOST_ROOT}") + set(Boost_ROOT ${HPX_BOOST_ROOT}) endif() include(HPX_SetupBoost) include(HPX_SetupBoostFilesystem) @@ -152,11 +152,11 @@ include(HPX_SetupBoostIostreams) include(HPX_SetupHIP) # Hwloc -set(HPX_HWLOC_ROOT "@HWLOC_ROOT@") +set(HPX_HWLOC_ROOT "@Hwloc_ROOT@") include(HPX_SetupHwloc) # Papi -set(HPX_PAPI_ROOT "@PAPI_ROOT@") +set(HPX_PAPI_ROOT "@Papi_ROOT@") include(HPX_SetupPapi) # CUDA @@ -169,11 +169,11 @@ endif() # APEX set(APEX_WITH_MSR "@APEX_WITH_MSR@") -set(MSR_ROOT "@MSR_ROOT@") +set(Msr_ROOT "@Msr_ROOT@") set(APEX_WITH_ACTIVEHARMONY "@APEX_WITH_ACTIVEHARMONY@") -set(ACTIVEHARMONY_ROOT "@ACTIVEHARMONY_ROOT@") +set(Activeharmony_ROOT "@Activeharmony_ROOT@") set(APEX_WITH_OTF2 "@APEX_WITH_OTF2@") -set(OTF2_ROOT "@OTF2_ROOT@") +set(Otf2_ROOT "@Otf2_ROOT@") include(HPX_SetupApex) # ############################################################################## diff --git a/cmake/templates/HPXMacros.cmake.in b/cmake/templates/HPXMacros.cmake.in index 3315902d6e58..bd2f1dd6bb82 100644 --- a/cmake/templates/HPXMacros.cmake.in +++ b/cmake/templates/HPXMacros.cmake.in @@ -68,18 +68,18 @@ function(hpx_check_boost_compatibility) if(HPX_IGNORE_BOOST_COMPATIBILITY) return() endif() - if(NOT DEFINED BOOST_ROOT) + if(NOT DEFINED Boost_ROOT) return() endif() # make sure paths are tested even if not string identical get_filename_component(PATH1 "${HPX_BOOST_ROOT}" ABSOLUTE) - get_filename_component(PATH2 "${BOOST_ROOT}" ABSOLUTE) + get_filename_component(PATH2 "${Boost_ROOT}" ABSOLUTE) if(NOT PATH1 STREQUAL PATH2) - hpx_error("The specified BOOST_ROOT differs from what has been used when" + hpx_error("The specified Boost_ROOT differs from what has been used when" " configuring and building HPX. Please use the same Boost " - "versions. HPX boost is ${HPX_BOOST_ROOT} and users is ${BOOST_ROOT}. " + "versions. HPX boost is ${HPX_BOOST_ROOT} and users is ${Boost_ROOT}. " "To disable this message set HPX_IGNORE_BOOST_COMPATIBILITY On." ) endif() diff --git a/cmake/templates/cmake_variables.rst.in b/cmake/templates/cmake_variables.rst.in index 931d0de07d10..2a6752e668e9 100644 --- a/cmake/templates/cmake_variables.rst.in +++ b/cmake/templates/cmake_variables.rst.in @@ -42,9 +42,9 @@ Each of the tools or libraries listed here will be automatically detected if they are installed in some standard location. If a tool or library is installed in a different location, you can specify its base directory by appending ``_ROOT`` to the variable name as listed below. For instance, to configure a -custom directory for ``BOOST``, specify ``BOOST_ROOT=/custom/boost/root``. +custom directory for ``Boost``, specify ``Boost_ROOT=/custom/boost/root``. -.. option:: BOOST_ROOT:PATH +.. option:: Boost_ROOT:PATH Specifies where to look for the Boost installation to be used for compiling |hpx|. Set this if CMake is not able to locate a suitable version of @@ -52,7 +52,7 @@ custom directory for ``BOOST``, specify ``BOOST_ROOT=/custom/boost/root``. Boost distribution or the directory where you unpacked and built Boost without installing it (with staged libraries). -.. option:: HWLOC_ROOT:PATH +.. option:: Hwloc_ROOT:PATH Specifies where to look for the hwloc library. Set this if CMake is not able to locate a suitable version of hwloc. Hwloc provides platform- @@ -60,14 +60,14 @@ custom directory for ``BOOST``, specify ``BOOST_ROOT=/custom/boost/root``. architecture (number of cores, number of NUMA domains, hyperthreading, etc.). |hpx| utilizes this information if available. -.. option:: PAPI_ROOT:PATH +.. option:: Papi_ROOT:PATH Specifies where to look for the PAPI library. The PAPI library is needed to compile a special component exposing PAPI hardware events and counters as |hpx| performance counters. This is not available on the Windows platform. -.. option:: AMPLIFIER_ROOT:PATH +.. option:: Amplifier_ROOT:PATH Specifies where to look for one of the tools of the Intel Parallel Studio product, either Intel Amplifier or Intel Inspector. This should be @@ -78,6 +78,6 @@ custom directory for ``BOOST``, specify ``BOOST_ROOT=/custom/boost/root``. In addition, some of the examples may need the following variables: -.. option:: HDF5_ROOT:PATH +.. option:: Hdf5_ROOT:PATH Specifies where to look for the |hdf5| include files and libraries. diff --git a/cmake/templates/hpxcxx.in b/cmake/templates/hpxcxx.in index ec1d9da2908a..43939dcb37df 100755 --- a/cmake/templates/hpxcxx.in +++ b/cmake/templates/hpxcxx.in @@ -1,4 +1,4 @@ -#! @PYTHON_EXECUTABLE@ +#! @Python_EXECUTABLE@ # # Copyright (c) 2014 Steven R. Brandt # diff --git a/cmake/templates/hpxrun.py.in b/cmake/templates/hpxrun.py.in index 70a5991e22f0..1accb6d010dc 100755 --- a/cmake/templates/hpxrun.py.in +++ b/cmake/templates/hpxrun.py.in @@ -1,4 +1,4 @@ -#! @PYTHON_EXECUTABLE@ +#! @Python_EXECUTABLE@ # # Copyright (c) 2014 Thomas Heller # diff --git a/cmake/toolchains/BGION-gcc.cmake b/cmake/toolchains/BGION-gcc.cmake index fb100952552b..b0447328a573 100644 --- a/cmake/toolchains/BGION-gcc.cmake +++ b/cmake/toolchains/BGION-gcc.cmake @@ -85,8 +85,8 @@ set(HPX_HIDDEN_VISIBILITY # # Convenience setup for jb @ bbpbg2.cscs.ch # -set(BOOST_ROOT "/gpfs/bbp.cscs.ch/home/biddisco/apps/gcc-4.8.2/boost_1_56_0") -set(HWLOC_ROOT "/gpfs/bbp.cscs.ch/home/biddisco/apps/gcc-4.8.2/hwloc-1.8.1") +set(Boost_ROOT "/gpfs/bbp.cscs.ch/home/biddisco/apps/gcc-4.8.2/boost_1_56_0") +set(Hwloc_ROOT "/gpfs/bbp.cscs.ch/home/biddisco/apps/gcc-4.8.2/hwloc-1.8.1") set(CMAKE_BUILD_TYPE "Debug" diff --git a/components/parcel_plugins/binary_filter/snappy/CMakeLists.txt b/components/parcel_plugins/binary_filter/snappy/CMakeLists.txt index ebc41f37b119..7945f2389e7f 100644 --- a/components/parcel_plugins/binary_filter/snappy/CMakeLists.txt +++ b/components/parcel_plugins/binary_filter/snappy/CMakeLists.txt @@ -11,14 +11,14 @@ endif() include(HPX_AddLibrary) find_package(Snappy) -if(NOT SNAPPY_FOUND) +if(NOT Snappy_FOUND) hpx_error("Snappy could not be found and HPX_WITH_COMPRESSION_SNAPPY=ON, \ please specify SNAPPY_ROOT to point to the correct location or set \ HPX_WITH_COMPRESSION_SNAPPY to OFF" ) endif() -hpx_debug("add_snappy_module" "SNAPPY_FOUND: ${SNAPPY_FOUND}") +hpx_debug("add_snappy_module" "SNAPPY_FOUND: ${Snappy_FOUND}") add_hpx_library( compression_snappy INTERNAL_FLAGS PLUGIN @@ -31,13 +31,13 @@ add_hpx_library( "hpx/binary_filter/snappy_serialization_filter_registration.hpp" PREPEND_HEADER_ROOT INSTALL_HEADERS FOLDER "Core/Plugins/Compression" - DEPENDENCIES ${SNAPPY_LIBRARY} ${HPX_WITH_UNITY_BUILD_OPTION} + DEPENDENCIES ${Snappy_LIBRARY} ${HPX_WITH_UNITY_BUILD_OPTION} ) target_include_directories( - compression_snappy SYSTEM PRIVATE ${SNAPPY_INCLUDE_DIR} + compression_snappy SYSTEM PRIVATE ${Snappy_INCLUDE_DIR} ) -target_link_directories(compression_snappy PRIVATE ${SNAPPY_LIBRARY_DIR}) +target_link_directories(compression_snappy PRIVATE ${Snappy_LIBRARY_DIR}) target_link_libraries(compression_snappy PUBLIC Boost::iostreams) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 437aa6671b00..bc2c88e473a7 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -221,14 +221,14 @@ foreach(output_format ${HPX_WITH_DOCUMENTATION_OUTPUT_FORMATS}) # the moment not worth the effort. if(${output_format} STREQUAL "latexpdf") set(SPHINX_DOCS_BUILD_COMMAND - ${SPHINX_EXECUTABLE} -M ${output_format} + ${Sphinx_EXECUTABLE} -M ${output_format} "${CMAKE_CURRENT_BINARY_DIR}/sphinx" "${SPHINX_DOCS_OUTPUT_DIR}" || ( exit 0) ) else() set(SPHINX_DOCS_BUILD_COMMAND - ${SPHINX_EXECUTABLE} -b ${output_format} -n -d + ${Sphinx_EXECUTABLE} -b ${output_format} -n -d "${CMAKE_CURRENT_BINARY_DIR}/doctree" "${CMAKE_CURRENT_BINARY_DIR}/sphinx" "${SPHINX_DOCS_OUTPUT_DIR}" ) diff --git a/docs/sphinx/contributing/documentation.rst b/docs/sphinx/contributing/documentation.rst index 99b577c696eb..79edaf15b5dc 100644 --- a/docs/sphinx/contributing/documentation.rst +++ b/docs/sphinx/contributing/documentation.rst @@ -41,15 +41,15 @@ manager, you can install them using the Python package manager ``pip``: You may need to set the following CMake variables to make sure CMake can find the required dependencies. -.. option:: DOXYGEN_ROOT:PATH +.. option:: Doxygen_ROOT:PATH Specifies where to look for the installation of the |doxygen|_ tool. -.. option:: SPHINX_ROOT:PATH +.. option:: Sphinx_ROOT:PATH Specifies where to look for the installation of the |sphinx|_ tool. -.. option:: BREATHE_APIDOC_ROOT:PATH +.. option:: Breathe_APIDOC_ROOT:PATH Specifies where to look for the installation of the |breathe|_ tool. diff --git a/docs/sphinx/manual/building_hpx.rst b/docs/sphinx/manual/building_hpx.rst index cc5343eb854d..3e974517ddfa 100644 --- a/docs/sphinx/manual/building_hpx.rst +++ b/docs/sphinx/manual/building_hpx.rst @@ -196,10 +196,10 @@ known to |cmake|, the following gets you started: .. code-block:: shell-session - $ cmake -DBOOST_ROOT=/path/to/boost - -DHWLOC_ROOT=/path/to/hwloc - -DTCMALLOC_ROOT=/path/to/tcmalloc - -DJEMALLOC_ROOT=/path/to/jemalloc + $ cmake -DBoost_ROOT=/path/to/boost + -DHwloc_ROOT=/path/to/hwloc + -DTcmalloc_ROOT=/path/to/tcmalloc + -DJemalloc_ROOT=/path/to/jemalloc [other CMake variable definitions] /path/to/source/tree @@ -207,7 +207,7 @@ known to |cmake|, the following gets you started: .. code-block:: shell-session - $ cmake -DBOOST_ROOT=~/packages/boost -DHWLOC_ROOT=/packages/hwloc -DCMAKE_INSTALL_PREFIX=~/packages/hpx ~/downloads/hpx_1.5.1 + $ cmake -DBoost_ROOT=~/packages/boost -DHwloc_ROOT=/packages/hwloc -DCMAKE_INSTALL_PREFIX=~/packages/hpx ~/downloads/hpx_1.5.1 * If you want to try |hpx| without using a custom allocator pass ``-DHPX_WITH_MALLOC=system`` to |cmake|: @@ -290,14 +290,14 @@ To build |hpx| under Windows 10 x64 with Visual Studio 2015: in any way. Instead, it will generate Visual Studio Solution Files, which will build |hpx| packages out of the |hpx| source tree. -* Set three new environment variables (in CMake, not in Windows environment): - ``BOOST_ROOT``, ``HWLOC_ROOT``, ``ASIO_ROOT``, ``CMAKE_INSTALL_PREFIX``. The meaning of +* Set new configuration variables (in CMake, not in Windows environment): + ``Boost_ROOT``, ``Hwloc_ROOT``, ``Asio_ROOT``, ``CMAKE_INSTALL_PREFIX``. The meaning of these variables is as follows: - * ``BOOST_ROOT`` the |hpx| root directory of the unpacked Boost headers/cpp files. - * ``HWLOC_ROOT`` the |hpx| root directory of the unpacked Portable Hardware Locality + * ``Boost_ROOT`` the |hpx| root directory of the unpacked Boost headers/cpp files. + * ``Hwloc_ROOT`` the |hpx| root directory of the unpacked Portable Hardware Locality files. - * ``ASIO_ROOT`` the |hpx| root directory of the unpacked ASIO files. Alternatively use + * ``Asio_ROOT`` the |hpx| root directory of the unpacked ASIO files. Alternatively use ``HPX_WITH_FETCH_ASIO`` with value ``True``. * ``CMAKE_INSTALL_PREFIX`` the |hpx| root directory where the future builds of |hpx| should be installed. @@ -320,13 +320,13 @@ To build |hpx| under Windows 10 x64 with Visual Studio 2015: Example CMake adding entry. - Alternatively, users could provide ``BOOST_LIBRARYDIR`` instead of - ``BOOST_ROOT``; the difference is that ``BOOST_LIBRARYDIR`` should point to + Alternatively, users could provide ``Boost_LIBRARYDIR`` instead of + ``Boost_ROOT``; the difference is that ``Boost_LIBRARYDIR`` should point to the subdirectory inside Boost root where all the compiled DLLs/LIBs are. For - example, ``BOOST_LIBRARYDIR`` may point to the ``bin.v2`` subdirectory under + example, ``Boost_LIBRARYDIR`` may point to the ``bin.v2`` subdirectory under the Boost rootdir. It is important to keep the meanings of these two variables - separated from each other: ``BOOST_DIR`` points to the ROOT folder of the - Boost library. ``BOOST_LIBRARYDIR`` points to the subdir inside the Boost root + separated from each other: ``Boost_DIR`` points to the ROOT folder of the + Boost library. ``Boost_LIBRARYDIR`` points to the subdir inside the Boost root folder where the compiled binaries are. * Click the 'Configure' button of CMake-GUI. You will be immediately presented with a diff --git a/docs/sphinx/manual/creating_hpx_projects.rst b/docs/sphinx/manual/creating_hpx_projects.rst index e4b9fb06b1b7..102f118f879a 100644 --- a/docs/sphinx/manual/creating_hpx_projects.rst +++ b/docs/sphinx/manual/creating_hpx_projects.rst @@ -476,14 +476,14 @@ Add the following code: CXXFLAGS=-O3 -std=c++17 - BOOST_ROOT=/path/to/boost - HWLOC_ROOT=/path/to/hwloc - TCMALLOC_ROOT=/path/to/tcmalloc + Boost_ROOT=/path/to/boost + Hwloc_ROOT=/path/to/hwloc + Tcmalloc_ROOT=/path/to/tcmalloc HPX_ROOT=/path/to/hpx - INCLUDE_DIRECTIVES=$(HPX_ROOT)/include $(BOOST_ROOT)/include $(HWLOC_ROOT)/include + INCLUDE_DIRECTIVES=$(HPX_ROOT)/include $(Boost_ROOT)/include $(Hwloc_ROOT)/include - LIBRARY_DIRECTIVES=-L$(HPX_ROOT)/lib $(HPX_ROOT)/lib/libhpx_init.a $(HPX_ROOT)/lib/libhpx.so $(BOOST_ROOT)/lib/libboost_atomic-mt.so $(BOOST_ROOT)/lib/libboost_filesystem-mt.so $(BOOST_ROOT)/lib/libboost_program_options-mt.so $(BOOST_ROOT)/lib/libboost_regex-mt.so $(BOOST_ROOT)/lib/libboost_system-mt.so -lpthread $(TCMALLOC_ROOT)/libtcmalloc_minimal.so $(HWLOC_ROOT)/libhwloc.so -ldl -lrt + LIBRARY_DIRECTIVES=-L$(HPX_ROOT)/lib $(HPX_ROOT)/lib/libhpx_init.a $(HPX_ROOT)/lib/libhpx.so $(Boost_ROOT)/lib/libboost_atomic-mt.so $(Boost_ROOT)/lib/libboost_filesystem-mt.so $(Boost_ROOT)/lib/libboost_program_options-mt.so $(Boost_ROOT)/lib/libboost_regex-mt.so $(Boost_ROOT)/lib/libboost_system-mt.so -lpthread $(Tcmalloc_ROOT)/libtcmalloc_minimal.so $(Hwloc_ROOT)/libhwloc.so -ldl -lrt LINK_FLAGS=$(HPX_ROOT)/lib/libhpx_wrap.a -Wl,-wrap=main # should be left empty for HPX_WITH_HPX_MAIN=OFF @@ -548,14 +548,14 @@ Now, in the directory, create a Makefile. Add the following code: CXXFLAGS=-O3 -std=c++17 - BOOST_ROOT=/path/to/boost - HWLOC_ROOT=/path/to/hwloc - TCMALLOC_ROOT=/path/to/tcmalloc + Boost_ROOT=/path/to/boost + Hwloc_ROOT=/path/to/hwloc + Tcmalloc_ROOT=/path/to/tcmalloc HPX_ROOT=/path/to/hpx - INCLUDE_DIRECTIVES=$(HPX_ROOT)/include $(BOOST_ROOT)/include $(HWLOC_ROOT)/include + INCLUDE_DIRECTIVES=$(HPX_ROOT)/include $(Boost_ROOT)/include $(Hwloc_ROOT)/include - LIBRARY_DIRECTIVES=-L$(HPX_ROOT)/lib $(HPX_ROOT)/lib/libhpx_init.a $(HPX_ROOT)/lib/libhpx.so $(BOOST_ROOT)/lib/libboost_atomic-mt.so $(BOOST_ROOT)/lib/libboost_filesystem-mt.so $(BOOST_ROOT)/lib/libboost_program_options-mt.so $(BOOST_ROOT)/lib/libboost_regex-mt.so $(BOOST_ROOT)/lib/libboost_system-mt.so -lpthread $(TCMALLOC_ROOT)/libtcmalloc_minimal.so $(HWLOC_ROOT)/libhwloc.so -ldl -lrt + LIBRARY_DIRECTIVES=-L$(HPX_ROOT)/lib $(HPX_ROOT)/lib/libhpx_init.a $(HPX_ROOT)/lib/libhpx.so $(Boost_ROOT)/lib/libboost_atomic-mt.so $(Boost_ROOT)/lib/libboost_filesystem-mt.so $(Boost_ROOT)/lib/libboost_program_options-mt.so $(Boost_ROOT)/lib/libboost_regex-mt.so $(Boost_ROOT)/lib/libboost_system-mt.so -lpthread $(Tcmalloc_ROOT)/libtcmalloc_minimal.so $(Hwloc_ROOT)/libhwloc.so -ldl -lrt LINK_FLAGS=$(HPX_ROOT)/lib/libhpx_wrap.a -Wl,-wrap=main # should be left empty for HPX_WITH_HPX_MAIN=OFF diff --git a/docs/sphinx/manual/optimizing_hpx_applications.rst b/docs/sphinx/manual/optimizing_hpx_applications.rst index f3ec0d4c2a27..90d956441728 100644 --- a/docs/sphinx/manual/optimizing_hpx_applications.rst +++ b/docs/sphinx/manual/optimizing_hpx_applications.rst @@ -3407,7 +3407,7 @@ It can be added as a ``git`` submodule by turning on the option :option:`HPX_WIT during |cmake| configuration. |tau|_ is an optional dependency when using |apex|. To build |hpx| with |apex|, add :option:`HPX_WITH_APEX`\ ``=ON``, and, -optionally, ``TAU_ROOT=$PATH_TO_TAU`` to your |cmake| configuration. In +optionally, ``Tau_ROOT=$PATH_TO_TAU`` to your |cmake| configuration. In addition, you can override the tag used for |apex| with the :option:`HPX_WITH_APEX_TAG` option. Please see the |apex_hpx_doc|_ for detailed instructions on using |apex| with |hpx|. diff --git a/docs/sphinx/manual/troubleshooting.rst b/docs/sphinx/manual/troubleshooting.rst index 8a693d30c6af..800e35f9e67b 100644 --- a/docs/sphinx/manual/troubleshooting.rst +++ b/docs/sphinx/manual/troubleshooting.rst @@ -74,7 +74,7 @@ You may see an error message that looks a bit like this: .. code-block:: text - Could NOT find TCMalloc (missing: TCMALLOC_LIBRARY TCMALLOC_INCLUDE_DIR) + Could NOT find TCMalloc (missing: Tcmalloc_LIBRARY Tcmalloc_INCLUDE_DIR) ERROR: HPX_WITH_MALLOC was set to tcmalloc, but tcmalloc could not be found. Valid options for HPX_WITH_MALLOC are: system, tcmalloc, jemalloc, mimalloc, tbbmalloc, and custom @@ -117,7 +117,7 @@ following flag on your |hpx| application CMake configuration: |hpx|-application build type conformance ---------------------------------------- -Your application’s build type should align with the HPX build type. For example, if you specified +Your application's build type should align with the HPX build type. For example, if you specified ``-DCMAKE_BUILD_TYPE=Debug`` during the |hpx| compilation, then your application needs to be compiled with the same flag. We recommend keeping a separate build folder for different build types and just point accordingly to the type you want by using ``-DHPX_DIR=/lib/cmake/HPX``. diff --git a/examples/1d_stencil/README.APEX b/examples/1d_stencil/README.APEX index 52eb26a83fa5..a17aa4badf8f 100644 --- a/examples/1d_stencil/README.APEX +++ b/examples/1d_stencil/README.APEX @@ -7,7 +7,7 @@ configure HPX with APEX: cmake ... \ -DHPX_WITH_APEX=TRUE \ -DAPEX_WITH_ACTIVEHARMONY=TRUE \ --DACTIVEHARMONY_ROOT= \ +-DActiveharmony_ROOT= \ ... Then to execute the example: diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index 1791882be2e0..272d27ba42ea 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -32,7 +32,7 @@ endif() set(hpx_external_SOURCES) if("${HPX_PLATFORM_UC}" STREQUAL "ANDROID") list(APPEND hpx_external_SOURCES ${hpx_external_objects_SOURCES} - "${ANDROID_NDK_ROOT}/sources/android/cpufeatures/cpu-features.c" + "${Android_NDK_ROOT}/sources/android/cpufeatures/cpu-features.c" ) endif() diff --git a/libs/core/command_line_handling_local/cmake/HPX_SetupJSON.cmake b/libs/core/command_line_handling_local/cmake/HPX_SetupJSON.cmake index f0e5bca5653c..119cb8eb07e3 100644 --- a/libs/core/command_line_handling_local/cmake/HPX_SetupJSON.cmake +++ b/libs/core/command_line_handling_local/cmake/HPX_SetupJSON.cmake @@ -4,6 +4,15 @@ # 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) +# compatibility with older CMake versions +if(JSON_ROOT AND NOT Json_ROOT) + set(Json_ROOT + ${JSON_ROOT} + CACHE PATH "Json base directory" + ) + unset(JSON_ROOT CACHE) +endif() + if(NOT HPX_WITH_FETCH_JSON) find_package(nlohmann_json 3.2.0 REQUIRED) elseif(NOT TARGET JSON::json) @@ -17,7 +26,7 @@ elseif(NOT TARGET JSON::json) ) else() hpx_info( - "HPX_WITH_FETCH_JSON=${HPX_WITH_FETCH_JSON}, JSON will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_JSON_TAG=${HPX_WITH_JSON_TAG})" + "HPX_WITH_FETCH_JSON=${HPX_WITH_FETCH_JSON}, JSON will be fetched using CMake's FetchContent and installed alongside HPX (HPX_WITH_Json_TAG=${HPX_WITH_Json_TAG})" ) endif() @@ -29,14 +38,14 @@ elseif(NOT TARGET JSON::json) ) fetchcontent_makeavailable(nlohmann_json) - set(JSON_ROOT ${nlohmann_json_SOURCE_DIR}) + set(Json_ROOT ${nlohmann_json_SOURCE_DIR}) add_library(json INTERFACE) target_include_directories( - json SYSTEM INTERFACE $ + json SYSTEM INTERFACE $ $ ) - target_compile_definitions(json INTERFACE JSON_HAS_CPP_17) + target_compile_definitions(json INTERFACE Json_HAS_CPP_17) install( TARGETS json @@ -45,7 +54,7 @@ elseif(NOT TARGET JSON::json) ) install( - DIRECTORY ${JSON_ROOT}/include/ + DIRECTORY ${Json_ROOT}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT core FILES_MATCHING diff --git a/libs/full/parcelport_libfabric/cmake/FindPMI.cmake b/libs/full/parcelport_libfabric/cmake/FindPMI.cmake index 20426147c638..ef7073ab1262 100644 --- a/libs/full/parcelport_libfabric/cmake/FindPMI.cmake +++ b/libs/full/parcelport_libfabric/cmake/FindPMI.cmake @@ -4,62 +4,70 @@ # 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) +# compatibility with older CMake versions +if(PMI_ROOT AND NOT Pmi_ROOT) + set(Pmi_ROOT + ${PMI_ROOT} + CACHE PATH "PMI base directory" + ) + unset(PMI_ROOT CACHE) +endif() + find_package(PkgConfig QUIET) + # look for cray pmi... -pkg_check_modules(PC_PMI_CRAY QUIET cray-pmi) +pkg_check_modules(PC_Pmi_CRAY QUIET cray-pmi) + # look for the rest if we couldn't find the cray package -if(NOT PC_PMI_CRAY_FOUND) - pkg_check_modules(PC_PMI QUIET pmi) +if(NOT PC_Pmi_CRAY_FOUND) + pkg_check_modules(PC_Pmi QUIET pmi) endif() find_path( - PMI_INCLUDE_DIR pmi2.h - HINTS ${PMI_ROOT} + Pmi_INCLUDE_DIR pmi2.h + HINTS ${Pmi_ROOT} ENV PMI_ROOT - ${PMI_DIR} + ${Pmi_DIR} ENV PMI_DIR - ${PC_PMI_CRAY_INCLUDEDIR} - ${PC_PMI_CRAY_INCLUDE_DIRS} - ${PC_PMI_INCLUDEDIR} - ${PC_PMI_INCLUDE_DIRS} + ${PC_Pmi_CRAY_INCLUDEDIR} + ${PC_Pmi_CRAY_INCLUDE_DIRS} + ${PC_Pmi_INCLUDEDIR} + ${PC_Pmi_INCLUDE_DIRS} PATH_SUFFIXES include ) find_library( - PMI_LIBRARY + Pmi_LIBRARY NAMES pmi - HINTS ${PMI_ROOT} + HINTS ${Pmi_ROOT} ENV PMI_ROOT - ${PC_PMI_CRAY_LIBDIR} - ${PC_PMI_CRAY_LIBRARY_DIRS} - ${PC_PMI_LIBDIR} - ${PC_PMI_LIBRARY_DIRS} + ${PC_Pmi_CRAY_LIBDIR} + ${PC_Pmi_CRAY_LIBRARY_DIRS} + ${PC_Pmi_LIBDIR} + ${PC_Pmi_LIBRARY_DIRS} PATH_SUFFIXES lib lib64 ) -# Set PMI_ROOT in case the other hints are used -if(PMI_ROOT) +# Set Pmi_ROOT in case the other hints are used +if(Pmi_ROOT) # The call to file is for compatibility with windows paths - file(TO_CMAKE_PATH ${PMI_ROOT} PMI_ROOT) + file(TO_CMAKE_PATH ${Pmi_ROOT} Pmi_ROOT) elseif("$ENV{PMI_ROOT}") - file(TO_CMAKE_PATH $ENV{PMI_ROOT} PMI_ROOT) + file(TO_CMAKE_PATH $ENV{PMI_ROOT} Pmi_ROOT) else() - file(TO_CMAKE_PATH "${PMI_INCLUDE_DIR}" PMI_INCLUDE_DIR) - string(REPLACE "/include" "" PMI_ROOT "${PMI_INCLUDE_DIR}") + file(TO_CMAKE_PATH "${Pmi_INCLUDE_DIR}" Pmi_INCLUDE_DIR) + string(REPLACE "/include" "" Pmi_ROOT "${Pmi_INCLUDE_DIR}") endif() -if(NOT PMI_LIBRARY OR NOT PMI_INCLUDE_DIR) - set(PMI_FOUND=OFF) +if(NOT Pmi_LIBRARY OR NOT Pmi_INCLUDE_DIR) + set(Pmi_FOUND=OFF) return() endif() -# hpx_error( "PMI_LIBRARY OR PMI_INCLUDE_DIR not found, please install PMI or -# set \ the right PMI_ROOT path" ) - include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(PMI DEFAULT_MSG PMI_LIBRARY PMI_INCLUDE_DIR) +find_package_handle_standard_args(PMI DEFAULT_MSG Pmi_LIBRARY Pmi_INCLUDE_DIR) -mark_as_advanced(PMI_ROOT PMI_LIBRARY PMI_INCLUDE_DIR) +mark_as_advanced(Pmi_ROOT Pmi_LIBRARY Pmi_INCLUDE_DIR) diff --git a/tests/performance/local/CMakeLists.txt b/tests/performance/local/CMakeLists.txt index 9566be850d4f..4d537abdf382 100644 --- a/tests/performance/local/CMakeLists.txt +++ b/tests/performance/local/CMakeLists.txt @@ -65,17 +65,17 @@ if(HPX_WITH_EXAMPLES_QTHREADS) ) set(qthreads_homogeneous_timed_task_spawn_FLAGS - NOLIBS DEPENDENCIES ${boost_library_dependencies} ${QTHREADS_LIBRARIES} + NOLIBS DEPENDENCIES ${boost_library_dependencies} ${Qthreads_LIBRARIES} hpx_core ) set(qthreads_heterogeneous_timed_task_spawn_FLAGS - NOLIBS DEPENDENCIES ${boost_library_dependencies} ${QTHREADS_LIBRARIES} + NOLIBS DEPENDENCIES ${boost_library_dependencies} ${Qthreads_LIBRARIES} hpx_core ) set(qthreads_heterogeneous_timed_task_spawn_INCLUDE_DIRECTORIES - ${QTHREADS_INCLUDE_DIR} + ${Qthreads_INCLUDE_DIR} ) endif() @@ -83,11 +83,11 @@ if(HPX_WITH_EXAMPLES_TBB) list(APPEND benchmarks tbb_homogeneous_timed_task_spawn) set(tbb_homogeneous_timed_task_spawn_FLAGS - NOLIBS DEPENDENCIES ${boost_library_dependencies} ${TBB_LIBRARIES} + NOLIBS DEPENDENCIES ${boost_library_dependencies} ${Tbb_LIBRARIES} hpx_core ) - set(tbb_homogeneous_timed_task_spawn_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIR}) + set(tbb_homogeneous_timed_task_spawn_INCLUDE_DIRECTORIES ${Tbb_INCLUDE_DIR}) endif() if(HPX_WITH_DISTRIBUTED_RUNTIME) diff --git a/tests/performance/local/htts_v2/CMakeLists.txt b/tests/performance/local/htts_v2/CMakeLists.txt index 05647b2fd811..86bf74b2a5ba 100644 --- a/tests/performance/local/htts_v2/CMakeLists.txt +++ b/tests/performance/local/htts_v2/CMakeLists.txt @@ -12,14 +12,14 @@ endif() if(HPX_WITH_EXAMPLES_QTHREADS) set(benchmarks ${benchmarks} htts2_qthreads) - set(htts2_qthreads_LIBRARIES ${QTHREADS_LIBRARY}) - set(htts2_qthreads_INCLUDE_DIRECTORIES ${QTHREADS_INCLUDE_DIR}) + set(htts2_qthreads_LIBRARIES ${Qthreads_LIBRARY}) + set(htts2_qthreads_INCLUDE_DIRECTORIES ${Qthreads_INCLUDE_DIR}) endif() if(HPX_WITH_EXAMPLES_TBB) set(benchmarks ${benchmarks} htts2_tbb) - set(htts2_tbb_LIBRARIES ${TBB_LIBRARY}) - set(htts2_tbb_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIR}) + set(htts2_tbb_LIBRARIES ${Tbb_LIBRARY}) + set(htts2_tbb_INCLUDE_DIRECTORIES ${Tbb_INCLUDE_DIR}) endif() foreach(benchmark ${benchmarks}) diff --git a/tools/build_boost.sh b/tools/build_boost.sh index 9573ebe0b58b..e821eaf24c5b 100755 --- a/tools/build_boost.sh +++ b/tools/build_boost.sh @@ -198,10 +198,10 @@ echo echo "Successfully built Boost ${DOT_VERSION}" echo echo "Debug root:" -echo " BOOST_ROOT=$DIRECTORY/debug" +echo " Boost_ROOT=$DIRECTORY/debug" echo echo "Release root:" -echo " BOOST_ROOT=$DIRECTORY/release" +echo " Boost_ROOT=$DIRECTORY/release"