Skip to content

Commit

Permalink
Tests link to dynamic HPXC & use --wrap for overriding main
Browse files Browse the repository at this point in the history
  • Loading branch information
Pansysk75 committed Apr 17, 2024
1 parent 43b1296 commit f4bfca3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 1 addition & 5 deletions openmp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S
"at least 3.20.0 now to avoid issues in the future!")
endif()
endif()

option(WITH_HPXC "Use HPX threading system." OFF)
if (WITH_HPXC)
message("Using HPXC")
set(LIBOMP_USE_STDCPPLIB TRUE)
find_package(HPX REQUIRED)
endif()

# Must go below project(..)
include(GNUInstallDirs)
Expand Down
11 changes: 5 additions & 6 deletions openmp/runtime/test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ if config.has_omit_frame_pointer_flag:

if config.with_hpxc:
flags += " -I " + config.hpxc_header_directory + \
" -L " + config.hpxc_library_directory + \
" -L " + os.path.realpath(config.hpx_library_directory) + \
" --include=hpxc/threads.h"
" -L " + os.path.realpath(config.hpxc_library_directory) + \
" --include=hpxc/threads.h --include=hpxc/util/wrap_main.h " + \
" -DHPXC_HAVE_DYNAMIC_HPXC_MAIN"

print("with_hpxc: " + str(config.with_hpxc))
print("hpx_library_directory: " + config.hpx_library_directory)

config.test_flags = " -I " + config.omp_header_directory + flags
config.test_flags_use_compiler_omp_h = flags
Expand All @@ -68,8 +67,8 @@ if config.has_libm:
if config.has_libatomic:
libs += " -latomic"
if (config.with_hpxc):
libs += " -lhpx -lhpx_core -lhpx_hpxc -lc++"
prepend_dynamic_library_path(config.hpx_library_directory)
libs += " -lhpx_hpxc -lhpxc_wrap -Wl,-wrap=main"
prepend_dynamic_library_path(config.hpxc_library_directory)

# Allow REQUIRES / UNSUPPORTED / XFAIL to work
config.target_triple = [ ]
Expand Down
1 change: 0 additions & 1 deletion openmp/runtime/test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ config.target_arch = "@LIBOMP_ARCH@"
config.with_hpxc = @WITH_HPXC@
config.hpxc_header_directory = "@HPXC_DIR@/include"
config.hpxc_library_directory = "@HPXC_DIR@/lib"
config.hpx_library_directory = "@HPX_DIR@/../../"

# Let the main config do the real work.
lit_config.load_config(config, "@LIBOMP_BASE_DIR@/test/lit.cfg")

0 comments on commit f4bfca3

Please sign in to comment.