Skip to content
Permalink
Browse files

Enable building Habana backend with BUILD_SHARED_LIBS (#2989)

Summary:
Habana build with shared libs was broken and nobody noticed
Pull Request resolved: #2989

Differential Revision: D15528838

Pulled By: bertmaher

fbshipit-source-id: 2f06e0b7ba579a9d3682008bd2a109285ca5368d
  • Loading branch information...
bertmaher authored and facebook-github-bot committed May 31, 2019
1 parent a29dd3f commit 3dcfe44e21ac931c886f56fbaee047794825145e
Showing with 14 additions and 2 deletions.
  1. +13 −1 CMakeLists.txt
  2. +1 −1 lib/Backends/Habana/CMakeLists.txt
@@ -97,10 +97,22 @@ if (GLOW_WITH_OPENCL)
endif ()

if (GLOW_WITH_HABANA)
add_definitions(-DGLOW_WITH_HABANA=1)

# Find habanalabs libraries.
list(APPEND CMAKE_PREFIX_PATH /usr/lib/habanalabs)
find_path(SYNAPSE_INCLUDE_DIR synapse.h)
find_library(SYNAPSE_LIB Synapse)
add_definitions(-DGLOW_WITH_HABANA=1)
find_library(TPCSIM_SHARED_LIB tpcsim_shared)
find_library(HL_THUNK_LIB hl-thunk)

# Create interface library to encapsulate necessary .so's.
add_library(Synapse INTERFACE)
target_link_libraries(Synapse
INTERFACE
"${SYNAPSE_LIB}"
"${TPCSIM_SHARED_LIB}"
"${HL_THUNK_LIB}")
endif ()

# Top level setup for external backends
@@ -9,7 +9,7 @@ target_include_directories(Habana

target_link_libraries(Habana
PUBLIC
"${SYNAPSE_LIB}"
Synapse
PRIVATE
Backend
Base

0 comments on commit 3dcfe44

Please sign in to comment.
You can’t perform that action at this time.