Skip to content

Commit

Permalink
Fixing cyclic dependencies
Browse files Browse the repository at this point in the history
- Fixing cyclic dependencies related to parcelport symbols
- Fixing cyclic dependencies in naming and agas modules
- Adding linux static github builder

- flyby: fixing compression filter linking order
  • Loading branch information
hkaiser committed Aug 15, 2023
1 parent e7c31a4 commit 560e2be
Show file tree
Hide file tree
Showing 33 changed files with 478 additions and 136 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/linux_release_static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright (c) 2020 ETH Zurich
# Copyright (c) 2023 The STE||AR Group
#
# 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 (Release, Static)

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
container: stellargroup/build_env:16

steps:
- uses: actions/checkout@v3
- name: Configure
shell: bash
run: |
cmake \
. \
-Bbuild \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DHPX_WITH_STATIC_LINKING=ON \
-DHPX_WITH_MALLOC=system \
-DHPX_WITH_FETCH_ASIO=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
54 changes: 53 additions & 1 deletion cmake/FindHwloc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,48 @@ if(NOT TARGET Hwloc::hwloc)
Hwloc DEFAULT_MSG HWLOC_LIBRARY HWLOC_INCLUDE_DIR
)

if(HPX_WITH_STATIC_LINKING AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
# libhwloc.a on Linux depends on libltdl and libudev
pkg_check_modules(PC_LTDL QUIET ltdl)
find_library(
LTDL_LIBRARY
NAMES ltdl libltdl
HINTS ${LTDL_ROOT}
ENV
LTDL_ROOT
${HPX_LTDL_ROOT}
${PC_LTDL_MINIMAL_LIBDIR}
${PC_LTDL_MINIMAL_LIBRARY_DIRS}
${PC_LTDL_LIBDIR}
${PC_LTDL_LIBRARY_DIRS}
PATH_SUFFIXES lib lib64
)

find_package_handle_standard_args(
Ltdl DEFAULT_MSG LTDL_LIBRARY
)

# libhwloc.a on Linux depends on libltdl and libudev
pkg_check_modules(PC_UDEV QUIET udev)
find_library(
UDEV_LIBRARY
NAMES udev libudev
HINTS ${UDEV_ROOT}
ENV
UDEV_ROOT
${HPX_UDEV_ROOT}
${PC_UDEV_MINIMAL_LIBDIR}
${PC_UDEV_MINIMAL_LIBRARY_DIRS}
${PC_UDEV_LIBDIR}
${PC_UDEV_LIBRARY_DIRS}
PATH_SUFFIXES lib lib64
)

find_package_handle_standard_args(
Udev DEFAULT_MSG UDEV_LIBRARY
)
endif()

get_property(
_type
CACHE HWLOC_ROOT
Expand All @@ -70,7 +112,17 @@ if(NOT TARGET Hwloc::hwloc)

add_library(Hwloc::hwloc INTERFACE IMPORTED)
target_include_directories(Hwloc::hwloc SYSTEM INTERFACE ${HWLOC_INCLUDE_DIR})
target_link_libraries(Hwloc::hwloc INTERFACE ${HWLOC_LIBRARIES})

target_link_libraries(Hwloc::hwloc INTERFACE ${HWLOC_LIBRARIES})
mark_as_advanced(HWLOC_ROOT HWLOC_LIBRARY HWLOC_INCLUDE_DIR)

if(Ltdl_FOUND)
target_link_libraries(Hwloc::hwloc INTERFACE ${LTDL_LIBRARY})
mark_as_advanced(LTDL_ROOT LTDL_LIBRARY)
endif()
if(Udev_FOUND)
target_link_libraries(Hwloc::hwloc INTERFACE ${UDEV_LIBRARY})
mark_as_advanced(UDEV_ROOT UDEV_LIBRARY)
endif()

endif()
11 changes: 5 additions & 6 deletions cmake/HPX_AddModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,9 @@ function(add_hpx_module libname modulename)
endforeach()
else()
foreach(file_to_generate ${${modulename}_GENERATED_HEADERS})
if(EXISTS ${file_to_generate})
hpx_warn("Removing zombie generated header: ${file_to_generate}")
file(REMOVE ${file_to_generate})
endif()
set(generated_headers ${generated_headers}
${generated_file_base}/${file_to_generate}
)
endforeach()
endif()
endif()
Expand Down Expand Up @@ -284,8 +283,8 @@ function(add_hpx_module libname modulename)
list(FIND _hpx_${libname}_modules ${dep} dep_index)
if(${dep_index} EQUAL -1)
hpx_error(
"The module ${dep} should not be be listed in MODULE_DEPENDENCIES "
"for module hpx_${modulename}"
"The module hpx_${dep} should not be be listed in MODULE_DEPENDENCIES "
"for '${libname}' module hpx_${modulename}"
)
endif()
endif()
Expand Down
26 changes: 3 additions & 23 deletions cmake/HPX_ParcelPorts.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021 Hartmut Kaiser
# Copyright (c) 2021-2023 Hartmut Kaiser
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand All @@ -9,26 +9,6 @@ if(HPX_WITH_DISTRIBUTED_RUNTIME)
${HPX_STATIC_PARCELPORT_PLUGINS}
)

# add_subdirectory is called before to insure HPX_STATIC_PARCELPORT_PLUGINS
# cache variable is filled
set(_parcelport_export)
set(_parcelport_init)

foreach(parcelport ${HPX_STATIC_PARCELPORT_PLUGINS})
set(_parcelport_export
"${_parcelport_export}HPX_EXPORT hpx::plugins::parcelport_factory_base *${parcelport}_factory_init(\n"
)
set(_parcelport_export
"${_parcelport_export} std::vector<hpx::plugins::parcelport_factory_base *>& factories);\n"
)
set(_parcelport_init
"${_parcelport_init} ${parcelport}_factory_init(factories);\n"
)
endforeach()

configure_file(
"${PROJECT_SOURCE_DIR}/cmake/templates/static_parcelports.hpp.in"
"${PROJECT_BINARY_DIR}/libs/full/parcelset/include/hpx/parcelset/static_parcelports.hpp"
@ONLY
)
# handle parcelports module to create proper dependencies
add_subdirectory(libs/full/parcelports)
endif()
7 changes: 4 additions & 3 deletions components/parcel_plugins/binary_filter/bzip2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ add_hpx_library(
"hpx/binary_filter/bzip2_serialization_filter.hpp"
"hpx/binary_filter/bzip2_serialization_filter_registration.hpp"
PREPEND_HEADER_ROOT INSTALL_HEADERS
FOLDER "Core/Plugins/Compression"
DEPENDENCIES ${BZIP2_LIBRARIES} ${HPX_WITH_UNITY_BUILD_OPTION}
FOLDER "Core/Plugins/Compression" ${HPX_WITH_UNITY_BUILD_OPTION}
)

target_include_directories(
compression_bzip2 SYSTEM PRIVATE ${BZIP2_INCLUDE_DIR}
)
target_link_libraries(compression_bzip2 PUBLIC Boost::iostreams)
target_link_libraries(
compression_bzip2 PUBLIC Boost::iostreams ${BZIP2_LIBRARIES}
)

add_hpx_pseudo_dependencies(
components.parcel_plugins.binary_filter.bzip2 compression_bzip2
Expand Down
7 changes: 4 additions & 3 deletions components/parcel_plugins/binary_filter/snappy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ add_hpx_library(
"hpx/binary_filter/snappy_serialization_filter.hpp"
"hpx/binary_filter/snappy_serialization_filter_registration.hpp"
PREPEND_HEADER_ROOT INSTALL_HEADERS
FOLDER "Core/Plugins/Compression"
DEPENDENCIES ${SNAPPY_LIBRARY} ${HPX_WITH_UNITY_BUILD_OPTION}
FOLDER "Core/Plugins/Compression" ${HPX_WITH_UNITY_BUILD_OPTION}
)

target_include_directories(
compression_snappy SYSTEM PRIVATE ${SNAPPY_INCLUDE_DIR}
)
target_link_directories(compression_snappy PRIVATE ${SNAPPY_LIBRARY_DIR})

target_link_libraries(compression_snappy PUBLIC Boost::iostreams)
target_link_libraries(
compression_snappy PUBLIC Boost::iostreams ${SNAPPY_LIBRARY}
)

add_hpx_pseudo_dependencies(
components.parcel_plugins.binary_filter.snappy compression_snappy
Expand Down
7 changes: 4 additions & 3 deletions components/parcel_plugins/binary_filter/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ add_hpx_library(
"hpx/binary_filter/zlib_serialization_filter.hpp"
"hpx/binary_filter/zlib_serialization_filter_registration.hpp"
PREPEND_HEADER_ROOT INSTALL_HEADERS
FOLDER "Core/Plugins/Compression"
DEPENDENCIES ${ZLIB_LIBRARIES} ${HPX_WITH_UNITY_BUILD_OPTION}
FOLDER "Core/Plugins/Compression" ${HPX_WITH_UNITY_BUILD_OPTION}
)

target_include_directories(compression_zlib SYSTEM PRIVATE ${ZLIB_INCLUDE_DIRS})
target_link_libraries(compression_zlib PUBLIC Boost::iostreams)
target_link_libraries(
compression_zlib PUBLIC Boost::iostreams ${ZLIB_LIBRARIES}
)

add_hpx_pseudo_dependencies(
components.parcel_plugins.binary_filter.zlib compression_zlib
Expand Down
5 changes: 5 additions & 0 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ foreach(lib ${HPX_LIBS})
endif()

add_subdirectory(${lib})

set(_hpx_${lib}_modules
${_hpx_${lib}_modules}
PARENT_SCOPE
)
endforeach()

# add_hpx_module populates HPX_ENABLED_MODULES
Expand Down
5 changes: 5 additions & 0 deletions libs/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,8 @@ hpx_info(" Configuring libhpx_core modules:")
foreach(module ${_hpx_core_modules})
add_subdirectory(${module})
endforeach()

set(_hpx_core_modules
${_hpx_core_modules}
PARENT_SCOPE
)
20 changes: 11 additions & 9 deletions libs/core/include_local/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ set(include_local_headers
hpx/experimental/task_group.hpp
)

set(generated_include_local_headers
hpx/algorithm.hpp
hpx/barrier.hpp
hpx/channel.hpp
hpx/compute.hpp
hpx/future.hpp
hpx/latch.hpp
hpx/runtime.hpp
)
if(NOT HPX_WITH_DISTRIBUTED_RUNTIME)
set(generated_include_local_headers
hpx/algorithm.hpp
hpx/barrier.hpp
hpx/channel.hpp
hpx/compute.hpp
hpx/future.hpp
hpx/latch.hpp
hpx/runtime.hpp
)
endif()

# The headers in hpx/local/ were deprecated in HPX V1.9.1
# cmake-format: off
Expand Down
4 changes: 3 additions & 1 deletion libs/core/init_runtime_local/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ set(init_runtime_local_headers hpx/init_runtime_local/detail/init_logging.hpp
hpx/init_runtime_local/init_runtime_local.hpp
)

set(generated_init_runtime_local_headers hpx/init.hpp)
if(NOT HPX_WITH_DISTRIBUTED_RUNTIME)
set(generated_init_runtime_local_headers hpx/init.hpp)
endif()

set(init_runtime_local_sources init_logging.cpp init_runtime_local.cpp)

Expand Down
11 changes: 6 additions & 5 deletions libs/create_module_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
'''
Copyright (c) 2019-2020 ETH Zurich
Copyright (c) 2018 Thomas Heller
Copyright (c) 2022-2023 Hartmut Kaiser
SPDX-License-Identifier: BSL-1.0
Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand All @@ -24,14 +25,14 @@
header_str = '=' * len(module_name)


cmake_root_header = f'''# Copyright (c) 2019-2021 The STE||AR-Group
cmake_root_header = f'''# Copyright (c) 2019-2023 The STE||AR-Group
#
# 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)
'''

cmake_header = f'''# Copyright (c) 2020-2021 The STE||AR-Group
cmake_header = f'''# Copyright (c) 2020-2023 The STE||AR-Group
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand All @@ -40,7 +41,7 @@

readme_template = f'''
..
Copyright (c) 2020-2021 The STE||AR-Group
Copyright (c) 2020-2023 The STE||AR-Group
SPDX-License-Identifier: BSL-1.0
Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand All @@ -57,7 +58,7 @@
'''

index_rst = f'''..
Copyright (c) 2020-2021 The STE||AR-Group
Copyright (c) 2020-2023 The STE||AR-Group
SPDX-License-Identifier: BSL-1.0
Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down Expand Up @@ -255,7 +256,7 @@ def mkdir(path):
header_underline_str = '=' * len(header_name_str)

modules_rst = f'''..
Copyright (c) 2018-2021 The STE||AR-Group
Copyright (c) 2018-2023 The STE||AR-Group
SPDX-License-Identifier: BSL-1.0
Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down
12 changes: 11 additions & 1 deletion libs/full/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set(_hpx_full_modules
parcelport_libfabric
parcelport_mpi
parcelport_tcp
parcelports
parcelset
parcelset_base
performance_counters
Expand All @@ -51,5 +52,14 @@ hpx_info("")
hpx_info(" Configuring libhpx modules:")

foreach(module ${_hpx_full_modules})
add_subdirectory(${module})
# the parcelports module is handled explicitly after all other modules have
# been processed (see HPX_ParcelPorts.cmake)
if(NOT (${module} STREQUAL "parcelports"))
add_subdirectory(${module})
endif()
endforeach()

set(_hpx_full_modules
${_hpx_full_modules}
PARENT_SCOPE
)
Loading

0 comments on commit 560e2be

Please sign in to comment.