Skip to content

Commit

Permalink
Merge #6305
Browse files Browse the repository at this point in the history
6305: Adapting build system for CMake V3.27 r=hkaiser a=hkaiser

CMake starting with V3.27 complains about all-CAPS `<LIBRARY>_ROOT` variable names.

Co-authored-by: Hartmut Kaiser <[email protected]>
  • Loading branch information
StellarBot and hkaiser committed Aug 20, 2023
2 parents 55ba082 + 1e319be commit 557b87d
Show file tree
Hide file tree
Showing 74 changed files with 999 additions and 873 deletions.
2 changes: 1 addition & 1 deletion .jenkins/cscs/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pipeline {
// number of node-hours consumed
axis {
name 'configuration_name'
values 'gcc-11', 'gcc-cuda', 'clang-10', 'clang-13', 'clang-cuda', 'clang-apex'
values 'gcc-11', 'clang-10', 'clang-13', 'clang-apex'
}
axis {
name 'build_type'
Expand Down
41 changes: 0 additions & 41 deletions .jenkins/cscs/env-clang-12.sh

This file was deleted.

46 changes: 0 additions & 46 deletions .jenkins/cscs/env-clang-cuda.sh

This file was deleted.

34 changes: 0 additions & 34 deletions .jenkins/cscs/env-gcc-10.sh

This file was deleted.

28 changes: 0 additions & 28 deletions .jenkins/cscs/env-gcc-cuda.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .jenkins/cscs/slurm-constraint-clang-12.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .jenkins/cscs/slurm-constraint-clang-9.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .jenkins/cscs/slurm-constraint-clang-cuda.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .jenkins/cscs/slurm-constraint-gcc-10.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .jenkins/cscs/slurm-constraint-gcc-8.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .jenkins/cscs/slurm-constraint-gcc-cuda.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .jenkins/cscs/slurm-constraint-icc.sh

This file was deleted.

33 changes: 22 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -2310,12 +2310,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)
Expand All @@ -2341,7 +2352,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
Expand Down Expand Up @@ -2466,7 +2477,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}
Expand Down
53 changes: 31 additions & 22 deletions cmake/FindAmplifier.cmake
Original file line number Diff line number Diff line change
@@ -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()
Loading

0 comments on commit 557b87d

Please sign in to comment.