Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
6cd4b6e0
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
提交
6cd4b6e0
编写于
12月 27, 2016
作者:
L
liaogang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update external libs
上级
280994fa
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
159 addition
and
113 deletion
+159
-113
cmake/external/numpy.cmake
cmake/external/numpy.cmake
+61
-43
cmake/external/openblas.cmake
cmake/external/openblas.cmake
+0
-2
cmake/external/python.cmake
cmake/external/python.cmake
+70
-61
cmake/external/swig.cmake
cmake/external/swig.cmake
+19
-5
cmake/external/warpctc.cmake
cmake/external/warpctc.cmake
+9
-2
未找到文件。
cmake/external/numpy.cmake
浏览文件 @
6cd4b6e0
...
...
@@ -12,46 +12,64 @@
# See the License for the specific language governing permissions and
# limitations under the License.
INCLUDE
(
ExternalProject
)
SET
(
NUMPY_SOURCES_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/third_party/numpy
)
SET
(
NUMPY_INSTALL_DIR
${
PROJECT_BINARY_DIR
}
/numpy
)
set
(
NUMPY_VERSION
"v1.11.3"
)
# setuptools
ExternalProject_Add
(
setuptools
PREFIX
${
PYTHON_SOURCES_DIR
}
/setuptools
URL http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
URL_MD5 7df2a529a074f613b509fb44feefe74e
BUILD_IN_SOURCE 1
UPDATE_COMMAND
""
PATCH_COMMAND
""
CONFIGURE_COMMAND
""
INSTALL_COMMAND
""
BUILD_COMMAND
${
PYTHON_EXECUTABLE
}
setup.py install
DEPENDS python zlib
)
ExternalProject_Add
(
cython
PREFIX
${
PYTHON_SOURCES_DIR
}
/cython
GIT_REPOSITORY https://github.com/cython/cython.git
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND
""
UPDATE_COMMAND
""
PATCH_COMMAND
""
INSTALL_COMMAND
""
BUILD_COMMAND
${
PYTHON_EXECUTABLE
}
setup.py install
DEPENDS python
)
ExternalProject_Add
(
numpy
GIT_REPOSITORY https://github.com/numpy/numpy.git
GIT_TAG
${
NUMPY_VERSION
}
CONFIGURE_COMMAND
""
UPDATE_COMMAND
""
PREFIX
${
NUMPY_SOURCES_DIR
}
BUILD_COMMAND
${
PYTHON_EXECUTABLE
}
setup.py build
INSTALL_COMMAND
${
PYTHON_EXECUTABLE
}
setup.py install
BUILD_IN_SOURCE 1
DEPENDS python setuptools cython
)
FIND_PACKAGE
(
NumPy
)
IF
(
NOT
${
NUMPY_FOUND
}
)
INCLUDE
(
ExternalProject
)
SET
(
NUMPY_SOURCES_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/third_party/numpy
)
SET
(
NUMPY_INSTALL_DIR
${
PROJECT_BINARY_DIR
}
/numpy
)
set
(
NUMPY_VERSION
"v1.11.3"
)
ExternalProject_Add
(
setuptools
PREFIX
${
PYTHON_SOURCES_DIR
}
/setuptools
URL http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
URL_MD5 7df2a529a074f613b509fb44feefe74e
BUILD_IN_SOURCE 1
UPDATE_COMMAND
""
PATCH_COMMAND
""
CONFIGURE_COMMAND
""
INSTALL_COMMAND
""
BUILD_COMMAND
${
PYTHON_EXECUTABLE
}
setup.py install
DEPENDS python zlib
)
ExternalProject_Add
(
cython
PREFIX
${
PYTHON_SOURCES_DIR
}
/cython
GIT_REPOSITORY https://github.com/cython/cython.git
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND
""
UPDATE_COMMAND
""
PATCH_COMMAND
""
INSTALL_COMMAND
""
BUILD_COMMAND
${
PYTHON_EXECUTABLE
}
setup.py install
DEPENDS python
)
ExternalProject_Add
(
numpy
GIT_REPOSITORY https://github.com/numpy/numpy.git
GIT_TAG
${
NUMPY_VERSION
}
CONFIGURE_COMMAND
""
UPDATE_COMMAND
""
PREFIX
${
NUMPY_SOURCES_DIR
}
BUILD_COMMAND
${
PYTHON_EXECUTABLE
}
setup.py build
INSTALL_COMMAND
${
PYTHON_EXECUTABLE
}
setup.py install
BUILD_IN_SOURCE 1
DEPENDS python setuptools cython
)
# find numpy include directory
FILE
(
WRITE
${
PROJECT_BINARY_DIR
}
/FindNumpyPath.py
"try: import numpy; print(numpy.get_include())
\n
except:pass
\n
"
)
EXEC_PROGRAM
(
"
${
PYTHON_EXECUTABLE
}
"
${
PROJECT_BINARY_DIR
}
ARGS
"FindNumpyPath.py"
OUTPUT_VARIABLE NUMPY_PATH
)
FIND_PATH
(
PYTHON_NUMPY_INCLUDE_DIR numpy/arrayobject.h
HINTS
"
${
NUMPY_PATH
}
"
"
${
PYTHON_INCLUDE_PATH
}
"
)
INCLUDE_DIRECTORIES
(
${
PYTHON_NUMPY_INCLUDE_DIR
}
)
ENDIF
()
cmake/external/openblas.cmake
浏览文件 @
6cd4b6e0
...
...
@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# INCLUDE(cblas)
INCLUDE
(
ExternalProject
)
SET
(
CBLAS_SOURCES_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/third_party/openblas
)
...
...
cmake/external/python.cmake
浏览文件 @
6cd4b6e0
...
...
@@ -12,72 +12,81 @@
# See the License for the specific language governing permissions and
# limitations under the License.
INCLUDE
(
ExternalProject
)
FIND_PACKAGE
(
PythonLibs 2.7
)
FIND_PACKAGE
(
PythonInterp 2.7
)
SET
(
PYTHON_SOURCES_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/third_party/python
)
SET
(
PYTHON_INSTALL_DIR
${
PROJECT_BINARY_DIR
}
/python
)
IF
((
NOT
${
PYTHONINTERP_FOUND
}
)
OR
(
NOT
${
PYTHONLIBS_FOUND
}
))
if
(
MSVC
)
list
(
APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
PATCH_COMMAND
${
CMAKE_COMMAND
}
-DPYTHON_SRC_DIR:PATH=
${
_python_SOURCE_DIR
}
-P
${
CMAKE_CURRENT_LIST_DIR
}
/PythonPatch.cmake
)
endif
()
INCLUDE
(
ExternalProject
)
if
(
APPLE
)
list
(
APPEND EXTERNAL_PROJECT_OPTIONAL_CMAKE_ARGS
-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON
)
endif
()
SET
(
PYTHON_SOURCES_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/third_party/python
)
SET
(
PYTHON_INSTALL_DIR
${
PROJECT_BINARY_DIR
}
/python
)
set
(
EXTERNAL_PROJECT_OPTIONAL_CMAKE_CACHE_ARGS
)
IF
(
MSVC
)
LIST
(
APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS
PATCH_COMMAND
${
CMAKE_COMMAND
}
-DPYTHON_SRC_DIR:PATH=
${
_python_SOURCE_DIR
}
-P
${
CMAKE_CURRENT_LIST_DIR
}
/PythonPatch.cmake
)
ENDIF
()
# Force Python build to "Release".
if
(
CMAKE_CONFIGURATION_TYPES
)
set
(
SAVED_CMAKE_CFG_INTDIR
${
CMAKE_CFG_INTDIR
}
)
set
(
CMAKE_CFG_INTDIR
"Release"
)
else
()
list
(
APPEND EXTERNAL_PROJECT_OPTIONAL_CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=Release
)
endif
()
IF
(
APPLE
)
LIST
(
APPEND EXTERNAL_PROJECT_OPTIONAL_CMAKE_ARGS
-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON
)
ENDIF
()
ExternalProject_Add
(
python
GIT_REPOSITORY
"https://github.com/python-cmake-buildsystem/python-cmake-buildsystem.git"
GIT_TAG
"ed5f9bcee540e47f82fa17f8360b820591aa6d66"
PREFIX
${
PYTHON_SOURCES_DIR
}
UPDATE_COMMAND
""
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=
${
PYTHON_INSTALL_DIR
}
-DBUILD_SHARED:BOOL=OFF
-DBUILD_STATIC:BOOL=ON
-DUSE_SYSTEM_LIBRARIES:BOOL=OFF
-DZLIB_ROOT:FILEPATH=
${
ZLIB_ROOT
}
-DZLIB_INCLUDE_DIR:PATH=
${
ZLIB_INCLUDE_DIR
}
-DZLIB_LIBRARY:FILEPATH=
${
ZLIB_LIBRARIES
}
-DDOWNLOAD_SOURCES:BOOL=ON
-DINSTALL_WINDOWS_TRADITIONAL:BOOL=OFF
${
EXTERNAL_PROJECT_OPTIONAL_CMAKE_CACHE_ARGS
}
${
EXTERNAL_PROJECT_OPTIONAL_CMAKE_ARGS
}
DEPENDS zlib
)
SET
(
EXTERNAL_PROJECT_OPTIONAL_CMAKE_CACHE_ARGS
)
set
(
_python_DIR
${
PYTHON_INSTALL_DIR
}
)
# Force Python build to "Release".
IF
(
CMAKE_CONFIGURATION_TYPES
)
SET
(
SAVED_CMAKE_CFG_INTDIR
${
CMAKE_CFG_INTDIR
}
)
SET
(
CMAKE_CFG_INTDIR
"Release"
)
ELSE
()
LIST
(
APPEND EXTERNAL_PROJECT_OPTIONAL_CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=Release
)
ENDIF
()
if
(
UNIX
)
set
(
_python_IMPORT_SUFFIX so
)
if
(
APPLE
)
set
(
_python_IMPORT_SUFFIX dylib
)
endif
()
set
(
PYTHON_INCLUDE_DIR
"
${
PYTHON_INSTALL_DIR
}
/include/python2.7"
CACHE PATH
"Python include dir"
FORCE
)
set
(
PYTHON_LIBRARY
"
${
PYTHON_INSTALL_DIR
}
/lib/libpython2.7.
${
_python_IMPORT_SUFFIX
}
"
CACHE FILEPATH
"Python library"
FORCE
)
set
(
PYTHON_EXECUTABLE
${
PYTHON_INSTALL_DIR
}
/bin/python CACHE FILEPATH
"Python executable"
FORCE
)
set
(
PY_SITE_PACKAGES_PATH
"
${
PYTHON_INSTALL_DIR
}
/lib/python2.7/site-packages"
CACHE PATH
"Python site-packages path"
FORCE
)
elseif
(
WIN32
)
set
(
PYTHON_INCLUDE_DIR
"
${
PYTHON_INSTALL_DIR
}
/include"
CACHE PATH
"Python include dir"
FORCE
)
set
(
PYTHON_LIBRARY
"
${
PYTHON_INSTALL_DIR
}
/libs/python27.lib"
CACHE FILEPATH
"Python library"
FORCE
)
set
(
PYTHON_EXECUTABLE
"
${
PYTHON_INSTALL_DIR
}
/bin/python.exe"
CACHE FILEPATH
"Python executable"
FORCE
)
set
(
PY_SITE_PACKAGES_PATH
"
${
PYTHON_INSTALL_DIR
}
/Lib/site-packages"
CACHE PATH
"Python site-packages path"
FORCE
)
else
()
message
(
FATAL_ERROR
"Unknown system !"
)
endif
()
ExternalProject_Add
(
python
GIT_REPOSITORY
"https://github.com/python-cmake-buildsystem/python-cmake-buildsystem.git"
GIT_TAG
"ed5f9bcee540e47f82fa17f8360b820591aa6d66"
PREFIX
${
PYTHON_SOURCES_DIR
}
UPDATE_COMMAND
""
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=
${
PYTHON_INSTALL_DIR
}
-DBUILD_SHARED:BOOL=OFF
-DBUILD_STATIC:BOOL=ON
-DUSE_SYSTEM_LIBRARIES:BOOL=OFF
-DZLIB_ROOT:FILEPATH=
${
ZLIB_ROOT
}
-DZLIB_INCLUDE_DIR:PATH=
${
ZLIB_INCLUDE_DIR
}
-DZLIB_LIBRARY:FILEPATH=
${
ZLIB_LIBRARIES
}
-DDOWNLOAD_SOURCES:BOOL=ON
-DINSTALL_WINDOWS_TRADITIONAL:BOOL=OFF
${
EXTERNAL_PROJECT_OPTIONAL_CMAKE_CACHE_ARGS
}
${
EXTERNAL_PROJECT_OPTIONAL_CMAKE_ARGS
}
DEPENDS zlib
)
SET
(
_python_DIR
${
PYTHON_INSTALL_DIR
}
)
IF
(
UNIX
)
SET
(
_python_IMPORT_SUFFIX a
)
IF
(
APPLE
)
SET
(
_python_IMPORT_SUFFIX lib
)
ENDIF
()
SET
(
PYTHON_INCLUDE_DIR
"
${
PYTHON_INSTALL_DIR
}
/include/python2.7"
CACHE PATH
"Python include dir"
FORCE
)
SET
(
PYTHON_LIBRARIES
"
${
PYTHON_INSTALL_DIR
}
/lib/libpython2.7.
${
_python_IMPORT_SUFFIX
}
"
CACHE FILEPATH
"Python library"
FORCE
)
SET
(
PYTHON_EXECUTABLE
${
PYTHON_INSTALL_DIR
}
/bin/python CACHE FILEPATH
"Python executable"
FORCE
)
SET
(
PY_SITE_PACKAGES_PATH
"
${
PYTHON_INSTALL_DIR
}
/lib/python2.7/site-packages"
CACHE PATH
"Python site-packages path"
FORCE
)
ELSEIF
(
WIN32
)
SET
(
PYTHON_INCLUDE_DIR
"
${
PYTHON_INSTALL_DIR
}
/include"
CACHE PATH
"Python include dir"
FORCE
)
SET
(
PYTHON_LIBRARIES
"
${
PYTHON_INSTALL_DIR
}
/libs/python27.lib"
CACHE FILEPATH
"Python library"
FORCE
)
SET
(
PYTHON_EXECUTABLE
"
${
PYTHON_INSTALL_DIR
}
/bin/python.exe"
CACHE FILEPATH
"Python executable"
FORCE
)
SET
(
PY_SITE_PACKAGES_PATH
"
${
PYTHON_INSTALL_DIR
}
/Lib/site-packages"
CACHE PATH
"Python site-packages path"
FORCE
)
ELSE
()
MESSAGE
(
FATAL_ERROR
"Unknown system !"
)
ENDIF
()
INCLUDE_DIRECTORIES
(
${
PYTHON_INCLUDE_DIR
}
)
ENDIF
()
cmake/external/swig.cmake
浏览文件 @
6cd4b6e0
...
...
@@ -13,9 +13,9 @@
# limitations under the License.
# Look for system swig
#
FIND_PACKAGE(SWIG)
FIND_PACKAGE
(
SWIG
)
#
IF(NOT ${SWIG_FOUND})
IF
(
NOT
${
SWIG_FOUND
}
)
# build swig as an external project
INCLUDE
(
ExternalProject
)
SET
(
SWIG_SOURCES_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/third_party/swig
)
...
...
@@ -62,14 +62,28 @@
./configure
--prefix=
${
SWIG_INSTALL_DIR
}
--with-pcre-prefix=
${
SWIG_INSTALL_DIR
}
/pcre
--with-python=
${
PYTHON_EXECUTABLE
}
BUILD_COMMAND cd
${
SWIG_SOURCES_DIR
}
/src/swig && make
INSTALL_COMMAND cd
${
SWIG_SOURCES_DIR
}
/src/swig && make install
DEPENDS pcre
python
DEPENDS pcre
)
set
(
SWIG_DIR
${
SWIG_INSTALL_DIR
}
/share/swig/
${
SWIG_TARGET_VERSION
}
CACHE FILEPATH
"SWIG Directory"
FORCE
)
set
(
SWIG_EXECUTABLE
${
SWIG_INSTALL_DIR
}
/bin/swig CACHE FILEPATH
"SWIG Executable"
FORCE
)
ENDIF
(
WIN32
)
#
ENDIF()
ENDIF
()
FUNCTION
(
generate_python_api target_name
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
PROJ_ROOT
}
/paddle/py_paddle/swig_paddle.py
${
PROJ_ROOT
}
/paddle/Paddle_wrap.cxx
${
PROJ_ROOT
}
/paddle/Paddle_wrap.h
COMMAND
${
SWIG_EXECUTABLE
}
-python -c++ -outcurrentdir -I../ api/Paddle.swig
&& mv
${
PROJ_ROOT
}
/paddle/swig_paddle.py
${
PROJ_ROOT
}
/paddle/py_paddle/swig_paddle.py
DEPENDS
${
PROJ_ROOT
}
/paddle/api/Paddle.swig
${
PROJ_ROOT
}
/paddle/api/PaddleAPI.h
WORKING_DIRECTORY
${
PROJ_ROOT
}
/paddle
COMMENT
"Generate Python API from swig"
)
ADD_CUSTOM_TARGET
(
${
target_name
}
ALL DEPENDS
${
PROJ_ROOT
}
/paddle/Paddle_wrap.cxx
${
PROJ_ROOT
}
/paddle/Paddle_wrap.h
${
PROJ_ROOT
}
/paddle/py_paddle/swig_paddle.py
)
ENDFUNCTION
(
generate_python_api
)
cmake/external/warpctc.cmake
浏览文件 @
6cd4b6e0
...
...
@@ -17,22 +17,29 @@ INCLUDE(ExternalProject)
SET
(
WARPCTC_SOURCES_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/third_party/warpctc
)
SET
(
WARPCTC_INSTALL_DIR
${
PROJECT_BINARY_DIR
}
/warpctc
)
IF
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
SET
(
USE_OMP ON
)
ELSE
()
SET
(
USE_OMP OFF
)
ENDIF
()
ExternalProject_Add
(
warpctc
GIT_REPOSITORY
"https://github.com/gangliao/warp-ctc.git"
PREFIX
${
WARPCTC_SOURCES_DIR
}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=
${
WARPCTC_INSTALL_DIR
}
CMAKE_ARGS -DWITH_GPU=
${
CUDA_FOUND
}
CMAKE_ARGS -DWITH_OMP=
${
USE_OMP
}
)
SET
(
WARPCTC_INCLUDE_DIR
"
${
WARP_INSTALL_DIR
}
/include"
CACHE PATH
"Warp-ctc Directory"
FORCE
)
INCLUDE_DIRECTORIES
(
${
WARPCTC_INCLUDE_DIR
}
)
IF
(
WIN32
)
set
(
WARPCTC_LIBRARIES
SET
(
WARPCTC_LIBRARIES
"
${
WARPCTC_INSTALL_DIR
}
/lib/warpctc.dll"
CACHE FILEPATH
"Warp-ctc Library"
FORCE
)
ELSE
(
WIN32
)
set
(
WARPCTC_LIBRARIES
SET
(
WARPCTC_LIBRARIES
"
${
WARPCTC_INSTALL_DIR
}
/lib/libwarpctc.so"
CACHE FILEPATH
"Warp-ctc Library"
FORCE
)
ENDIF
(
WIN32
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录