Unverified Commit 1af7dde2 authored by Scott Cyphers's avatar Scott Cyphers Committed by GitHub

Merge pull request #3196 from NervanaSystems/avijit/plaid_rpath_fix

Added rpath setting for PlaidML backend
parents a93547d6 1185fb48
...@@ -306,12 +306,12 @@ set(NGRAPH_INSTALL_DOC "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}") ...@@ -306,12 +306,12 @@ set(NGRAPH_INSTALL_DOC "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}")
set(NGRAPH_INSTALL_BIN "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") set(NGRAPH_INSTALL_BIN "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
if (LINUX) if (LINUX)
if (DEFINED NGRAPH_RPATH) if (DEFINED NGRAPH_RPATH)
set(CMAKE_BUILD_RPATH "$ORIGIN:${NGRAPH_RPATH}")
set(CMAKE_INSTALL_RPATH "$ORIGIN:${NGRAPH_RPATH}") set(CMAKE_INSTALL_RPATH "$ORIGIN:${NGRAPH_RPATH}")
else() else()
set(CMAKE_BUILD_RPATH "$ORIGIN")
set(CMAKE_INSTALL_RPATH "$ORIGIN") set(CMAKE_INSTALL_RPATH "$ORIGIN")
endif() endif()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif() endif()
#----------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------
......
...@@ -75,3 +75,11 @@ target_include_directories(plaidml_backend SYSTEM PUBLIC ${PLAIDML_INCLUDE_DIRS} ...@@ -75,3 +75,11 @@ target_include_directories(plaidml_backend SYSTEM PUBLIC ${PLAIDML_INCLUDE_DIRS}
target_link_libraries(plaidml_backend PUBLIC ngraph libplaidml) target_link_libraries(plaidml_backend PUBLIC ngraph libplaidml)
install(TARGETS plaidml_backend LIBRARY DESTINATION ${NGRAPH_INSTALL_LIB}) 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()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment