Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
PlaidML RPATH fixes (#3287)
Browse files Browse the repository at this point in the history
* Added rpath setting for PlaidML backend

* Fix colons

* Separate build and install rpath

* Explicitly set target properties
  • Loading branch information
earhart authored and diyessi committed Jul 23, 2019
1 parent 9722b7f commit 28f2001
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@ set(NGRAPH_INSTALL_DOC "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}")
set(NGRAPH_INSTALL_BIN "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
if (LINUX)
if (DEFINED NGRAPH_RPATH)
set(CMAKE_BUILD_RPATH "$ORIGIN:${NGRAPH_RPATH}")
set(CMAKE_INSTALL_RPATH "$ORIGIN:${NGRAPH_RPATH}")
else()
set(CMAKE_BUILD_RPATH "$ORIGIN")
set(CMAKE_INSTALL_RPATH "$ORIGIN")
endif()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()

#-----------------------------------------------------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions src/ngraph/runtime/plaidml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,11 @@ target_include_directories(plaidml_backend SYSTEM PUBLIC ${PLAIDML_INCLUDE_DIRS}
target_link_libraries(plaidml_backend PUBLIC ngraph libplaidml)
install(TARGETS plaidml_backend LIBRARY DESTINATION ${NGRAPH_INSTALL_LIB})

set(CMAKE_MACOSX_RPATH 1)
if(APPLE)
set_property(TARGET plaidml_backend PROPERTY INSTALL_RPATH "@loader_path/;@loader_path/../../..")
elseif(DEFINED NGRAPH_RPATH)
set_property(TARGET plaidml_backend PROPERTY INSTALL_RPATH "\$ORIGIN;\$ORIGIN/../../..;${NGRAPH_RPATH}")
else()
set_property(TARGET plaidml_backend PROPERTY INSTALL_RPATH "\$ORIGIN;\$ORIGIN/../../..")
endif()

0 comments on commit 28f2001

Please sign in to comment.