neuware.cmake 924 字节
Newer Older
F
fwenguang 已提交
1
if(NOT WITH_MLU)
2
  return()
F
fwenguang 已提交
3 4 5
endif()

if(NOT ENV{NEUWARE_HOME})
6
  set(NEUWARE_HOME "/usr/local/neuware")
F
fwenguang 已提交
7
else()
8
  set(NEUWARE_HOME $ENV{NEUWARE_HOME})
F
fwenguang 已提交
9 10 11 12 13 14
endif()
message(STATUS "NEUWARE_HOME: " ${NEUWARE_HOME})

set(NEUWARE_INCLUDE_DIR ${NEUWARE_HOME}/include)
set(NEUWARE_LIB_DIR ${NEUWARE_HOME}/lib64)

15
include_directories(${NEUWARE_INCLUDE_DIR})
F
fwenguang 已提交
16 17 18 19

set(CNNL_LIB ${NEUWARE_LIB_DIR}/libcnnl.so)
set(CNRT_LIB ${NEUWARE_LIB_DIR}/libcnrt.so)
set(CNDRV_LIB ${NEUWARE_LIB_DIR}/libcndrv.so)
F
fwenguang 已提交
20
set(CNPAPI_LIB ${NEUWARE_LIB_DIR}/libcnpapi.so)
F
fwenguang 已提交
21 22

generate_dummy_static_lib(LIB_NAME "neuware_lib" GENERATOR "neuware.cmake")
F
fwenguang 已提交
23 24
set(NEUWARE_LIB_DEPS ${CNNL_LIB} ${CNRT_LIB} ${CNDRV_LIB} ${CNPAPI_LIB})

25
if(WITH_CNCL)
26 27 28 29
  message(STATUS "Compile with CNCL!")
  add_definitions(-DPADDLE_WITH_CNCL)
  set(CNCL_LIB ${NEUWARE_LIB_DIR}/libcncl.so)
  list(APPEND NEUWARE_LIB_DEPS ${CNCL_LIB})
30
endif()
F
fwenguang 已提交
31

32
target_link_libraries(neuware_lib ${NEUWARE_LIB_DEPS})