Skip to content

Commit f857af4

Browse files
estewart08ronlieb
authored andcommitted
[ompd] - Remove hardcoded RUNPATH from ompdModule.cpython.so.
Use `$ORIGIN` in RUNPATH instead. Link in libclang-cpp.so to ompdModule.so to satisfy missing llvm dynamic symbols just like we do in the cpython version. Change-Id: Ic38ded1e34bd4e12d47ada47a5e34444662f31f9
1 parent 20e8466 commit f857af4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

openmp/libompd/gdb-plugin/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ GET_FILENAME_COMPONENT(CLANG_CPP_PATH "${CLANG_CPP}" PATH)
6565

6666
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python-module/ompd/__init__.py
6767
DEPENDS ompdModule.c DLSymService.cpp ompdAPITests.c setup.py ompd/frame_filter.py ompd/__init__.py ompd/ompd_address_space.py ompd/ompd_callbacks.py ompd/ompd_handles.py ompd/ompd.py
68-
COMMAND ${CMAKE_COMMAND} -E env LIBOMP_INCLUDE_DIR=${LIBOMP_INCLUDE_DIR} LLVM_MAIN_INCLUDE_DIR=${LLVM_MAIN_INCLUDE_DIR} CLANG_CPP=${CLANG_CPP} INSTALL_LIB_LOC=${CLANG_CPP_PATH}
68+
COMMAND ${CMAKE_COMMAND} -E env LIBOMP_INCLUDE_DIR=${LIBOMP_INCLUDE_DIR} LLVM_MAIN_INCLUDE_DIR=${LLVM_MAIN_INCLUDE_DIR} CLANG_CPP=${CLANG_CPP}
6969
${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py -v bdist_wheel -b ${CMAKE_CURRENT_BINARY_DIR}/build -d ${CMAKE_CURRENT_BINARY_DIR}
7070
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py clean --all
7171
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/ompd.egg-info
@@ -89,6 +89,7 @@ include_directories (
8989

9090
target_link_libraries (ompdModule ${Python3_LIBRARIES})
9191
target_link_libraries (ompdModule ${CMAKE_DL_LIBS})
92+
target_link_libraries (ompdModule ${CLANG_CPP})
9293

9394
set_target_properties (ompdModule PROPERTIES PREFIX "")
9495
set_target_properties (ompdModule PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/python-module/ompd/")

openmp/libompd/gdb-plugin/setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# Needed for dlsym
1111
clang_cpp = os.environ.get('CLANG_CPP', dir_path)
1212
clang_cpp_dir = clang_cpp.split('libclang-cpp.so')
13-
install_lib_loc = os.environ.get('INSTALL_LIB_LOC', dir_path)
1413

1514
print("find_packages : ", find_packages())
1615
setup(
@@ -19,5 +18,5 @@
1918
py_modules=['loadompd'],
2019
setup_requires=['wheel'],
2120
packages=find_packages(),
22-
ext_modules=[Extension('ompd.ompdModule', [dir_path+'/ompdModule.c', dir_path+'/ompdAPITests.c', dir_path+'/DLSymService.cpp'], include_dirs=[omp_include_dir, llvm_include_dir], runtime_library_dirs=[install_lib_loc], libraries=['clang-cpp'], library_dirs=[clang_cpp_dir[0]])]
21+
ext_modules=[Extension('ompd.ompdModule', [dir_path+'/ompdModule.c', dir_path+'/ompdAPITests.c', dir_path+'/DLSymService.cpp'], include_dirs=[omp_include_dir, llvm_include_dir], runtime_library_dirs=["$ORIGIN:$ORIGIN/../lib"], libraries=['clang-cpp'], library_dirs=[clang_cpp_dir[0]])]
2322
)

0 commit comments

Comments
 (0)