Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
e4be077f
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
692
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,发现更多精彩内容 >>
提交
e4be077f
编写于
7月 11, 2017
作者:
H
Helin Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add go testing into cmake and fix libpaddle_go_optimizer.a link path
上级
267f9a2c
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
37 addition
and
12 deletion
+37
-12
CMakeLists.txt
CMakeLists.txt
+4
-0
cmake/generic.cmake
cmake/generic.cmake
+12
-9
go/CMakeLists.txt
go/CMakeLists.txt
+3
-0
go/master/CMakeLists.txt
go/master/CMakeLists.txt
+3
-0
go/pserver/CMakeLists.txt
go/pserver/CMakeLists.txt
+3
-0
go/pserver/client/c/CMakeLists.txt
go/pserver/client/c/CMakeLists.txt
+8
-0
go/pserver/optimizer.go
go/pserver/optimizer.go
+1
-2
go/utils/networkhelper/CMakeLists.txt
go/utils/networkhelper/CMakeLists.txt
+3
-0
paddle/CMakeLists.txt
paddle/CMakeLists.txt
+0
-1
未找到文件。
CMakeLists.txt
浏览文件 @
e4be077f
...
...
@@ -140,6 +140,10 @@ endif(USE_NNPACK)
add_subdirectory
(
proto
)
# "add_subdirectory(go)" should be placed after the following loine,
# because it depends on paddle/optimizer.
add_subdirectory
(
paddle/optimizer
)
# "add_subdirectory(paddle)" and "add_subdirectory(python)" should be
# placed after this block, because they depends on it.
if
(
WITH_GOLANG
)
...
...
cmake/generic.cmake
浏览文件 @
e4be077f
...
...
@@ -301,7 +301,7 @@ function(go_library TARGET_NAME)
file
(
GLOB GO_SOURCE RELATIVE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
"*.go"
)
string
(
REPLACE
"
${
PADDLE_GO_PATH
}
/"
""
CMAKE_CURRENT_SOURCE_REL_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
)
# FIXME: link path
add_custom_command
(
TARGET
${
TARGET_NAME
}
POST_BUILD
COMMAND rm
"
${${
TARGET_NAME
}
_LIB_PATH
}
"
# Golang build source code
...
...
@@ -335,15 +335,18 @@ endfunction(go_binary)
function
(
go_test TARGET_NAME
)
set
(
options OPTIONAL
)
set
(
oneValueArgs
""
)
set
(
multiValueArgs
SRCS
DEPS
)
set
(
multiValueArgs DEPS
)
cmake_parse_arguments
(
go_test
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
add_custom_command
(
OUTPUT
${
TARGET_NAME
}
_timestamp
string
(
REPLACE
"
${
PADDLE_GO_PATH
}
"
""
CMAKE_CURRENT_SOURCE_REL_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
)
add_custom_target
(
${
TARGET_NAME
}
ALL DEPENDS go_vendor
${
go_test_DEPS
}
)
add_custom_command
(
TARGET
${
TARGET_NAME
}
POST_BUILD
COMMAND env GOPATH=
${
GOPATH
}
${
CMAKE_Go_COMPILER
}
test
-c -o
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
TARGET_NAME
}
"
${
go_test_SRCS
}
".
${
CMAKE_CURRENT_SOURCE_REL_DIR
}
"
WORKING_DIRECTORY
"
${
PADDLE_IN_GOPATH
}
/go"
)
add_test
(
NAME
${
TARGET_NAME
}
COMMAND
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
TARGET_NAME
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
add_custom_target
(
${
TARGET_NAME
}
ALL DEPENDS
${
TARGET_NAME
}
_timestamp
${
go_test_DEPS
}
)
add_test
(
${
TARGET_NAME
}
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
TARGET_NAME
}
)
endfunction
(
go_test
)
function
(
proto_library TARGET_NAME
)
...
...
go/CMakeLists.txt
浏览文件 @
e4be077f
...
...
@@ -17,3 +17,6 @@ add_subdirectory(pserver/client/c)
add_subdirectory
(
cmd/pserver
)
add_subdirectory
(
cmd/master
)
add_subdirectory
(
master/c
)
add_subdirectory
(
master
)
add_subdirectory
(
pserver
)
add_subdirectory
(
utils/networkhelper
)
go/master/CMakeLists.txt
0 → 100644
浏览文件 @
e4be077f
if
(
WITH_TESTING
)
go_test
(
master_test
)
endif
()
go/pserver/CMakeLists.txt
0 → 100644
浏览文件 @
e4be077f
if
(
WITH_TESTING
)
go_test
(
pserver_test DEPS paddle_go_optimizer
)
endif
()
go/pserver/client/c/CMakeLists.txt
浏览文件 @
e4be077f
cc_library
(
paddle_go_optimizer DEPS paddle_optimizer paddle_proto glog gflags protobuf
)
target_link_libraries
(
paddle_go_optimizer stdc++ m
)
# Copy library to the required place.
# See: go/pserver/optimizer.go:
# // #cgo LDFLAGS: ${SRCDIR}/client/c/libpaddle_go_optimizer.a -lstdc++ -lm
add_custom_command
(
TARGET paddle_go_optimizer POST_BUILD
COMMAND cp
"
${
CMAKE_CURRENT_BINARY_DIR
}
/libpaddle_go_optimizer.a"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
go_library
(
paddle_pserver_cclient STATIC DEPS paddle_go_optimizer
)
if
(
WITH_TESTING
)
# FIXME: this test requires pserver which is not managed by the test
...
...
go/pserver/optimizer.go
浏览文件 @
e4be077f
package
pserver
// #cgo CFLAGS: -I ../../
// //FIXME: ldflags contain "build" path
// #cgo LDFLAGS: ${SRCDIR}/../../build/go/pserver/client/c/libpaddle_go_optimizer.a -lstdc++ -lm
// #cgo LDFLAGS: ${SRCDIR}/client/c/libpaddle_go_optimizer.a -lstdc++ -lm
// #include "paddle/optimizer/optimizer.h"
// #include <stdlib.h>
// #include <string.h>
...
...
go/utils/networkhelper/CMakeLists.txt
0 → 100644
浏览文件 @
e4be077f
if
(
WITH_TESTING
)
go_test
(
network_helper_test
)
endif
()
paddle/CMakeLists.txt
浏览文件 @
e4be077f
...
...
@@ -8,7 +8,6 @@ add_subdirectory(gserver)
add_subdirectory
(
pserver
)
add_subdirectory
(
trainer
)
add_subdirectory
(
scripts
)
add_subdirectory
(
optimizer
)
add_subdirectory
(
string
)
if
(
Boost_FOUND
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录