Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
49b77855
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
694
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
49b77855
编写于
5月 11, 2017
作者:
Y
Yi Wang
提交者:
GitHub
5月 11, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2040 from wangkuiyi/use-ubuntu-16
Use ubuntu 16
上级
c31aed4d
86733663
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
90 addition
and
75 deletion
+90
-75
Dockerfile
Dockerfile
+15
-11
paddle/api/CMakeLists.txt
paddle/api/CMakeLists.txt
+3
-1
paddle/scripts/docker/build.sh
paddle/scripts/docker/build.sh
+65
-28
paddle/scripts/tools/build_docs/build_docs.sh
paddle/scripts/tools/build_docs/build_docs.sh
+7
-35
未找到文件。
Dockerfile
浏览文件 @
49b77855
# A image for building paddle binaries
# Use cuda devel base image for both cpu and gpu environment
FROM
nvidia/cuda:8.0-cudnn5-devel-ubuntu1
4
.04
FROM
nvidia/cuda:8.0-cudnn5-devel-ubuntu1
6
.04
MAINTAINER
PaddlePaddle Authors <paddle-dev@baidu.com>
ARG
UBUNTU_MIRROR
...
...
@@ -23,11 +23,14 @@ ENV HOME /root
COPY
./paddle/scripts/docker/root/ /root/
RUN
apt-get update
&&
\
apt-get
install
-y
git python-pip python-dev openssh-server bison
&&
\
apt-get
install
-y
wget unzip
tar
xz-utils bzip2
gzip
coreutils
&&
\
apt-get
install
-y
curl
sed grep
graphviz libjpeg-dev zlib1g-dev
&&
\
apt-get
install
-y
python-numpy python-matplotlib gcc g++ liblapack-dev liblapacke-dev
&&
\
apt-get
install
-y
automake locales clang-format-3.8 swig doxygen
&&
\
apt-get
install
-y
\
git python-pip python-dev openssh-server bison
\
wget unzip
tar
xz-utils bzip2
gzip
coreutils
\
curl
sed grep
graphviz libjpeg-dev zlib1g-dev
\
python-numpy python-matplotlib gcc g++
\
automake locales clang-format-3.8 swig doxygen cmake
\
liblapack-dev liblapacke-dev
\
clang-3.8 llvm-3.8 libclang-3.8-dev
&&
\
apt-get clean
-y
# git credential to skip password typing
...
...
@@ -51,11 +54,12 @@ RUN pip install --upgrade pip && \
RUN
apt-get
install
-y
libssl-dev libffi-dev
RUN
pip
install
certifi urllib3[secure]
RUN
curl
-sSL
https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz |
tar
-xz
&&
\
cd
cmake-3.4.1
&&
./bootstrap
&&
make
-j
`
nproc
`
&&
make
install
&&
\
cd
..
&&
rm
-rf
cmake-3.4.1
VOLUME
["/woboq_out"]
# Install woboq_codebrowser to /woboq
RUN
git clone https://github.com/woboq/woboq_codebrowser /woboq
&&
\
(
cd
/woboq
\
cmake
-DLLVM_CONFIG_EXECUTABLE
=
/usr/bin/llvm-config-3.8
\
-DCMAKE_BUILD_TYPE
=
Release
.
\
make
)
# Configure OpenSSH server. c.f. https://docs.docker.com/engine/examples/running_ssh_service
RUN
mkdir
/var/run/sshd
...
...
paddle/api/CMakeLists.txt
浏览文件 @
49b77855
...
...
@@ -92,7 +92,9 @@ add_custom_command(OUTPUT ${PROJ_ROOT}/paddle/py_paddle/_swig_paddle.so
# TODO(yuyang18) : make wheel name calculated by cmake
add_custom_target
(
python_api_wheel ALL DEPENDS
${
PROJ_ROOT
}
/paddle/py_paddle/_swig_paddle.so
)
install
(
DIRECTORY
${
PROJ_ROOT
}
/paddle/dist/ DESTINATION opt/paddle/share/wheels
)
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/paddle/dist/
DESTINATION opt/paddle/share/wheels
)
if
(
WITH_TESTING
)
IF
(
NOT PY_PIP_FOUND
)
...
...
paddle/scripts/docker/build.sh
浏览文件 @
49b77855
...
...
@@ -4,9 +4,9 @@ set -xe
# Set BASE_IMAGE according to env variables
if
[
${
WITH_GPU
}
==
"ON"
]
;
then
BASE_IMAGE
=
"nvidia/cuda:8.0-cudnn5-runtime-ubuntu1
4
.04"
BASE_IMAGE
=
"nvidia/cuda:8.0-cudnn5-runtime-ubuntu1
6
.04"
else
BASE_IMAGE
=
"ubuntu:1
4
.04"
BASE_IMAGE
=
"ubuntu:1
6
.04"
fi
DOCKERFILE_GPU_ENV
=
""
...
...
@@ -22,6 +22,20 @@ cd /paddle/build
# build script will not fail if *.deb does not exist
rm
*
.deb 2>/dev/null
||
true
cat
<<
EOF
========================================
Configuring cmake in /paddle/build ...
-DCMAKE_BUILD_TYPE=Release
-DWITH_DOC=OFF
-DWITH_GPU=
${
WITH_GPU
:-
OFF
}
-DWITH_AVX=
${
WITH_AVX
:-
OFF
}
-DWITH_SWIG_PY=ON
-DCUDNN_ROOT=/usr/
-DWITH_STYLE_CHECK=
${
WITH_STYLE_CHECK
:-
OFF
}
-DWITH_TESTING=
${
WITH_TESTING
:-
OFF
}
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
========================================
EOF
cmake ..
\
-DCMAKE_BUILD_TYPE
=
Release
\
-DWITH_DOC
=
OFF
\
...
...
@@ -32,50 +46,61 @@ cmake .. \
-DWITH_STYLE_CHECK
=
${
WITH_STYLE_CHECK
:-
OFF
}
\
-DWITH_TESTING
=
${
WITH_TESTING
:-
OFF
}
\
-DCMAKE_EXPORT_COMPILE_COMMANDS
=
ON
cat
<<
EOF
========================================
Building in /paddle/build ...
Build unit tests:
${
WITH_TESTING
:-
OFF
}
========================================
EOF
make
-j
`
nproc
`
if
[
${
WITH_TESTING
:-
OFF
}
==
"ON"
]
&&
[
${
RUN_TEST
:-
OFF
}
==
"ON"
]
;
then
pip uninstall
-y
py-paddle paddle
||
true
ctest
-V
fi
cat
<<
EOF
========================================
Installing ...
========================================
EOF
make
install
pip
install
/usr/local/opt/paddle/share/wheels/
*
.whl
paddle version
# To build documentation, we need to run cmake twice.
# This awkwardness is due to https://github.com/PaddlePaddle/Paddle/issues/1854.
# It also describes a solution.
# To build documentation, we need to run cmake again after installing
# PaddlePaddle. This awkwardness is due to
# https://github.com/PaddlePaddle/Paddle/issues/1854. It also
# describes a solution.
if
[
${
WITH_DOC
}
==
"ON"
]
;
then
cat
<<
EOF
========================================
Building documentation ...
In /paddle/build_doc
========================================
EOF
mkdir
-p
/paddle/build_doc
pushd
/paddle/build_doc
cmake ..
\
-DWITH_DOC
=
ON
\
-DWITH_GPU
=
OFF
\
-DWITH_AVX
=
${
WITH_AVX
:-
O
FF
}
\
-DWITH_AVX
=
${
WITH_AVX
:-
O
N
}
\
-DWITH_SWIG_PY
=
ON
\
-DWITH_STYLE_CHECK
=
OFF
make paddle_docs paddle_docs_cn
DOC_DIR
=
"/paddle/paddle/scripts/tools/build_docs/"
mkdir
-p
$DOC_DIR
/doc
mkdir
-p
$DOC_DIR
/doc_cn
cp
-r
/paddle/build_doc/doc/en/html/
*
$DOC_DIR
/doc
cp
-r
/paddle/build_doc/doc/cn/html/
*
$DOC_DIR
/doc_cn
popd
rm
-rf
/paddle/build_doc
fi
# generate deb package for current build
cpack
-D
CPACK_GENERATOR
=
'DEB'
..
if
[[
${
WOBOQ
:-
OFF
}
==
'ON'
]]
;
then
apt-get
install
-y
clang-3.8 llvm-3.8 libclang-3.8-dev
# Install woboq_codebrowser.
git clone https://github.com/woboq/woboq_codebrowser /woboq
cd
/woboq
cmake
-DLLVM_CONFIG_EXECUTABLE
=
/usr/bin/llvm-config-3.8
\
-DCMAKE_BUILD_TYPE
=
Release
\
.
make
-j
`
nproc
`
export
WOBOQ_OUT
=
/woboq_out/paddle
export
BUILD_DIR
=
/paddle/build
cat
<<
EOF
========================================
Converting C++ source code into HTML ...
========================================
EOF
export
WOBOQ_OUT
=
/paddle/build/woboq_out
mkdir
-p
$WOBOQ_OUT
cp
-rv
/woboq/data
$WOBOQ_OUT
/../data
/woboq/generator/codebrowser_generator
\
...
...
@@ -84,11 +109,23 @@ if [[ ${WOBOQ:-OFF} == 'ON' ]]; then
-o
$WOBOQ_OUT
\
-p
paddle:/paddle
/woboq/indexgenerator/codebrowser_indexgenerator
$WOBOQ_OUT
cd
/woboq
make clean
fi
paddle version
# generate deb package for current build
# FIXME(typhoonzero): should we remove paddle/scripts/deb ?
cat
<<
EOF
========================================
Generating .deb package ...
========================================
EOF
cpack
-D
CPACK_GENERATOR
=
'DEB'
..
cat
<<
EOF
========================================
Generate /paddle/build/Dockerfile ...
========================================
EOF
cat
>
/paddle/build/Dockerfile
<<
EOF
FROM
${
BASE_IMAGE
}
...
...
paddle/scripts/tools/build_docs/build_docs.sh
浏览文件 @
49b77855
#!/bin/bash
set
-e
function
usage
(){
echo
"usage: build_doc [--help] [<args>]"
echo
"This script generates doc and doc_cn in the script's directory."
echo
"These are common commands used in various situations:"
echo
" with_docker build doc and doc_cn with docker"
echo
" local build doc and doc_cn locally"
}
case
"
$1
"
in
"with_docker"
)
docker run
--rm
-v
$PWD
/../../../../:/paddle
\
-e
"WITH_GPU=OFF"
-e
"WITH_AVX=ON"
-e
"WITH_DOC=ON"
paddledev/paddle:dev
;;
"local"
)
mkdir
-p
doc
mkdir
-p
doc_cn
PADDLE_SOURCE_DIR
=
$PWD
/../../../../
mkdir
-p
$PADDLE_SOURCE_DIR
/build_doc
pushd
$PADDLE_SOURCE_DIR
/build_doc
cmake ..
-DWITH_DOC
=
ON
make paddle_docs paddle_docs_cn
popd
cp
-r
$PADDLE_SOURCE_DIR
/build_doc/doc/en/html/
*
doc
cp
-r
$PADDLE_SOURCE_DIR
/build_doc/doc/cn/html/
*
doc_cn
rm
-rf
$PADDLE_SOURCE_DIR
/build_doc
;;
"--help"
)
usage
;;
*
)
usage
;;
esac
docker run
--rm
\
-v
$(
git rev-parse
--show-toplevel
)
:/paddle
\
-e
"WITH_GPU=OFF"
\
-e
"WITH_AVX=ON"
\
-e
"WITH_DOC=ON"
\
-e
"WOBOQ=ON"
\
${
1
:-
"paddledev/paddle:dev"
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录