Skip to content

Commit

Permalink
Set CMAKE_INSTALL_RPATH for non-system install prefix
Browse files Browse the repository at this point in the history
During install set RPATH so that libtbb can be found when building
with the oneTBB submodule.
The following programs in the tools directory require libtbb:

- compress_inverted_index
- evaluate_queries
- invert
- parse_collection
- partition_fwd_index
- reorder-docids
- shards

See #242
  • Loading branch information
lgrz authored and elshize committed Nov 29, 2024
1 parent 1830ef9 commit f3d8727
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") # Add debug info anyway
endif()

# modify RPATH when installing to a non-system directory (e.g. /usr/local).
# required to find libtbb with non-system libtbb.
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if(NOT PISA_SYSTEM_ONETBB AND "${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
endif()

find_package(OpenMP)
Expand Down

0 comments on commit f3d8727

Please sign in to comment.