@@ -2,29 +2,17 @@ if (NOT WITH_ANAKIN)
2
2
return ()
3
3
endif ()
4
4
5
+ INCLUDE (ExternalProject )
5
6
set (ANAKIN_SOURCE_DIR ${THIRD_PARTY_PATH} /anakin )
6
7
# the anakin install dir is only default one now
7
8
set (ANAKIN_INSTALL_DIR ${THIRD_PARTY_PATH} /anakin/src/extern_anakin/output )
8
9
set (ANAKIN_INCLUDE ${ANAKIN_INSTALL_DIR} )
9
10
set (ANAKIN_LIBRARY ${ANAKIN_INSTALL_DIR} )
10
- SET (ANAKIN_SHARED_LIB ${ANAKIN_LIBRARY} /libanakin.so )
11
- SET (ANAKIN_SABER_LIB ${ANAKIN_LIBRARY} /libanakin_saber_common.so )
11
+ set (ANAKIN_SHARED_LIB ${ANAKIN_LIBRARY} /libanakin.so )
12
+ set (ANAKIN_SABER_LIB ${ANAKIN_LIBRARY} /libanakin_saber_common.so )
12
13
13
- # A helper function used in Anakin, currently, to use it, one need to recursively include
14
- # nearly all the header files.
15
- function (fetch_include_recursively root_dir )
16
- if (IS_DIRECTORY ${root_dir} )
17
- include_directories (BEFORE ${root_dir} )
18
- endif ()
19
-
20
- file (GLOB ALL_SUB RELATIVE ${root_dir} ${root_dir} /* )
21
- foreach (sub ${ALL_SUB} )
22
- if (IS_DIRECTORY ${root_dir} /${sub} )
23
- fetch_include_recursively (${root_dir} /${sub} )
24
- endif ()
25
- endforeach ()
26
- endfunction ()
27
- fetch_include_recursively (${ANAKIN_INCLUDE} )
14
+ include_directories (${ANAKIN_INCLUDE} )
15
+ include_directories (${ANAKIN_INCLUDE} /saber/ )
28
16
29
17
set (ANAKIN_COMPILE_EXTRA_FLAGS
30
18
-Wno-error=unused-but-set-variable -Wno-unused-but-set-variable
@@ -60,11 +48,9 @@ ExternalProject_Add(
60
48
message (STATUS "Anakin for inference is enabled" )
61
49
message (STATUS "Anakin is set INCLUDE:${ANAKIN_INCLUDE} LIBRARY:${ANAKIN_LIBRARY} " )
62
50
63
- fetch_include_recursively (${ANAKIN_INCLUDE} )
64
- add_dependencies (extern_anakin protobuf mklml )
65
51
add_library (anakin SHARED IMPORTED GLOBAL )
66
52
set_property (TARGET anakin PROPERTY IMPORTED_LOCATION ${ANAKIN_SHARED_LIB} )
67
53
set_property (TARGET anakin PROPERTY IMPORTED_LOCATION ${ANAKIN_SABER_LIB} )
68
54
set_property (TARGET anakin PROPERTY IMPORTED_LOCATION ${CUDNN_LIBRARY} )
69
- add_dependencies (anakin extern_anakin )
55
+ add_dependencies (anakin extern_anakin protobuf mklml )
70
56
list (APPEND external_project_dependencies anakin )
0 commit comments