Skip to content

Commit 5d75406

Browse files
Merge pull request #77 from shintaro-iwasaki/SymlinkArgobotsLibraries
Install Argobots in LIBOMP_LIBRARY_DIR for testing
2 parents 7085d4d + cb54ddb commit 5d75406

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
lines changed

libomptarget/test/lit.cfg

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ else: # Unices
6464
append_dynamic_library_path('LD_LIBRARY_PATH', \
6565
config.omp_host_rtl_directory, ":")
6666

67-
# Setup BOLT flag
68-
if config.using_abt:
69-
config.available_features.add('abt')
70-
config.test_flags += " -L " + config.libabt_dir + "/lib" + \
71-
" -Wl,-rpath," + config.libabt_dir + "/lib -labt"
72-
7367
# substitutions
7468
# - for targets that exist in the system create the actual command.
7569
# - for valid targets that do not exist in the system, return false, so that the

libomptarget/test/lit.site.cfg.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ config.library_dir = "@LIBOMPTARGET_LIBRARY_DIR@"
1010
config.omp_header_directory = "@LIBOMPTARGET_OPENMP_HEADER_FOLDER@"
1111
config.omp_host_rtl_directory = "@LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER@"
1212
config.operating_system = "@CMAKE_SYSTEM_NAME@"
13-
config.using_abt = @LIBOMP_TEST_USE_ARGOBOTS@
14-
config.libabt_dir = "@LIBOMP_ARGOBOTS_INSTALL_DIR@"
1513
config.libomptarget_all_targets = "@LIBOMPTARGET_ALL_TARGETS@".split()
1614
config.libomptarget_system_targets = "@LIBBOLTTARGET_SYSTEM_TARGETS@".split()
1715
config.libomptarget_filecheck = "@OPENMP_FILECHECK_EXECUTABLE@"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Create symbolic links for testing.
2+
3+
FILE(GLOB LIBOMP_ARGOBOTS_LIBS "${LIBOMP_ARGOBOTS_INSTALL_DIR}/lib/${SHARED_LIBRARY_PREFIX}*${SHARED_LIBRARY_SUFFIX}*")
4+
foreach(LIBOMP_ARGOBOTS_LIB IN LISTS LIBOMP_ARGOBOTS_LIBS)
5+
get_filename_component(LIBOMP_ARGOBOTS_LIB_NAME "${LIBOMP_ARGOBOTS_LIB}" NAME)
6+
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${LIBOMP_ARGOBOTS_LIB}" "${LIBOMP_ARGOBOTS_LIB_NAME}"
7+
WORKING_DIRECTORY ${LIBBOLT_LIBRARY_DIR}
8+
)
9+
endforeach()
10+
execute_process(
11+
COMMAND ${CMAKE_COMMAND} -E create_symlink ${LIBOMP_ARGOBOTS_INSTALL_DIR}/include/abt.h abt.h
12+
WORKING_DIRECTORY ${LIBBOLT_INCLUDE_DIR}
13+
)

runtime/src/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,20 @@ if(NOT WIN32)
186186
endif()
187187
endif()
188188

189+
# Add symbolic links to Argobots to the runtime path for testing
190+
if(${LIBOMP_USE_ARGOBOTS})
191+
add_custom_command(TARGET bolt-omp POST_BUILD
192+
COMMAND ${CMAKE_COMMAND}
193+
-D LIBOMP_ARGOBOTS_INSTALL_DIR="${LIBOMP_ARGOBOTS_INSTALL_DIR}"
194+
-D LIBBOLT_LIBRARY_DIR="${LIBBOLT_LIBRARY_DIR}"
195+
-D LIBBOLT_INCLUDE_DIR="${CMAKE_CURRENT_BINARY_DIR}"
196+
-D SHARED_LIBRARY_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}"
197+
-D SHARED_LIBRARY_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}"
198+
-P "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/LibboltSymlinkArgobots.cmake"
199+
WORKING_DIRECTORY ${LIBBOLT_LIBRARY_DIR}
200+
)
201+
endif()
202+
189203
# Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
190204
libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
191205
target_link_libraries(bolt-omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${CMAKE_DL_LIBS})

runtime/test/lit.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ if config.using_hwloc:
6969
if config.using_abt:
7070
config.available_features.add('abt')
7171
libs += " -labt"
72-
config.test_flags += " -L " + config.libabt_dir + "/lib" + \
73-
" -Wl,-rpath," + config.libabt_dir + "/lib" \
74-
" -I " + config.libabt_dir + "/include"
7572
# Some tasking tests require larger stack size.
7673
config.environment['ABT_THREAD_STACKSIZE'] = "262144"
7774
# Sleep alleviates oversubscription overheads when -j is specified.

runtime/test/lit.site.cfg.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ config.operating_system = "@CMAKE_SYSTEM_NAME@"
1313
config.hwloc_library_dir = "@LIBOMP_HWLOC_LIBRARY_DIR@"
1414
config.using_hwloc = @LIBOMP_USE_HWLOC@
1515
config.using_abt = @LIBOMP_TEST_USE_ARGOBOTS@
16-
config.libabt_dir = "@LIBOMP_ARGOBOTS_INSTALL_DIR@"
1716
config.has_ompt = @LIBBOLT_OMPT_SUPPORT@ and @LIBOMP_OMPT_OPTIONAL@
1817
config.has_libm = @LIBOMP_HAVE_LIBM@
1918
config.has_libatomic = @LIBOMP_HAVE_LIBATOMIC@

0 commit comments

Comments
 (0)