Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
46ee8cee
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
46ee8cee
编写于
9月 15, 2017
作者:
L
Liu Yiqun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move the sreach and link of veclib to iOS's toolchain file .
上级
76338fb6
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
38 addition
and
27 deletion
+38
-27
cmake/cblas.cmake
cmake/cblas.cmake
+5
-25
cmake/cross_compiling/ios.cmake
cmake/cross_compiling/ios.cmake
+33
-2
未找到文件。
cmake/cblas.cmake
浏览文件 @
46ee8cee
...
...
@@ -172,29 +172,9 @@ if (REFERENCE_CBLAS_INCLUDE_DIR AND REFERENCE_CBLAS_LIBRARY)
message
(
STATUS
"Found reference-cblas (include:
${
CBLAS_INC_DIR
}
, library:
${
CBLAS_LIBRARIES
}
)"
)
endif
()
if
(
IOS
)
# Find vecLib for iOS
set
(
VECLIB_SEARCH_DIRS
${
IOS_SDK_ROOT
}
/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks
${
IOS_SDK_ROOT
}
/System/Library/Frameworks/Accelerate.framework/Frameworks
)
find_path
(
VECLIB_INC_DIR vecLib.h PATHS
${
VECLIB_SEARCH_DIRS
}
/vecLib.framework/Headers
)
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
vecLib DEFAULT_MSG VECLIB_INC_DIR
)
if
(
VECLIB_FOUND
)
if
(
IOS_USE_VECLIB_FOR_BLAS AND VECLIB_FOUND
)
set
(
CBLAS_FOUND ON
)
set
(
CBLAS_PROVIDER vecLib
)
set
(
CBLAS_INC_DIR
${
VECLIB_INC_DIR
}
)
if
(
VECLIB_INC_DIR MATCHES
"^/System/Library/Frameworks/vecLib.framework.*"
)
set
(
CBLAS_LIBRARIES -lcblas
"-framework vecLib"
)
message
(
STATUS
"Found standalone vecLib.framework"
)
else
()
set
(
CBLAS_LIBRARIES -lcblas
"-framework Accelerate"
)
message
(
STATUS
"Found vecLib as part of Accelerate.framework"
)
endif
()
add_definitions
(
-DPADDLE_USE_VECLIB
)
endif
()
endif
()
cmake/cross_compiling/ios.cmake
浏览文件 @
46ee8cee
...
...
@@ -28,6 +28,7 @@
# IOS_DEPLOYMENT_TARGET
# The minimum iOS deployment version, such as "7.0"
# IOS_ENABLE_BITCODE = ON (default) or OFF
# IOS_USE_VECLIB_FOR_BLAS = OFF (default) or ON
# IOS_DEVELOPER_ROOT = automatic(default) or /path/to/platform/Developer folder
# By default this location is automatcially chosen based on the IOS_PLATFORM value above.
# If set manually, it will override the default location and force the user of a particular Developer Platform
...
...
@@ -97,6 +98,11 @@ if(NOT DEFINED IOS_ENABLE_BITCODE)
endif
()
set
(
IOS_ENABLE_BITCODE
${
IOS_ENABLE_BITCODE
}
CACHE BOOL
"Whether to enable bitcode"
)
if
(
NOT DEFINED IOS_USE_VECLIB_FOR_BLAS
)
set
(
IOS_USE_VECLIB_FOR_BLAS OFF
)
endif
()
set
(
IOS_USE_VECLIB_FOR_BLAS
${
IOS_UES_VECLIB_FOR_BLAS
}
CACHE BOOL
"Whether to use veclib"
)
# Check the platform selection and setup for developer root
if
(
${
IOS_PLATFORM
}
STREQUAL
"OS"
)
set
(
IOS_PLATFORM_LOCATION
"iPhoneOS.platform"
)
...
...
@@ -245,8 +251,33 @@ set(IOS_COMPILER_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${XCODE_IOS_BITCODE_
set
(
CMAKE_C_FLAGS
"
${
IOS_COMPILER_FLAGS
}
${
CMAKE_C_FLAGS
}
"
CACHE STRING
"C flags"
)
set
(
CMAKE_CXX_FLAGS
"
${
IOS_COMPILER_FLAGS
}
-fvisibility-inlines-hidden
${
CMAKE_CXX_FLAGS
}
"
CACHE STRING
"CXX flags"
)
set
(
CMAKE_C_LINK_FLAGS
"
${
XCODE_IOS_PLATFORM_VERSION_FLAGS
}
-Wl,-search_paths_first
${
CMAKE_C_LINK_FLAGS
}
"
)
set
(
CMAKE_CXX_LINK_FLAGS
"
${
XCODE_IOS_PLATFORM_VERSION_FLAGS
}
-Wl,-search_paths_first
${
CMAKE_CXX_LINK_FLAGS
}
"
)
set
(
IOS_LINK_FLAGS
"
${
XCODE_IOS_PLATFORM_VERSION_FLAGS
}
-Wl,-search_paths_first"
)
if
(
IOS_USE_VECLIB_FOR_BLAS
)
# Find vecLib for iOS
set
(
VECLIB_SEARCH_DIRS
${
IOS_SDK_ROOT
}
/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks
${
IOS_SDK_ROOT
}
/System/Library/Frameworks/Accelerate.framework/Frameworks
)
find_path
(
VECLIB_INC_DIR vecLib.h PATHS
${
VECLIB_SEARCH_DIRS
}
/vecLib.framework/Headers
)
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
vecLib DEFAULT_MSG VECLIB_INC_DIR
)
if
(
VECLIB_FOUND
)
if
(
VECLIB_INC_DIR MATCHES
"^/System/Library/Frameworks/vecLib.framework.*"
)
set
(
IOS_LINK_FLAGS
${
IOS_LINK_FLAGS
}
-lcblas
"-framework vecLib"
)
message
(
STATUS
"Found standalone vecLib.framework"
)
else
()
set
(
IOS_LINK_FLAGS
${
IOS_LINK_FLAGS
}
-lcblas
"-framework Accelerate"
)
message
(
STATUS
"Found vecLib as part of Accelerate.framework"
)
endif
()
endif
()
endif
()
set
(
CMAKE_C_LINK_FLAGS
"
${
IOS_LINK_FLAGS
}
${
CMAKE_C_LINK_FLAGS
}
"
)
set
(
CMAKE_CXX_LINK_FLAGS
"
${
IOS_LINK_FLAGS
}
${
CMAKE_CXX_LINK_FLAGS
}
"
)
set
(
CMAKE_PLATFORM_HAS_INSTALLNAME 1
)
if
(
NOT IOS_ENABLE_BITCODE
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录