Skip to content
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

Merged
merged 20 commits into from
Sep 20, 2017
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
11cb75f
add the ios cross compile
NHZlX Aug 28, 2017
43dde93
Refine the cross-compiling toolchain file for iOS.
Xreki Aug 29, 2017
fb38e66
Seperate the codes that cannot and don't need to build for iOS devices.
Xreki Aug 29, 2017
d2435ba
Disable the finding of python, swig related packages completely when …
Xreki Aug 29, 2017
224f8b0
Support building for multiple architecures at one time.
Xreki Aug 30, 2017
473161f
Merge branch 'ios_cross_compile' into build_ios
Xreki Aug 30, 2017
0cb3906
Merge branch 'develop' into build_ios
Xreki Aug 30, 2017
d57ffc4
Deliver the cross-compilng platform-specific args to external libraries.
Xreki Aug 30, 2017
aeea8ab
Remove the linking of train-related libraries when cross-compiling fo…
Xreki Aug 30, 2017
bf7fc48
Merge branch 'develop' into build_ios
Xreki Aug 30, 2017
36fc405
Merge branch 'develop' into build_ios
Xreki Aug 31, 2017
fb93a8b
Add paddle_pserver back to c-api library, because it is used in Evalu…
Xreki Aug 31, 2017
d1f5f49
Merge branch 'develop' into build_ios
Xreki Sep 4, 2017
7976876
Add the finding of iOS's native vecLib.framework.
Xreki Sep 4, 2017
2ee8a4c
Add build_ios task in travis, and move the installing of glide into c…
Xreki Sep 4, 2017
b4d710c
Merge branch 'develop' into build_ios
Xreki Sep 13, 2017
9e524fc
Remove the generation of executable, such as paddle_trainer, when set…
Xreki Sep 13, 2017
76338fb
Merge branch 'develop' into build_ios
Xreki Sep 14, 2017
46ee8ce
Move the sreach and link of veclib to iOS's toolchain file .
Xreki Sep 15, 2017
26e9ab4
Fix if-statement error in CMakeLists.txt and remove build_ios task fr…
Xreki Sep 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ cache:
- $HOME/.ccache
- $HOME/.cache/pip
- $TRAVIS_BUILD_DIR/build/third_party
- $TRAVIS_BUILD_DIR/build_ios/third_party
sudo: required
dist: trusty
os:
- linux
env:
- JOB=build_doc
- JOB=check_style
matrix:
include:
- env: JOB=build_ios
os: osx
osx_image: xcode8.3
compiler: clang
addons:
apt:
packages:
Expand All @@ -36,10 +43,6 @@ before_install:
# protobuf version.
- sudo pip install -r $TRAVIS_BUILD_DIR/python/requirements.txt
- sudo pip install wheel sphinx==1.5.6 recommonmark sphinx-rtd-theme==0.1.9 virtualenv pre-commit LinkChecker
- curl https://glide.sh/get | bash
- eval "$(GIMME_GO_VERSION=1.8.3 gimme)"
- go get -u github.com/alecthomas/gometalinter
- gometalinter --install
- |
function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
script:
Expand Down
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if(NOT CMAKE_CROSSCOMPILING)
endif(NOT CMAKE_CROSSCOMPILING)
find_package(Git REQUIRED)
find_package(Threads REQUIRED)
if(NOT ANDROID)
if(NOT ANDROID AND NOT IOS)
find_package(Boost QUIET)
endif()

Expand Down Expand Up @@ -64,27 +64,27 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()

if(ANDROID)
if(${CMAKE_SYSTEM_VERSION} VERSION_LESS "16")
if(ANDROID OR IOS)
if(ANDROID AND ${CMAKE_SYSTEM_VERSION} VERSION_LESS "16")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个ANDROID判断需要提到外面,否则后面那个elseif分支有问题。

Copy link
Contributor Author

@Xreki Xreki Sep 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对的,merge的时候没注意。Done。

message(FATAL_ERROR "Unsupport standalone toolchains with Android API level lower than 16")
elseif(${CMAKE_SYSTEM_VERSION} VERSION_LESS "21")
# TODO: support glog for Android api 16 ~ 19 in the future
message(WARNING "Using the unofficial git repository <https://github.com/Xreki/glog.git> instead")
endif()

set(WITH_GPU OFF CACHE STRING
"Disable GPU when cross-compiling for Android" FORCE)
"Disable GPU when cross-compiling for Android and iOS" FORCE)
set(WITH_AVX OFF CACHE STRING
"Disable AVX when cross-compiling for Android" FORCE)
"Disable AVX when cross-compiling for Android and iOS" FORCE)
set(WITH_PYTHON OFF CACHE STRING
"Disable PYTHON when cross-compiling for Android" FORCE)
"Disable PYTHON when cross-compiling for Android and iOS" FORCE)
set(WITH_RDMA OFF CACHE STRING
"Disable RDMA when cross-compiling for Android" FORCE)
"Disable RDMA when cross-compiling for Android and iOS" FORCE)
set(WITH_MKLDNN OFF CACHE STRING
"Disable MKLDNN when cross-compiling for Android" FORCE)
"Disable MKLDNN when cross-compiling for Android and iOS" FORCE)
set(WITH_MKLML OFF CACHE STRING
"Disable MKLML package when cross-compiling for Android" FORCE)
endif(ANDROID)
"Disable MKLML package when cross-compiling for Android and iOS" FORCE)
endif()

set(THIRD_PARTY_PATH "${CMAKE_BINARY_DIR}/third_party" CACHE STRING
"A path setting third party libraries download & build directories.")
Expand Down
7 changes: 7 additions & 0 deletions cmake/cblas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,10 @@ if (REFERENCE_CBLAS_INCLUDE_DIR AND REFERENCE_CBLAS_LIBRARY)
add_definitions(-DPADDLE_USE_REFERENCE_CBLAS)
message(STATUS "Found reference-cblas (include: ${CBLAS_INC_DIR}, library: ${CBLAS_LIBRARIES})")
endif()

if(IOS_USE_VECLIB_FOR_BLAS AND VECLIB_FOUND)
set(CBLAS_FOUND ON)
set(CBLAS_PROVIDER vecLib)
set(CBLAS_INC_DIR ${VECLIB_INC_DIR})
add_definitions(-DPADDLE_USE_VECLIB)
endif()
Loading