-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add the support of the cross-compiling for iOS devices #3764
Conversation
…WITH_PYTHON and WITH_SWIG_PY are set to OFF.
…r Android and iOS. Recover the mistakenly deleted WARPCTC variable in cmake.
look forward to the support for armv7 and simulator |
d0d0db6
to
473bf59
Compare
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.
赞!
CMakeLists.txt
Outdated
if(ANDROID) | ||
if(${CMAKE_SYSTEM_VERSION} VERSION_LESS "16") | ||
if(ANDROID OR IOS) | ||
if(ANDROID AND ${CMAKE_SYSTEM_VERSION} VERSION_LESS "16") |
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判断需要提到外面,否则后面那个elseif分支有问题。
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.
对的,merge的时候没注意。Done。
|
||
IF(CMAKE_CROSSCOMPILING) | ||
SET(OPTIONAL_ARGS HOSTCC=${HOST_C_COMPILER}) | ||
GET_FILENAME_COMPONENT(CROSS_SUFFIX ${CMAKE_C_COMPILER} DIRECTORY) | ||
SET(CROSS_SUFFIX ${CROSS_SUFFIX}/) | ||
IF(ANDROID) | ||
# arm_soft_fp_abi branch of OpenBLAS to support softfp | ||
# https://github.com/xianyi/OpenBLAS/tree/arm_soft_fp_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.
目前看起来好像没有必要用arm_soft_fp_abi
分支,这个分支的所有commit已经都合入develop了。
This branch is 242 commits behind develop.
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.
这个分支的修改内容似乎并没有合入master
或者develop
分支,从两个分支的Makefile.arm
看的出来:
ifeq ($(CORE), ARMV7)
ifeq ($(OSNAME), Android)
ifeq ($(ARM_SOFTFP_ABI), 1)
CCOMMON_OPT += -mfpu=neon -march=armv7-a
FCOMMON_OPT += -mfpu=neon -march=armv7-a
else
CCOMMON_OPT += -mfpu=neon -march=armv7-a -Wl,--no-warn-mismatch
FCOMMON_OPT += -mfpu=neon -march=armv7-a -Wl,--no-warn-mismatch
endif
else
CCOMMON_OPT += -mfpu=vfpv3 -march=armv7-a
FCOMMON_OPT += -mfpu=vfpv3 -march=armv7-a
endif
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.
arm_soft_fp_abi
分支只显示This branch is 242 commits behind develop.
说明它已经merge到develop了,否则应该会显示commits ahead of develop这类的。至于,develop的Makefile.arm与arm_soft_fp_abi的不一样可能是develop后来又修改了。
ps,我用develop的编译跑了一下,好像没发现比arm_soft_fp_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.
我验证一下,下一个PR修复吧。
Xcode is used as the toolchain for cross-compiling for iOS devices. Make sure Xcode is installed on your Mac.
Use the following
CMake
commandSet
-DIOS_USE_VECLIB_FOR_BLAS=ON
to useveclib
, such asWhen neither
IOS_USE_VECLIB_FOR_BLAS
norUSE_EIGEN_FOR_BLAS
is set ,OpenBLAS
will be used. You can changeCMAKE_OSX_ARCHITECTURES
to"armv7"
, but noteOpenBLAS
can not be built forarmv7
.TODO:
make
process