-
Notifications
You must be signed in to change notification settings - Fork 5.8k
feature/anakin ci #11330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/anakin ci #11330
Changes from all commits
c0e7a96
e92e91d
64fa10d
01e3fba
1da398e
243891a
55c6386
8b4f40d
f194fba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
if (NOT WITH_ANAKIN) | ||
return() | ||
endif() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1-3可以去掉。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 下面会 wget anakin 的库,如果没有打开可以忽略所有下面的逻辑。 |
||
|
||
set(ANAKIN_INSTALL_DIR "${THIRD_PARTY_PATH}/install/anakin" CACHE PATH | ||
"Anakin install path." FORCE) | ||
set(ANAKIN_INCLUDE "${ANAKIN_INSTALL_DIR}" CACHE STRING "root of Anakin header files") | ||
set(ANAKIN_LIBRARY "${ANAKIN_INSTALL_DIR}" CACHE STRING "path of Anakin library") | ||
|
||
set(ANAKIN_COMPILE_EXTRA_FLAGS -Wno-error=unused-variable -Wno-error=format-extra-args -Wno-error=comment -Wno-error=format -Wno-error=switch -Wno-error=return-type -Wno-error=non-virtual-dtor -Wno-reorder -Wno-error=cpp) | ||
|
||
set(ANAKIN_LIBRARY_URL "https://github.com/pangge/Anakin/releases/download/3.0/anakin_release_simple.tar.gz") | ||
|
||
# A helper function used in Anakin, currently, to use it, one need to recursively include | ||
# nearly all the header files. | ||
function(fetch_include_recursively root_dir) | ||
if (IS_DIRECTORY ${root_dir}) | ||
include_directories(${root_dir}) | ||
endif() | ||
|
||
file(GLOB ALL_SUB RELATIVE ${root_dir} ${root_dir}/*) | ||
foreach(sub ${ALL_SUB}) | ||
if (IS_DIRECTORY ${root_dir}/${sub}) | ||
fetch_include_recursively(${root_dir}/${sub}) | ||
endif() | ||
endforeach() | ||
endfunction() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 可以用 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 有时间的话在另外一个 pr 里加吧。 |
||
|
||
# download library | ||
message(STATUS "Download Anakin library from ${ANAKIN_LIBRARY_URL}") | ||
execute_process(COMMAND bash -c "mkdir -p ${ANAKIN_INSTALL_DIR}") | ||
execute_process(COMMAND bash -c "rm -rf ${ANAKIN_INSTALL_DIR}/*") | ||
execute_process(COMMAND bash -c "cd ${ANAKIN_INSTALL_DIR}; wget -q ${ANAKIN_LIBRARY_URL}") | ||
execute_process(COMMAND bash -c "mkdir -p ${ANAKIN_INSTALL_DIR}") | ||
execute_process(COMMAND bash -c "cd ${ANAKIN_INSTALL_DIR}; tar xzf anakin_release_simple.tar.gz") | ||
|
||
if (WITH_ANAKIN) | ||
message(STATUS "Anakin for inference is enabled") | ||
message(STATUS "Anakin is set INCLUDE:${ANAKIN_INCLUDE} LIBRARY:${ANAKIN_LIBRARY}") | ||
fetch_include_recursively(${ANAKIN_INCLUDE}) | ||
link_directories(${ANAKIN_LIBRARY}) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ci里要设成ON,测一下么?可以修改paddle_build.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already set in
paddle_build.sh