Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
39f9056c
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
提交
39f9056c
编写于
4月 28, 2017
作者:
L
Liu Yiqun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Config HOST_C/CXX_COMPILER for cross-compiling.
上级
285daf91
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
57 addition
and
9 deletion
+57
-9
cmake/cross_compiling/android.cmake
cmake/cross_compiling/android.cmake
+5
-5
cmake/cross_compiling/host.cmake
cmake/cross_compiling/host.cmake
+49
-0
cmake/external/openblas.cmake
cmake/external/openblas.cmake
+2
-4
cmake/system.cmake
cmake/system.cmake
+1
-0
未找到文件。
cmake/cross_compiling/android.cmake
浏览文件 @
39f9056c
...
...
@@ -112,19 +112,19 @@ IF(${CMAKE_VERSION} VERSION_LESS "3.7.0")
SET
(
ANDROID_TOOLCHAIN_PREFIX
"
${
ANDROID_TOOLCHAIN_ROOT
}
/bin/
${
ANDROID_TOOLCHAIN_NAME
}
-"
)
IF
(
EXISTS
"
${
ANDROID_TOOLCHAIN_PREFIX
}
gcc"
)
SET
(
CMAKE_C_COMPILER
"
${
ANDROID_TOOLCHAIN_PREFIX
}
gcc"
)
SET
(
CMAKE_C_COMPILER
"
${
ANDROID_TOOLCHAIN_PREFIX
}
gcc"
CACHE PATH
"C compiler"
)
ELSE
()
MESSAGE
(
FATAL_ERROR
"Cannot f
i
nd C compiler:
${
ANDROID_TOOLCHAIN_PREFIX
}
gcc"
)
MESSAGE
(
FATAL_ERROR
"Cannot f
ou
nd C compiler:
${
ANDROID_TOOLCHAIN_PREFIX
}
gcc"
)
ENDIF
()
IF
(
EXISTS
"
${
ANDROID_TOOLCHAIN_PREFIX
}
g++"
)
SET
(
CMAKE_CXX_COMPILER
"
${
ANDROID_TOOLCHAIN_PREFIX
}
g++"
)
SET
(
CMAKE_CXX_COMPILER
"
${
ANDROID_TOOLCHAIN_PREFIX
}
g++"
CACHE PATH
"CXX compiler"
)
ELSE
()
MESSAGE
(
FATAL_ERROR
"Cannot f
i
nd CXX compiler:
${
ANDROID_TOOLCHAIN_PREFIX
}
g++"
)
MESSAGE
(
FATAL_ERROR
"Cannot f
ou
nd CXX compiler:
${
ANDROID_TOOLCHAIN_PREFIX
}
g++"
)
ENDIF
()
IF
(
EXISTS
"
${
ANDROID_TOOLCHAIN_PREFIX
}
gfortran"
)
SET
(
CMAKE_Fortran_COMPILER
"
${
ANDROID_TOOLCHAIN_PREFIX
}
gfortran"
)
SET
(
CMAKE_Fortran_COMPILER
"
${
ANDROID_TOOLCHAIN_PREFIX
}
gfortran"
CACHE PATH
"Fortran compiler"
)
ENDIF
()
# Toolchain and ABI specific flags.
...
...
cmake/cross_compiling/host.cmake
0 → 100644
浏览文件 @
39f9056c
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# find host C compiler
IF
(
HOST_C_COMPILER
)
SET
(
HOST_C_COMPILER_NAME
${
HOST_C_COMPILER
}
)
ELSEIF
(
NOT $ENV{CC} STREQUAL
""
)
SET
(
HOST_C_COMPILER_NAME $ENV{CC}
)
ELSE
()
SET
(
HOST_C_COMPILER_NAME cc
)
ENDIF
()
GET_FILENAME_COMPONENT
(
HOST_C_COMPILER_PATH
${
HOST_C_COMPILER_NAME
}
PROGRAM
)
IF
(
NOT HOST_C_COMPILER_PATH OR NOT EXISTS
${
HOST_C_COMPILER_PATH
}
)
MESSAGE
(
FATAL_ERROR
"Cannot found host C compiler, set host C compiler:
\n
"
"
\t
cmake .. -DHOST_C_COMPILER=..."
)
ENDIF
()
# find host CXX compiler
IF
(
HOST_CXX_COMPILER
)
SET
(
HOST_CXX_COMPILER_NAME
${
HOST_CXX_COMPILER
}
)
ELSEIF
(
NOT $ENV{CXX} STREQUAL
""
)
SET
(
HOST_CXX_COMPILER_NAME $ENV{CXX}
)
ELSE
()
SET
(
HOST_CXX_COMPILER_NAME c++
)
ENDIF
()
GET_FILENAME_COMPONENT
(
HOST_CXX_COMPILER_PATH
${
HOST_CXX_COMPILER_NAME
}
PROGRAM
)
IF
(
NOT HOST_CXX_COMPILER_PATH OR NOT EXISTS
${
HOST_CXX_COMPILER_PATH
}
)
MESSAGE
(
FATAL_ERROR
"Cannot found host CXX compiler, set host CXX compiler:
\n
"
"
\t
cmake .. -DHOST_CXX_COMPILER=..."
)
ENDIF
()
SET
(
HOST_C_COMPILER
${
HOST_C_COMPILER_PATH
}
CACHE PATH
"Host C compiler"
)
SET
(
HOST_CXX_COMPILER
${
HOST_CXX_COMPILER_PATH
}
CACHE PATH
"Host CXX compiler"
)
MESSAGE
(
STATUS
"Found host C compiler: "
${
HOST_C_COMPILER
}
)
MESSAGE
(
STATUS
"Found host CXX compiler: "
${
HOST_CXX_COMPILER
}
)
cmake/external/openblas.cmake
浏览文件 @
39f9056c
...
...
@@ -57,11 +57,9 @@ IF(NOT ${CBLAS_FOUND})
SET
(
OPENBLAS_COMMIT
"v0.2.19"
)
SET
(
OPENBLAS_ARGS FC=
${
CMAKE_Fortran_COMPILER
}
DYNAMIC_ARCH=1 libs netlib
)
SET
(
HOST_C_COMPILER
${
CMAKE_C_COMPILER
}
)
ELSE
()
SET
(
OPENBLAS_COMMIT
"b5c96fcfcdc82945502a2303116a64d89985daf5"
)
SET
(
OPTIONAL_ARGS TARGET=ARMV7 ARM_SOFTFP_ABI=1 NOFORTRAN=1 USE_THREAD=0 libs
)
SET
(
HOST_C_COMPILER gcc
)
SET
(
OPTIONAL_ARGS HOSTCC=
${
HOST_C_COMPILER
}
TARGET=ARMV7 ARM_SOFTFP_ABI=1 NOFORTRAN=1 USE_THREAD=0 libs
)
ENDIF
()
ExternalProject_Add
(
...
...
@@ -72,7 +70,7 @@ IF(NOT ${CBLAS_FOUND})
PREFIX
${
CBLAS_SOURCES_DIR
}
INSTALL_DIR
${
CBLAS_INSTALL_DIR
}
BUILD_IN_SOURCE 1
BUILD_COMMAND
${
CMAKE_MAKE_PROGRAM
}
CC=
${
CMAKE_C_COMPILER
}
HOSTCC=
${
HOST_C_COMPILER
}
NO_SHARED=1
${
OPTIONAL_ARGS
}
BUILD_COMMAND
${
CMAKE_MAKE_PROGRAM
}
CC=
${
CMAKE_C_COMPILER
}
NO_SHARED=1
${
OPTIONAL_ARGS
}
INSTALL_COMMAND
${
CMAKE_MAKE_PROGRAM
}
install NO_SHARED=1 PREFIX=<INSTALL_DIR>
UPDATE_COMMAND
""
CONFIGURE_COMMAND
""
...
...
cmake/system.cmake
浏览文件 @
39f9056c
...
...
@@ -74,6 +74,7 @@ MESSAGE(STATUS "Found Paddle host system's CPU: ${CPU_CORES} cores")
# configuration for cross-compiling
IF
(
DEFINED CMAKE_SYSTEM_NAME
)
INCLUDE
(
cross_compiling/host
)
IF
(
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"Android"
)
SET
(
ANDROID TRUE
)
INCLUDE
(
cross_compiling/android
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录