Skip to content

Commit 22bc328

Browse files
committed
fix anakin-NOTFOUND compiler error
1 parent b2367f3 commit 22bc328

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

cmake/external/anakin.cmake

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ ExternalProject_Add(
4848
message(STATUS "Anakin for inference is enabled")
4949
message(STATUS "Anakin is set INCLUDE:${ANAKIN_INCLUDE} LIBRARY:${ANAKIN_LIBRARY}")
5050

51-
add_library(anakin SHARED IMPORTED GLOBAL)
52-
set_property(TARGET anakin PROPERTY IMPORTED_LOCATION ${ANAKIN_SHARED_LIB})
53-
set_property(TARGET anakin PROPERTY IMPORTED_LOCATION ${ANAKIN_SABER_LIB})
54-
set_property(TARGET anakin PROPERTY IMPORTED_LOCATION ${CUDNN_LIBRARY})
55-
add_dependencies(anakin extern_anakin protobuf mklml)
56-
list(APPEND external_project_dependencies anakin)
51+
add_library(anakin_shared SHARED IMPORTED GLOBAL)
52+
set_property(TARGET anakin_shared PROPERTY IMPORTED_LOCATION ${ANAKIN_SHARED_LIB})
53+
add_dependencies(anakin_shared extern_anakin protobuf mklml)
54+
55+
add_library(anakin_saber SHARED IMPORTED GLOBAL)
56+
set_property(TARGET anakin_saber PROPERTY IMPORTED_LOCATION ${ANAKIN_SABER_LIB})
57+
add_dependencies(anakin_saber extern_anakin protobuf mklml)
58+
59+
list(APPEND external_project_dependencies anakin_shared anakin_saber)

paddle/fluid/inference/api/CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,20 @@ endif()
6262

6363
if (WITH_ANAKIN) # only needed in CI
6464
# compile the libinference_anakin_api.a and anakin.so.
65-
nv_library(inference_anakin_api SRCS api.cc api_anakin_engine.cc DEPS anakin)
66-
nv_library(inference_anakin_api_shared SHARED SRCS api.cc api_anakin_engine.cc DEPS anakin)
67-
set(ANAKIN_DEPS_LIB ${ANAKIN_SHARED_LIB} ${ANAKIN_SABER_LIB} ${CUDNN_LIBRARY})
65+
nv_library(inference_anakin_api SRCS api.cc api_anakin_engine.cc DEPS anakin_shared anakin_saber)
66+
#nv_library(inference_anakin_api_shared SHARED SRCS api.cc api_anakin_engine.cc DEPS anakin)
6867
function(anakin_target target_name)
6968
target_compile_options(${target_name} BEFORE PUBLIC ${ANAKIN_COMPILE_EXTRA_FLAGS})
70-
target_link_libraries(${target_name} ${ANAKIN_DEPS_LIB})
7169
endfunction()
7270
anakin_target(inference_anakin_api)
73-
anakin_target(inference_anakin_api_shared)
71+
#anakin_target(inference_anakin_api_shared)
7472
if (WITH_TESTING)
7573
# TODO(luotao): anakin_model will move to demo_ci later
7674
set(ANAKIN_MODLE_URL "http://paddle-inference-dist.bj.bcebos.com/mobilenet_v2.anakin.bin")
77-
execute_process(COMMAND bash -c "cd ${ANAKIN_INSTALL_DIR}; wget -q --no-check-certificate ${ANAKIN_MODLE_URL}")
75+
execute_process(COMMAND bash -c "wget -q --no-check-certificate ${ANAKIN_MODLE_URL}")
7876
cc_test(inference_anakin_test SRCS api_anakin_engine_tester.cc
79-
ARGS --model=${ANAKIN_INSTAL_DIR}/mobilenet_v2.anakin.bin
80-
DEPS inference_anakin_api_shared dynload_cuda SERIAL)
77+
ARGS --model=${CMAKE_CURRENT_BINARY_DIR}/mobilenet_v2.anakin.bin
78+
DEPS inference_anakin_api dynload_cuda SERIAL)
8179
target_compile_options(inference_anakin_test BEFORE PUBLIC ${ANAKIN_COMPILE_EXTRA_FLAGS})
8280
endif(WITH_TESTING)
8381
endif()

0 commit comments

Comments
 (0)