diff --git a/.circleci/config.yml b/.circleci/config.yml index 3a08796d4f05..47377297e97e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -601,7 +601,7 @@ jobs: -T test \ --no-compress-output \ --output-on-failure \ - --tests-regex `grep -v -e ^# -e ^$ /hpx/source/.circleci/tests.unit1.targets | sed ':b;N;$!bb;s/\n/|/g'` \ + --tests-regex `grep -v -e ^# -e ^$ /hpx/source/.circleci/tests.unit1.targets | sed ':b;N;$!bb;s/\n/|/g'` - run: <<: *convert_xml - run: diff --git a/.github/workflows/tests.examples.targets b/.github/workflows/tests.examples.targets new file mode 100644 index 000000000000..c387058eb408 --- /dev/null +++ b/.github/workflows/tests.examples.targets @@ -0,0 +1,43 @@ +# Copyright (c) 2022 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) +# +# examples that should not be run on Github windows builders +# +tests.examples.1d_stencil.1d_stencil_6 +tests.examples.1d_stencil.1d_stencil_7 +tests.examples.async_io.async_io_simple +tests.examples.modules.checkpoint.1d_stencil_4_checkpoint +tests.examples.modules.program_options.config_file_types +tests.examples.modules.program_options.custom_syntax +tests.examples.modules.program_options.env_options +tests.examples.modules.program_options.first +tests.examples.modules.program_options.multiple_sources +tests.examples.modules.program_options.option_groups +tests.examples.modules.program_options.options_description +tests.examples.modules.program_options.options_hierarchy +tests.examples.modules.program_options.real +tests.examples.modules.program_options.regex +tests.examples.modules.program_options.response_file +tests.examples.modules.resiliency_distributed.distributed.tcp.async_replay_distributed +tests.examples.modules.resiliency_distributed.distributed.tcp.async_replicate_distributed +tests.examples.modules.resiliency.1d_stencil_replay_exception +tests.examples.modules.resiliency.1d_stencil_replay_validate +tests.examples.modules.resiliency.async_replay +tests.examples.modules.resiliency.async_replicate_vote +tests.examples.modules.resiliency.async_replicate +tests.examples.modules.resiliency.dataflow_replicate +tests.examples.modules.resiliency.version +tests.examples.modules.resource_partitioner.async_customization +tests.examples.modules.resource_partitioner.guided_pool_test +tests.examples.modules.resource_partitioner.oversubscribing_resource_partitioner +tests.examples.modules.resource_partitioner.simple_resource_partitioner +tests.examples.modules.resource_partitioner.simplest_resource_partitioner_1 +tests.examples.modules.resource_partitioner.simplest_resource_partitioner_2 +tests.examples.quickstart.1d_wave_equation +tests.examples.quickstart.partitioned_vector_spmd_foreach +tests.examples.quickstart.sort_by_key_demo +tests.examples.transpose.transpose_block_numa +tests.examples.modules.collectives.distributed.tcp.channel_communicator diff --git a/.github/workflows/windows_debug.yml b/.github/workflows/windows_debug.yml index 814f4996687e..3ae1bc9f71e0 100644 --- a/.github/workflows/windows_debug.yml +++ b/.github/workflows/windows_debug.yml @@ -43,52 +43,19 @@ jobs: run: | cmake --build build --config Debug \ --target ALL_BUILD \ - -- -maxcpucount -verbosity:minimal -nologo + -- -maxcpucount:2 -verbosity:minimal -nologo - name: Install shell: bash run: | cmake --install build --config Debug - name: Test - shell: bash 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 \ - "tests.examples.1d_stencil.1d_stencil_6|\ - tests.examples.1d_stencil.1d_stencil_7|\ - tests.examples.async_io.async_io_simple|\ - tests.examples.modules.checkpoint.1d_stencil_4_checkpoint|\ - tests.examples.modules.program_options.config_file_types|\ - tests.examples.modules.program_options.custom_syntax|\ - tests.examples.modules.program_options.env_options|\ - tests.examples.modules.program_options.first|\ - tests.examples.modules.program_options.multiple_sources|\ - tests.examples.modules.program_options.option_groups|\ - tests.examples.modules.program_options.options_description|\ - tests.examples.modules.program_options.options_hierarchy|\ - tests.examples.modules.program_options.real|\ - tests.examples.modules.program_options.regex|\ - tests.examples.modules.program_options.response_file|\ - tests.examples.modules.resiliency_distributed.distributed.tcp.async_replay_distributed|\ - tests.examples.modules.resiliency_distributed.distributed.tcp.async_replicate_distributed|\ - tests.examples.modules.resiliency.1d_stencil_replay_exception|\ - tests.examples.modules.resiliency.1d_stencil_replay_validate|\ - tests.examples.modules.resiliency.async_replay|\ - tests.examples.modules.resiliency.async_replicate_vote|\ - tests.examples.modules.resiliency.async_replicate|\ - tests.examples.modules.resiliency.dataflow_replicate|\ - tests.examples.modules.resiliency.version|\ - tests.examples.modules.resource_partitioner.async_customization|\ - tests.examples.modules.resource_partitioner.guided_pool_test|\ - tests.examples.modules.resource_partitioner.oversubscribing_resource_partitioner|\ - tests.examples.modules.resource_partitioner.simple_resource_partitioner|\ - tests.examples.modules.resource_partitioner.simplest_resource_partitioner_1|\ - tests.examples.modules.resource_partitioner.simplest_resource_partitioner_2|\ - tests.examples.quickstart.1d_wave_equation|\ - tests.examples.quickstart.partitioned_vector_spmd_foreach|\ - tests.examples.quickstart.sort_by_key_demo|\ - tests.examples.transpose.transpose_block_numa|\ - tests.examples.modules.collectives.distributed.tcp.channel_communicator" + 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/.github/workflows/windows_release.yml b/.github/workflows/windows_release.yml index ae20c353deeb..7c087ef9c99d 100644 --- a/.github/workflows/windows_release.yml +++ b/.github/workflows/windows_release.yml @@ -42,52 +42,19 @@ jobs: run: | cmake --build build --config Release \ --target ALL_BUILD \ - -- -maxcpucount -verbosity:minimal -nologo + -- -maxcpucount:2 -verbosity:minimal -nologo - name: Install shell: bash run: | cmake --install build --config Release - name: Test - shell: bash 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 Release \ - --tests-regex tests.examples \ - --exclude-regex \ - "tests.examples.1d_stencil.1d_stencil_6|\ - tests.examples.1d_stencil.1d_stencil_7|\ - tests.examples.async_io.async_io_simple|\ - tests.examples.modules.checkpoint.1d_stencil_4_checkpoint|\ - tests.examples.modules.program_options.config_file_types|\ - tests.examples.modules.program_options.custom_syntax|\ - tests.examples.modules.program_options.env_options|\ - tests.examples.modules.program_options.first|\ - tests.examples.modules.program_options.multiple_sources|\ - tests.examples.modules.program_options.option_groups|\ - tests.examples.modules.program_options.options_description|\ - tests.examples.modules.program_options.options_hierarchy|\ - tests.examples.modules.program_options.real|\ - tests.examples.modules.program_options.regex|\ - tests.examples.modules.program_options.response_file|\ - tests.examples.modules.resiliency_distributed.distributed.tcp.async_replay_distributed|\ - tests.examples.modules.resiliency_distributed.distributed.tcp.async_replicate_distributed|\ - tests.examples.modules.resiliency.1d_stencil_replay_exception|\ - tests.examples.modules.resiliency.1d_stencil_replay_validate|\ - tests.examples.modules.resiliency.async_replay|\ - tests.examples.modules.resiliency.async_replicate_vote|\ - tests.examples.modules.resiliency.async_replicate|\ - tests.examples.modules.resiliency.dataflow_replicate|\ - tests.examples.modules.resiliency.version|\ - tests.examples.modules.resource_partitioner.async_customization|\ - tests.examples.modules.resource_partitioner.guided_pool_test|\ - tests.examples.modules.resource_partitioner.oversubscribing_resource_partitioner|\ - tests.examples.modules.resource_partitioner.simple_resource_partitioner|\ - tests.examples.modules.resource_partitioner.simplest_resource_partitioner_1|\ - tests.examples.modules.resource_partitioner.simplest_resource_partitioner_2|\ - tests.examples.quickstart.1d_wave_equation|\ - tests.examples.quickstart.partitioned_vector_spmd_foreach|\ - tests.examples.quickstart.sort_by_key_demo|\ - tests.examples.transpose.transpose_block_numa|\ - tests.examples.modules.collectives.distributed.tcp.channel_communicator" + ctest ` + --output-on-failure ` + --build-config Release ` + --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/.github/workflows/windows_release_static.yml b/.github/workflows/windows_release_static.yml new file mode 100644 index 000000000000..ab2501e1339e --- /dev/null +++ b/.github/workflows/windows_release_static.yml @@ -0,0 +1,62 @@ +# Copyright (c) 2020 Mikael Simberg +# Copyright (c) 2022 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) + +name: Windows CI (Release, Static) + +on: [pull_request] + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + - uses: jwlawson/actions-setup-cmake@v1.9 + 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=Release \ + -DCMAKE_TOOLCHAIN_FILE='C:/projects/vcpkg/scripts/buildsystems/vcpkg.cmake' \ + -DHPX_WITH_STATIC_LINKING=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_WITH_CHECK_MODULE_DEPENDENCIES=On \ + -DCMAKE_CXX_FLAGS=-permissive- + - name: Build + shell: bash + run: | + cmake --build build --config Release \ + --target ALL_BUILD \ + -- -maxcpucount:2 -verbosity:minimal -nologo + - name: Install + shell: bash + run: | + cmake --install build --config Release + - 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 Release ` + --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/cmake/HPX_AddComponent.cmake b/cmake/HPX_AddComponent.cmake index 129a87ced830..60cb0b9053cb 100644 --- a/cmake/HPX_AddComponent.cmake +++ b/cmake/HPX_AddComponent.cmake @@ -201,7 +201,10 @@ function(add_hpx_component name) # cmake-format: on # install PDB if needed - if(MSVC) + if(MSVC + AND NOT ${name}_STATIC + AND NOT HPX_WITH_STATIC_LINKING + ) # cmake-format: off set(_target_flags ${_target_flags} diff --git a/cmake/HPX_AddExecutable.cmake b/cmake/HPX_AddExecutable.cmake index c2c35d40115c..6db831c58cce 100644 --- a/cmake/HPX_AddExecutable.cmake +++ b/cmake/HPX_AddExecutable.cmake @@ -167,7 +167,10 @@ function(add_hpx_executable name) endif() set(_target_flags INSTALL INSTALL_FLAGS DESTINATION ${install_destination}) # install PDB if needed - if(MSVC) + if(MSVC + AND NOT ${name}_STATIC + AND NOT HPX_WITH_STATIC_LINKING + ) # cmake-format: off set(_target_flags ${_target_flags} diff --git a/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_predef.hpp b/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_predef.hpp index d5a9970a1959..5fdcef40de5b 100644 --- a/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_predef.hpp +++ b/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_predef.hpp @@ -19,7 +19,8 @@ /////////////////////////////////////////////////////////////////////////////// // declare explicitly instantiated templates -#if !defined(HPX_PARTITIONED_VECTOR_MODULE_EXPORTS) +#if !defined(HPX_PARTITIONED_VECTOR_MODULE_EXPORTS) && \ + !defined(HPX_HAVE_STATIC_LINKING) // partitioned_vector HPX_REGISTER_PARTITIONED_VECTOR_DECLARATION(double) diff --git a/components/containers/partitioned_vector/src/partitioned_vector_component_double.cpp b/components/containers/partitioned_vector/src/partitioned_vector_component_double.cpp index a7f4b0f79047..b08b3882435b 100644 --- a/components/containers/partitioned_vector/src/partitioned_vector_component_double.cpp +++ b/components/containers/partitioned_vector/src/partitioned_vector_component_double.cpp @@ -6,11 +6,12 @@ #include +#if !defined(HPX_HAVE_STATIC_LINKING) #include #include -#include #include +#include #include @@ -20,7 +21,7 @@ HPX_REGISTER_PARTITIONED_VECTOR(double) // arguments #if defined(HPX_MSVC) #pragma warning(push) -#pragma warning(disable: 5037) +#pragma warning(disable : 5037) #endif template class HPX_PARTITIONED_VECTOR_EXPORT @@ -30,14 +31,14 @@ template class HPX_PARTITIONED_VECTOR_EXPORT template class HPX_PARTITIONED_VECTOR_EXPORT hpx::partitioned_vector>; template HPX_PARTITIONED_VECTOR_EXPORT - hpx::partitioned_vector>::partitioned_vector( - size_type, hpx::container_distribution_policy const&, void*); +hpx::partitioned_vector>::partitioned_vector( + size_type, hpx::container_distribution_policy const&, void*); template HPX_PARTITIONED_VECTOR_EXPORT - hpx::partitioned_vector>::partitioned_vector( - size_type, double const&, hpx::container_distribution_policy const&, - void*); +hpx::partitioned_vector>::partitioned_vector( + size_type, double const&, hpx::container_distribution_policy const&, void*); #if defined(HPX_MSVC) #pragma warning(pop) #endif +#endif diff --git a/components/containers/partitioned_vector/src/partitioned_vector_component_int.cpp b/components/containers/partitioned_vector/src/partitioned_vector_component_int.cpp index cb71d0c99ec6..5c4f4b31e2f6 100644 --- a/components/containers/partitioned_vector/src/partitioned_vector_component_int.cpp +++ b/components/containers/partitioned_vector/src/partitioned_vector_component_int.cpp @@ -6,11 +6,12 @@ #include +#if !defined(HPX_HAVE_STATIC_LINKING) #include #include -#include #include +#include #include @@ -22,7 +23,7 @@ HPX_REGISTER_PARTITIONED_VECTOR(long_long) // arguments #if defined(HPX_MSVC) #pragma warning(push) -#pragma warning(disable: 5037) +#pragma warning(disable : 5037) #endif template class HPX_PARTITIONED_VECTOR_EXPORT @@ -32,12 +33,11 @@ template class HPX_PARTITIONED_VECTOR_EXPORT template class HPX_PARTITIONED_VECTOR_EXPORT hpx::partitioned_vector>; template HPX_PARTITIONED_VECTOR_EXPORT - hpx::partitioned_vector>::partitioned_vector( - size_type, hpx::container_distribution_policy const&, void*); +hpx::partitioned_vector>::partitioned_vector( + size_type, hpx::container_distribution_policy const&, void*); template HPX_PARTITIONED_VECTOR_EXPORT - hpx::partitioned_vector>::partitioned_vector( - size_type, int const&, hpx::container_distribution_policy const&, - void*); +hpx::partitioned_vector>::partitioned_vector( + size_type, int const&, hpx::container_distribution_policy const&, void*); template class HPX_PARTITIONED_VECTOR_EXPORT hpx::server::partitioned_vector>; @@ -46,14 +46,14 @@ template class HPX_PARTITIONED_VECTOR_EXPORT template class HPX_PARTITIONED_VECTOR_EXPORT hpx::partitioned_vector>; template HPX_PARTITIONED_VECTOR_EXPORT - hpx::partitioned_vector>::partitioned_vector( - size_type, hpx::container_distribution_policy const&, void*); -template HPX_PARTITIONED_VECTOR_EXPORT - hpx::partitioned_vector>::partitioned_vector( - size_type, long long const&, hpx::container_distribution_policy const&, - void*); +hpx::partitioned_vector>::partitioned_vector( + size_type, hpx::container_distribution_policy const&, void*); +template HPX_PARTITIONED_VECTOR_EXPORT hpx::partitioned_vector>::partitioned_vector(size_type, long long const&, + hpx::container_distribution_policy const&, void*); #if defined(HPX_MSVC) #pragma warning(pop) #endif +#endif diff --git a/components/containers/partitioned_vector/src/partitioned_vector_component_std_string.cpp b/components/containers/partitioned_vector/src/partitioned_vector_component_std_string.cpp index 3e0d92479744..8c32b90404e9 100644 --- a/components/containers/partitioned_vector/src/partitioned_vector_component_std_string.cpp +++ b/components/containers/partitioned_vector/src/partitioned_vector_component_std_string.cpp @@ -6,11 +6,12 @@ #include +#if !defined(HPX_HAVE_STATIC_LINKING) #include #include -#include #include +#include #include #include @@ -23,7 +24,7 @@ HPX_REGISTER_PARTITIONED_VECTOR(std_string) // arguments #if defined(HPX_MSVC) #pragma warning(push) -#pragma warning(disable: 5037) +#pragma warning(disable : 5037) #endif template class HPX_PARTITIONED_VECTOR_EXPORT @@ -32,16 +33,15 @@ template class HPX_PARTITIONED_VECTOR_EXPORT hpx::partitioned_vector_partition>; template class HPX_PARTITIONED_VECTOR_EXPORT hpx::partitioned_vector>; -template HPX_PARTITIONED_VECTOR_EXPORT - hpx::partitioned_vector>:: - partitioned_vector(size_type, hpx::container_distribution_policy const&, - void*); -template HPX_PARTITIONED_VECTOR_EXPORT - hpx::partitioned_vector>:: - partitioned_vector(size_type, std::string const&, - hpx::container_distribution_policy const&, void*); +template HPX_PARTITIONED_VECTOR_EXPORT hpx::partitioned_vector>::partitioned_vector(size_type, + hpx::container_distribution_policy const&, void*); +template HPX_PARTITIONED_VECTOR_EXPORT hpx::partitioned_vector>::partitioned_vector(size_type, std::string const&, + hpx::container_distribution_policy const&, void*); #if defined(HPX_MSVC) #pragma warning(pop) #endif +#endif diff --git a/components/containers/partitioned_vector/tests/unit/coarray.cpp b/components/containers/partitioned_vector/tests/unit/coarray.cpp index 31371cf2aee5..ef638b35f8b8 100644 --- a/components/containers/partitioned_vector/tests/unit/coarray.cpp +++ b/components/containers/partitioned_vector/tests/unit/coarray.cpp @@ -20,6 +20,9 @@ /////////////////////////////////////////////////////////////////////////////// // coarray is predefined in the partitioned_vector module +#if defined(HPX_HAVE_STATIC_LINKING) +HPX_REGISTER_COARRAY(double) +#endif void bulk_test( hpx::lcos::spmd_block block, std::size_t height, diff --git a/components/containers/partitioned_vector/tests/unit/coarray_all_reduce.cpp b/components/containers/partitioned_vector/tests/unit/coarray_all_reduce.cpp index 7d3ee2b6b82d..81309d03fc17 100644 --- a/components/containers/partitioned_vector/tests/unit/coarray_all_reduce.cpp +++ b/components/containers/partitioned_vector/tests/unit/coarray_all_reduce.cpp @@ -20,6 +20,9 @@ /////////////////////////////////////////////////////////////////////////////// // coarray is predefined in the partitioned_vector module +#if defined(HPX_HAVE_STATIC_LINKING) +HPX_REGISTER_COARRAY(double) +#endif void bulk_test( hpx::lcos::spmd_block block, std::string values) diff --git a/components/containers/partitioned_vector/tests/unit/partitioned_vector_subview.cpp b/components/containers/partitioned_vector/tests/unit/partitioned_vector_subview.cpp index b1528915bfff..a12fe4a28a6c 100644 --- a/components/containers/partitioned_vector/tests/unit/partitioned_vector_subview.cpp +++ b/components/containers/partitioned_vector/tests/unit/partitioned_vector_subview.cpp @@ -23,7 +23,9 @@ /////////////////////////////////////////////////////////////////////////////// // The vector types to be used are defined in partitioned_vector module. -// HPX_REGISTER_PARTITIONED_VECTOR(double) +#if defined(HPX_HAVE_STATIC_LINKING) +HPX_REGISTER_PARTITIONED_VECTOR(double) +#endif void bulk_test(hpx::lcos::spmd_block block, std::size_t N, diff --git a/components/containers/partitioned_vector/tests/unit/partitioned_vector_view.cpp b/components/containers/partitioned_vector/tests/unit/partitioned_vector_view.cpp index 8dc1466e6b84..d48121807365 100644 --- a/components/containers/partitioned_vector/tests/unit/partitioned_vector_view.cpp +++ b/components/containers/partitioned_vector/tests/unit/partitioned_vector_view.cpp @@ -23,7 +23,9 @@ /////////////////////////////////////////////////////////////////////////////// // The vector types to be used are defined in partitioned_vector module. -// HPX_REGISTER_PARTITIONED_VECTOR(double) +#if defined(HPX_HAVE_STATIC_LINKING) +HPX_REGISTER_PARTITIONED_VECTOR(double) +#endif void bulk_test(hpx::lcos::spmd_block block, std::size_t height, diff --git a/components/containers/partitioned_vector/tests/unit/partitioned_vector_view_iterator.cpp b/components/containers/partitioned_vector/tests/unit/partitioned_vector_view_iterator.cpp index d7c1f85bc13e..43683636888b 100644 --- a/components/containers/partitioned_vector/tests/unit/partitioned_vector_view_iterator.cpp +++ b/components/containers/partitioned_vector/tests/unit/partitioned_vector_view_iterator.cpp @@ -21,7 +21,9 @@ /////////////////////////////////////////////////////////////////////////////// // The vector types to be used are defined in partitioned_vector module. -// HPX_REGISTER_PARTITIONED_VECTOR(double) +#if defined(HPX_HAVE_STATIC_LINKING) +HPX_REGISTER_PARTITIONED_VECTOR(double) +#endif void bulk_test( hpx::lcos::spmd_block block, std::size_t size_x, diff --git a/components/containers/partitioned_vector/tests/unit/serialization_partitioned_vector.cpp b/components/containers/partitioned_vector/tests/unit/serialization_partitioned_vector.cpp index fb06d9026e88..2723a8c4d5af 100644 --- a/components/containers/partitioned_vector/tests/unit/serialization_partitioned_vector.cpp +++ b/components/containers/partitioned_vector/tests/unit/serialization_partitioned_vector.cpp @@ -20,6 +20,9 @@ // partitioned_vector and partitioned_vector are predefined in the // partitioned_vector module +#if defined(HPX_HAVE_STATIC_LINKING) +HPX_REGISTER_PARTITIONED_VECTOR(double) +#endif typedef unsigned long ulong; diff --git a/examples/1d_stencil/1d_stencil_channel.cpp b/examples/1d_stencil/1d_stencil_channel.cpp index 3fdd5bf8acac..e0378deb7b9a 100644 --- a/examples/1d_stencil/1d_stencil_channel.cpp +++ b/examples/1d_stencil/1d_stencil_channel.cpp @@ -34,7 +34,7 @@ using communication_type = double; -HPX_REGISTER_CHANNEL_DECLARATION(communication_type) +HPX_REGISTER_CHANNEL_DECLARATION(communication_type, stencil_communication) HPX_REGISTER_CHANNEL(communication_type, stencil_communication) int hpx_main(hpx::program_options::variables_map& vm) diff --git a/examples/jacobi_smp/jacobi_hpx.cpp b/examples/jacobi_smp/jacobi_hpx.cpp index b04a1fcd8583..771034838603 100644 --- a/examples/jacobi_smp/jacobi_hpx.cpp +++ b/examples/jacobi_smp/jacobi_hpx.cpp @@ -5,11 +5,11 @@ // 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) -#include "jacobi.hpp" - #include #include +#include "jacobi.hpp" + #include #include #include diff --git a/examples/jacobi_smp/jacobi_nonuniform_hpx.cpp b/examples/jacobi_smp/jacobi_nonuniform_hpx.cpp index e654938c0af5..d1c6d40ed118 100644 --- a/examples/jacobi_smp/jacobi_nonuniform_hpx.cpp +++ b/examples/jacobi_smp/jacobi_nonuniform_hpx.cpp @@ -5,12 +5,12 @@ // 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) -#include "jacobi_nonuniform.hpp" - #include #include #include +#include "jacobi_nonuniform.hpp" + #include #include #include diff --git a/examples/pipeline/collector.cpp b/examples/pipeline/collector.cpp index 3c5b7aee7d8e..f91c9a8b52af 100644 --- a/examples/pipeline/collector.cpp +++ b/examples/pipeline/collector.cpp @@ -11,7 +11,7 @@ #include -HPX_REGISTER_CHANNEL(int) +HPX_REGISTER_CHANNEL(int, pipeline) hpx::future f3(hpx::lcos::channel& c2) { diff --git a/examples/pipeline/emitter.cpp b/examples/pipeline/emitter.cpp index 7c2db04815dc..0744e46c71c7 100644 --- a/examples/pipeline/emitter.cpp +++ b/examples/pipeline/emitter.cpp @@ -11,7 +11,7 @@ #include -HPX_REGISTER_CHANNEL(int) +HPX_REGISTER_CHANNEL(int, pipeline) void f1(hpx::lcos::channel& c1) { @@ -20,7 +20,7 @@ void f1(hpx::lcos::channel& c1) std::cout << "First Stage: " << i << ". Executed on locality " << hpx::get_locality_id() << " " << hpx::get_locality_name() << '\n'; - c1.set(i); + c1.set(int(i)); hpx::this_thread::sleep_for(std::chrono::seconds(5)); } c1.close(); diff --git a/examples/pipeline/worker.cpp b/examples/pipeline/worker.cpp index 962962286ebf..98a6af0bd472 100644 --- a/examples/pipeline/worker.cpp +++ b/examples/pipeline/worker.cpp @@ -11,7 +11,7 @@ #include -HPX_REGISTER_CHANNEL(int) +HPX_REGISTER_CHANNEL(int, pipeline) hpx::future f2(hpx::lcos::channel& c1, hpx::lcos::channel& c2) { diff --git a/examples/quickstart/CMakeLists.txt b/examples/quickstart/CMakeLists.txt index dc13a1fa4697..624b9d4116b6 100644 --- a/examples/quickstart/CMakeLists.txt +++ b/examples/quickstart/CMakeLists.txt @@ -33,7 +33,7 @@ set(example_programs wait_composition ) -if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") +if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" AND NOT HPX_WITH_STATIC_LINKING) set(example_programs ${example_programs} init_globally) endif() diff --git a/examples/quickstart/matrix_multiplication.cpp b/examples/quickstart/matrix_multiplication.cpp index b4b3acf035e1..bd6fc488ca50 100644 --- a/examples/quickstart/matrix_multiplication.cpp +++ b/examples/quickstart/matrix_multiplication.cpp @@ -62,8 +62,8 @@ int hpx_main(hpx::program_options::variables_map& vm) std::cout << "using seed: " << seed << std::endl; // Define range of values - std::size_t lower = vm["l"].as(); - std::size_t upper = vm["u"].as(); + int lower = vm["l"].as(); + int upper = vm["u"].as(); // Matrices have random values in the range [lower, upper] std::uniform_int_distribution dis(lower, upper); @@ -112,10 +112,10 @@ int main(int argc, char* argv[]) hpx::program_options::value(), "The random number generator seed to use for this run") ("l", - hpx::program_options::value()->default_value(0), + hpx::program_options::value()->default_value(0), "Lower limit of range of values") ("u", - hpx::program_options::value()->default_value(10), + hpx::program_options::value()->default_value(10), "Upper limit of range of values"); // clang-format on hpx::local::init_params init_args; diff --git a/examples/random_mem_access/random_mem_access_client.cpp b/examples/random_mem_access/random_mem_access_client.cpp index 144e356f826d..a123cbca9a44 100644 --- a/examples/random_mem_access/random_mem_access_client.cpp +++ b/examples/random_mem_access/random_mem_access_client.cpp @@ -50,7 +50,8 @@ int hpx_main(hpx::program_options::variables_map& vm) std::vector> barrier; for (std::size_t i = 0; i < iterations; i++) { - std::uniform_int_distribution<> dis(0, array_size - 1); + std::uniform_int_distribution<> dis( + 0, static_cast(array_size - 1)); std::size_t rn = dis(gen); //std::cout << " Random element access: " << rn << std::endl; barrier.push_back(accu[rn].add_async()); diff --git a/examples/spell_check/spell_check_file.cpp b/examples/spell_check/spell_check_file.cpp index 1809fcf6ff55..30d2a3e761b0 100644 --- a/examples/spell_check/spell_check_file.cpp +++ b/examples/spell_check/spell_check_file.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,7 @@ std::string search(int start, int end, std::string const& word) { int pos = mid / 2; - int size; + std::size_t size; //if our value is lower than start, we disregard it. if (word.length() >= check.length()) size = check.length(); @@ -48,7 +49,7 @@ std::string search(int start, int end, std::string const& word) size = word.length(); std::string part; bool sub = true; - for (int i = 0; i < size; i++) + for (std::size_t i = 0; i < size; i++) { char check_char = static_cast(tolower(check[i])); char word_char = word[i]; @@ -75,13 +76,13 @@ std::string search(int start, int end, std::string const& word) return ""; } } - int size; + std::size_t size; //if our value is lower than start, we disregard it. if (word.length() >= check.length()) size = check.length(); else size = word.length(); - for (int i = 0; i < size; i++) + for (std::size_t i = 0; i < size; i++) { char check_char = static_cast(tolower(check[i])); char word_char = word[i]; diff --git a/examples/spell_check/spell_check_simple.cpp b/examples/spell_check/spell_check_simple.cpp index 96b572800c2c..de4aa8ddc32b 100644 --- a/examples/spell_check/spell_check_simple.cpp +++ b/examples/spell_check/spell_check_simple.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,7 @@ std::string search(int start, int end, std::string const& word) { int pos = mid / 2; - int size; + std::size_t size; //if our value is lower than start, we disregard it. if (word.length() >= check.length()) size = check.length(); @@ -48,7 +49,7 @@ std::string search(int start, int end, std::string const& word) size = word.length(); std::string part; bool sub = true; - for (int i = 0; i < size; i++) + for (std::size_t i = 0; i < size; i++) { char check_char = static_cast(tolower(check[i])); char word_char = word[i]; @@ -75,13 +76,13 @@ std::string search(int start, int end, std::string const& word) return word + " was found in this dictionary.\n"; } } - int size; + std::size_t size; //if our value is lower than start, we disregard it. if (word.length() >= check.length()) size = check.length(); else size = word.length(); - for (int i = 0; i < size; i++) + for (std::size_t i = 0; i < size; i++) { char check_char = static_cast(tolower(check[i])); char word_char = word[i]; diff --git a/examples/throttle/throttle/server/throttle.cpp b/examples/throttle/throttle/server/throttle.cpp index d346fb75d460..be9a535769bf 100644 --- a/examples/throttle/throttle/server/throttle.cpp +++ b/examples/throttle/throttle/server/throttle.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -121,7 +122,8 @@ namespace throttle { namespace server { hpx::threads::make_thread_function_nullary( hpx::bind(&throttle::throttle_controller, this, shepherd)), description.c_str(), hpx::threads::thread_priority::high, - hpx::threads::thread_schedule_hint(shepherd)); + hpx::threads::thread_schedule_hint( + static_cast(shepherd))); hpx::threads::register_thread(data); } @@ -135,7 +137,8 @@ namespace throttle { namespace server { hpx::threads::make_thread_function_nullary( hpx::bind(&throttle::suspend, this, shepherd)), description.c_str(), hpx::threads::thread_priority::high, - hpx::threads::thread_schedule_hint(shepherd)); + hpx::threads::thread_schedule_hint( + static_cast(shepherd))); hpx::threads::register_thread(data); } }} // namespace throttle::server diff --git a/examples/transpose/transpose_serial_vector.cpp b/examples/transpose/transpose_serial_vector.cpp index 7159c9ab4781..4fd1c1540455 100644 --- a/examples/transpose/transpose_serial_vector.cpp +++ b/examples/transpose/transpose_serial_vector.cpp @@ -1,11 +1,12 @@ // Copyright (c) 2014 Thomas Heller -// Copyright (c) 2014 Hartmut Kaiser +// Copyright (c) 2014-2022 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) #include + #if !defined(HPX_COMPUTE_DEVICE_CODE) #include #include @@ -20,15 +21,15 @@ #define COL_SHIFT 1000.00 // Constant to shift column index #define ROW_SHIFT 0.001 // Constant to shift row index +#if defined(HPX_HAVE_STATIC_LINKING) +HPX_REGISTER_PARTITIONED_VECTOR(double) +#endif + bool verbose = false; double test_results( std::uint64_t order, hpx::partitioned_vector const& trans); -#if !defined(HPX_MSVC) -HPX_REGISTER_PARTITIONED_VECTOR(double) -#endif - /////////////////////////////////////////////////////////////////////////////// int hpx_main(hpx::program_options::variables_map& vm) { diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index 5ec623328782..851412a47c71 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -70,13 +70,7 @@ add_hpx_source_group( ) if(NOT HPX_WITH_STATIC_LINKING) - if(MSVC) - # The MSVC linker can't handle a static library as large as we get when - # statically linking the main HPX library - set(hpx_library_link_mode_core SHARED) - else() - set(hpx_library_link_mode_core ${hpx_library_link_mode}) - endif() + set(hpx_library_link_mode_core ${hpx_library_link_mode}) endif() # ############################################################################## @@ -245,7 +239,7 @@ install( ) # install PDB if needed -if(MSVC) +if(MSVC AND NOT HPX_WITH_STATIC_LINKING) install( FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} @@ -317,7 +311,7 @@ foreach(lib ${HPX_LIBS}) # creation can move here as well. if(NOT ${lib} STREQUAL "full") string(TOUPPER ${lib} uppercase_lib) - add_library(hpx_${lib} SHARED src/empty.cpp) + add_library(hpx_${lib} ${hpx_library_link_mode} src/empty.cpp) target_compile_definitions(hpx_${lib} PRIVATE HPX_${uppercase_lib}_EXPORTS) set_target_properties(hpx_${lib} PROPERTIES FOLDER "Core") @@ -367,7 +361,7 @@ if(HPX_WITH_ITTNOTIFY) target_link_libraries(hpx_core PUBLIC Amplifier::amplifier) endif() -if(HPX_WITH_MODULES_AS_STATIC_LIBRARIES) +if(HPX_WITH_MODULES_AS_STATIC_LIBRARIES OR HPX_WITH_STATIC_LINKING) target_link_libraries(hpx_core PUBLIC hpx_public_flags) target_link_libraries(hpx_core PUBLIC hpx_base_libraries) target_link_libraries(hpx_core PUBLIC hpx_dependencies_boost) diff --git a/libs/core/asio/src/asio_util.cpp b/libs/core/asio/src/asio_util.cpp index 940d2eb8b69a..1ee51003f49f 100644 --- a/libs/core/asio/src/asio_util.cpp +++ b/libs/core/asio/src/asio_util.cpp @@ -31,7 +31,7 @@ #include #include -#if defined(HPX_WINDOWS) +#if defined(HPX_WINDOWS) && !defined(HPX_HAVE_STATIC_LINKING) // Prevent asio from initializing Winsock, the object must be constructed // before any Asio's own global objects. With MSVC, this may be accomplished // by adding the following code to the DLL: diff --git a/libs/core/config/include/hpx/config/export_definitions.hpp b/libs/core/config/include/hpx/config/export_definitions.hpp index d26fb880434d..2efd4dd28c5e 100644 --- a/libs/core/config/include/hpx/config/export_definitions.hpp +++ b/libs/core/config/include/hpx/config/export_definitions.hpp @@ -17,7 +17,7 @@ // clang-format off #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -#if !defined(HPX_MODULE_STATIC_LINKING) +#if !defined(HPX_MODULE_STATIC_LINKING) && !defined(HPX_HAVE_STATIC_LINKING) # define HPX_SYMBOL_EXPORT __declspec(dllexport) # define HPX_SYMBOL_IMPORT __declspec(dllimport) # define HPX_SYMBOL_INTERNAL /* empty */ diff --git a/libs/core/runtime_local/include/hpx/runtime_local/runtime_local.hpp b/libs/core/runtime_local/include/hpx/runtime_local/runtime_local.hpp index ac68f573c9d6..ef09c021f724 100644 --- a/libs/core/runtime_local/include/hpx/runtime_local/runtime_local.hpp +++ b/libs/core/runtime_local/include/hpx/runtime_local/runtime_local.hpp @@ -46,10 +46,11 @@ namespace hpx { /////////////////////////////////////////////////////////////////////// // There is no need to protect these global from thread concurrent // access as they are access during early startup only. - extern std::list global_pre_startup_functions; - extern std::list global_startup_functions; - extern std::list global_pre_shutdown_functions; - extern std::list global_shutdown_functions; + extern std::list& global_pre_startup_functions(); + extern std::list& global_startup_functions(); + extern std::list& + global_pre_shutdown_functions(); + extern std::list& global_shutdown_functions(); } // namespace detail /////////////////////////////////////////////////////////////////////////// diff --git a/libs/core/runtime_local/src/runtime_local.cpp b/libs/core/runtime_local/src/runtime_local.cpp index c2ea3869f741..b7cc945f1545 100644 --- a/libs/core/runtime_local/src/runtime_local.cpp +++ b/libs/core/runtime_local/src/runtime_local.cpp @@ -400,30 +400,31 @@ namespace hpx { // copy over all startup functions registered so far for (startup_function_type& f : - detail::global_pre_startup_functions) + detail::global_pre_startup_functions()) { add_pre_startup_function(HPX_MOVE(f)); } - detail::global_pre_startup_functions.clear(); + detail::global_pre_startup_functions().clear(); - for (startup_function_type& f : detail::global_startup_functions) + for (startup_function_type& f : detail::global_startup_functions()) { add_startup_function(HPX_MOVE(f)); } - detail::global_startup_functions.clear(); + detail::global_startup_functions().clear(); for (shutdown_function_type& f : - detail::global_pre_shutdown_functions) + detail::global_pre_shutdown_functions()) { add_pre_shutdown_function(HPX_MOVE(f)); } - detail::global_pre_shutdown_functions.clear(); + detail::global_pre_shutdown_functions().clear(); - for (shutdown_function_type& f : detail::global_shutdown_functions) + for (shutdown_function_type& f : + detail::global_shutdown_functions()) { add_shutdown_function(HPX_MOVE(f)); } - detail::global_shutdown_functions.clear(); + detail::global_shutdown_functions().clear(); } catch (std::exception const& e) { @@ -1114,10 +1115,31 @@ namespace hpx { /////////////////////////////////////////////////////////////////////// // There is no need to protect these global from thread concurrent // access as they are access during early startup only. - std::list global_pre_startup_functions; - std::list global_startup_functions; - std::list global_pre_shutdown_functions; - std::list global_shutdown_functions; + std::list& global_pre_startup_functions() + { + static std::list + global_pre_startup_functions_; + return global_pre_startup_functions_; + } + + std::list& global_startup_functions() + { + static std::list global_startup_functions_; + return global_startup_functions_; + } + + std::list& global_pre_shutdown_functions() + { + static std::list + global_pre_shutdown_functions_; + return global_pre_shutdown_functions_; + } + + std::list& global_shutdown_functions() + { + static std::list global_shutdown_functions_; + return global_shutdown_functions_; + } } // namespace detail /////////////////////////////////////////////////////////////////////////// @@ -1137,7 +1159,7 @@ namespace hpx { } else { - detail::global_pre_startup_functions.push_back(HPX_MOVE(f)); + detail::global_pre_startup_functions().push_back(HPX_MOVE(f)); } } @@ -1156,7 +1178,7 @@ namespace hpx { } else { - detail::global_startup_functions.push_back(HPX_MOVE(f)); + detail::global_startup_functions().push_back(HPX_MOVE(f)); } } @@ -1176,7 +1198,7 @@ namespace hpx { } else { - detail::global_pre_shutdown_functions.push_back(HPX_MOVE(f)); + detail::global_pre_shutdown_functions().push_back(HPX_MOVE(f)); } } @@ -1196,7 +1218,7 @@ namespace hpx { } else { - detail::global_shutdown_functions.push_back(HPX_MOVE(f)); + detail::global_shutdown_functions().push_back(HPX_MOVE(f)); } } diff --git a/libs/full/agas/src/detail/interface.cpp b/libs/full/agas/src/detail/interface.cpp index aaa70b6d59a3..f78f87efbed0 100644 --- a/libs/full/agas/src/detail/interface.cpp +++ b/libs/full/agas/src/detail/interface.cpp @@ -634,5 +634,9 @@ namespace hpx { namespace agas { } }; - agas_interface_functions agas_init; + agas_interface_functions& agas_init() + { + static agas_interface_functions agas_init_; + return agas_init_; + } }} // namespace hpx::agas diff --git a/libs/full/async_distributed/include/hpx/async_distributed/base_lco_with_value.hpp b/libs/full/async_distributed/include/hpx/async_distributed/base_lco_with_value.hpp index 38cb1bb43f36..f185d931f621 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/base_lco_with_value.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/base_lco_with_value.hpp @@ -421,8 +421,9 @@ namespace hpx { namespace components { namespace detail { HPX_PP_CAT( \ HPX_PP_CAT(base_lco_with_value_, Name), Tag)::set_value_action, \ "lco_set_value_action", std::size_t(-1), std::size_t(-1)) \ -/**/ + /**/ +#if !defined(HPX_HAVE_STATIC_LINKING) /////////////////////////////////////////////////////////////////////////////// HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION(hpx::naming::gid_type, gid_type) HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION( @@ -453,3 +454,4 @@ HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION( std::vector, vector_std_uint32_type) HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION(hpx::util::section, hpx_section) HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION(std::string, std_string) +#endif diff --git a/libs/full/async_distributed/src/base_lco_with_value.cpp b/libs/full/async_distributed/src/base_lco_with_value.cpp index 00cb1a1cb57e..583a5987ce6e 100644 --- a/libs/full/async_distributed/src/base_lco_with_value.cpp +++ b/libs/full/async_distributed/src/base_lco_with_value.cpp @@ -5,6 +5,9 @@ // 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) +#include + +#if !defined(HPX_HAVE_STATIC_LINKING) #include #include #include @@ -37,3 +40,5 @@ HPX_REGISTER_BASE_LCO_WITH_VALUE_ID(std::vector, vector_id_type, HPX_REGISTER_BASE_LCO_WITH_VALUE_ID(hpx::util::unused_type, unused_type, hpx::actions::base_lco_with_value_unused_get, hpx::actions::base_lco_with_value_unused_set) + +#endif diff --git a/libs/full/async_distributed/src/base_lco_with_value_1.cpp b/libs/full/async_distributed/src/base_lco_with_value_1.cpp index 4774c843512b..f4e6f7a8baf3 100644 --- a/libs/full/async_distributed/src/base_lco_with_value_1.cpp +++ b/libs/full/async_distributed/src/base_lco_with_value_1.cpp @@ -5,6 +5,9 @@ // 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) +#include + +#if !defined(HPX_HAVE_STATIC_LINKING) #include #include #include @@ -23,3 +26,5 @@ HPX_REGISTER_BASE_LCO_WITH_VALUE_ID(std::int8_t, int8_t, HPX_REGISTER_BASE_LCO_WITH_VALUE_ID(std::uint8_t, uint8_t, hpx::actions::base_lco_with_value_uint8_get, hpx::actions::base_lco_with_value_uint8_set) + +#endif diff --git a/libs/full/async_distributed/src/base_lco_with_value_2.cpp b/libs/full/async_distributed/src/base_lco_with_value_2.cpp index 5d72701d691a..39b4e55aa05e 100644 --- a/libs/full/async_distributed/src/base_lco_with_value_2.cpp +++ b/libs/full/async_distributed/src/base_lco_with_value_2.cpp @@ -5,6 +5,9 @@ // 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) +#include + +#if !defined(HPX_HAVE_STATIC_LINKING) #include #include #include @@ -23,3 +26,5 @@ HPX_REGISTER_BASE_LCO_WITH_VALUE_ID(std::int32_t, int32_t, HPX_REGISTER_BASE_LCO_WITH_VALUE_ID(std::uint32_t, uint32_t, hpx::actions::base_lco_with_value_uint32_get, hpx::actions::base_lco_with_value_uint32_set) + +#endif diff --git a/libs/full/async_distributed/src/base_lco_with_value_3.cpp b/libs/full/async_distributed/src/base_lco_with_value_3.cpp index a046109678fa..b2dad04b3d38 100644 --- a/libs/full/async_distributed/src/base_lco_with_value_3.cpp +++ b/libs/full/async_distributed/src/base_lco_with_value_3.cpp @@ -5,6 +5,9 @@ // 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) +#include + +#if !defined(HPX_HAVE_STATIC_LINKING) #include #include #include @@ -38,3 +41,5 @@ HPX_REGISTER_BASE_LCO_WITH_VALUE_ID(hpx::util::section, hpx_section, HPX_REGISTER_BASE_LCO_WITH_VALUE_ID(std::string, std_string, hpx::actions::base_lco_with_value_std_string_get, hpx::actions::base_lco_with_value_std_string_set) + +#endif diff --git a/libs/full/components_base/include/hpx/components_base/agas_interface.hpp b/libs/full/components_base/include/hpx/components_base/agas_interface.hpp index 79a252d4067a..0f65b70bfc45 100644 --- a/libs/full/components_base/include/hpx/components_base/agas_interface.hpp +++ b/libs/full/components_base/include/hpx/components_base/agas_interface.hpp @@ -294,4 +294,8 @@ namespace hpx { namespace agas { HPX_EXPORT naming::address_type get_symbol_ns_lva(); HPX_EXPORT naming::address_type get_runtime_support_lva(); + /////////////////////////////////////////////////////////////////////////// + // initialize AGAS interface function wrappers + struct agas_interface_functions& agas_init(); + }} // namespace hpx::agas diff --git a/libs/full/init_runtime/src/hpx_init.cpp b/libs/full/init_runtime/src/hpx_init.cpp index ad106d6fe878..bea2879ba0f1 100644 --- a/libs/full/init_runtime/src/hpx_init.cpp +++ b/libs/full/init_runtime/src/hpx_init.cpp @@ -64,7 +64,10 @@ #include #include #include +#if defined(HPX_HAVE_NETWORKING) #include +#include +#endif #include #include #include @@ -714,6 +717,16 @@ namespace hpx { hpx::parallel::util::detail:: set_parallel_exception_termination_handler(&hpx::terminate); + // instantiate the interface function initialization objects +#if defined(HPX_HAVE_DISTRIBUTED_RUNTIME) +#if defined(HPX_HAVE_NETWORKING) + parcelset::locality_init(); +#endif + agas::agas_init(); + agas::runtime_components_init(); + components::counter_init(); +#endif + #if defined(HPX_NATIVE_MIC) || defined(__bgq__) || defined(__bgqion__) unsetenv("LANG"); unsetenv("LC_CTYPE"); diff --git a/libs/full/lcos_distributed/include/hpx/lcos_distributed/server/channel.hpp b/libs/full/lcos_distributed/include/hpx/lcos_distributed/server/channel.hpp index ae1cd6b593f6..64862a5bb249 100644 --- a/libs/full/lcos_distributed/include/hpx/lcos_distributed/server/channel.hpp +++ b/libs/full/lcos_distributed/include/hpx/lcos_distributed/server/channel.hpp @@ -146,8 +146,6 @@ namespace hpx { namespace lcos { namespace server { HPX_REGISTER_ACTION_DECLARATION( \ hpx::lcos::server::channel::close_action, \ HPX_PP_CAT(__channel_close_action, HPX_PP_CAT(type, name))) \ - HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION( \ - type, type, name, component_tag) \ /**/ #define HPX_REGISTER_CHANNEL(...) \ @@ -179,5 +177,4 @@ namespace hpx { namespace lcos { namespace server { HPX_PP_CAT(__channel_set_generation_action, HPX_PP_CAT(type, name))) \ HPX_REGISTER_ACTION(hpx::lcos::server::channel::close_action, \ HPX_PP_CAT(__channel_close_action, HPX_PP_CAT(type, name))) \ - HPX_REGISTER_BASE_LCO_WITH_VALUE(type, type, name, component_tag) \ /**/ diff --git a/libs/full/parcelset_base/include/hpx/parcelset_base/locality_interface.hpp b/libs/full/parcelset_base/include/hpx/parcelset_base/locality_interface.hpp index 67e9eaa42cdb..0bbef0e4abf4 100644 --- a/libs/full/parcelset_base/include/hpx/parcelset_base/locality_interface.hpp +++ b/libs/full/parcelset_base/include/hpx/parcelset_base/locality_interface.hpp @@ -23,6 +23,11 @@ namespace hpx::parcelset { HPX_EXPORT parcelset::parcel create_parcel(); HPX_EXPORT locality create_locality(std::string const& name); + + /////////////////////////////////////////////////////////////////////////// + // initialize locality interface function wrappers + struct locality_interface_functions& locality_init(); + } // namespace hpx::parcelset #endif diff --git a/libs/full/performance_counters/include/hpx/performance_counters/server/base_performance_counter.hpp b/libs/full/performance_counters/include/hpx/performance_counters/server/base_performance_counter.hpp index fb9f160df4cc..ac4630b20793 100644 --- a/libs/full/performance_counters/include/hpx/performance_counters/server/base_performance_counter.hpp +++ b/libs/full/performance_counters/include/hpx/performance_counters/server/base_performance_counter.hpp @@ -16,6 +16,8 @@ #include #include +#include + /////////////////////////////////////////////////////////////////////////////// namespace hpx { namespace performance_counters { namespace server { @@ -112,6 +114,8 @@ namespace hpx { namespace performance_counters { namespace server { }; }}} // namespace hpx::performance_counters::server +#include + HPX_ACTION_HAS_CRITICAL_PRIORITY(hpx::performance_counters::server:: base_performance_counter ::get_counter_info_action) HPX_REGISTER_ACTION_DECLARATION( diff --git a/libs/full/runtime_distributed/include/hpx/runtime_distributed/runtime_support.hpp b/libs/full/runtime_distributed/include/hpx/runtime_distributed/runtime_support.hpp index 2fdc0c2f4c26..a6e2a0de257d 100644 --- a/libs/full/runtime_distributed/include/hpx/runtime_distributed/runtime_support.hpp +++ b/libs/full/runtime_distributed/include/hpx/runtime_distributed/runtime_support.hpp @@ -152,3 +152,14 @@ namespace hpx { namespace components { hpx::id_type gid_; }; }} // namespace hpx::components + +/////////////////////////////////////////////////////////////////////////////// +// initialize runtime interface function wrappers +namespace hpx::agas { + struct runtime_components_init_interface_functions& + runtime_components_init(); +} + +namespace hpx::components { + struct counter_interface_functions& counter_init(); +} // namespace hpx::components diff --git a/libs/full/runtime_distributed/src/locality_interface.cpp b/libs/full/runtime_distributed/src/locality_interface.cpp index ee5029541cea..77f86576994e 100644 --- a/libs/full/runtime_distributed/src/locality_interface.cpp +++ b/libs/full/runtime_distributed/src/locality_interface.cpp @@ -162,7 +162,11 @@ namespace hpx::parcelset { } }; - locality_interface_functions locality_init; + locality_interface_functions& locality_init() + { + static locality_interface_functions locality_init_; + return locality_init_; + } } // namespace hpx::parcelset #endif diff --git a/libs/full/runtime_distributed/src/runtime_support.cpp b/libs/full/runtime_distributed/src/runtime_support.cpp index 8f061c9e685e..124ced88a2ca 100644 --- a/libs/full/runtime_distributed/src/runtime_support.cpp +++ b/libs/full/runtime_distributed/src/runtime_support.cpp @@ -105,7 +105,12 @@ namespace hpx { namespace agas { } }; - runtime_components_init_interface_functions runtime_components_init; + runtime_components_init_interface_functions& runtime_components_init() + { + static runtime_components_init_interface_functions + runtime_components_init_; + return runtime_components_init_; + } }} // namespace hpx::agas namespace hpx { namespace components { @@ -130,5 +135,9 @@ namespace hpx { namespace components { } }; - counter_interface_functions counter_init; + counter_interface_functions& counter_init() + { + static counter_interface_functions counter_init_; + return counter_init_; + } }} // namespace hpx::components