Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
4315a38d
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
提交
4315a38d
编写于
9月 12, 2016
作者:
G
gangliao
提交者:
GitHub
9月 12, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request
#1
from reyoung/mac_port
revise CMake for MAC OS
上级
eb5cf64b
738b6894
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
45 addition
and
30 deletion
+45
-30
CMakeLists.txt
CMakeLists.txt
+1
-0
cmake/flags.cmake
cmake/flags.cmake
+2
-2
cmake/util.cmake
cmake/util.cmake
+42
-28
未找到文件。
CMakeLists.txt
浏览文件 @
4315a38d
...
@@ -14,6 +14,7 @@ find_package(CUDA QUIET)
...
@@ -14,6 +14,7 @@ find_package(CUDA QUIET)
find_package
(
Protobuf REQUIRED
)
find_package
(
Protobuf REQUIRED
)
find_package
(
PythonLibs 2.7 REQUIRED
)
find_package
(
PythonLibs 2.7 REQUIRED
)
find_package
(
PythonInterp 2.7 REQUIRED
)
find_package
(
PythonInterp 2.7 REQUIRED
)
find_package
(
ZLIB REQUIRED
)
find_package
(
NumPy
)
find_package
(
NumPy
)
find_package
(
Threads REQUIRED
)
find_package
(
Threads REQUIRED
)
find_package
(
Glog
)
find_package
(
Glog
)
...
...
cmake/flags.cmake
浏览文件 @
4315a38d
...
@@ -58,8 +58,8 @@ set(COMMON_FLAGS
...
@@ -58,8 +58,8 @@ set(COMMON_FLAGS
-fPIC
-fPIC
-fno-omit-frame-pointer
-fno-omit-frame-pointer
-Wall
-Wall
#
-Wextra
-Wextra
#
-Werror
-Werror
-Wnon-virtual-dtor
-Wnon-virtual-dtor
-Wdelete-non-virtual-dtor
-Wdelete-non-virtual-dtor
-Wno-unused-parameter
-Wno-unused-parameter
...
...
cmake/util.cmake
浏览文件 @
4315a38d
# MAC OS does not contain start-up and whole-archive args
if
(
APPLE
)
set
(
GROUP_START
""
)
set
(
GROUP_END
""
)
set
(
ARCHIVE_START
""
)
set
(
ARCHIVE_END
""
)
else
()
set
(
GROUP_START
"-Wl,--start-group"
)
set
(
GROUP_END
"-Wl,--end-group"
)
set
(
ARCHIVE_START
"-Wl,--whole-archive"
)
set
(
ARCHIVE_END
"-Wl,--no-whole-archive"
)
endif
()
# Some common routine for paddle compile.
# Some common routine for paddle compile.
# target_circle_link_libraries
# target_circle_link_libraries
...
@@ -23,17 +7,46 @@ endif()
...
@@ -23,17 +7,46 @@ endif()
# Rest Arguments: libraries which link together.
# Rest Arguments: libraries which link together.
function
(
target_circle_link_libraries TARGET_NAME
)
function
(
target_circle_link_libraries TARGET_NAME
)
if
(
APPLE
)
if
(
APPLE
)
set
(
LIBS
)
set
(
inArchive OFF
)
set
(
libsInArgn
)
foreach
(
arg
${
ARGN
}
)
foreach
(
arg
${
ARGN
}
)
list
(
APPEND OSX_LIBRARIES
"-Wl,-force_load"
"
${
arg
}
"
)
if
(
${
arg
}
STREQUAL
"ARCHIVE_START"
)
set
(
inArchive ON
)
elseif
(
${
arg
}
STREQUAL
"ARCHIVE_END"
)
set
(
inArchive OFF
)
else
()
if
(
inArchive
)
list
(
APPEND LIBS
"-Wl,-force_load"
)
endif
()
list
(
APPEND LIBS
${
arg
}
)
list
(
APPEND libsInArgn
${
arg
}
)
endif
()
endforeach
()
endforeach
()
list
(
REVERSE libsInArgn
)
target_link_libraries
(
${
TARGET_NAME
}
target_link_libraries
(
${
TARGET_NAME
}
${
OSX_LIBRARIES
}
-lz
)
${
LIBS
}
else
()
${
libsInArgn
}
)
else
()
# LINUX
set
(
LIBS
)
foreach
(
arg
${
ARGN
}
)
if
(
${
arg
}
STREQUAL
"ARCHIVE_START"
)
list
(
APPEND LIBS
"-Wl,--whole-archive"
)
elseif
(
${
arg
}
STREQUAL
"ARCHIVE_END"
)
list
(
APPEND LIBS
"-Wl,--no-whole-archive"
)
else
()
list
(
APPEND LIBS
${
arg
}
)
endif
()
endforeach
()
target_link_libraries
(
${
TARGET_NAME
}
target_link_libraries
(
${
TARGET_NAME
}
${
GROUP_START
}
"-Wl,--start-group"
${
ARGN
}
${
LIBS
}
-lz
"-Wl,--end-group"
)
${
GROUP_END
}
)
endif
()
endif
()
endfunction
()
endfunction
()
...
@@ -65,20 +78,20 @@ function(link_paddle_exe TARGET_NAME)
...
@@ -65,20 +78,20 @@ function(link_paddle_exe TARGET_NAME)
if
(
PADDLE_WITH_INTERNAL
)
if
(
PADDLE_WITH_INTERNAL
)
set
(
INTERAL_LIBS paddle_internal_gserver paddle_internal_parameter
)
set
(
INTERAL_LIBS paddle_internal_gserver paddle_internal_parameter
)
target_circle_link_libraries
(
${
TARGET_NAME
}
target_circle_link_libraries
(
${
TARGET_NAME
}
${
ARCHIVE_START
}
ARCHIVE_START
paddle_internal_gserver
paddle_internal_gserver
paddle_internal_owlqn
paddle_internal_owlqn
${
ARCHIVE_END
}
ARCHIVE_END
paddle_internal_parameter
)
paddle_internal_parameter
)
else
()
else
()
set
(
INTERAL_LIBS
""
)
set
(
INTERAL_LIBS
""
)
endif
()
endif
()
target_circle_link_libraries
(
${
TARGET_NAME
}
target_circle_link_libraries
(
${
TARGET_NAME
}
${
ARCHIVE_START
}
ARCHIVE_START
paddle_gserver
paddle_gserver
${
METRIC_LIBS
}
${
METRIC_LIBS
}
${
ARCHIVE_END
}
ARCHIVE_END
paddle_pserver
paddle_pserver
paddle_trainer_lib
paddle_trainer_lib
paddle_network
paddle_network
...
@@ -92,7 +105,8 @@ function(link_paddle_exe TARGET_NAME)
...
@@ -92,7 +105,8 @@ function(link_paddle_exe TARGET_NAME)
${
CMAKE_THREAD_LIBS_INIT
}
${
CMAKE_THREAD_LIBS_INIT
}
${
CBLAS_LIBS
}
${
CBLAS_LIBS
}
${
CMAKE_DL_LIBS
}
${
CMAKE_DL_LIBS
}
${
INTERAL_LIBS
}
)
${
INTERAL_LIBS
}
${
ZLIB_LIBRARIES
}
)
if
(
WITH_PYTHON
)
if
(
WITH_PYTHON
)
target_link_libraries
(
${
TARGET_NAME
}
target_link_libraries
(
${
TARGET_NAME
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录