Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
a02ec8c9
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
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看板
提交
a02ec8c9
编写于
12月 27, 2016
作者:
L
liaogang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refine CMakeLists
上级
62b55cc6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
184 addition
and
271 deletion
+184
-271
CMakeLists.txt
CMakeLists.txt
+46
-134
cmake/check_packages.cmake
cmake/check_packages.cmake
+3
-28
cmake/definitions.cmake
cmake/definitions.cmake
+62
-0
cmake/rdma.cmake
cmake/rdma.cmake
+68
-64
cmake/swig.cmake
cmake/swig.cmake
+0
-15
cmake/util.cmake
cmake/util.cmake
+4
-30
cmake/version.cmake
cmake/version.cmake
+1
-0
未找到文件。
CMakeLists.txt
浏览文件 @
a02ec8c9
...
...
@@ -4,163 +4,75 @@ project(paddle CXX C)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
CMAKE_SOURCE_DIR
}
/cmake"
)
set
(
PROJ_ROOT
${
CMAKE_SOURCE_DIR
}
)
include
(
package
)
find_package
(
SWIG 2.0
)
find_package
(
CUDA QUIET
)
find_package
(
Protobuf REQUIRED
)
# Check protobuf library version.
execute_process
(
COMMAND
${
PROTOBUF_PROTOC_EXECUTABLE
}
--version
OUTPUT_VARIABLE PROTOBUF_VERSION
)
string
(
REPLACE
"libprotoc "
""
PROTOBUF_VERSION
${
PROTOBUF_VERSION
}
)
set
(
PROTOBUF_3 OFF
)
if
(
${
PROTOBUF_VERSION
}
VERSION_GREATER
"3.0.0"
OR
${
PROTOBUF_VERSION
}
VERSION_EQUAL
"3.0.0"
)
set
(
PROTOBUF_3 ON
)
endif
()
find_package
(
PythonLibs 2.7 REQUIRED
)
find_package
(
PythonInterp 2.7 REQUIRED
)
find_package
(
ZLIB REQUIRED
)
find_package
(
NumPy REQUIRED
)
find_package
(
Threads REQUIRED
)
find_package
(
AVX QUIET
)
find_package
(
Glog REQUIRED
)
find_package
(
Gflags REQUIRED
)
find_package
(
GTest
)
find_package
(
Sphinx
)
find_package
(
Doxygen
)
include
(
cblas
)
find_program
(
M4_EXECUTABLE m4
)
###################### Configurations ###########################
find_package
(
CUDA QUIET
)
find_package
(
Git REQUIRED
)
find_package
(
Threads REQUIRED
)
include
(
simd
)
###################### Configurations ############################
option
(
WITH_DSO
"Compile PaddlePaddle with dynamic linked libraries"
ON
)
option
(
WITH_GPU
"Compile PaddlePaddle with gpu"
${
CUDA_FOUND
}
)
option
(
WITH_DOUBLE
"Compile PaddlePaddle with double precision, otherwise use single precision"
OFF
)
option
(
WITH_AVX
"Compile PaddlePaddle with avx intrinsics"
${
AVX_FOUND
}
)
option
(
WITH_PYTHON
"Compile PaddlePaddle with python interpreter"
ON
)
option
(
WITH_STYLE_CHECK
"Style Check for PaddlePaddle"
${
PYTHONINTERP_FOUND
}
)
option
(
WITH_STYLE_CHECK
"Style Check for PaddlePaddle"
ON
)
option
(
WITH_RDMA
"Compile PaddlePaddle with rdma support"
OFF
)
option
(
WITH_TIMER
"Compile PaddlePaddle use timer"
OFF
)
option
(
WITH_PROFILER
"Compile PaddlePaddle use gpu profiler"
OFF
)
option
(
WITH_TESTING
"Compile and run unittest for PaddlePaddle"
${
GTEST_FOUND
}
)
option
(
WITH_TESTING
"Compile and run unittest for PaddlePaddle"
ON
)
option
(
WITH_DOC
"Compile PaddlePaddle with documentation"
OFF
)
option
(
WITH_SWIG_PY
"Compile PaddlePaddle with py PaddlePaddle prediction api"
${
SWIG_FOUND
}
)
option
(
WITH_SWIG_PY
"Compile PaddlePaddle with py PaddlePaddle prediction api"
ON
)
option
(
ON_TRAVIS
"Running test on travis-ci or not."
OFF
)
option
(
ON_COVERALLS
"Generating code coverage data on coveralls or not."
OFF
)
option
(
COVERALLS_UPLOAD
"Uploading the generated coveralls json."
ON
)
include
(
external/zlib
)
# download, build, install zlib
include
(
external/gflags
)
# download, build, install gflags
include
(
external/glog
)
# download, build, install glog
include
(
external/gtest
)
# download, build, install gtest
include
(
external/protobuf
)
# download, build, install protobuf
include
(
external/openblas
)
# download, build, install openblas
include
(
external/python
)
# download, build, install python
include
(
external/numpy
)
# download, build, install numpy
include
(
external/swig
)
# download, build, install swig
include
(
external/warpctc
)
# download, build, install warpctc
include
(
package
)
# set paddle packages
include
(
cpplint
)
# set paddle c++ style
include
(
ccache
)
# set ccache for compilation
include
(
util
)
# set unittest and link libs
include
(
rdma
)
# set rdma libraries
include
(
flags
)
# set paddle compile flags
include
(
cudnn
)
# set cudnn libraries
include
(
version
)
# set PADDLE_VERSION
include
(
coveralls
)
# set code coverage
include
(
python_module
)
# set python module
include
(
check_packages
)
# check configuration
include
(
definitions
)
# add paddle definitions
include
(
cpplint
)
include
(
ccache
)
if
(
WITH_RDMA
)
include
(
rdma
)
endif
()
include
(
util
)
include
(
flags
)
include
(
cudnn
)
include
(
FindPythonModule
)
include
(
check_packages
)
include
(
swig
)
include
(
coveralls
)
# Set PaddlePaddle version to Git tag name or Git commit ID.
find_package
(
Git REQUIRED
)
# version.cmake will get the current PADDLE_VERSION
include
(
version
)
add_definitions
(
-DPADDLE_VERSION=
${
PADDLE_VERSION
}
)
if
(
NOT WITH_GPU
)
add_definitions
(
-DPADDLE_ONLY_CPU
)
add_definitions
(
-DHPPL_STUB_FUNC
)
list
(
APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS cu
)
else
()
if
(
${
CUDA_VERSION_MAJOR
}
VERSION_LESS 7
)
message
(
FATAL_ERROR
"Paddle need CUDA >= 7.0 to compile"
)
endif
()
if
(
NOT CUDNN_FOUND
)
message
(
FATAL_ERROR
"Paddle need cudnn to compile"
)
endif
()
if
(
WITH_AVX
)
set
(
CUDA_NVCC_FLAGS
${
CUDA_NVCC_FLAGS
}
"-Xcompiler
${
AVX_FLAG
}
"
)
else
(
WITH_AVX
)
set
(
CUDA_NVCC_FLAGS
${
CUDA_NVCC_FLAGS
}
"-Xcompiler
${
SSE3_FLAG
}
"
)
endif
(
WITH_AVX
)
# Include cuda and cudnn
include_directories
(
${
CUDNN_INCLUDE_DIR
}
)
include_directories
(
${
CUDA_TOOLKIT_INCLUDE
}
)
endif
(
NOT WITH_GPU
)
if
(
WITH_DSO
)
add_definitions
(
-DPADDLE_USE_DSO
)
endif
(
WITH_DSO
)
if
(
WITH_DOUBLE
)
add_definitions
(
-DPADDLE_TYPE_DOUBLE
)
set
(
ACCURACY double
)
else
(
WITH_DOUBLE
)
set
(
ACCURACY float
)
endif
(
WITH_DOUBLE
)
if
(
NOT WITH_TIMER
)
add_definitions
(
-DPADDLE_DISABLE_TIMER
)
endif
(
NOT WITH_TIMER
)
if
(
NOT WITH_PROFILER
)
add_definitions
(
-DPADDLE_DISABLE_PROFILER
)
endif
(
NOT WITH_PROFILER
)
if
(
WITH_AVX
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
AVX_FLAG
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
AVX_FLAG
}
"
)
else
(
WITH_AVX
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
SSE3_FLAG
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
SSE3_FLAG
}
"
)
endif
(
WITH_AVX
)
if
(
WITH_PYTHON
)
include_directories
(
${
PYTHON_INCLUDE_DIR
}
)
include_directories
(
${
PYTHON_NUMPY_INCLUDE_DIR
}
)
else
(
WITH_PYTHON
)
add_definitions
(
-DPADDLE_NO_PYTHON
)
endif
(
WITH_PYTHON
)
if
(
WITH_RDMA
)
include_directories
(
"
${
RDMA_INC_DIR
}
"
)
else
(
WITH_RDMA
)
add_definitions
(
-DPADDLE_DISABLE_RDMA
)
endif
(
WITH_RDMA
)
# glog
include_directories
(
${
LIBGLOG_INCLUDE_DIR
}
)
#gflags
add_definitions
(
-DGFLAGS_NS=
${
GFLAGS_NAMESPACE
}
)
include_directories
(
${
GFLAGS_INCLUDE_DIRS
}
)
if
(
WITH_TESTING
)
enable_testing
()
include_directories
(
${
GTEST_INCLUDE_DIRS
}
)
endif
()
include_directories
(
"
${
CBLAS_INC_DIR
}
"
)
include_directories
(
"
${
PROJ_ROOT
}
"
)
include_directories
(
"
${
PROJ_ROOT
}
/paddle/cuda/include"
)
include_directories
(
${
PROTOBUF_INCLUDE_DIRS
}
)
include_directories
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/proto"
)
if
(
EXISTS
"
${
PROJ_ROOT
}
/paddle/internals/CMakeLists.txt"
)
set
(
PADDLE_WITH_INTERNAL ON
)
include
(
paddle/internals/CMakeLists.txt
)
else
()
set
(
PADDLE_WITH_INTERNAL OFF
)
set
(
INTERNAL_PROTO_PATH
""
)
endif
()
set
(
EXTERNAL_LIBS
# have not include gtest here.
${
GFLAGS_LIBRARIES
}
${
GLOG_LIBRARIES
}
${
CBLAS_LIBRARIES
}
${
PROTOBUF_LIBRARIES
}
${
WARPCTC_LIBRARIES
}
${
ZLIB_LIBRARIES
}
)
add_subdirectory
(
proto
)
add_subdirectory
(
paddle
)
add_subdirectory
(
python
)
if
(
WITH_DOC
)
add_subdirectory
(
doc
)
endif
()
cmake/check_packages.cmake
浏览文件 @
a02ec8c9
...
...
@@ -2,38 +2,13 @@
if
(
WITH_GPU
)
find_package
(
CUDA REQUIRED
)
# CUDA is required when use gpu
endif
()
if
(
WITH_PYTHON
)
find_package
(
PythonLibs 2.6 REQUIRED
)
find_package
(
PythonInterp REQUIRED
)
find_package
(
NumPy REQUIRED
)
endif
()
if
(
WITH_STYLE_CHECK
)
find_package
(
PythonInterp REQUIRED
)
endif
()
find_package
(
Glog REQUIRED
)
find_package
(
Gflags REQUIRED
)
if
(
WITH_TESTING
)
find_package
(
GTest REQUIRED
)
endif
()
endif
(
WITH_GPU
)
if
(
WITH_DOC
)
find_package
(
Sphinx REQUIRED
)
find_python_module
(
recommonmark REQUIRED
)
endif
()
endif
(
WITH_DOC
)
if
(
WITH_SWIG_PY
)
if
(
NOT SWIG_FOUND
)
message
(
FATAL_ERROR
"SWIG is not found. Please install swig or disable WITH_SWIG_PY"
)
endif
()
find_python_module
(
wheel REQUIRED
)
# package wheel
endif
()
if
(
NOT M4_EXECUTABLE
)
message
(
FATAL_ERROR
"Paddle need m4 to generate proto file."
)
endif
()
endif
(
WITH_SWIG_PY
)
cmake/definitions.cmake
0 → 100644
浏览文件 @
a02ec8c9
# 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.
if
(
WITH_DSO
)
add_definitions
(
-DPADDLE_USE_DSO
)
endif
(
WITH_DSO
)
if
(
WITH_DOUBLE
)
add_definitions
(
-DPADDLE_TYPE_DOUBLE
)
endif
(
WITH_DOUBLE
)
if
(
NOT WITH_TIMER
)
add_definitions
(
-DPADDLE_DISABLE_TIMER
)
endif
(
NOT WITH_TIMER
)
if
(
NOT WITH_PROFILER
)
add_definitions
(
-DPADDLE_DISABLE_PROFILER
)
endif
(
NOT WITH_PROFILER
)
if
(
NOT WITH_GPU
)
add_definitions
(
-DPADDLE_ONLY_CPU
)
add_definitions
(
-DHPPL_STUB_FUNC
)
list
(
APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS cu
)
else
()
if
(
${
CUDA_VERSION_MAJOR
}
VERSION_LESS 7
)
message
(
FATAL_ERROR
"Paddle need CUDA >= 7.0 to compile"
)
endif
()
if
(
NOT CUDNN_FOUND
)
message
(
FATAL_ERROR
"Paddle need cudnn to compile"
)
endif
()
if
(
WITH_AVX
)
set
(
CUDA_NVCC_FLAGS
${
CUDA_NVCC_FLAGS
}
"-Xcompiler
${
AVX_FLAG
}
"
)
else
(
WITH_AVX
)
set
(
CUDA_NVCC_FLAGS
${
CUDA_NVCC_FLAGS
}
"-Xcompiler
${
SSE3_FLAG
}
"
)
endif
(
WITH_AVX
)
# Include cuda and cudnn
include_directories
(
${
CUDNN_INCLUDE_DIR
}
)
include_directories
(
${
CUDA_TOOLKIT_INCLUDE
}
)
endif
(
NOT WITH_GPU
)
if
(
WITH_AVX
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
AVX_FLAG
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
AVX_FLAG
}
"
)
else
(
WITH_AVX
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
SSE3_FLAG
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
SSE3_FLAG
}
"
)
endif
(
WITH_AVX
)
cmake/rdma.cmake
浏览文件 @
a02ec8c9
...
...
@@ -5,72 +5,76 @@
# svn co https://svn.baidu.com/sys/ip/trunk/rdma/thirdparty rdma/
# we use static output in svn repositories to avoid implict bugs from not standard runtime env.
set
(
RDMA_ROOT $ENV{RDMA_ROOT} CACHE PATH
"Folder contains RDMA sock library and thirdparty library"
)
if
(
WITH_RDMA
)
set
(
RDMA_ROOT $ENV{RDMA_ROOT} CACHE PATH
"Folder contains RDMA sock library and thirdparty library"
)
function
(
generate_rdma_links
)
#redirect to current DIR to isolate the pollution from system runtime environment
#it can benifits unified control for different gcc environment.
#e.g, by default gcc48 did not refer /usr/lib64 which could contain low version
#runtime libraries that will crash process while loading it. That redirect trick
#can fix it.
execute_process
(
COMMAND mkdir -p librdma
COMMAND ln -s -f /usr/lib64/libibverbs.so.1.0.0 librdma/libibverbs.so.1
COMMAND ln -s -f /usr/lib64/libibverbs.so.1.0.0 librdma/libibverbs.so
COMMAND ln -s -f /usr/lib64/librdmacm.so.1.0.0 librdma/librdmacm.so.1
COMMAND ln -s -f /usr/lib64/librdmacm.so.1.0.0 librdma/librdmacm.so
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
endfunction
(
generate_rdma_links
)
#check and set headers
find_path
(
RDMA_INC_SXISOCK sxi_sock.h PATHS
${
RDMA_ROOT
}
/sockrdmav1/output/include
)
find_path
(
RDMA_INC_XIO libxio.h PATHS
${
RDMA_ROOT
}
/thirdparty/output/accelio
)
find_path
(
RDMA_INC_EVENT event2 PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_path
(
RDMA_INC_NUMA numa.h PATHS
${
RDMA_ROOT
}
/thirdparty/output/libnuma
)
#check and set libs
find_library
(
RDMA_LIB_SXISOCK NAMES sxisock PATHS
${
RDMA_ROOT
}
/sockrdmav1/output
)
find_library
(
RDMA_LIB_XIO NAMES xio PATHS
${
RDMA_ROOT
}
/thirdparty/output/accelio
)
find_library
(
RDMA_LIB_EVENT NAMES event PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_EVENT_CORE NAMES event_core PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_EVENT_EXTRA NAMES event_extra PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_EVENT_PTHREADS NAMES event_pthreads PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_NUMA NAMES numa PATHS
${
RDMA_ROOT
}
/thirdparty/output/libnuma
)
if
(
RDMA_INC_SXISOCK AND
RDMA_INC_XIO AND
RDMA_INC_EVENT AND
RDMA_INC_NUMA AND
RDMA_LIB_SXISOCK AND
RDMA_LIB_XIO AND
RDMA_LIB_EVENT AND
RDMA_LIB_EVENT_CORE AND
RDMA_LIB_EVENT_EXTRA AND
RDMA_LIB_EVENT_PTHREADS AND
RDMA_LIB_NUMA
function
(
generate_rdma_links
)
#redirect to current DIR to isolate the pollution from system runtime environment
#it can benifits unified control for different gcc environment.
#e.g, by default gcc48 did not refer /usr/lib64 which could contain low version
#runtime libraries that will crash process while loading it. That redirect trick
#can fix it.
execute_process
(
COMMAND mkdir -p librdma
COMMAND ln -s -f /usr/lib64/libibverbs.so.1.0.0 librdma/libibverbs.so.1
COMMAND ln -s -f /usr/lib64/libibverbs.so.1.0.0 librdma/libibverbs.so
COMMAND ln -s -f /usr/lib64/librdmacm.so.1.0.0 librdma/librdmacm.so.1
COMMAND ln -s -f /usr/lib64/librdmacm.so.1.0.0 librdma/librdmacm.so
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
endfunction
(
generate_rdma_links
)
set
(
RDMA_INC_DIR
${
RDMA_INC_SXISOCK
}
${
RDMA_INC_XIO
}
${
RDMA_INC_EVENT
}
${
RDMA_INC_NUMA
}
)
set
(
RDMA_LIBS
${
RDMA_LIB_SXISOCK
}
${
RDMA_LIB_XIO
}
${
RDMA_LIB_EVENT
}
${
RDMA_LIB_EVENT_CORE
}
${
RDMA_LIB_EVENT_EXTRA
}
${
RDMA_LIB_EVENT_PTHREADS
}
${
RDMA_LIB_NUMA
}
)
set
(
RDMA_LD_FLAGS
"-L./librdma -libverbs -lrdmacm -Xlinker -rpath ./librdma"
)
return
()
endif
()
#check and set headers
find_path
(
RDMA_INC_SXISOCK sxi_sock.h PATHS
${
RDMA_ROOT
}
/sockrdmav1/output/include
)
find_path
(
RDMA_INC_XIO libxio.h PATHS
${
RDMA_ROOT
}
/thirdparty/output/accelio
)
find_path
(
RDMA_INC_EVENT event2 PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_path
(
RDMA_INC_NUMA numa.h PATHS
${
RDMA_ROOT
}
/thirdparty/output/libnuma
)
#check and set libs
find_library
(
RDMA_LIB_SXISOCK NAMES sxisock PATHS
${
RDMA_ROOT
}
/sockrdmav1/output
)
find_library
(
RDMA_LIB_XIO NAMES xio PATHS
${
RDMA_ROOT
}
/thirdparty/output/accelio
)
find_library
(
RDMA_LIB_EVENT NAMES event PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_EVENT_CORE NAMES event_core PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_EVENT_EXTRA NAMES event_extra PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_EVENT_PTHREADS NAMES event_pthreads PATHS
${
RDMA_ROOT
}
/thirdparty/output/libevent
)
find_library
(
RDMA_LIB_NUMA NAMES numa PATHS
${
RDMA_ROOT
}
/thirdparty/output/libnuma
)
#if this module is not called, RDMA_INC_DIR RDMA_LIBS will be null, so top module always refer this variable
if
(
RDMA_INC_SXISOCK AND
RDMA_INC_XIO AND
RDMA_INC_EVENT AND
RDMA_INC_NUMA AND
RDMA_LIB_SXISOCK AND
RDMA_LIB_XIO AND
RDMA_LIB_EVENT AND
RDMA_LIB_EVENT_CORE AND
RDMA_LIB_EVENT_EXTRA AND
RDMA_LIB_EVENT_PTHREADS AND
RDMA_LIB_NUMA
)
message
(
FATAL_ERROR,
"RDMA libraries are not found, try to set RDMA_ROOT or check all related libraries."
)
set
(
RDMA_INC_DIR
${
RDMA_INC_SXISOCK
}
${
RDMA_INC_XIO
}
${
RDMA_INC_EVENT
}
${
RDMA_INC_NUMA
}
)
set
(
RDMA_LIBS
${
RDMA_LIB_SXISOCK
}
${
RDMA_LIB_XIO
}
${
RDMA_LIB_EVENT
}
${
RDMA_LIB_EVENT_CORE
}
${
RDMA_LIB_EVENT_EXTRA
}
${
RDMA_LIB_EVENT_PTHREADS
}
${
RDMA_LIB_NUMA
}
)
set
(
RDMA_LD_FLAGS
"-L./librdma -libverbs -lrdmacm -Xlinker -rpath ./librdma"
)
include_directories
(
"
${
RDMA_INC_DIR
}
"
)
else
()
#if this module is not called, RDMA_INC_DIR RDMA_LIBS will be null, so top module always refer this variable
message
(
FATAL_ERROR,
"RDMA libraries are not found, try to set RDMA_ROOT or check all related libraries."
)
endif
()
else
(
WITH_RDMA
)
set
(
RDMA_LIBS
""
)
set
(
RDMA_LD_FLAGS
""
)
add_definitions
(
-DPADDLE_DISABLE_RDMA
)
endif
(
WITH_RDMA
)
cmake/swig.cmake
已删除
100644 → 0
浏览文件 @
62b55cc6
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 -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/util.cmake
浏览文件 @
a02ec8c9
...
...
@@ -81,18 +81,6 @@ function(link_paddle_exe TARGET_NAME)
set
(
METRIC_LIBS
""
)
endif
()
if
(
PADDLE_WITH_INTERNAL
)
set
(
INTERAL_LIBS paddle_internal_gserver paddle_internal_parameter
)
target_circle_link_libraries
(
${
TARGET_NAME
}
ARCHIVE_START
paddle_internal_gserver
paddle_internal_owlqn
ARCHIVE_END
paddle_internal_parameter
)
else
()
set
(
INTERAL_LIBS
""
)
endif
()
target_circle_link_libraries
(
${
TARGET_NAME
}
ARCHIVE_START
paddle_gserver
...
...
@@ -109,20 +97,11 @@ function(link_paddle_exe TARGET_NAME)
paddle_cuda
paddle_test_main
${
METRIC_LIBS
}
${
PROTOBUF_LIBRARY
}
${
LIBGLOG_LIBRARY
}
${
GFLAGS_LIBRARIES
}
${
EXTERNAL_LIBS
}
${
CMAKE_THREAD_LIBS_INIT
}
${
CBLAS_LIBS
}
${
ZLIB_LIBRARIES
}
${
INTERAL_LIBS
}
${
CMAKE_DL_LIBS
}
)
if
(
WITH_RDMA
)
target_link_libraries
(
${
TARGET_NAME
}
${
RDMA_LD_FLAGS
}
${
RDMA_LIBS
}
)
endif
()
${
CMAKE_DL_LIBS
}
${
RDMA_LD_FLAGS
}
${
RDMA_LIBS
}
)
if
(
WITH_PYTHON
)
target_link_libraries
(
${
TARGET_NAME
}
...
...
@@ -142,11 +121,6 @@ function(link_paddle_exe TARGET_NAME)
target_link_libraries
(
${
TARGET_NAME
}
rt
)
endif
()
endif
()
if
(
NOT WITH_DSO
)
target_link_libraries
(
${
TARGET_NAME
}
${
WARPCTC_LIBRARY
}
)
endif
()
endfunction
()
# link_paddle_test
...
...
cmake/version.cmake
浏览文件 @
a02ec8c9
...
...
@@ -21,4 +21,5 @@ while ("${PADDLE_VERSION}" STREQUAL "")
endif
()
endwhile
()
add_definitions
(
-DPADDLE_VERSION=
${
PADDLE_VERSION
}
)
message
(
STATUS
"Paddle version is
${
PADDLE_VERSION
}
"
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录