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