From 9bf27c57eee5dd45dd82496459285e55949d40e4 Mon Sep 17 00:00:00 2001 From: Auriane R Date: Tue, 6 Sep 2022 11:52:28 +0200 Subject: [PATCH 1/5] Replace fetch_content by find_package for p2300 package --- cmake/pika_setup_p2300.cmake | 39 ++++++------------------------------ 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/cmake/pika_setup_p2300.cmake b/cmake/pika_setup_p2300.cmake index 06118e0b8..d691cfdd0 100644 --- a/cmake/pika_setup_p2300.cmake +++ b/cmake/pika_setup_p2300.cmake @@ -5,45 +5,18 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) if(PIKA_WITH_P2300_REFERENCE_IMPLEMENTATION AND NOT PIKA_FIND_PACKAGE) + if(PIKA_WITH_CXX_STANDARD LESS 20) + pika_error( "PIKA_WITH_P2300_REFERENCE_IMPLEMENTATION requires at least C++20 (PIKA_WITH_CXX_STANDARD is currently ${PIKA_WITH_CXX_STANDARD})" ) - endif() - - include(FetchContent) - fetchcontent_declare( - P2300 - GIT_REPOSITORY https://github.com/brycelelbach/wg21_P2300_std_execution.git - GIT_TAG 063fd9a9e8d9c0284f795f5342e057b3bc428202 - ) - fetchcontent_getproperties(P2300) - if(NOT p2300_POPULATED) - fetchcontent_populate(P2300) endif() - add_library(P2300 INTERFACE) - target_include_directories( - P2300 SYSTEM INTERFACE "$" - "$" - ) - target_compile_features(P2300 INTERFACE cxx_std_20) - - install( - TARGETS P2300 - EXPORT pika_internal_targets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT core - ) - pika_export_internal_targets(P2300) - - install( - DIRECTORY "${p2300_SOURCE_DIR}/include/" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" - COMPONENT core - ) + find_package(p2300 REQUIRED) + if(NOT PIKA_FIND_PACKAGE) + target_link_libraries(pika_base_libraries INTERFACE P2300::p2300) + endif() - target_link_libraries(pika_base_libraries INTERFACE P2300) endif() From 00fe2dd7c82a1bbb26829ab660b9f0b65947dbb2 Mon Sep 17 00:00:00 2001 From: Auriane R Date: Mon, 19 Sep 2022 21:16:33 +0200 Subject: [PATCH 2/5] Remove additional condition PIKA_FIND_PACKAGE --- cmake/pika_setup_p2300.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/pika_setup_p2300.cmake b/cmake/pika_setup_p2300.cmake index d691cfdd0..0e14ebcb1 100644 --- a/cmake/pika_setup_p2300.cmake +++ b/cmake/pika_setup_p2300.cmake @@ -4,7 +4,7 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -if(PIKA_WITH_P2300_REFERENCE_IMPLEMENTATION AND NOT PIKA_FIND_PACKAGE) +if(PIKA_WITH_P2300_REFERENCE_IMPLEMENTATION) if(PIKA_WITH_CXX_STANDARD LESS 20) From 17f14391d5e6215d87fcf8e5c596f513b19a0f93 Mon Sep 17 00:00:00 2001 From: Auriane R Date: Mon, 19 Sep 2022 21:17:18 +0200 Subject: [PATCH 3/5] Replace find_package with pika_find_package --- cmake/pika_setup_p2300.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/pika_setup_p2300.cmake b/cmake/pika_setup_p2300.cmake index 0e14ebcb1..234d8b1e0 100644 --- a/cmake/pika_setup_p2300.cmake +++ b/cmake/pika_setup_p2300.cmake @@ -14,7 +14,7 @@ if(PIKA_WITH_P2300_REFERENCE_IMPLEMENTATION) endif() - find_package(p2300 REQUIRED) + pika_find_package(p2300 REQUIRED) if(NOT PIKA_FIND_PACKAGE) target_link_libraries(pika_base_libraries INTERFACE P2300::p2300) endif() From 7b5685da1c02c7879dc1d00f8d0da478430695e4 Mon Sep 17 00:00:00 2001 From: Auriane R Date: Mon, 19 Sep 2022 22:33:49 +0200 Subject: [PATCH 4/5] Add p2300 setup in pika-config --- cmake/templates/pika-config.cmake.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/templates/pika-config.cmake.in b/cmake/templates/pika-config.cmake.in index 2667de03f..323950c6e 100644 --- a/cmake/templates/pika-config.cmake.in +++ b/cmake/templates/pika-config.cmake.in @@ -92,6 +92,8 @@ include(pika_setup_cuda) include(pika_setup_mpi) +include(pika_setup_p2300) + # APEX set(PIKA_APEX_ROOT "@APEX_ROOT@") include(pika_setup_apex) From 0d8da7c3ec9f70576345b1194a080f6c91342e46 Mon Sep 17 00:00:00 2001 From: Auriane R Date: Tue, 20 Sep 2022 09:02:18 +0200 Subject: [PATCH 5/5] Update image to version 9 to make p2300 available --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index abd6e3d40..17f9d7054 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ setup_arm64_machine: &setup_arm64_machine docker_default: &docker_default docker: - - image: pikaorg/pika-ci-base:8 + - image: pikaorg/pika-ci-base:9 defaults: &defaults <<: *working_dir_default