Skip to content

Commit

Permalink
Fixing static linking (for Windows)
Browse files Browse the repository at this point in the history
- add github action
- flyby: unify handling of excluded targets for Windows github builders
- flyby: fixing a couple of signed/unsigned and integer size related warnings
  • Loading branch information
hkaiser committed Jul 13, 2022
1 parent 8fc267c commit 898255c
Show file tree
Hide file tree
Showing 49 changed files with 350 additions and 191 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/tests.examples.targets
Original file line number Diff line number Diff line change
@@ -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
51 changes: 9 additions & 42 deletions .github/workflows/windows_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
51 changes: 9 additions & 42 deletions .github/workflows/windows_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
62 changes: 62 additions & 0 deletions .github/workflows/windows_release_static.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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')
5 changes: 4 additions & 1 deletion cmake/HPX_AddComponent.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
5 changes: 4 additions & 1 deletion cmake/HPX_AddExecutable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>
HPX_REGISTER_PARTITIONED_VECTOR_DECLARATION(double)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

#include <hpx/config.hpp>

#if !defined(HPX_HAVE_STATIC_LINKING)
#include <hpx/distribution_policies/container_distribution_policy.hpp>

#include <hpx/components/containers/partitioned_vector/export_definitions.hpp>
#include <hpx/components/containers/partitioned_vector/partitioned_vector_component.hpp>
#include <hpx/components/containers/partitioned_vector/partitioned_vector.hpp>
#include <hpx/components/containers/partitioned_vector/partitioned_vector_component.hpp>

#include <vector>

Expand All @@ -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
Expand All @@ -30,14 +31,14 @@ template class HPX_PARTITIONED_VECTOR_EXPORT
template class HPX_PARTITIONED_VECTOR_EXPORT
hpx::partitioned_vector<double, std::vector<double>>;
template HPX_PARTITIONED_VECTOR_EXPORT
hpx::partitioned_vector<double, std::vector<double>>::partitioned_vector(
size_type, hpx::container_distribution_policy const&, void*);
hpx::partitioned_vector<double, std::vector<double>>::partitioned_vector(
size_type, hpx::container_distribution_policy const&, void*);
template HPX_PARTITIONED_VECTOR_EXPORT
hpx::partitioned_vector<double, std::vector<double>>::partitioned_vector(
size_type, double const&, hpx::container_distribution_policy const&,
void*);
hpx::partitioned_vector<double, std::vector<double>>::partitioned_vector(
size_type, double const&, hpx::container_distribution_policy const&, void*);

#if defined(HPX_MSVC)
#pragma warning(pop)
#endif

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

#include <hpx/config.hpp>

#if !defined(HPX_HAVE_STATIC_LINKING)
#include <hpx/distribution_policies/container_distribution_policy.hpp>

#include <hpx/components/containers/partitioned_vector/export_definitions.hpp>
#include <hpx/components/containers/partitioned_vector/partitioned_vector_component.hpp>
#include <hpx/components/containers/partitioned_vector/partitioned_vector.hpp>
#include <hpx/components/containers/partitioned_vector/partitioned_vector_component.hpp>

#include <vector>

Expand All @@ -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
Expand All @@ -32,12 +33,11 @@ template class HPX_PARTITIONED_VECTOR_EXPORT
template class HPX_PARTITIONED_VECTOR_EXPORT
hpx::partitioned_vector<int, std::vector<int>>;
template HPX_PARTITIONED_VECTOR_EXPORT
hpx::partitioned_vector<int, std::vector<int>>::partitioned_vector(
size_type, hpx::container_distribution_policy const&, void*);
hpx::partitioned_vector<int, std::vector<int>>::partitioned_vector(
size_type, hpx::container_distribution_policy const&, void*);
template HPX_PARTITIONED_VECTOR_EXPORT
hpx::partitioned_vector<int, std::vector<int>>::partitioned_vector(
size_type, int const&, hpx::container_distribution_policy const&,
void*);
hpx::partitioned_vector<int, std::vector<int>>::partitioned_vector(
size_type, int const&, hpx::container_distribution_policy const&, void*);

template class HPX_PARTITIONED_VECTOR_EXPORT
hpx::server::partitioned_vector<long long, std::vector<long long>>;
Expand All @@ -46,14 +46,14 @@ template class HPX_PARTITIONED_VECTOR_EXPORT
template class HPX_PARTITIONED_VECTOR_EXPORT
hpx::partitioned_vector<long long, std::vector<long long>>;
template HPX_PARTITIONED_VECTOR_EXPORT
hpx::partitioned_vector<long long, std::vector<long long>>::partitioned_vector(
size_type, hpx::container_distribution_policy const&, void*);
template HPX_PARTITIONED_VECTOR_EXPORT
hpx::partitioned_vector<long long, std::vector<long long>>::partitioned_vector(
size_type, long long const&, hpx::container_distribution_policy const&,
void*);
hpx::partitioned_vector<long long, std::vector<long long>>::partitioned_vector(
size_type, hpx::container_distribution_policy const&, void*);
template HPX_PARTITIONED_VECTOR_EXPORT hpx::partitioned_vector<long long,
std::vector<long long>>::partitioned_vector(size_type, long long const&,
hpx::container_distribution_policy const&, void*);

#if defined(HPX_MSVC)
#pragma warning(pop)
#endif

#endif
Loading

0 comments on commit 898255c

Please sign in to comment.