提交 94042ccd 编写于 作者: L luotao1

add comment

上级 64c0ba28
......@@ -14,7 +14,7 @@ SET(ANAKIN_SABER_LIB ${ANAKIN_LIBRARY}/libanakin_saber_common.so)
# nearly all the header files.
function(fetch_include_recursively root_dir)
if (IS_DIRECTORY ${root_dir})
include_directories(${root_dir})
include_directories(BEFORE ${root_dir})
endif()
file(GLOB ALL_SUB RELATIVE ${root_dir} ${root_dir}/*)
......@@ -26,20 +26,6 @@ function(fetch_include_recursively root_dir)
endfunction()
fetch_include_recursively(${ANAKIN_INCLUDE})
# A nother helper function used in Anakin.
function(target_fetch_include_recursively root_dir target_name)
if (IS_DIRECTORY ${root_dir})
target_include_directories(${target_name} PUBLIC ${root_dir})
endif()
file(GLOB ALL_SUB RELATIVE ${root_dir} ${root_dir}/*)
foreach(sub ${ALL_SUB})
if (IS_DIRECTORY ${root_dir}/${sub})
target_include_directories(${target_name} PUBLIC ${root_dir}/${sub})
endif()
endforeach()
endfunction()
set(ANAKIN_COMPILE_EXTRA_FLAGS
-Wno-error=unused-but-set-variable -Wno-unused-but-set-variable
-Wno-error=unused-variable -Wno-unused-variable
......@@ -56,6 +42,7 @@ set(ANAKIN_COMPILE_EXTRA_FLAGS
ExternalProject_Add(
extern_anakin
${EXTERNAL_PROJECT_LOG_ARGS}
# TODO(luotao): use PaddlePaddle/Anakin later
GIT_REPOSITORY "https://github.com/luotao1/Anakin"
GIT_TAG "3957ae9263eaa0b1986758dac60a88852afb09be"
PREFIX ${ANAKIN_SOURCE_DIR}
......@@ -73,6 +60,7 @@ ExternalProject_Add(
message(STATUS "Anakin for inference is enabled")
message(STATUS "Anakin is set INCLUDE:${ANAKIN_INCLUDE} LIBRARY:${ANAKIN_LIBRARY}")
fetch_include_recursively(${ANAKIN_INCLUDE})
add_dependencies(extern_anakin protobuf mklml)
add_library(anakin SHARED IMPORTED GLOBAL)
set_property(TARGET anakin PROPERTY IMPORTED_LOCATION ${ANAKIN_SHARED_LIB})
......
......@@ -62,11 +62,11 @@ endif()
if (WITH_ANAKIN) # only needed in CI
# compile the libinference_anakin_api.a and anakin.so.
fetch_include_recursively(${ANAKIN_INCLUDE})
nv_library(inference_anakin_api SRCS api.cc api_anakin_engine.cc DEPS anakin)
nv_library(inference_anakin_api_shared SHARED SRCS api.cc api_anakin_engine.cc DEPS anakin)
set(ANAKIN_DEPS_LIB ${ANAKIN_SHARED_LIB} ${ANAKIN_SABER_LIB} ${CUDNN_LIBRARY})
function(anakin_target target_name)
target_fetch_include_recursively(${ANAKIN_INCLUDE} ${target_name})
target_compile_options(${target_name} BEFORE PUBLIC ${ANAKIN_COMPILE_EXTRA_FLAGS})
target_link_libraries(${target_name} ${ANAKIN_DEPS_LIB})
endfunction()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册