neuware.cmake 1005 字节
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

set(CNNL_LIB ${NEUWARE_LIB_DIR}/libcnnl.so)
C
cifar10 已提交
18
set(MLUOP_LIB ${NEUWARE_LIB_DIR}/libmluops.so)
F
fwenguang 已提交
19 20
set(CNRT_LIB ${NEUWARE_LIB_DIR}/libcnrt.so)
set(CNDRV_LIB ${NEUWARE_LIB_DIR}/libcndrv.so)
F
fwenguang 已提交
21
set(CNPAPI_LIB ${NEUWARE_LIB_DIR}/libcnpapi.so)
F
fwenguang 已提交
22 23

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

27
if(WITH_CNCL)
28 29 30 31
  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})
32
endif()
F
fwenguang 已提交
33

34
target_link_libraries(neuware_lib ${NEUWARE_LIB_DEPS})