Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
797854d
Re-enable external build tests with C++ modules
LSUDOKO Apr 19, 2026
cdff10b
build: fix C++ modules BMI export and re-enable external build tests
LSUDOKO Apr 25, 2026
a7c5c53
chore: resolve modify/delete conflict by removing deleted file
LSUDOKO Apr 25, 2026
af1fe47
style: apply clang-format to modified files
LSUDOKO Apr 25, 2026
6ec642a
style: apply clang-format to all library, example, and test files
LSUDOKO Apr 25, 2026
e286bfd
fix: restore extern C++ and fix POSIX header collection for modules
LSUDOKO Apr 25, 2026
45d182a
fix:disable pkg-config test for modules and cleanup header whitespace…
LSUDOKO Apr 25, 2026
a5cd735
apply CI-requested formatting for clang-format and cmake-format
LSUDOKO Apr 25, 2026
03ae3b5
trigger ci: verify all builds pass with restored extern C++ and macro…
LSUDOKO Apr 25, 2026
f879162
fix: restore standard build stability by fixing macro definitions and…
LSUDOKO Apr 25, 2026
13c5e03
fix: restore standard build stability by fixing macro definitions and…
LSUDOKO Apr 27, 2026
8b3984b
build: fix C++ modules BMI export and re-enable external build tests
LSUDOKO Apr 27, 2026
489d884
build: fix C++ modules BMI export and re-enable external build tests
LSUDOKO Apr 27, 2026
fd1e4eb
fix: correctly register pseudo-targets for build tests
LSUDOKO Apr 27, 2026
62a85b6
fix: correctly restore build tests and fix cmake formatting
LSUDOKO Apr 27, 2026
2f9325d
fix: unconditionally include POSIX headers for modules on Linux
LSUDOKO Apr 27, 2026
ccbec5a
Fix external C++ modules package consumers
LSUDOKO Apr 29, 2026
d5609b6
build: fix C++ modules BMI export and re-enable external build tests
LSUDOKO Apr 29, 2026
fb671ac
build: fix external C++ modules package tests
LSUDOKO Apr 29, 2026
3fdd927
build: fix wrapper module generation in CI
LSUDOKO Apr 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 0 additions & 46 deletions cmake/HPX_CXXModules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,35 +103,6 @@ function(hpx_configure_module_producer producer)

# Make sure consumers scan for the BMI
set_target_properties(${_iface} PROPERTIES INTERFACE_CXX_SCAN_FOR_MODULES On)

if(MSVC)
# MSVC: CMake/MSVC handle IFCs automatically; create a target for
# convenience, consumers can link to this to get ordering and include info
return()
endif()

# Compiler-specific flags to instruct where to write module cache
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES
"AppleClang"
)
# Clang common flags
target_compile_options(${producer} PRIVATE "-fmodule-output=${_moddir}")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# GCC: modern flags
hpx_add_target_compile_option_if_available(
${producer} PRIVATE "-fmodule-output=${_moddir}" RESULT ok
)
if(NOT ok)
hpx_error(
"hpx_configure_module_producer: the used version of gcc does not support '-fmodule-output'"
)
endif()
else()
hpx_warn(
"hpx_configure_module_producer: unknown compiler '${CMAKE_CXX_COMPILER_ID}'; "
"exposing EXPORT_MODULE_DIR='${_moddir}' for manual handling"
)
endif()
endfunction()

# hpx_configure_module_consumer(<consumer> <producer>])
Expand Down Expand Up @@ -159,28 +130,11 @@ function(hpx_configure_module_consumer consumer producer)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID
MATCHES "AppleClang"
)
target_compile_options(
${consumer} PRIVATE "-fprebuilt-module-path=${_module_dir}"
)
get_target_property(_type ${consumer} TYPE)
if((_type STREQUAL "SHARED_LIBRARY") OR (_type STREQUAL "EXECUTABLE"))
target_link_options(${consumer} PRIVATE "-fuse-ld=lld")
target_link_options(${consumer} PRIVATE "-Wl,--error-limit=0")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
hpx_add_target_compile_option_if_available(
${consumer} PRIVATE "-fprebuilt-module-path=${_module_dir}" RESULT ok
)
if(NOT ok)
hpx_error(
"hpx_configure_module_consumer: the used version of gcc does not "
"support '-fprebuilt-module-path='"
)
endif()
else()
hpx_warn(
"hpx_configure_module_consumer: unknown compiler '${CMAKE_CXX_COMPILER_ID}'"
)
endif()
endif()
endfunction()
2 changes: 2 additions & 0 deletions cmake/HPX_CollectStdHeaders.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ set(STANDARD_LIBRARY_HEADERS
"<cstdint>"
"<cstdio>"
"<cstdlib>"
"<dlfcn.h>"
"<link.h>"
Comment thread
hkaiser marked this conversation as resolved.
Outdated
Comment thread
hkaiser marked this conversation as resolved.
Outdated
"<cstring>"
"<ctime>"
"<cuchar>"
Expand Down
12 changes: 5 additions & 7 deletions cmake/templates/hpx.ixx.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ module;
// violations.
#include <hpx/config/std_headers.hpp>

export module HPX.@cap_libname@;
#if !defined(__ANDROID__) && !defined(ANDROID) && !defined(__APPLE__)
#include <link.h>
#endif
#include <dlfcn.h>
Comment thread
LSUDOKO marked this conversation as resolved.
Outdated

// Make sure the exported symbols are name-mangled using standard C++ rules.
// This is necessary as otherwise the symbols exported from the shared libraries
// will be exported from the module using a differently encoded name.
extern "C++" {
Comment thread
hkaiser marked this conversation as resolved.
export module HPX.@cap_libname@;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will break linking when C++ modules are enabled. I think we discussed this before. What's you rationale of removing the extern "C++" again?

#if defined(HPX_MSVC)
// disable warning C5244: '#include <filename>' in the purview of module
Expand Down Expand Up @@ -51,5 +51,3 @@ extern "C++" {
#if defined(HPX_MSVC)
#pragma warning(pop)
#endif

} // extern "C++"
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ namespace hpx::traits {
using type = std::underlying_type_t<T>;
};

HPX_CXX_CORE_EXPORT template <typename T>
struct unwrap_enum<T, false>
template <typename T> struct unwrap_enum<T, false>
{
using type = T;
};
Expand All @@ -69,28 +68,24 @@ namespace hpx::traits {
};

// every type is layout-compatible with itself
HPX_CXX_CORE_EXPORT template <typename T>
struct pointer_category_helper<T, T>
template <typename T> struct pointer_category_helper<T, T>
{
using type = std::conditional_t<std::is_trivially_copyable_v<T>,
trivially_copyable_pointer_tag, general_pointer_tag>;
};

// pointers are layout compatible
HPX_CXX_CORE_EXPORT template <typename T>
struct pointer_category_helper<T*, T const*>
template <typename T> struct pointer_category_helper<T*, T const*>
{
using type = trivially_copyable_pointer_tag;
};

HPX_CXX_CORE_EXPORT template <typename T>
struct pointer_category_helper<T*, T volatile*>
template <typename T> struct pointer_category_helper<T*, T volatile*>
{
using type = trivially_copyable_pointer_tag;
};

HPX_CXX_CORE_EXPORT template <typename T>
struct pointer_category_helper<T*, T const volatile*>
template <typename T> struct pointer_category_helper<T*, T const volatile*>
{
using type = trivially_copyable_pointer_tag;
};
Expand All @@ -116,8 +111,7 @@ namespace hpx::traits {
general_pointer_tag>;
};

HPX_CXX_CORE_EXPORT template <typename Source, typename Dest>
struct pointer_move_category<Source, Dest, false>
template <typename Source, typename Dest> struct pointer_move_category<Source, Dest, false>
{
using type = general_pointer_tag;
};
Expand All @@ -134,8 +128,7 @@ namespace hpx::traits {
general_pointer_tag>;
};

HPX_CXX_CORE_EXPORT template <typename Source, typename Dest>
struct pointer_copy_category<Source, Dest, false>
template <typename Source, typename Dest> struct pointer_copy_category<Source, Dest, false>
{
using type = general_pointer_tag;
};
Expand All @@ -150,8 +143,7 @@ namespace hpx::traits {
relocatable_pointer_tag, general_pointer_tag>;
};

HPX_CXX_CORE_EXPORT template <typename Source, typename Dest>
struct pointer_relocate_category<Source, Dest, false>
template <typename Source, typename Dest> struct pointer_relocate_category<Source, Dest, false>
{
using type = general_pointer_tag;
};
Expand Down
31 changes: 11 additions & 20 deletions libs/core/algorithms/include/hpx/algorithms/traits/projected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ namespace hpx::traits {

// For segmented iterators, we consider the local_raw_iterator instead of
// the given one.
HPX_CXX_CORE_EXPORT template <typename Iterator>
struct projected_iterator<Iterator,
template <typename Iterator> struct projected_iterator<Iterator,
std::enable_if_t<is_segmented_iterator_v<Iterator>>>
{
using local_iterator =
Expand All @@ -39,8 +38,7 @@ namespace hpx::traits {
local_iterator>::local_raw_iterator;
};

HPX_CXX_CORE_EXPORT template <typename Iterator>
struct projected_iterator<Iterator,
template <typename Iterator> struct projected_iterator<Iterator,
std::void_t<typename std::decay_t<Iterator>::proxy_type>>
{
using type = typename std::decay_t<Iterator>::proxy_type;
Expand All @@ -59,8 +57,7 @@ namespace hpx::parallel::traits {
typename Enable = void>
struct projected_result_of;

HPX_CXX_CORE_EXPORT template <typename Proj, typename Iter>
struct projected_result_of<Proj, Iter,
template <typename Proj, typename Iter> struct projected_result_of<Proj, Iter,
std::enable_if_t<hpx::traits::is_iterator_v<Iter>>>
: hpx::util::invoke_result<Proj, hpx::traits::iter_reference_t<Iter>>
{
Expand Down Expand Up @@ -92,8 +89,7 @@ namespace hpx::parallel::traits {
typename Enable = void>
struct projected_result_of_vector_pack;

HPX_CXX_CORE_EXPORT template <typename Projected>
struct projected_result_of_vector_pack<Projected,
template <typename Projected> struct projected_result_of_vector_pack<Projected,
std::void_t<typename Projected::iterator_type>>
: projected_result_of_vector_pack_<typename Projected::projector_type,
hpx::traits::iter_value_t<typename Projected::iterator_type>>
Expand Down Expand Up @@ -123,8 +119,7 @@ namespace hpx::parallel::traits {
// void

// clang-format off
HPX_CXX_CORE_EXPORT template <typename Proj, typename Iter>
struct is_projected<Proj, Iter,
template <typename Proj, typename Iter> struct is_projected<Proj, Iter,
std::enable_if_t<
hpx::traits::is_iterator_v<Iter> &&
hpx::is_invocable_v<Proj, hpx::traits::iter_reference_t<Iter>>
Expand All @@ -142,8 +137,7 @@ namespace hpx::parallel::traits {
{
};

HPX_CXX_CORE_EXPORT template <typename Projected>
struct is_projected_indirect<Projected,
template <typename Projected> struct is_projected_indirect<Projected,
std::void_t<typename Projected::projector_type>>
: detail::is_projected<typename Projected::projector_type,
typename Projected::iterator_type>
Expand Down Expand Up @@ -180,8 +174,7 @@ namespace hpx::parallel::traits {
{
};

HPX_CXX_CORE_EXPORT template <typename Projected>
struct is_projected_zip_iterator<Projected,
template <typename Projected> struct is_projected_zip_iterator<Projected,
std::void_t<typename Projected::iterator_type>>
: hpx::traits::is_zip_iterator<typename Projected::iterator_type>
{
Expand All @@ -201,9 +194,8 @@ namespace hpx::parallel::traits {
{
};

HPX_CXX_CORE_EXPORT template <typename ExPolicy, typename F,
typename... Projected>
struct is_indirect_callable<ExPolicy, F, hpx::util::pack<Projected...>,
template <typename ExPolicy, typename F,
typename... Projected> struct is_indirect_callable<ExPolicy, F, hpx::util::pack<Projected...>,
std::enable_if_t<
hpx::util::all_of_v<is_projected_indirect<Projected>...> &&
(!hpx::is_vectorpack_execution_policy_v<ExPolicy> ||
Expand All @@ -218,9 +210,8 @@ namespace hpx::parallel::traits {
// Vector pack execution policies used with zip-iterators require
// special handling because zip_iterator<>::reference is not a real
// reference type.
HPX_CXX_CORE_EXPORT template <typename ExPolicy, typename F,
typename... Projected>
struct is_indirect_callable<ExPolicy, F, hpx::util::pack<Projected...>,
template <typename ExPolicy, typename F,
typename... Projected> struct is_indirect_callable<ExPolicy, F, hpx::util::pack<Projected...>,
std::enable_if_t<
hpx::util::all_of_v<is_projected_indirect<Projected>...> &&
hpx::is_vectorpack_execution_policy_v<ExPolicy> &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ namespace hpx::parallel::traits {
{
};

HPX_CXX_CORE_EXPORT template <typename Proj, typename Rng>
struct projected_range_result_of<Proj, Rng,
template <typename Proj, typename Rng> struct projected_range_result_of<Proj, Rng,
std::enable_if_t<std::ranges::range<Rng>>>
: detail::projected_result_of<std::decay_t<Proj>,
std::ranges::iterator_t<Rng>>
Expand All @@ -36,8 +35,7 @@ namespace hpx::parallel::traits {
{
};

HPX_CXX_CORE_EXPORT template <typename Proj, typename Rng>
struct is_projected_range<Proj, Rng,
template <typename Proj, typename Rng> struct is_projected_range<Proj, Rng,
std::enable_if_t<std::ranges::range<Rng>>>
: detail::is_projected<std::decay_t<Proj>, std::ranges::iterator_t<Rng>>
{
Expand All @@ -54,8 +52,7 @@ namespace hpx::parallel::traits {
{
};

HPX_CXX_CORE_EXPORT template <typename Proj, typename Rng>
struct projected_range<Proj, Rng, std::enable_if_t<std::ranges::range<Rng>>>
template <typename Proj, typename Rng> struct projected_range<Proj, Rng, std::enable_if_t<std::ranges::range<Rng>>>
{
using projector_type = std::decay_t<Proj>;
using iterator_type = std::ranges::iterator_t<Rng>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ namespace hpx::traits {
};

// MSVC needs this for whatever reason
template <>
struct segmented_local_iterator_traits<void>
template <> struct segmented_local_iterator_traits<void>
{
using is_segmented_local_iterator = std::false_type;
};
Expand Down
6 changes: 2 additions & 4 deletions libs/core/algorithms/include/hpx/parallel/algorithms/copy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,7 @@ namespace hpx::parallel {
typename Enable = void>
struct copy_iter;

HPX_CXX_CORE_EXPORT template <typename FwdIter1, typename FwdIter2>
struct copy_iter<FwdIter1, FwdIter2,
template <typename FwdIter1, typename FwdIter2> struct copy_iter<FwdIter1, FwdIter2,
std::enable_if_t<
iterators_are_segmented<FwdIter1, FwdIter2>::value>>
: public copy<util::in_out_result<
Expand All @@ -451,8 +450,7 @@ namespace hpx::parallel {
{
};

HPX_CXX_CORE_EXPORT template <typename FwdIter1, typename FwdIter2>
struct copy_iter<FwdIter1, FwdIter2,
template <typename FwdIter1, typename FwdIter2> struct copy_iter<FwdIter1, FwdIter2,
std::enable_if_t<
iterators_are_not_segmented<FwdIter1, FwdIter2>::value>>
: public copy<util::in_out_result<FwdIter1, FwdIter2>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ namespace hpx::parallel::detail {
Result>::local_raw_iterator;
};

HPX_CXX_CORE_EXPORT template <typename Result1, typename Result2>
struct local_algorithm_result<util::in_out_result<Result1, Result2>>
template <typename Result1, typename Result2> struct local_algorithm_result<util::in_out_result<Result1, Result2>>
{
using type1 = typename hpx::traits::segmented_local_iterator_traits<
Result1>::local_raw_iterator;
Expand All @@ -46,18 +45,16 @@ namespace hpx::parallel::detail {
using type = util::in_out_result<type1, type2>;
};

HPX_CXX_CORE_EXPORT template <typename Result>
struct local_algorithm_result<util::min_max_result<Result>>
template <typename Result> struct local_algorithm_result<util::min_max_result<Result>>
{
using type1 = typename hpx::traits::segmented_local_iterator_traits<
Result>::local_raw_iterator;

using type = util::min_max_result<type1>;
};

HPX_CXX_CORE_EXPORT template <typename Result1, typename Result2,
typename Result3>
struct local_algorithm_result<
template <typename Result1, typename Result2,
typename Result3> struct local_algorithm_result<
util::in_in_out_result<Result1, Result2, Result3>>
{
using type1 = typename hpx::traits::segmented_local_iterator_traits<
Expand All @@ -70,8 +67,7 @@ namespace hpx::parallel::detail {
using type = util::in_in_out_result<type1, type2, type3>;
};

template <>
struct local_algorithm_result<void>
template <> struct local_algorithm_result<void>
{
using type = void;
};
Expand Down
Loading