Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
oneflow
提交
9244cdeb
O
oneflow
项目概览
Oneflow-Inc
/
oneflow
上一次同步 接近 3 年
通知
13
Star
2733
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oneflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9244cdeb
编写于
5月 20, 2017
作者:
J
jinhui yuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
re-org cmake files
上级
42cf3049
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
77 addition
and
10 deletion
+77
-10
.gitignore
.gitignore
+4
-1
CMakeLists.txt
CMakeLists.txt
+13
-5
build_oneflow.bat
build_oneflow.bat
+8
-0
build_oneflow.sh
build_oneflow.sh
+8
-0
build_third_party.bat
build_third_party.bat
+7
-0
build_third_party.sh
build_third_party.sh
+7
-0
cmake/third_party.cmake
cmake/third_party.cmake
+0
-4
cmake/third_party/gflags.cmake
cmake/third_party/gflags.cmake
+5
-0
cmake/third_party/glog.cmake
cmake/third_party/glog.cmake
+5
-0
cmake/third_party/googletest.cmake
cmake/third_party/googletest.cmake
+5
-0
cmake/third_party/grpc.cmake
cmake/third_party/grpc.cmake
+5
-0
cmake/third_party/protobuf.cmake
cmake/third_party/protobuf.cmake
+5
-0
cmake/third_party/zlib.cmake
cmake/third_party/zlib.cmake
+5
-0
未找到文件。
.gitignore
浏览文件 @
9244cdeb
build
build_oneflow
build_third_party
third_party
CMakeLists.txt
浏览文件 @
9244cdeb
...
@@ -6,15 +6,26 @@ project(oneflow C CXX)
...
@@ -6,15 +6,26 @@ project(oneflow C CXX)
enable_testing
()
enable_testing
()
set
(
CMAKE_CXX_STANDARD 11
)
set
(
CMAKE_CXX_STANDARD 11
)
set
(
CMAKE_POSITION_INDEPENDENT_CODE ON
)
set
(
CMAKE_POSITION_INDEPENDENT_CODE ON
)
if
(
WIN32
)
set
(
CMAKE_BUILD_TYPE Debug
)
endif
()
set
(
oneflow_src_dir
${
PROJECT_SOURCE_DIR
}
/oneflow
)
set
(
oneflow_src_dir
${
PROJECT_SOURCE_DIR
}
/oneflow
)
set
(
oneflow_cmake_dir
${
PROJECT_SOURCE_DIR
}
/cmake
)
set
(
oneflow_cmake_dir
${
PROJECT_SOURCE_DIR
}
/cmake
)
if
(
WIN32
)
if
(
WIN32
)
else
()
else
()
list
(
APPEND CUDA_NVCC_FLAGS
"-std=c++11 -w"
)
list
(
APPEND CUDA_NVCC_FLAGS
"-std=c++11 -w"
)
endif
()
endif
()
# option
option
(
PREPARE_THIRD_PARTY
"Whether include the third party codes in the solution"
OFF
)
option
(
DOWNLOAD_THIRD_PARTY
"Download and build all third party codes"
OFF
)
set
(
THIRD_PARTY_DIR
"
${
PROJECT_SOURCE_DIR
}
/third_party"
)
if
(
NOT EXISTS
${
THIRD_PARTY_DIR
}
)
message
(
FATAL_ERROR
"Please set third party directory by: -DTHIRD_PARTY_DIR=/your/third_party/path"
)
endif
()
# Different set for different platform
# Different set for different platform
if
(
MSVC
)
if
(
MSVC
)
...
@@ -76,9 +87,6 @@ RELATIVE_PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS
...
@@ -76,9 +87,6 @@ RELATIVE_PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS
cuda_add_library
(
of_protoobj
${
PROTO_SRCS
}
${
PROTO_HDRS
}
)
cuda_add_library
(
of_protoobj
${
PROTO_SRCS
}
${
PROTO_HDRS
}
)
target_link_libraries
(
of_protoobj
${
oneflow_third_party_libs
}
)
target_link_libraries
(
of_protoobj
${
oneflow_third_party_libs
}
)
if
(
DOWNLOAD_THIRD_PARTY
)
add_dependencies
(
of_protoobj
${
oneflow_third_party_dependencies
}
)
endif
()
# cc obj lib
# cc obj lib
include_directories
(
${
oneflow_src_dir
}
)
include_directories
(
${
oneflow_src_dir
}
)
...
...
build_oneflow.bat
0 → 100644
浏览文件 @
9244cdeb
del
build_oneflow
mkdir
build_oneflow
cd
./build_oneflow
cmake
..
-A
x64
msbuild
/p
:Configuration
=
Debug
ALL_BUILD
.vcxproj
cd
..
build_oneflow.sh
0 → 100644
浏览文件 @
9244cdeb
rm
-rf
build_oneflow
mkdir
build_oneflow
cd
./build_oneflow
cmake ..
make
-j
cd
..
build_third_party.bat
0 → 100644
浏览文件 @
9244cdeb
del
build_third_party
mkdir
build_third_party
cd
./build_third_party
cmake
../cmake/third_party
-A
x64
msbuild
/p
:Configuration
=
Debug
ALL_BUILD
.vcxproj
cd
..
build_third_party.sh
0 → 100644
浏览文件 @
9244cdeb
rm
-rf
build_third_party
mkdir
build_third_party
cd
./build_third_party
cmake ../cmake/third_party
make
-j
cd
..
cmake/third_party.cmake
浏览文件 @
9244cdeb
set
(
THIRD_PARTY_DIR
"
${
CMAKE_BINARY_DIR
}
/third_party"
CACHE PATH
"Location where third party headers and libs will be put."
)
mark_as_advanced
(
THIRD_PARTY_DIR
)
if
(
NOT WIN32
)
if
(
NOT WIN32
)
find_package
(
Threads
)
find_package
(
Threads
)
endif
()
endif
()
...
...
cmake/third_party/gflags.cmake
浏览文件 @
9244cdeb
...
@@ -24,10 +24,13 @@ foreach(LIBRARY_NAME ${GFLAGS_LIBRARY_NAMES})
...
@@ -24,10 +24,13 @@ foreach(LIBRARY_NAME ${GFLAGS_LIBRARY_NAMES})
list
(
APPEND GFLAGS_BUILD_STATIC_LIBRARIES
${
GFLAGS_BUILD_LIBRARY_DIR
}
/
${
LIBRARY_NAME
}
)
list
(
APPEND GFLAGS_BUILD_STATIC_LIBRARIES
${
GFLAGS_BUILD_LIBRARY_DIR
}
/
${
LIBRARY_NAME
}
)
endforeach
()
endforeach
()
if
(
PREPARE_THIRD_PARTY
)
ExternalProject_Add
(
gflags
ExternalProject_Add
(
gflags
PREFIX gflags
PREFIX gflags
GIT_REPOSITORY
${
gflags_URL
}
GIT_REPOSITORY
${
gflags_URL
}
GIT_TAG
${
gflags_TAG
}
GIT_TAG
${
gflags_TAG
}
UPDATE_COMMAND
""
BUILD_IN_SOURCE 1
BUILD_IN_SOURCE 1
INSTALL_COMMAND
""
INSTALL_COMMAND
""
CMAKE_CACHE_ARGS
CMAKE_CACHE_ARGS
...
@@ -51,3 +54,5 @@ add_custom_target(gflags_create_library_dir
...
@@ -51,3 +54,5 @@ add_custom_target(gflags_create_library_dir
add_custom_target
(
gflags_copy_libs_to_destination
add_custom_target
(
gflags_copy_libs_to_destination
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
GFLAGS_BUILD_STATIC_LIBRARIES
}
${
GFLAGS_LIBRARY_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
GFLAGS_BUILD_STATIC_LIBRARIES
}
${
GFLAGS_LIBRARY_DIR
}
DEPENDS gflags_create_library_dir
)
DEPENDS gflags_create_library_dir
)
endif
(
PREPARE_THIRD_PARTY
)
cmake/third_party/glog.cmake
浏览文件 @
9244cdeb
...
@@ -31,10 +31,13 @@ set (GLOG_PUBLIC_H
...
@@ -31,10 +31,13 @@ set (GLOG_PUBLIC_H
${
CMAKE_CURRENT_BINARY_DIR
}
/glog/src/glog/src/glog/log_severity.h
${
CMAKE_CURRENT_BINARY_DIR
}
/glog/src/glog/src/glog/log_severity.h
)
)
if
(
PREPARE_THIRD_PARTY
)
ExternalProject_Add
(
glog
ExternalProject_Add
(
glog
PREFIX glog
PREFIX glog
GIT_REPOSITORY
${
glog_URL
}
GIT_REPOSITORY
${
glog_URL
}
GIT_TAG
${
glog_TAG
}
GIT_TAG
${
glog_TAG
}
UPDATE_COMMAND
""
BUILD_IN_SOURCE 1
BUILD_IN_SOURCE 1
INSTALL_COMMAND
""
INSTALL_COMMAND
""
CMAKE_CACHE_ARGS
CMAKE_CACHE_ARGS
...
@@ -66,3 +69,5 @@ add_custom_target(glog_create_library_dir
...
@@ -66,3 +69,5 @@ add_custom_target(glog_create_library_dir
add_custom_target
(
glog_copy_libs_to_destination
add_custom_target
(
glog_copy_libs_to_destination
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
GLOG_BUILD_STATIC_LIBRARIES
}
${
GLOG_LIBRARY_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
GLOG_BUILD_STATIC_LIBRARIES
}
${
GLOG_LIBRARY_DIR
}
DEPENDS glog_create_library_dir
)
DEPENDS glog_create_library_dir
)
endif
(
PREPARE_THIRD_PARTY
)
\ No newline at end of file
cmake/third_party/googletest.cmake
浏览文件 @
9244cdeb
...
@@ -23,10 +23,13 @@ foreach(LIBRARY_NAME ${GOOGLETEST_LIBRARY_NAMES})
...
@@ -23,10 +23,13 @@ foreach(LIBRARY_NAME ${GOOGLETEST_LIBRARY_NAMES})
list
(
APPEND GOOGLETEST_BUILD_STATIC_LIBRARIES
${
GOOGLETEST_BUILD_LIBRARY_DIR
}
/
${
LIBRARY_NAME
}
)
list
(
APPEND GOOGLETEST_BUILD_STATIC_LIBRARIES
${
GOOGLETEST_BUILD_LIBRARY_DIR
}
/
${
LIBRARY_NAME
}
)
endforeach
()
endforeach
()
if
(
PREPARE_THIRD_PARTY
)
ExternalProject_Add
(
googletest
ExternalProject_Add
(
googletest
PREFIX googletest
PREFIX googletest
GIT_REPOSITORY
${
googletest_URL
}
GIT_REPOSITORY
${
googletest_URL
}
GIT_TAG
${
googletest_TAG
}
GIT_TAG
${
googletest_TAG
}
UPDATE_COMMAND
""
BUILD_IN_SOURCE 1
BUILD_IN_SOURCE 1
INSTALL_COMMAND
""
INSTALL_COMMAND
""
CMAKE_CACHE_ARGS
CMAKE_CACHE_ARGS
...
@@ -51,3 +54,5 @@ add_custom_target(googletest_create_library_dir
...
@@ -51,3 +54,5 @@ add_custom_target(googletest_create_library_dir
add_custom_target
(
googletest_copy_libs_to_destination
add_custom_target
(
googletest_copy_libs_to_destination
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
GOOGLETEST_BUILD_STATIC_LIBRARIES
}
${
GOOGLETEST_LIBRARY_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
GOOGLETEST_BUILD_STATIC_LIBRARIES
}
${
GOOGLETEST_LIBRARY_DIR
}
DEPENDS googletest_create_library_dir
)
DEPENDS googletest_create_library_dir
)
endif
(
PREPARE_THIRD_PARTY
)
\ No newline at end of file
cmake/third_party/grpc.cmake
浏览文件 @
9244cdeb
...
@@ -29,11 +29,14 @@ foreach(LIBRARY_NAME ${GRPC_LIBRARY_NAMES})
...
@@ -29,11 +29,14 @@ foreach(LIBRARY_NAME ${GRPC_LIBRARY_NAMES})
list
(
APPEND GRPC_BUILD_STATIC_LIBRARIES
${
GRPC_BUILD_LIBRARY_DIR
}
/
${
LIBRARY_NAME
}
)
list
(
APPEND GRPC_BUILD_STATIC_LIBRARIES
${
GRPC_BUILD_LIBRARY_DIR
}
/
${
LIBRARY_NAME
}
)
endforeach
()
endforeach
()
if
(
PREPARE_THIRD_PARTY
)
ExternalProject_Add
(
grpc
ExternalProject_Add
(
grpc
PREFIX grpc
PREFIX grpc
DEPENDS protobuf zlib
DEPENDS protobuf zlib
GIT_REPOSITORY
${
GRPC_URL
}
GIT_REPOSITORY
${
GRPC_URL
}
GIT_TAG
${
GRPC_TAG
}
GIT_TAG
${
GRPC_TAG
}
UPDATE_COMMAND
""
BUILD_IN_SOURCE 1
BUILD_IN_SOURCE 1
INSTALL_COMMAND
""
INSTALL_COMMAND
""
CMAKE_CACHE_ARGS
CMAKE_CACHE_ARGS
...
@@ -63,3 +66,5 @@ add_custom_target(grpc_create_library_dir
...
@@ -63,3 +66,5 @@ add_custom_target(grpc_create_library_dir
add_custom_target
(
grpc_copy_libs_to_destination
add_custom_target
(
grpc_copy_libs_to_destination
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
GRPC_BUILD_STATIC_LIBRARIES
}
${
GRPC_LIBRARY_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
GRPC_BUILD_STATIC_LIBRARIES
}
${
GRPC_LIBRARY_DIR
}
DEPENDS grpc_create_library_dir
)
DEPENDS grpc_create_library_dir
)
endif
(
PREPARE_THIRD_PARTY
)
\ No newline at end of file
cmake/third_party/protobuf.cmake
浏览文件 @
9244cdeb
...
@@ -31,11 +31,14 @@ endforeach()
...
@@ -31,11 +31,14 @@ endforeach()
set
(
PROTOBUF_BUILD_PROTOC_EXECUTABLE
${
PROTOBUF_BUILD_LIBRARY_DIR
}
/
${
PROTOC_EXECUTABLE_NAME
}
)
set
(
PROTOBUF_BUILD_PROTOC_EXECUTABLE
${
PROTOBUF_BUILD_LIBRARY_DIR
}
/
${
PROTOC_EXECUTABLE_NAME
}
)
set
(
PROTOBUF_PROTOC_EXECUTABLE
${
PROTOBUF_BINARY_DIR
}
/
${
PROTOC_EXECUTABLE_NAME
}
)
set
(
PROTOBUF_PROTOC_EXECUTABLE
${
PROTOBUF_BINARY_DIR
}
/
${
PROTOC_EXECUTABLE_NAME
}
)
if
(
PREPARE_THIRD_PARTY
)
ExternalProject_Add
(
protobuf
ExternalProject_Add
(
protobuf
PREFIX protobuf
PREFIX protobuf
DEPENDS zlib
DEPENDS zlib
GIT_REPOSITORY
${
PROTOBUF_URL
}
GIT_REPOSITORY
${
PROTOBUF_URL
}
GIT_TAG
${
PROTOBUF_TAG
}
GIT_TAG
${
PROTOBUF_TAG
}
UPDATE_COMMAND
""
BUILD_IN_SOURCE 1
BUILD_IN_SOURCE 1
SOURCE_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
/protobuf/src/protobuf
SOURCE_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
/protobuf/src/protobuf
CONFIGURE_COMMAND
${
CMAKE_COMMAND
}
cmake/
CONFIGURE_COMMAND
${
CMAKE_COMMAND
}
cmake/
...
@@ -77,3 +80,5 @@ add_custom_target(protobuf_create_binary_dir
...
@@ -77,3 +80,5 @@ add_custom_target(protobuf_create_binary_dir
add_custom_target
(
protobuf_copy_binary_to_destination
add_custom_target
(
protobuf_copy_binary_to_destination
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
PROTOBUF_BUILD_PROTOC_EXECUTABLE
}
${
PROTOBUF_BINARY_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
PROTOBUF_BUILD_PROTOC_EXECUTABLE
}
${
PROTOBUF_BINARY_DIR
}
DEPENDS protobuf_create_binary_dir
)
DEPENDS protobuf_create_binary_dir
)
endif
(
PREPARE_THIRD_PARTY
)
\ No newline at end of file
cmake/third_party/zlib.cmake
浏览文件 @
9244cdeb
...
@@ -28,10 +28,13 @@ set(ZLIB_HEADERS
...
@@ -28,10 +28,13 @@ set(ZLIB_HEADERS
"
${
ZLIB_INSTALL
}
/include/zlib.h"
"
${
ZLIB_INSTALL
}
/include/zlib.h"
)
)
if
(
PREPARE_THIRD_PARTY
)
ExternalProject_Add
(
zlib
ExternalProject_Add
(
zlib
PREFIX zlib
PREFIX zlib
GIT_REPOSITORY
${
ZLIB_URL
}
GIT_REPOSITORY
${
ZLIB_URL
}
GIT_TAG
${
ZLIB_TAG
}
GIT_TAG
${
ZLIB_TAG
}
UPDATE_COMMAND
""
INSTALL_DIR
${
ZLIB_INSTALL
}
INSTALL_DIR
${
ZLIB_INSTALL
}
BUILD_IN_SOURCE 1
BUILD_IN_SOURCE 1
CMAKE_CACHE_ARGS
CMAKE_CACHE_ARGS
...
@@ -61,3 +64,5 @@ add_custom_target(zlib_create_library_dir
...
@@ -61,3 +64,5 @@ add_custom_target(zlib_create_library_dir
add_custom_target
(
zlib_copy_libs_to_destination
add_custom_target
(
zlib_copy_libs_to_destination
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
ZLIB_BUILD_STATIC_LIBRARIES
}
${
ZLIB_LIBRARY_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
ZLIB_BUILD_STATIC_LIBRARIES
}
${
ZLIB_LIBRARY_DIR
}
DEPENDS zlib_create_library_dir
)
DEPENDS zlib_create_library_dir
)
endif
(
PREPARE_THIRD_PARTY
)
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录