@@ -20,18 +20,35 @@ set(CMAKE_CXX_STANDARD 17)
2020set (CMAKE_CXX_STANDARD_REQUIRED True )
2121
2222find_package (HPX REQUIRED)
23- find_package (MPI REQUIRED )
23+ find_package (MPI)
2424
2525include (GNUInstallDirs)
2626
2727link_directories (${CMAKE_SOURCE_DIR} /../core)
2828
29- add_executable (hpx_distributed hpx_distributed.cc)
30- target_link_libraries (hpx_distributed PUBLIC HPX::hpx HPX::wrap_main MPI::MPI_C core_s)
31-
32- install (
33- TARGETS hpx_distributed
34- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
35- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
36- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
37- )
29+ # Build hpx_distributed only if MPI is available
30+ if (MPI_FOUND)
31+ add_executable (hpx_distributed hpx_distributed.cc)
32+ target_include_directories (hpx_distributed PRIVATE ${CMAKE_SOURCE_DIR} /../core)
33+ target_link_libraries (hpx_distributed PUBLIC HPX::hpx HPX::wrap_main MPI::MPI_C core_s)
34+ set (INSTALL_TARGETS hpx_distributed)
35+ message (STATUS "MPI found - building hpx_distributed" )
36+ else ()
37+ message (STATUS "MPI not found - skipping hpx_distributed" )
38+ set (INSTALL_TARGETS "" )
39+ endif ()
40+
41+ # New fork_join_executor implementation for intra-node parallelism
42+ add_executable (hpx_task_bench hpx_task_bench.cpp)
43+ target_include_directories (hpx_task_bench PRIVATE ${CMAKE_SOURCE_DIR} /../core)
44+ target_link_libraries (hpx_task_bench PUBLIC HPX::hpx HPX::wrap_main core_s)
45+ list (APPEND INSTALL_TARGETS hpx_task_bench)
46+
47+ if (INSTALL_TARGETS)
48+ install (
49+ TARGETS ${INSTALL_TARGETS}
50+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
51+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
52+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
53+ )
54+ endif ()
0 commit comments