Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg committed Jul 9, 2021
2 parents ae510dd + ba5056d commit 7ba653a
Show file tree
Hide file tree
Showing 105 changed files with 8,629 additions and 1,683 deletions.
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,11 @@ jobs:
name: Installing
command: |
./bin/hello_world_distributed --hpx:bind=none
# Disable Vc here as the target machine of the container image may
# not support the same vector intrinsics as this machine. The
# "Test Docker Image" below fails with "Illegal instruction" if VC
# is enabled, and other machines may fail similarly.
cmake -DHPX_WITH_DATAPAR_VC=Off .
ninja -j2 install
working_directory: /hpx/build
when: always
Expand Down
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,10 @@ if(HPX_WITH_PRECOMPILED_HEADERS)
set(HPX_WITH_PRECOMPILED_HEADERS_INTERNAL ON)

add_library(hpx_precompiled_headers OBJECT libs/src/dummy.cpp)
target_link_libraries(hpx_precompiled_headers PRIVATE hpx_private_flags)
target_link_libraries(
hpx_precompiled_headers PRIVATE hpx_public_flags hpx_private_flags
hpx_base_libraries
)
target_precompile_headers(
hpx_precompiled_headers
PRIVATE
Expand Down Expand Up @@ -1730,8 +1733,6 @@ if(NOT WIN32)
# System libraries
# ############################################################################
if(NOT MSVC)
hpx_add_compile_flag_if_available(-pthread)
hpx_add_link_flag_if_available(-pthread TARGETS EXE SHARED)
if(HPX_CXX11_STD_ATOMIC_LIBRARIES)
target_link_libraries(
hpx_base_libraries INTERFACE ${HPX_CXX11_STD_ATOMIC_LIBRARIES}
Expand Down Expand Up @@ -2014,7 +2015,9 @@ else()
AND NOT WIN32
AND NOT HPX_WITH_SANITIZERS
)
hpx_add_link_flag_if_available(-Wl,-z,defs TARGETS SHARED EXE)
hpx_add_link_flag_if_available(
-Wl,-z,defs TARGETS SHARED_LIBRARY EXECUTABLE
)
endif()
if(WIN32)
target_link_libraries(hpx_base_libraries INTERFACE psapi WS2_32 mswsock)
Expand All @@ -2026,7 +2029,9 @@ else()

if(HPX_WITH_HIDDEN_VISIBILITY)
hpx_add_compile_flag_if_available(-fvisibility=hidden)
hpx_add_link_flag_if_available(-fvisibility=hidden TARGETS SHARED EXE)
hpx_add_link_flag_if_available(
-fvisibility=hidden TARGETS SHARED_LIBRARY EXECUTABLE
)
hpx_add_config_define(HPX_HAVE_ELF_HIDDEN_VISIBILITY)
hpx_add_config_define(HPX_HAVE_COROUTINE_GCC_HIDDEN_VISIBILITY)
hpx_add_config_define(HPX_HAVE_PLUGIN_GCC_HIDDEN_VISIBILITY)
Expand Down Expand Up @@ -2147,6 +2152,8 @@ endif()
# library. Dependencies that are only needed by plugins, examples or tests
# should be found separately in the appropriate subdirectory.

include(HPX_SetupThreads)

# Setup our required Boost libraries.
include(HPX_SetupBoost)
include(HPX_SetupBoostFilesystem)
Expand Down
1 change: 0 additions & 1 deletion cmake/FindAsio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# 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)

hpx_warn("finding asio")
if(NOT TARGET Asio::asio)
find_path(
ASIO_INCLUDE_DIR asio.hpp
Expand Down
8 changes: 6 additions & 2 deletions cmake/HPX_AddCompileFlag.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

include(CMakeParseArguments)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)

function(hpx_add_target_compile_option FLAG)
Expand Down Expand Up @@ -179,13 +178,18 @@ function(hpx_add_compile_flag)
endfunction()

function(hpx_add_compile_flag_if_available FLAG)
set(options PUBLIC)
set(one_value_args NAME)
set(multi_value_args CONFIGURATIONS LANGUAGES)
cmake_parse_arguments(
HPX_ADD_COMPILE_FLAG_IA "${options}" "${one_value_args}"
"${multi_value_args}" ${ARGN}
)

if(HPX_ADD_COMPILE_FLAG_IA_PUBLIC)
set(_public PUBLIC)
endif()

if(HPX_ADD_COMPILE_FLAG_IA_NAME)
string(TOUPPER ${HPX_ADD_COMPILE_FLAG_IA_NAME} _name)
else()
Expand All @@ -211,7 +215,7 @@ function(hpx_add_compile_flag_if_available FLAG)
if(HPX_WITH_${_lang}_FLAG_${_name})
hpx_add_compile_flag(
${FLAG} CONFIGURATIONS ${HPX_ADD_COMPILE_FLAG_IA_CONFIGURATIONS}
LANGUAGES ${_lang}
LANGUAGES ${_lang} ${_public}
)
else()
hpx_info("\"${FLAG}\" not available for language ${_lang}.")
Expand Down
79 changes: 29 additions & 50 deletions cmake/HPX_AddLinkFlag.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,87 +5,64 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

include(CMakeParseArguments)
include(CheckCXXCompilerFlag)

macro(hpx_add_link_flag FLAG)
set(options)
set(options PUBLIC)
set(one_value_args)
set(multi_value_args TARGETS CONFIGURATIONS)
cmake_parse_arguments(
HPX_ADD_LINK_FLAG "${options}" "${one_value_args}" "${multi_value_args}"
${ARGN}
)

set(_targets EXE SHARED STATIC)
if(HPX_ADD_LINK_FLAG_TARGETS)
set(_targets ${HPX_ADD_LINK_FLAG_TARGETS})
endif()

set(_configurations "none")
if(HPX_REMOVE_LINK_FLAG_CONFIGURATIONS)
set(_configurations "${HPX_REMOVE_LINK_FLAG_CONFIGURATIONS}")
if(HPX_ADD_LINK_FLAG_PUBLIC)
set(_dest hpx_public_flags)
else()
set(_dest hpx_private_flags)
endif()

foreach(_config ${_configurations})
set(_conf)
if(NOT _config STREQUAL "none")
string(TOUPPER "${_config}" _conf)
set(_conf "_${_conf}")
endif()

foreach(_target ${_targets})
set(CMAKE_${_target}_LINKER_FLAGS${_conf}
"${CMAKE_${_target}_LINKER_FLAGS${_conf}} ${FLAG}"
)
endforeach()
endforeach()
endmacro()

macro(hpx_remove_link_flag FLAG)
set(options)
set(one_value_args)
set(multi_value_args TARGETS CONFIGURATIONS)
cmake_parse_arguments(
HPX_REMOVE_LINK_FLAG "${options}" "${one_value_args}" "${multi_value_args}"
${ARGN}
)

set(_targets EXE SHARED STATIC)
set(_targets "none")
if(HPX_ADD_LINK_FLAG_TARGETS)
set(_targets ${HPX_ADD_LINK_FLAG_TARGETS})
endif()

set(_configurations "none")
if(HPX_REMOVE_LINK_FLAG_CONFIGURATIONS)
set(_configurations "${HPX_REMOVE_LINK_FLAG_CONFIGURATIONS}")
if(HPX_ADD_LINK_FLAG_CONFIGURATIONS)
set(_configurations "${HPX_ADD_LINK_FLAG_CONFIGURATIONS}")
endif()

foreach(_config ${_configurations})
set(_conf)
if(NOT _config STREQUAL "none")
string(TOUPPER "${_config}" _conf)
set(_conf "_${_conf}")
endif()

foreach(_target ${_targets})
string(REGEX REPLACE "${FLAG}" "" CMAKE_${_target}_LINKER_FLAGS${_conf}
"${CMAKE_${_target}_LINKER_FLAGS${_conf}}"
)
if(NOT _config STREQUAL "none" AND NOT _target STREQUAL "none")
set(_flag
"$<$<AND:$<CONFIG:${_config}>,$<STREQUAL:$<TARGET_PROPERTY:TYPE>,${_target}>:${FLAG}>"
)
elseif(_config STREQUAL "none" AND NOT _target STREQUAL "none")
set(_flag "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,${_target}>:${FLAG}>")
elseif(NOT _config STREQUAL "none" AND _target STREQUAL "none")
set(_flag "$<$<CONFIG:${_config}>:${FLAG}>")
else()
set(_flag "${FLAG}")
endif()
target_link_options(${_dest} INTERFACE "${_flag}")
endforeach()
endforeach()
endmacro()

include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)

macro(hpx_add_link_flag_if_available FLAG)
set(options)
set(options PUBLIC)
set(one_value_args NAME)
set(multi_value_args TARGETS)
cmake_parse_arguments(
HPX_ADD_LINK_FLAG_IA "${options}" "${one_value_args}" "${multi_value_args}"
${ARGN}
)

if(HPX_ADD_LINK_FLAG_IA_PUBLIC)
set(_public PUBLIC)
endif()

if(HPX_ADD_LINK_FLAG_IA_NAME)
string(TOUPPER ${HPX_ADD_LINK_FLAG_IA_NAME} _name)
else()
Expand All @@ -100,7 +77,9 @@ macro(hpx_add_link_flag_if_available FLAG)

check_cxx_compiler_flag("${FLAG}" WITH_LINKER_FLAG_${_name})
if(WITH_LINKER_FLAG_${_name})
hpx_add_link_flag(${FLAG} TARGETS ${HPX_ADD_LINK_FLAG_IA_TARGETS})
hpx_add_link_flag(
${FLAG} TARGETS ${HPX_ADD_LINK_FLAG_IA_TARGETS} ${_public}
)
else()
hpx_info("Linker \"${FLAG}\" not available.")
endif()
Expand Down
10 changes: 6 additions & 4 deletions cmake/HPX_GeneratePackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,21 @@ if(HPX_WITH_PKGCONFIG)
hpx_pkgconfig_component INTERFACE "-std=c++${HPX_CXX_STANDARD}"
)

set(exclude_targets hpx_interface Threads::Threads)

# Generate the pkconfig files for HPX_APPLICATION (both for build and install)
hpx_generate_pkgconfig_from_target(
hpx_pkgconfig_application hpx_application TRUE EXCLUDE hpx_interface
hpx_pkgconfig_application hpx_application TRUE EXCLUDE ${exclude_targets}
)
hpx_generate_pkgconfig_from_target(
hpx_pkgconfig_application hpx_application FALSE EXCLUDE hpx_interface
hpx_pkgconfig_application hpx_application FALSE EXCLUDE ${exclude_targets}
)
# Generate the pkconfig files for HPX_COMPONENT (both for build and install)
hpx_generate_pkgconfig_from_target(
hpx_pkgconfig_component hpx_component TRUE EXCLUDE hpx_interface
hpx_pkgconfig_component hpx_component TRUE EXCLUDE ${exclude_targets}
)
hpx_generate_pkgconfig_from_target(
hpx_pkgconfig_component hpx_component FALSE EXCLUDE hpx_interface
hpx_pkgconfig_component hpx_component FALSE EXCLUDE ${exclude_targets}
)

string(TOLOWER ${CMAKE_BUILD_TYPE} build_type)
Expand Down
3 changes: 0 additions & 3 deletions cmake/HPX_SetupBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ if(NOT TARGET hpx_dependencies_boost)

include(HPX_AddDefinitions)

find_package(Threads QUIET REQUIRED)
target_link_libraries(hpx_dependencies_boost INTERFACE Threads::Threads)

# Boost preprocessor definitions
if(NOT Boost_USE_STATIC_LIBS)
hpx_add_config_cond_define(BOOST_ALL_DYN_LINK)
Expand Down
16 changes: 16 additions & 0 deletions cmake/HPX_SetupThreads.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2018 Christopher Hinz
# Copyright (c) 2014 Thomas Heller
#
# 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)

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

if(NOT HPX_FIND_PACKAGE)
target_link_libraries(hpx_base_libraries INTERFACE Threads::Threads)

hpx_add_compile_flag_if_available(-pthread PUBLIC)
hpx_add_link_flag_if_available(-pthread PUBLIC)
endif()
2 changes: 2 additions & 0 deletions cmake/templates/HPXConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ if(NOT MIMALLOC_ROOT AND NOT "$ENV{MIMALLOC_ROOT}")
endif()
include(HPX_SetupAllocator)

include(HPX_SetupThreads)

# Boost Separate boost targets to be unarily linked to some modules
set(HPX_BOOST_ROOT "@BOOST_ROOT@")
# By default BOOST_ROOT is set to HPX_BOOST_ROOT (not necessary for PAPI or
Expand Down
31 changes: 21 additions & 10 deletions docs/sphinx/api/public_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -565,16 +565,27 @@ more information about the parallel algorithms.
Functions
---------

- :cpp:func:`hpx::parallel::v1::uninitialized_copy`
- :cpp:func:`hpx::parallel::v1::uninitialized_copy_n`
- :cpp:func:`hpx::parallel::v1::uninitialized_default_construct`
- :cpp:func:`hpx::parallel::v1::uninitialized_default_construct_n`
- :cpp:func:`hpx::parallel::v1::uninitialized_fill`
- :cpp:func:`hpx::parallel::v1::uninitialized_fill_n`
- :cpp:func:`hpx::parallel::v1::uninitialized_move`
- :cpp:func:`hpx::parallel::v1::uninitialized_move_n`
- :cpp:func:`hpx::parallel::v1::uninitialized_value_construct`
- :cpp:func:`hpx::parallel::v1::uninitialized_value_construct_n`
- :cpp:func:`hpx::uninitialized_copy`
- :cpp:func:`hpx::uninitialized_copy_n`
- :cpp:func:`hpx::uninitialized_default_construct`
- :cpp:func:`hpx::uninitialized_default_construct_n`
- :cpp:func:`hpx::uninitialized_fill`
- :cpp:func:`hpx::uninitialized_fill_n`
- :cpp:func:`hpx::uninitialized_move`
- :cpp:func:`hpx::uninitialized_move_n`
- :cpp:func:`hpx::uninitialized_value_construct`
- :cpp:func:`hpx::uninitialized_value_construct_n`

- :cpp:func:`hpx::ranges::uninitialized_copy`
- :cpp:func:`hpx::ranges::uninitialized_copy_n`
- :cpp:func:`hpx::ranges::uninitialized_default_construct`
- :cpp:func:`hpx::ranges::uninitialized_default_construct_n`
- :cpp:func:`hpx::ranges::uninitialized_fill`
- :cpp:func:`hpx::ranges::uninitialized_fill_n`
- :cpp:func:`hpx::ranges::uninitialized_move`
- :cpp:func:`hpx::ranges::uninitialized_move_n`
- :cpp:func:`hpx::ranges::uninitialized_value_construct`
- :cpp:func:`hpx::ranges::uninitialized_value_construct_n`

Header ``hpx/numeric.hpp``
==========================
Expand Down
20 changes: 10 additions & 10 deletions docs/sphinx/manual/writing_single_node_hpx_applications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -716,43 +716,43 @@ Parallel algorithms
* Destroys a range of objects.
* ``<hpx/memory.hpp>``
* :cppreference-memory:`destroy_n`
* * :cpp:func:`hpx::parallel::v1::uninitialized_copy`
* * :cpp:func:`hpx::uninitialized_copy`
* Copies a range of objects to an uninitialized area of memory.
* ``<hpx/memory.hpp>``
* :cppreference-memory:`uninitialized_copy`
* * :cpp:func:`hpx::parallel::v1::uninitialized_copy_n`
* * :cpp:func:`hpx::uninitialized_copy_n`
* Copies a number of objects to an uninitialized area of memory.
* ``<hpx/memory.hpp>``
* :cppreference-memory:`uninitialized_copy_n`
* * :cpp:func:`hpx::parallel::v1::uninitialized_default_construct`
* * :cpp:func:`hpx::uninitialized_default_construct`
* Copies a range of objects to an uninitialized area of memory.
* ``<hpx/memory.hpp>``
* :cppreference-memory:`uninitialized_default_construct`
* * :cpp:func:`hpx::parallel::v1::uninitialized_default_construct_n`
* * :cpp:func:`hpx::uninitialized_default_construct_n`
* Copies a number of objects to an uninitialized area of memory.
* ``<hpx/memory.hpp>``
* :cppreference-memory:`uninitialized_default_construct_n`
* * :cpp:func:`hpx::parallel::v1::uninitialized_fill`
* * :cpp:func:`hpx::uninitialized_fill`
* Copies an object to an uninitialized area of memory.
* ``<hpx/memory.hpp>``
* :cppreference-memory:`uninitialized_fill`
* * :cpp:func:`hpx::parallel::v1::uninitialized_fill_n`
* * :cpp:func:`hpx::uninitialized_fill_n`
* Copies an object to an uninitialized area of memory.
* ``<hpx/memory.hpp>``
* :cppreference-memory:`uninitialized_fill_n`
* * :cpp:func:`hpx::parallel::v1::uninitialized_move`
* * :cpp:func:`hpx::uninitialized_move`
* Moves a range of objects to an uninitialized area of memory.
* ``<hpx/memory.hpp>``
* :cppreference-memory:`uninitialized_move`
* * :cpp:func:`hpx::parallel::v1::uninitialized_move_n`
* * :cpp:func:`hpx::uninitialized_move_n`
* Moves a number of objects to an uninitialized area of memory.
* ``<hpx/memory.hpp>``
* :cppreference-memory:`uninitialized_move_n`
* * :cpp:func:`hpx::parallel::v1::uninitialized_value_construct`
* * :cpp:func:`hpx::uninitialized_value_construct`
* Constructs objects in an uninitialized area of memory.
* ``<hpx/memory.hpp>``
* :cppreference-memory:`uninitialized_value_construct`
* * :cpp:func:`hpx::parallel::v1::uninitialized_value_construct_n`
* * :cpp:func:`hpx::uninitialized_value_construct_n`
* Constructs objects in an uninitialized area of memory.
* ``<hpx/memory.hpp>``
* :cppreference-memory:`uninitialized_value_construct_n`
Expand Down
Loading

0 comments on commit 7ba653a

Please sign in to comment.