Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
b5ca2a3e
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b5ca2a3e
编写于
4月 02, 2020
作者:
D
dengwentao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
:modify protobuf cmake
上级
aaa8d9ed
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
28 addition
and
26 deletion
+28
-26
cmake/external_libs/protobuf.cmake
cmake/external_libs/protobuf.cmake
+15
-14
cmake/utils.cmake
cmake/utils.cmake
+5
-3
graphengine
graphengine
+1
-1
mindspore/ccsrc/CMakeLists.txt
mindspore/ccsrc/CMakeLists.txt
+3
-4
mindspore/ccsrc/dataset/CMakeLists.txt
mindspore/ccsrc/dataset/CMakeLists.txt
+1
-1
mindspore/ccsrc/dataset/engine/datasetops/source/CMakeLists.txt
...ore/ccsrc/dataset/engine/datasetops/source/CMakeLists.txt
+1
-1
mindspore/ccsrc/dataset/engine/tdt/CMakeLists.txt
mindspore/ccsrc/dataset/engine/tdt/CMakeLists.txt
+1
-1
mindspore/ccsrc/mindrecord/CMakeLists.txt
mindspore/ccsrc/mindrecord/CMakeLists.txt
+1
-1
未找到文件。
cmake/external_libs/protobuf.cmake
浏览文件 @
b5ca2a3e
mindspore_add_pkg
(
protobuf
VER 3.8.0
HEAD_ONLY ./
URL https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz
MD5 3d9e32700639618a4d2d342c99d4507a
)
set
(
protobuf_BUILD_TESTS OFF CACHE BOOL
"Disable protobuf test"
)
set
(
protobuf_BUILD_SHARED_LIBS OFF CACHE BOOL
"Gen shared library"
)
set
(
protobuf_USE_STATIC_LIBS ON
)
set
(
protobuf_CXXFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2"
)
set
(
protobuf_LDFLAGS
"-Wl,-z,relro,-z,now,-z,noexecstack"
)
set
(
_ms_tmp_CMAKE_CXX_FLAGS
${
CMAKE_CXX_FLAGS
}
)
set
(
CMAKE_CXX_FLAGS
${
_ms_tmp_CMAKE_CXX_FLAGS
}
)
string
(
REPLACE
" -Wall"
""
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
)
string
(
REPLACE
" -Werror"
""
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
)
add_subdirectory
(
${
protobuf_DIRPATH
}
/cmake
${
protobuf_DIRPATH
}
/build
)
set
(
CMAKE_CXX_FLAGS
${
_ms_tmp_CMAKE_CXX_FLAGS
}
)
mindspore_add_pkg
(
protobuf
VER 3.8.0
LIBS protobuf
EXE protoc
URL https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz
MD5 3d9e32700639618a4d2d342c99d4507a
CMAKE_PATH cmake/
CMAKE_OPTION -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF
)
set
(
PROTOBUF_LIBRARY protobuf::libprotobuf
)
include_directories
(
${
protobuf_DIRPATH
}
/src
)
add_library
(
mindspore::protobuf ALIAS libprotobuf
)
include_directories
(
${
protobuf_INC
}
)
add_library
(
mindspore::protobuf ALIAS protobuf::protobuf
)
set
(
CMAKE_CXX_FLAGS
${
_ms_tmp_CMAKE_CXX_FLAGS
}
)
function
(
ms_protobuf_generate c_var h_var
)
if
(
NOT ARGN
)
...
...
cmake/utils.cmake
浏览文件 @
b5ca2a3e
...
...
@@ -192,10 +192,12 @@ set(MS_FIND_NO_DEFAULT_PATH ${MS_FIND_NO_DEFAULT_PATH} PARENT_SCOPE)
function
(
mindspore_add_pkg pkg_name
)
set
(
options
)
set
(
oneValueArgs URL MD5 GIT_REPOSITORY GIT_TAG VER EXE DIR HEAD_ONLY
)
set
(
oneValueArgs URL MD5 GIT_REPOSITORY GIT_TAG VER EXE DIR HEAD_ONLY
CMAKE_PATH
)
set
(
multiValueArgs CMAKE_OPTION LIBS PRE_CONFIGURE_COMMAND CONFIGURE_COMMAND BUILD_OPTION INSTALL_INCS INSTALL_LIBS PATCHES
)
cmake_parse_arguments
(
PKG
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
if
(
NOT PKG_CMAKE_PATH
)
set
(
PKG_CMAKE_PATH .
)
endif
()
set
(
__FIND_PKG_NAME
${
pkg_name
}
)
string
(
TOLOWER
${
pkg_name
}
pkg_name
)
message
(
"pkg name:
${
__FIND_PKG_NAME
}
,
${
pkg_name
}
"
)
...
...
@@ -304,7 +306,7 @@ function(mindspore_add_pkg pkg_name )
__exec_cmd
(
COMMAND
${
CMAKE_COMMAND
}
${
PKG_CMAKE_OPTION
}
-G
${
CMAKE_GENERATOR
}
${${
pkg_name
}
_CMAKE_CFLAGS
}
${${
pkg_name
}
_CMAKE_CXXFLAGS
}
${${
pkg_name
}
_CMAKE_LDFLAGS
}
-DCMAKE_INSTALL_PREFIX=
${${
pkg_name
}
_BASE_DIR
}
..
-DCMAKE_INSTALL_PREFIX=
${${
pkg_name
}
_BASE_DIR
}
${${
pkg_name
}
_SOURCE_DIR
}
/
${
PKG_CMAKE_PATH
}
WORKING_DIRECTORY
${${
pkg_name
}
_SOURCE_DIR
}
/_build
)
__exec_cmd
(
COMMAND
${
CMAKE_COMMAND
}
--build . --target install -- -j
${
THNUM
}
...
...
graphengine
@
40e9f6f8
Subproject commit
5bd0dc1ed59a9ec4ea6a602bf1385c59d845f922
Subproject commit
40e9f6f834469d2d228f9782a0a41f95be94d429
mindspore/ccsrc/CMakeLists.txt
浏览文件 @
b5ca2a3e
...
...
@@ -157,10 +157,9 @@ file(GLOB_RECURSE MEM_REUSE_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
if
(
NOT ENABLE_DUMP_E2E
)
list
(
REMOVE_ITEM MINDSPORE_SRC_LIST
"debug/e2e_dump.cc"
)
endif
()
file
(
COPY
"
${
ms_onnx_INC
}
/onnx/onnx.proto"
DESTINATION
${
CMAKE_CURRENT_SOURCE_DIR
}
)
file
(
GLOB_RECURSE ONNX_PROTO RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/onnx.proto"
)
message
(
“onnx proto path is :
${
ONNX_PROTO
}
”
)
message
(
"onnx proto path is :
${
ONNX_PROTO
}
"
)
ms_protobuf_generate
(
ONNX_PROTO_SRCS ONNX_PROTO_HDRS
${
ONNX_PROTO
}
)
list
(
APPEND MINDSPORE_PROTO_LIST
${
ONNX_PROTO_SRCS
}
)
...
...
@@ -319,7 +318,7 @@ target_link_libraries(mindspore dl)
target_link_libraries
(
mindspore mindspore::flatbuffers
)
# link protobuf
if
(
ENABLE_D
)
target_link_libraries
(
mindspore
protobuf::lib
protobuf
)
target_link_libraries
(
mindspore
mindspore::
protobuf
)
endif
()
# set c_expression building
...
...
@@ -464,7 +463,7 @@ if(ENABLE_GPU)
endif
()
if
(
ENABLE_DUMP_PROTO
)
target_link_libraries
(
_c_expression PRIVATE
protobuf::lib
protobuf
)
target_link_libraries
(
_c_expression PRIVATE
mindspore::
protobuf
)
endif
()
if
(
ENABLE_GPU
)
...
...
mindspore/ccsrc/dataset/CMakeLists.txt
浏览文件 @
b5ca2a3e
...
...
@@ -76,7 +76,7 @@ set_target_properties(_c_dataengine PROPERTIES
################# Link with external libraries ########################
target_link_libraries
(
_c_dataengine PRIVATE mindspore mindspore_gvar
)
target_link_libraries
(
_c_dataengine PRIVATE mindspore::pybind11_module -ldl
protobuf::lib
protobuf
${
SECUREC_LIBRARY
}
)
target_link_libraries
(
_c_dataengine PRIVATE mindspore::pybind11_module -ldl
mindspore::
protobuf
${
SECUREC_LIBRARY
}
)
target_link_libraries
(
_c_dataengine PUBLIC mindspore::jpeg_turbo mindspore::opencv_core mindspore::opencv_imgcodecs
mindspore::opencv_imgproc
)
if
(
ENABLE_GPUQUE
)
...
...
mindspore/ccsrc/dataset/engine/datasetops/source/CMakeLists.txt
浏览文件 @
b5ca2a3e
...
...
@@ -20,4 +20,4 @@ add_library(engine-datasetops-source OBJECT
celeba_op.cc
)
add_dependencies
(
engine-datasetops-source
protobuf::lib
protobuf
)
add_dependencies
(
engine-datasetops-source
mindspore::
protobuf
)
mindspore/ccsrc/dataset/engine/tdt/CMakeLists.txt
浏览文件 @
b5ca2a3e
...
...
@@ -4,4 +4,4 @@ add_library(engine-tdt OBJECT
${
FEATURE_SRCS
}
)
add_dependencies
(
engine-tdt
protobuf::lib
protobuf
)
add_dependencies
(
engine-tdt
mindspore::
protobuf
)
mindspore/ccsrc/mindrecord/CMakeLists.txt
浏览文件 @
b5ca2a3e
...
...
@@ -26,7 +26,7 @@ set_target_properties(_c_mindrecord PROPERTIES
)
# add link library
target_link_libraries
(
_c_mindrecord PRIVATE mindspore::sqlite
${
PYTHON_LIB
}
${
SECUREC_LIBRARY
}
mindspore mindspore_gvar
protobuf::lib
protobuf
)
target_link_libraries
(
_c_mindrecord PRIVATE mindspore::sqlite
${
PYTHON_LIB
}
${
SECUREC_LIBRARY
}
mindspore mindspore_gvar
mindspore::
protobuf
)
if
(
USE_GLOG
)
target_link_libraries
(
_c_mindrecord PRIVATE mindspore::glog
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录