Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
cdf6af64
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看板
提交
cdf6af64
编写于
1月 14, 2017
作者:
L
liaogang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add external openblas
上级
f8a529cf
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
34 addition
and
17 deletion
+34
-17
.travis.yml
.travis.yml
+1
-1
cmake/external/openblas.cmake
cmake/external/openblas.cmake
+25
-7
cmake/system.cmake
cmake/system.cmake
+2
-2
doc/getstarted/build_and_install/build_from_source_en.md
doc/getstarted/build_and_install/build_from_source_en.md
+3
-2
paddle/scripts/travis/before_install.osx.sh
paddle/scripts/travis/before_install.osx.sh
+1
-3
paddle/scripts/travis/build_and_test.sh
paddle/scripts/travis/build_and_test.sh
+1
-1
paddle/scripts/travis/docs.sh
paddle/scripts/travis/docs.sh
+1
-1
未找到文件。
.travis.yml
浏览文件 @
cdf6af64
...
@@ -25,9 +25,9 @@ addons:
...
@@ -25,9 +25,9 @@ addons:
packages
:
packages
:
-
gcc-4.8
-
gcc-4.8
-
g++-4.8
-
g++-4.8
-
gfortran-4.8
-
git
-
git
-
build-essential
-
build-essential
-
libatlas-base-dev
-
python
-
python
-
python-pip
-
python-pip
-
python2.7-dev
-
python2.7-dev
...
...
cmake/external/openblas.cmake
浏览文件 @
cdf6af64
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
INCLUDE
(
cblas
)
INCLUDE
(
cblas
)
IF
(
NOT
${
CBLAS_FOUND
}
)
IF
(
NOT
${
CBLAS_FOUND
}
)
MESSAGE
(
FATAL_ERROR
"Please install OpenBlas, MKL or ATLAS."
)
INCLUDE
(
ExternalProject
)
INCLUDE
(
ExternalProject
)
SET
(
CBLAS_SOURCES_DIR
${
THIRD_PARTY_PATH
}
/openblas
)
SET
(
CBLAS_SOURCES_DIR
${
THIRD_PARTY_PATH
}
/openblas
)
...
@@ -28,20 +27,39 @@ IF(NOT ${CBLAS_FOUND})
...
@@ -28,20 +27,39 @@ IF(NOT ${CBLAS_FOUND})
SET
(
CBLAS_LIBRARIES
"
${
CBLAS_INSTALL_DIR
}
/lib/libopenblas.a"
CACHE FILEPATH
"openblas library"
FORCE
)
SET
(
CBLAS_LIBRARIES
"
${
CBLAS_INSTALL_DIR
}
/lib/libopenblas.a"
CACHE FILEPATH
"openblas library"
FORCE
)
ENDIF
(
WIN32
)
ENDIF
(
WIN32
)
IF
(
CMAKE_COMPILER_IS_GNUCC
)
ENABLE_LANGUAGE
(
Fortran
)
LIST
(
APPEND CBLAS_LIBRARIES gfortran pthread
)
ENDIF
(
CMAKE_COMPILER_IS_GNUCC
)
IF
(
NOT CMAKE_Fortran_COMPILER
)
MESSAGE
(
FATAL_ERROR
"To build lapack in libopenblas, "
"you need to set gfortran compiler: cmake .. -DCMAKE_Fortran_COMPILER=..."
)
ENDIF
(
NOT CMAKE_Fortran_COMPILER
)
ExternalProject_Add
(
ExternalProject_Add
(
openblas
openblas
${
EXTERNAL_PROJECT_LOG_ARGS
}
GIT_REPOSITORY https://github.com/xianyi/OpenBLAS.git
URL
"https://github.com/xianyi/OpenBLAS/archive/v0.2.19.tar.gz"
GIT_TAG v0.2.19
PREFIX
${
CBLAS_SOURCES_DIR
}
PREFIX
${
CBLAS_SOURCES_DIR
}
INSTALL_DIR
${
CBLAS_INSTALL_DIR
}
INSTALL_DIR
${
CBLAS_INSTALL_DIR
}
BUILD_IN_SOURCE 1
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND
""
BUILD_COMMAND
${
CMAKE_MAKE_PROGRAM
}
FC=
${
CMAKE_Fortran_COMPILER
}
CC=
${
CMAKE_C_COMPILER
}
HOSTCC=
${
CMAKE_C_COMPILER
}
NO_SHARED=1 libs netlib
BUILD_COMMAND make CC=
${
CMAKE_C_COMPILER
}
FC=
${
CMAKE_Fortran_COMPILER
}
INSTALL_COMMAND
${
CMAKE_MAKE_PROGRAM
}
install NO_SHARED=1 PREFIX=<INSTALL_DIR>
INSTALL_COMMAND make install PREFIX=<INSTALL_DIR>
UPDATE_COMMAND
""
UPDATE_COMMAND
""
CONFIGURE_COMMAND
""
)
ExternalProject_Add_Step
(
openblas lapacke_install
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
CBLAS_SOURCES_DIR
}
/src/openblas/lapack-netlib/LAPACKE/include/lapacke_mangling_with_flags.h"
"
${
CBLAS_INSTALL_DIR
}
/include/lapacke_mangling.h"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
CBLAS_SOURCES_DIR
}
/src/openblas/lapack-netlib/LAPACKE/include/lapacke.h"
"
${
CBLAS_INSTALL_DIR
}
/include/lapacke.h"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
CBLAS_SOURCES_DIR
}
/src/openblas/lapack-netlib/LAPACKE/include/lapacke_config.h"
"
${
CBLAS_INSTALL_DIR
}
/include/lapacke_config.h"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
CBLAS_SOURCES_DIR
}
/src/openblas/lapack-netlib/LAPACKE/include/lapacke_utils.h"
"
${
CBLAS_INSTALL_DIR
}
/include/lapacke_utils.h"
DEPENDEES install
)
)
LIST
(
APPEND external_project_dependencies openblas
)
LIST
(
APPEND external_project_dependencies openblas
)
ENDIF
()
ENDIF
(
NOT
${
CBLAS_FOUND
}
)
INCLUDE_DIRECTORIES
(
${
CBLAS_INC_DIR
}
)
INCLUDE_DIRECTORIES
(
${
CBLAS_INC_DIR
}
)
cmake/system.cmake
浏览文件 @
cdf6af64
...
@@ -47,7 +47,7 @@ SET(EXTERNAL_PROJECT_LOG_ARGS
...
@@ -47,7 +47,7 @@ SET(EXTERNAL_PROJECT_LOG_ARGS
LOG_DOWNLOAD 0
# Wrap download in script to log output
LOG_DOWNLOAD 0
# Wrap download in script to log output
LOG_UPDATE 1
# Wrap update in script to log output
LOG_UPDATE 1
# Wrap update in script to log output
LOG_CONFIGURE 1
# Wrap configure in script to log output
LOG_CONFIGURE 1
# Wrap configure in script to log output
LOG_BUILD
1
# Wrap build in script to log output
LOG_BUILD
0
# Wrap build in script to log output
LOG_TEST 1
# Wrap test in script to log output
LOG_TEST 1
# Wrap test in script to log output
LOG_INSTALL
1
# Wrap install in script to log output
LOG_INSTALL
0
# Wrap install in script to log output
)
)
doc/getstarted/build_and_install/build_from_source_en.md
浏览文件 @
cdf6af64
...
@@ -64,7 +64,8 @@ As a simple example, consider the following:
...
@@ -64,7 +64,8 @@ As a simple example, consider the following:
1.
**BLAS Dependencies(optional)**
1.
**BLAS Dependencies(optional)**
Paddle will find BLAS from system's default path. But you can specify MKL, OpenBLAS or ATLAS via
`MKL_ROOT`
,
`OPENBLAS_ROOT`
or
`ATLAS_ROOT`
.
CMake will search BLAS libraries from system. If not found, OpenBLAS will be downloaded, built and installed automatically.
To utilize preinstalled BLAS, you can simply specify MKL, OpenBLAS or ATLAS via
`MKL_ROOT`
,
`OPENBLAS_ROOT`
or
`ATLAS_ROOT`
.
```bash
```bash
# specify MKL
# specify MKL
...
@@ -99,7 +100,7 @@ As a simple example, consider the following:
...
@@ -99,7 +100,7 @@ As a simple example, consider the following:
```bash
```bash
# necessary
# necessary
sudo apt-get update
sudo apt-get update
sudo apt-get install -y g++ make cmake build-essential
libatlas-base-dev
python python-pip libpython-dev git
sudo apt-get install -y g++ make cmake build-essential python python-pip libpython-dev git
sudo pip install wheel numpy
sudo pip install wheel numpy
sudo pip install 'protobuf>=3.0.0'
sudo pip install 'protobuf>=3.0.0'
```
```
...
...
paddle/scripts/travis/before_install.osx.sh
浏览文件 @
cdf6af64
#!/bin/bash
#!/bin/bash
brew update
brew update
brew tap homebrew/science
brew tap homebrew/science
brew
install
python
brew
install
openblas swig md5sha1sum
sudo
pip
install
--upgrade
protobuf
brew
install
swig openblas md5sha1sum protobuf
paddle/scripts/travis/build_and_test.sh
浏览文件 @
cdf6af64
...
@@ -6,7 +6,7 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
...
@@ -6,7 +6,7 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export
PYTHONPATH
=
/opt/python/2.7.12/lib/python2.7/site-packages
export
PYTHONPATH
=
/opt/python/2.7.12/lib/python2.7/site-packages
export
PYTHONHOME
=
/opt/python/2.7.12
export
PYTHONHOME
=
/opt/python/2.7.12
export
PATH
=
/opt/python/2.7.12/bin:
${
PATH
}
export
PATH
=
/opt/python/2.7.12/bin:
${
PATH
}
cmake ..
-DON_TRAVIS
=
ON
-DON_COVERALLS
=
ON
-DCOVERALLS_UPLOAD
=
ON
${
EXTRA_CMAKE_OPTS
}
cmake ..
-D
CMAKE_Fortran_COMPILER
=
/usr/bin/gfortran-4.8
-D
ON_TRAVIS
=
ON
-DON_COVERALLS
=
ON
-DCOVERALLS_UPLOAD
=
ON
${
EXTRA_CMAKE_OPTS
}
NRPOC
=
`
nproc
`
NRPOC
=
`
nproc
`
make
-j
$NPROC
make
-j
$NPROC
make coveralls
make coveralls
...
...
paddle/scripts/travis/docs.sh
浏览文件 @
cdf6af64
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
source
./common.sh
source
./common.sh
# Compile Documentation only.
# Compile Documentation only.
cmake ..
-DCMAKE_BUILD_TYPE
=
Debug
-DWITH_GPU
=
OFF
-DWITH_DOC
=
ON
${
EXTRA_CMAKE_OPTS
}
cmake ..
-DCMAKE_BUILD_TYPE
=
Debug
-D
CMAKE_Fortran_COMPILER
=
/usr/bin/gfortran-4.8
-D
WITH_GPU
=
OFF
-DWITH_DOC
=
ON
${
EXTRA_CMAKE_OPTS
}
make paddle_docs paddle_docs_cn
make paddle_docs paddle_docs_cn
# check websites for broken links
# check websites for broken links
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录