From dfe2bbe003756944a4c56e096476bd783d9ce52c Mon Sep 17 00:00:00 2001 From: Vedant Date: Tue, 19 Dec 2023 23:53:04 +0530 Subject: [PATCH 01/11] Adding boost fetch option and corresponding workflow tests Signed-off-by: Vedant --- .github/workflows/linux_debug_boost_fetch.yml | 45 ++++++++++ .github/workflows/macos_debug.yml | 4 +- .github/workflows/macos_debug_fetch_boost.yml | 83 +++++++++++++++++++ .../windows_debug_vs2022_fetch_boost.yml | 61 ++++++++++++++ CMakeLists.txt | 9 ++ cmake/HPX_SetupBoost.cmake | 33 ++++++++ 6 files changed, 234 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/linux_debug_boost_fetch.yml create mode 100644 .github/workflows/macos_debug_fetch_boost.yml create mode 100644 .github/workflows/windows_debug_vs2022_fetch_boost.yml diff --git a/.github/workflows/linux_debug_boost_fetch.yml b/.github/workflows/linux_debug_boost_fetch.yml new file mode 100644 index 000000000000..2756622c86e1 --- /dev/null +++ b/.github/workflows/linux_debug_boost_fetch.yml @@ -0,0 +1,45 @@ +# Copyright (c) 2020 ETH Zurich +# +# 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) + +name: Linux CI (Debug) with Boost Fetch + +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + container: stellargroup/build_env:14 + + steps: + - uses: actions/checkout@v4 + - name: Configure + shell: bash + run: | + cmake \ + . \ + -Bbuild \ + -GNinja \ + -DCMAKE_BUILD_TYPE=Debug \ + -DHPX_WITH_MALLOC=system \ + -DHPX_WITH_FETCH_ASIO=ON \ + -DHPX_WITH_FETCH_BOOST=ON \ + -DHPX_WITH_EXAMPLES=ON \ + -DHPX_WITH_TESTS=ON \ + -DHPX_WITH_TESTS_MAX_THREADS_PER_LOCALITY=2 \ + -DHPX_WITH_CHECK_MODULE_DEPENDENCIES=On + - name: Build + shell: bash + run: | + cmake --build build --target all + cmake --build build --target examples + - name: Test + shell: bash + run: | + cd build + ctest \ + --output-on-failure \ + --tests-regex tests.examples \ + --exclude-regex tests.examples.transpose.transpose_block_numa diff --git a/.github/workflows/macos_debug.yml b/.github/workflows/macos_debug.yml index 3ddb09f960f0..887745a840c1 100644 --- a/.github/workflows/macos_debug.yml +++ b/.github/workflows/macos_debug.yml @@ -6,7 +6,9 @@ name: macOS CI (Debug) -on: [pull_request] +on: + push: + branches: [ boost_fetch ] jobs: build: diff --git a/.github/workflows/macos_debug_fetch_boost.yml b/.github/workflows/macos_debug_fetch_boost.yml new file mode 100644 index 000000000000..cfa45a07e172 --- /dev/null +++ b/.github/workflows/macos_debug_fetch_boost.yml @@ -0,0 +1,83 @@ +# Copyright (c) 2020 Mikael Simberg +# +# 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) + +name: macOS CI (Debug) with Boost Fetch + +on: + push: + branches: [ boost_fetch ] + +jobs: + build: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + # Workaround for https://github.com/actions/virtual-environments/issues/2322 + rm -rf /usr/local/bin/2to3* + rm -rf /usr/local/bin/idle3* + rm -rf /usr/local/bin/pydoc3* + rm -rf /usr/local/bin/python3* + brew upgrade + brew update && \ + brew install --overwrite python-tk && \ + brew install --overwrite hwloc gperftools ninja && \ + brew upgrade cmake + - name: Configure + shell: bash + run: | + cmake \ + -H. \ + -Bbuild \ + -GNinja \ + -DCMAKE_BUILD_TYPE=Debug \ + -DHPX_WITH_FETCH_ASIO=ON \ + -DHPX_WITH_FETCH_BOOST=ON \ + -DHPX_WITH_EXAMPLES=ON \ + -DHPX_WITH_TESTS=ON \ + -DHPX_WITH_TESTS_MAX_THREADS_PER_LOCALITY=2 \ + -DHPX_WITH_CHECK_MODULE_DEPENDENCIES=On + - name: Build + shell: bash + run: | + cmake --build build --target all + - name: Test + shell: bash + run: | + cmake --build build --target tests + cd build + ctest --output-on-failure \ + --exclude-regex \ + "tests.examples.quickstart.1d_wave_equation|\ + tests.examples.transpose.transpose_block_numa|\ + tests.performance.local.wait_all_timings|\ + tests.regressions.components.distributed.tcp.bulk_new_3054|\ + tests.regressions.dynamic_counters_loaded_1508|\ + tests.regressions.lcos.wait_all_hang_1946|\ + tests.regressions.modules.async_combinators.wait_all_hang_1946|\ + tests.regressions.modules.collectives.distributed.tcp.broadcast_apply|\ + tests.regressions.modules.collectives.distributed.tcp.broadcast_unwrap_future_2885|\ + tests.regressions.modules.collectives.distributed.tcp.remote_latch|\ + tests.regressions.modules.compute_local.parallel_fill_4132|\ + tests.regressions.util.distributed.tcp.zero_copy_parcels_1001_no_zero_copy_optimization|\ + tests.regressions.modules.performance_counters.dynamic_counters_loaded_1508|\ + tests.regressions.modules.performance_counters.statistics_2666|\ + tests.unit.modules.runtime_components.distributed.tcp.migrate_component|\ + tests.unit.modules.runtime_components.distributed.tcp.migrate_polymorphic_component|\ + tests.unit.modules.algorithms.default_construct|\ + tests.unit.modules.algorithms.destroy|\ + tests.unit.modules.algorithms.foreach_executors|\ + tests.unit.modules.algorithms.max_element|\ + tests.unit.modules.algorithms.replace_copy_if|\ + tests.unit.modules.compute_local.numa_allocator|\ + tests.unit.modules.execution.standalone_thread_pool_executor|\ + tests.unit.modules.resource_partitioner.used_pus|\ + tests.unit.modules.segmented_algorithms.distributed.tcp.partitioned_vector|\ + tests.unit.threads.distributed.tcp.thread_stacksize|\ + tests.unit.topology.numa_allocator|\ + tests.unit.modules.runtime_components.distributed.tcp.migrate_polymorphic_component" diff --git a/.github/workflows/windows_debug_vs2022_fetch_boost.yml b/.github/workflows/windows_debug_vs2022_fetch_boost.yml new file mode 100644 index 000000000000..d3804a93070b --- /dev/null +++ b/.github/workflows/windows_debug_vs2022_fetch_boost.yml @@ -0,0 +1,61 @@ +# Copyright (c) 2020 Mikael Simberg +# +# 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) + +name: Windows CI (Debug, VS2022 toolset) with Boost Fetch + +on: [pull_request] + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - uses: jwlawson/actions-setup-cmake@v1.14 + with: + cmake-version: '3.22.x' + - name: Install dependencies + run: | + md C:\projects + $client = new-object System.Net.WebClient + $client.DownloadFile("https://rostam.cct.lsu.edu/download/builder/vcpkg-export-hpx-dependencies-2022.7z","C:\projects\vcpkg-export-hpx-dependencies.7z") + 7z x C:\projects\vcpkg-export-hpx-dependencies.7z -y -oC:\projects\vcpkg + - name: Configure + shell: bash + run: | + cmake . -Bbuild -G'Visual Studio 17 2022' \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_TOOLCHAIN_FILE='C:/projects/vcpkg/scripts/buildsystems/vcpkg.cmake' \ + -DHPX_WITH_FETCH_BOOST=ON \ + -DHPX_WITH_FETCH_ASIO=ON \ + -DHPX_WITH_EXAMPLES=ON \ + -DHPX_WITH_TESTS=ON \ + -DHPX_WITH_TESTS_UNIT=ON \ + -DHPX_WITH_DEPRECATION_WARNINGS=OFF \ + -DHPX_WITH_TESTS_MAX_THREADS_PER_LOCALITY=2 \ + -DHPX_COROUTINES_WITH_SWAP_CONTEXT_EMULATION=ON \ + -DHPX_WITH_CHECK_MODULE_DEPENDENCIES=On + - name: Build + shell: bash + run: | + cmake --build build --config Debug \ + --target ALL_BUILD \ + -- -maxcpucount:2 -verbosity:minimal -nologo + - name: Install + shell: bash + run: | + cmake --install build --config Debug + - name: Test + run: | + Set-Alias -Name grep -Value 'C:\Program Files\Git\usr\bin\grep.exe' + Set-Alias -Name sed -Value 'C:\Program Files\Git\usr\bin\sed.exe' + cd build + ctest ` + --output-on-failure ` + --build-config Debug ` + --tests-regex tests.examples ` + --exclude-regex ` + $(grep -v -e ^# -e ^$ D:/a/hpx/hpx/.github/workflows/tests.examples.targets | sed ':b;N;$!bb;s/\n/|/g') diff --git a/CMakeLists.txt b/CMakeLists.txt index 996c66ba25e3..796d2a89f3d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -958,6 +958,15 @@ if(HPX_WITH_APEX) ) endif() +hpx_option( + HPX_WITH_FETCH_BOOST + BOOL + "Use FetchContent to fetch Asio. By default an installed Asio will be used. (default: OFF)" + OFF + CATEGORY "Build Targets" + ADVANCED +) + # Options for automatically fetching Asio hpx_option( HPX_WITH_FETCH_ASIO diff --git a/cmake/HPX_SetupBoost.cmake b/cmake/HPX_SetupBoost.cmake index 873d7724a714..79b0099c0bb0 100644 --- a/cmake/HPX_SetupBoost.cmake +++ b/cmake/HPX_SetupBoost.cmake @@ -5,6 +5,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) +if (HPX_WITH_FETCH_BOOST) + include(FetchContent) + FetchContent_Declare(Boost + URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz + TLS_VERIFY true + ) + FetchContent_Populate(Boost) + + set(EX_PRC "Execute process" CACHE STRING "Used by command line tool.") + set(EX_PRC_INTERNAL "" CACHE INTERNAL "for internal use only; do not modify") + + if(NOT EX_PRC STREQUAL EX_PRC_INTERNAL) + if(WIN32) + execute_process(COMMAND cmd /C "cd ${CMAKE_BINARY_DIR}\\_deps\\boost-src && .\\bootstrap.bat && .\\b2 headers cxxflags=/std:c++20" ) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + hpx_info("Building fetched boost") + execute_process(COMMAND sh -c "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed && ./b2 && ./b2 install --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed cxxflags=--std=c++20") + else() + execute_process(COMMAND sh -c "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++20" ) + endif() + set(EX_PRC_INTERNAL ${EX_PRC} CACHE INTERNAL "for internal use only; do not modify") + endif() + + if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(Boost_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") + set(Boost_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") + set(Boost_LIBRARY_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src/stage/lib") + else() + set(Boost_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") + set(Boost_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") + endif() +endif() + # In case find_package(HPX) is called multiple times if(NOT TARGET hpx_dependencies_boost) # We first try to find the required minimum set of Boost libraries. This will From 2c7a068bf7175cb7a0f8c2ff8f68a416f10c5c7e Mon Sep 17 00:00:00 2001 From: Vedant Date: Thu, 18 Jan 2024 22:45:53 +0530 Subject: [PATCH 02/11] Added copyright, and renamed file for linux workflow Signed-off-by: Vedant --- ...{linux_debug_boost_fetch.yml => linux_debug_fetch_boost.yml} | 2 +- .github/workflows/macos_debug_fetch_boost.yml | 2 +- .github/workflows/windows_debug_vs2022_fetch_boost.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{linux_debug_boost_fetch.yml => linux_debug_fetch_boost.yml} (97%) diff --git a/.github/workflows/linux_debug_boost_fetch.yml b/.github/workflows/linux_debug_fetch_boost.yml similarity index 97% rename from .github/workflows/linux_debug_boost_fetch.yml rename to .github/workflows/linux_debug_fetch_boost.yml index 2756622c86e1..b9075783fdea 100644 --- a/.github/workflows/linux_debug_boost_fetch.yml +++ b/.github/workflows/linux_debug_fetch_boost.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2020 ETH Zurich +# Copyright (c) 2024 Vedant Nimje # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/.github/workflows/macos_debug_fetch_boost.yml b/.github/workflows/macos_debug_fetch_boost.yml index cfa45a07e172..6e15323bb26a 100644 --- a/.github/workflows/macos_debug_fetch_boost.yml +++ b/.github/workflows/macos_debug_fetch_boost.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Mikael Simberg +# Copyright (c) 2024 Vedant Nimje # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/.github/workflows/windows_debug_vs2022_fetch_boost.yml b/.github/workflows/windows_debug_vs2022_fetch_boost.yml index d3804a93070b..1e7a7e5f8123 100644 --- a/.github/workflows/windows_debug_vs2022_fetch_boost.yml +++ b/.github/workflows/windows_debug_vs2022_fetch_boost.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Mikael Simberg +# Copyright (c) 2024 Vedant Nimje # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying From 2942a7428130c6032bd6761e1c2fa6cc8418701a Mon Sep 17 00:00:00 2001 From: Vedant Date: Thu, 18 Jan 2024 22:47:36 +0530 Subject: [PATCH 03/11] Set activation for macos workflows to pull_request only Signed-off-by: Vedant --- .github/workflows/macos_debug.yml | 4 +--- .github/workflows/macos_debug_fetch_boost.yml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos_debug.yml b/.github/workflows/macos_debug.yml index 887745a840c1..3ddb09f960f0 100644 --- a/.github/workflows/macos_debug.yml +++ b/.github/workflows/macos_debug.yml @@ -6,9 +6,7 @@ name: macOS CI (Debug) -on: - push: - branches: [ boost_fetch ] +on: [pull_request] jobs: build: diff --git a/.github/workflows/macos_debug_fetch_boost.yml b/.github/workflows/macos_debug_fetch_boost.yml index 6e15323bb26a..c60bc2c1b3e7 100644 --- a/.github/workflows/macos_debug_fetch_boost.yml +++ b/.github/workflows/macos_debug_fetch_boost.yml @@ -6,9 +6,7 @@ name: macOS CI (Debug) with Boost Fetch -on: - push: - branches: [ boost_fetch ] +on: [pull_request] jobs: build: From 23c1d497b55e3663935df8642bccd9b7affe270d Mon Sep 17 00:00:00 2001 From: Vedant Date: Thu, 18 Jan 2024 23:34:22 +0530 Subject: [PATCH 04/11] Fixing order of steps in macOS workflow Signed-off-by: Vedant --- .github/workflows/macos_debug_fetch_boost.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos_debug_fetch_boost.yml b/.github/workflows/macos_debug_fetch_boost.yml index c60bc2c1b3e7..4386e5a4e800 100644 --- a/.github/workflows/macos_debug_fetch_boost.yml +++ b/.github/workflows/macos_debug_fetch_boost.yml @@ -44,10 +44,10 @@ jobs: shell: bash run: | cmake --build build --target all + cmake --build build --target tests - name: Test shell: bash run: | - cmake --build build --target tests cd build ctest --output-on-failure \ --exclude-regex \ From 0b69e30f632e51b188d840e3054a7c31751e10f0 Mon Sep 17 00:00:00 2001 From: Vedant Date: Fri, 19 Jan 2024 22:33:28 +0530 Subject: [PATCH 05/11] Added variable for Boost variables, and made some misc changes Signed-off-by: Vedant --- cmake/HPX_SetupBoost.cmake | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cmake/HPX_SetupBoost.cmake b/cmake/HPX_SetupBoost.cmake index 79b0099c0bb0..1bbbb80642c3 100644 --- a/cmake/HPX_SetupBoost.cmake +++ b/cmake/HPX_SetupBoost.cmake @@ -6,9 +6,13 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) if (HPX_WITH_FETCH_BOOST) + set(HPX_WITH_BOOST_VERSION "1.84.0") + hpx_info( + "HPX_WITH_FETCH_BOOST=${HPX_WITH_FETCH_BOOST}, Boost v${HPX_WITH_BOOST_VERSION} will be fetched using CMake's FetchContent" + ) include(FetchContent) FetchContent_Declare(Boost - URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz + URL https://github.com/boostorg/boost/releases/download/boost-${HPX_WITH_BOOST_VERSION}/boost-${HPX_WITH_BOOST_VERSION}.tar.gz TLS_VERIFY true ) FetchContent_Populate(Boost) @@ -28,13 +32,8 @@ if (HPX_WITH_FETCH_BOOST) set(EX_PRC_INTERNAL ${EX_PRC} CACHE INTERNAL "for internal use only; do not modify") endif() - if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(Boost_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") - set(Boost_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") - set(Boost_LIBRARY_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src/stage/lib") - else() - set(Boost_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") - set(Boost_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") + set(Boost_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") + set(Boost_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") endif() endif() From 0287f31a1fa79f21f144063565213321f0779ed1 Mon Sep 17 00:00:00 2001 From: Vedant Date: Tue, 23 Jan 2024 22:11:06 +0530 Subject: [PATCH 06/11] Applying cmake-format to Boost setup file Signed-off-by: Vedant --- cmake/HPX_SetupBoost.cmake | 46 ++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/cmake/HPX_SetupBoost.cmake b/cmake/HPX_SetupBoost.cmake index 1bbbb80642c3..ddef0ef615df 100644 --- a/cmake/HPX_SetupBoost.cmake +++ b/cmake/HPX_SetupBoost.cmake @@ -5,36 +5,58 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -if (HPX_WITH_FETCH_BOOST) +if(HPX_WITH_FETCH_BOOST) set(HPX_WITH_BOOST_VERSION "1.84.0") hpx_info( "HPX_WITH_FETCH_BOOST=${HPX_WITH_FETCH_BOOST}, Boost v${HPX_WITH_BOOST_VERSION} will be fetched using CMake's FetchContent" ) include(FetchContent) - FetchContent_Declare(Boost - URL https://github.com/boostorg/boost/releases/download/boost-${HPX_WITH_BOOST_VERSION}/boost-${HPX_WITH_BOOST_VERSION}.tar.gz - TLS_VERIFY true + fetchcontent_declare( + Boost + URL https://github.com/boostorg/boost/releases/download/boost-${HPX_WITH_BOOST_VERSION}/boost-${HPX_WITH_BOOST_VERSION}.tar.gz + TLS_VERIFY true ) - FetchContent_Populate(Boost) + fetchcontent_populate(Boost) - set(EX_PRC "Execute process" CACHE STRING "Used by command line tool.") - set(EX_PRC_INTERNAL "" CACHE INTERNAL "for internal use only; do not modify") + set(EX_PRC + "Execute process" + CACHE STRING "Used by command line tool." + ) + set(EX_PRC_INTERNAL + "" + CACHE INTERNAL "for internal use only; do not modify" + ) if(NOT EX_PRC STREQUAL EX_PRC_INTERNAL) if(WIN32) - execute_process(COMMAND cmd /C "cd ${CMAKE_BINARY_DIR}\\_deps\\boost-src && .\\bootstrap.bat && .\\b2 headers cxxflags=/std:c++20" ) + execute_process( + COMMAND + cmd /C + "cd ${CMAKE_BINARY_DIR}\\_deps\\boost-src && .\\bootstrap.bat && .\\b2 headers cxxflags=/std:c++20" + ) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") hpx_info("Building fetched boost") - execute_process(COMMAND sh -c "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed && ./b2 && ./b2 install --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed cxxflags=--std=c++20") + execute_process( + COMMAND + sh -c + "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed && ./b2 && ./b2 install --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed cxxflags=--std=c++20" + ) else() - execute_process(COMMAND sh -c "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++20" ) + execute_process( + COMMAND + sh -c + "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++20" + ) endif() - set(EX_PRC_INTERNAL ${EX_PRC} CACHE INTERNAL "for internal use only; do not modify") + set(EX_PRC_INTERNAL + ${EX_PRC} + CACHE INTERNAL "for internal use only; do not modify" + ) endif() set(Boost_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") set(Boost_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") - endif() +endif() endif() # In case find_package(HPX) is called multiple times From d0f3a32f7dfc34bf7d3073578e36b3497501b7de Mon Sep 17 00:00:00 2001 From: Vedant Date: Tue, 23 Jan 2024 22:19:13 +0530 Subject: [PATCH 07/11] Removing left-out endif() statement Signed-off-by: Vedant --- cmake/HPX_SetupBoost.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmake/HPX_SetupBoost.cmake b/cmake/HPX_SetupBoost.cmake index ddef0ef615df..cfaf8ebf86cb 100644 --- a/cmake/HPX_SetupBoost.cmake +++ b/cmake/HPX_SetupBoost.cmake @@ -35,7 +35,6 @@ if(HPX_WITH_FETCH_BOOST) "cd ${CMAKE_BINARY_DIR}\\_deps\\boost-src && .\\bootstrap.bat && .\\b2 headers cxxflags=/std:c++20" ) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - hpx_info("Building fetched boost") execute_process( COMMAND sh -c @@ -57,7 +56,6 @@ if(HPX_WITH_FETCH_BOOST) set(Boost_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") set(Boost_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") endif() -endif() # In case find_package(HPX) is called multiple times if(NOT TARGET hpx_dependencies_boost) From 8a8d6acd4f423f54c05f8e511a4f20a99adefe6d Mon Sep 17 00:00:00 2001 From: Vedant Date: Wed, 24 Jan 2024 11:42:08 +0530 Subject: [PATCH 08/11] Adding description for fetch option Signed-off-by: Vedant --- CMakeLists.txt | 2 +- cmake/HPX_SetupBoost.cmake | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 796d2a89f3d6..ff03f869940a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -961,7 +961,7 @@ endif() hpx_option( HPX_WITH_FETCH_BOOST BOOL - "Use FetchContent to fetch Asio. By default an installed Asio will be used. (default: OFF)" + "Use FetchContent to fetch Boost. By default an installed Boost will be used. (default: OFF)" OFF CATEGORY "Build Targets" ADVANCED diff --git a/cmake/HPX_SetupBoost.cmake b/cmake/HPX_SetupBoost.cmake index cfaf8ebf86cb..28803e8594ca 100644 --- a/cmake/HPX_SetupBoost.cmake +++ b/cmake/HPX_SetupBoost.cmake @@ -15,6 +15,7 @@ if(HPX_WITH_FETCH_BOOST) Boost URL https://github.com/boostorg/boost/releases/download/boost-${HPX_WITH_BOOST_VERSION}/boost-${HPX_WITH_BOOST_VERSION}.tar.gz TLS_VERIFY true + DOWNLOAD_EXTRACT_TIMESTAMP true ) fetchcontent_populate(Boost) @@ -53,8 +54,14 @@ if(HPX_WITH_FETCH_BOOST) ) endif() - set(Boost_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") - set(Boost_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") + set(Boost_DIR + "${CMAKE_BINARY_DIR}/_deps/boost-src" + CACHE INTERNAL "" + ) + set(Boost_INCLUDE_DIR + "${CMAKE_BINARY_DIR}/_deps/boost-src" + CACHE INTERNAL "" + ) endif() # In case find_package(HPX) is called multiple times From 505853dfed78725b4bf7203712f95cd19c1553ba Mon Sep 17 00:00:00 2001 From: Vedant Date: Fri, 26 Jan 2024 15:38:19 +0530 Subject: [PATCH 09/11] Modified commands to build boost using HPX_CXX_STANDARD, and made misc changes Signed-off-by: Vedant --- cmake/HPX_SetupBoost.cmake | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmake/HPX_SetupBoost.cmake b/cmake/HPX_SetupBoost.cmake index 28803e8594ca..330cee36068d 100644 --- a/cmake/HPX_SetupBoost.cmake +++ b/cmake/HPX_SetupBoost.cmake @@ -18,14 +18,13 @@ if(HPX_WITH_FETCH_BOOST) DOWNLOAD_EXTRACT_TIMESTAMP true ) fetchcontent_populate(Boost) - set(EX_PRC "Execute process" CACHE STRING "Used by command line tool." ) set(EX_PRC_INTERNAL "" - CACHE INTERNAL "for internal use only; do not modify" + CACHE STRING "for internal use only; do not modify" ) if(NOT EX_PRC STREQUAL EX_PRC_INTERNAL) @@ -33,19 +32,19 @@ if(HPX_WITH_FETCH_BOOST) execute_process( COMMAND cmd /C - "cd ${CMAKE_BINARY_DIR}\\_deps\\boost-src && .\\bootstrap.bat && .\\b2 headers cxxflags=/std:c++20" + "cd ${CMAKE_BINARY_DIR}\\_deps\\boost-src && .\\bootstrap.bat && .\\b2 headers cxxflags=/std:c++${HPX_CXX_STANDARD}" ) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") execute_process( COMMAND sh -c - "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed && ./b2 && ./b2 install --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed cxxflags=--std=c++20" + "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed && ./b2 && ./b2 install --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed cxxflags=--std=c++${HPX_CXX_STANDARD}" ) else() execute_process( COMMAND sh -c - "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++20" + "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++${HPX_WITH_CXX_STANDARD}" ) endif() set(EX_PRC_INTERNAL From ecc252e40cf5d55b3785cbf1f8dd90f9470dfe15 Mon Sep 17 00:00:00 2001 From: Vedant Date: Fri, 26 Jan 2024 22:34:17 +0530 Subject: [PATCH 10/11] Changing variable names for consistency Signed-off-by: Vedant --- cmake/HPX_SetupBoost.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/HPX_SetupBoost.cmake b/cmake/HPX_SetupBoost.cmake index 330cee36068d..3d650cf2d83d 100644 --- a/cmake/HPX_SetupBoost.cmake +++ b/cmake/HPX_SetupBoost.cmake @@ -18,16 +18,16 @@ if(HPX_WITH_FETCH_BOOST) DOWNLOAD_EXTRACT_TIMESTAMP true ) fetchcontent_populate(Boost) - set(EX_PRC + set(HPX_WITH_EX_PRC "Execute process" CACHE STRING "Used by command line tool." ) - set(EX_PRC_INTERNAL + set(HPX_WITH_EX_PRC_INTERNAL "" CACHE STRING "for internal use only; do not modify" ) - if(NOT EX_PRC STREQUAL EX_PRC_INTERNAL) + if(NOT HPX_WITH_EX_PRC STREQUAL HPX_WITH_EX_PRC_INTERNAL) if(WIN32) execute_process( COMMAND @@ -47,8 +47,8 @@ if(HPX_WITH_FETCH_BOOST) "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++${HPX_WITH_CXX_STANDARD}" ) endif() - set(EX_PRC_INTERNAL - ${EX_PRC} + set(HPX_WITH_EX_PRC_INTERNAL + ${HPX_WITH_EX_PRC} CACHE INTERNAL "for internal use only; do not modify" ) endif() From 437f36599897933fc1cb2c37020b2b6bead90463 Mon Sep 17 00:00:00 2001 From: Vedant Date: Sun, 28 Jan 2024 22:19:08 +0530 Subject: [PATCH 11/11] Renaming variables to be self-explanatory Signed-off-by: Vedant --- cmake/HPX_SetupBoost.cmake | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/cmake/HPX_SetupBoost.cmake b/cmake/HPX_SetupBoost.cmake index 3d650cf2d83d..86d2d3fa7e75 100644 --- a/cmake/HPX_SetupBoost.cmake +++ b/cmake/HPX_SetupBoost.cmake @@ -18,16 +18,20 @@ if(HPX_WITH_FETCH_BOOST) DOWNLOAD_EXTRACT_TIMESTAMP true ) fetchcontent_populate(Boost) - set(HPX_WITH_EX_PRC + set(HPX_WITH_BUILD_FETCHED_BOOST "Execute process" - CACHE STRING "Used by command line tool." + CACHE STRING "Used by command line tool to build fetched Boost" ) - set(HPX_WITH_EX_PRC_INTERNAL + set(HPX_WITH_BUILD_FETCHED_BOOST_CHECK "" - CACHE STRING "for internal use only; do not modify" + CACHE + STRING + "for internal use only, do not modify. Checks if fetched Boost is built" ) - if(NOT HPX_WITH_EX_PRC STREQUAL HPX_WITH_EX_PRC_INTERNAL) + if(NOT HPX_WITH_BUILD_FETCHED_BOOST STREQUAL + HPX_WITH_BUILD_FETCHED_BOOST_CHECK + ) if(WIN32) execute_process( COMMAND @@ -44,12 +48,14 @@ if(HPX_WITH_FETCH_BOOST) execute_process( COMMAND sh -c - "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++${HPX_WITH_CXX_STANDARD}" + "cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++${HPX_CXX_STANDARD}" ) endif() - set(HPX_WITH_EX_PRC_INTERNAL - ${HPX_WITH_EX_PRC} - CACHE INTERNAL "for internal use only; do not modify" + set(HPX_WITH_BUILD_FETCHED_BOOST_CHECK + ${HPX_WITH_BUILD_FETCHED_BOOST} + CACHE + INTERNAL + "for internal use only, do not modify. Checks if fetched Boost is built" ) endif()