-
Notifications
You must be signed in to change notification settings - Fork 47
support android ndk #102
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
base: main
Are you sure you want to change the base?
support android ndk #102
Conversation
支持使用Android NDK工具链编译modelbox。编译所得到的so文件,可被安卓/鸿蒙平台上的APP调用。
@@ -4,7 +4,7 @@ mark_as_advanced(MINDSPORE_INCLUDE) | |||
|
|||
# Look for the library (sorted from most current/relevant entry to least). | |||
find_library(MINDSPORE_LIBRARY NAMES | |||
mindspore | |||
NAMES mindspore mindspore-lite |
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.
mindspore和lite版本能混用吗?
是否应该要分开?
@@ -22,6 +22,14 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) | |||
message(FATAL_ERROR "Do not build in source directory!") | |||
endif() | |||
|
|||
if (DEFINED ENV{USER_ROOT} AND ANDROID_ABI) |
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.
这个可以放到CMake/options里面。
#ifdef ANDROID | ||
/* When they come from different so files, they may have different hash | ||
* codes even if they have the same names. */ | ||
if (strcmp(typeid(T).name(), entrys_[key].type().name()) == 0) { |
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.
strncmp
inline _LIBCPP_INLINE_VISIBILITY | ||
typename std::enable_if | ||
< | ||
!std::is_array<_Tp>::value && !std::is_array<_Up>::value, |
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.
vscode里面格式化代码
@@ -0,0 +1,139 @@ | |||
/* Android does not provide execinfo.h. We implement backtrace and |
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.
版权头文件
vscode里面格式化代码。
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.
这个文件感觉可以放到src/libmodelbox/base/arch/android中。避免andriod宏
object, then these functions return 0. */ | ||
if (!dladdr(addr, &info) || info.dli_fname == NULL) | ||
{ | ||
pos += snprintf(symbols + pos, len - pos, "Unknown(+0) [%p]", addr) + 1; |
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.
snprintf_s
return NULL; | ||
} | ||
|
||
memset(symbols, 0, sizeof(void *)); |
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.
memset_s
#include <execinfo.h> | ||
#else | ||
#include "../../../libmodelbox/base/utils/backtrace.cc" |
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.
这里包含了cc文件,是不是不合理。
find_package(PythonInterp ${PYTHON_VER}) | ||
if(NOT ${PYTHONINTERP_FOUND}) | ||
if (DEFINED ENV{USER_ROOT} AND ANDROID_ABI AND PYTHON_VERSION_STRING) | ||
if(EXISTS "$ENV{USER_ROOT}/${ANDROID_ABI}/usr/lib/libpython${PYTHON_VERSION_STRING}.so") |
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.
这个可以写个cmake函数。
8931842
to
1d25ee9
Compare
@@ -58,7 +58,16 @@ Status FfmpegVideoMuxer::Mux(const AVRational &time_base, | |||
av_packet_rescale_ts(av_packet.get(), time_base, stream_->time_base); | |||
av_packet->stream_index = stream_->index; | |||
if (!is_header_wrote_) { | |||
#ifndef ANDROID |
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.
这里为什么 Android和其它有区别?
d2068f7
to
5cb3ffa
Compare
支持使用Android NDK工具链编译modelbox。编译所得到的so文件,可被安卓/鸿蒙平台上的APP调用。