Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
e9594596
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看板
提交
e9594596
编写于
4月 14, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
4月 14, 2020
浏览文件
操作
浏览文件
下载
差异文件
!270 fix complite error while using .so with clang on macos
Merge pull request !270 from SanjayChan/mac_os
上级
d9cd681c
65a49a21
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
64 addition
and
27 deletion
+64
-27
CMakeLists.txt
CMakeLists.txt
+6
-1
build.sh
build.sh
+1
-1
cmake/external_libs/gtest.cmake
cmake/external_libs/gtest.cmake
+2
-2
cmake/external_libs/jpeg_turbo.cmake
cmake/external_libs/jpeg_turbo.cmake
+6
-2
cmake/external_libs/libtiff.cmake
cmake/external_libs/libtiff.cmake
+10
-3
cmake/external_libs/opencv.cmake
cmake/external_libs/opencv.cmake
+9
-4
cmake/external_libs/protobuf.cmake
cmake/external_libs/protobuf.cmake
+5
-1
cmake/external_libs/sqlite.cmake
cmake/external_libs/sqlite.cmake
+5
-1
mindspore/ccsrc/CMakeLists.txt
mindspore/ccsrc/CMakeLists.txt
+12
-9
mindspore/ccsrc/dataset/CMakeLists.txt
mindspore/ccsrc/dataset/CMakeLists.txt
+6
-1
mindspore/ccsrc/kernel/common_utils.cc
mindspore/ccsrc/kernel/common_utils.cc
+2
-2
未找到文件。
CMakeLists.txt
浏览文件 @
e9594596
...
...
@@ -5,8 +5,13 @@ include(${CMAKE_SOURCE_DIR}/cmake/options.cmake)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
CMAKE_SOURCE_DIR
}
/cmake/modules/"
)
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"$ENV{CXXFLAGS} -O2 -Werror -Wno-return-std-move -Wno-unused-private-field -Wno-unused-lambda-capture -Wno-sign-compare -Wno-overloaded-virtual -Wno-unneeded-internal-declaration -Wno-unused-variable -Wno-pessimizing-move -Wno-inconsistent-missing-override -DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2"
)
else
()
set
(
CMAKE_CXX_FLAGS_RELEASE
"$ENV{CXXFLAGS} -O2 -Wl,--allow-shlib-undefined -DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2"
)
endif
()
set
(
CMAKE_CXX_FLAGS_DEBUG
"$ENV{CXXFLAGS} -O0 -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer -Wl,--allow-shlib-undefined -D_LIBCPP_INLINE_VISIBILITY='' -D'_LIBCPP_EXTERN_TEMPLATE(...)=' -DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2 -Wno-cpp"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"$ENV{CXXFLAGS} -O2 -Wl,--allow-shlib-undefined -DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-I/usr/local/include -std=c++17 -Werror -Wall -Wno-deprecated-declarations -fPIC"
)
set
(
CMAKE_EXPORT_COMPILE_COMMANDS ON
)
...
...
build.sh
浏览文件 @
e9594596
...
...
@@ -297,7 +297,7 @@ build_mindspore()
if
[[
"X
$ENABLE_DUMPE2E
"
=
"Xon"
]]
;
then
CMAKE_ARGS
=
"
${
CMAKE_ARGS
}
-DENABLE_DUMP_E2E=ON"
fi
CMAKE_ARGS
=
"
${
CMAKE_ARGS
}
-DENABLE_DUMP_IR=
${
ENABLE_DUMP_IR
^^
}
"
CMAKE_ARGS
=
"
${
CMAKE_ARGS
}
-DENABLE_DUMP_IR=
${
ENABLE_DUMP_IR
}
"
if
[[
"X
$ENABLE_MPI
"
=
"Xon"
]]
;
then
CMAKE_ARGS
=
"
${
CMAKE_ARGS
}
-DENABLE_MPI=ON"
fi
...
...
cmake/external_libs/gtest.cmake
浏览文件 @
e9594596
...
...
@@ -9,5 +9,5 @@ mindspore_add_pkg(gtest
-DCMAKE_MACOSX_RPATH=TRUE -Dgtest_disable_pthreads=ON
)
include_directories
(
${
gtest_INC
}
)
add_library
(
mindspore::gtest ALIAS gtest::gtest
)
file
(
COPY
${
gtest_LIBPATH
}
/libgtest
.so
DESTINATION
${
CMAKE_BINARY_DIR
}
/googletest/googlemock/gtest
)
file
(
COPY
${
gtest_LIBPATH
}
/libgtest_main
.so
DESTINATION
${
CMAKE_BINARY_DIR
}
/googletest/googlemock/gtest
)
file
(
COPY
${
gtest_LIBPATH
}
/libgtest
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
DESTINATION
${
CMAKE_BINARY_DIR
}
/googletest/googlemock/gtest
)
file
(
COPY
${
gtest_LIBPATH
}
/libgtest_main
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
DESTINATION
${
CMAKE_BINARY_DIR
}
/googletest/googlemock/gtest
)
cmake/external_libs/jpeg_turbo.cmake
浏览文件 @
e9594596
set
(
jpeg_turbo_USE_STATIC_LIBS ON
)
set
(
jpeg_turbo_CFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2"
)
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
set
(
jpeg_turbo_CFLAGS
"-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2"
)
else
()
set
(
jpeg_turbo_CFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2"
)
endif
()
set
(
jpeg_turbo_LDFLAGS
"-Wl,-z,relro,-z,now,-z,noexecstack"
)
mindspore_add_pkg
(
jpeg_turbo
VER 2.0.4
...
...
cmake/external_libs/libtiff.cmake
浏览文件 @
e9594596
set
(
tiff_CXXFLAGS
"-fstack-protector-all -Wno-maybe
-uninitialized -Wno-unused-parameter -Wno-unused-result \
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
set
(
tiff_CXXFLAGS
"-fstack-protector-all -Wno
-uninitialized -Wno-unused-parameter -Wno-unused-result \
-Wno-unused-but-set-variable -fPIC -D_FORTIFY_SOURCE=2 -O2"
)
set
(
tiff_CFLAGS
"-fstack-protector-all -Wno-maybe
-uninitialized -Wno-unused-parameter -Wno-unused-result \
set
(
tiff_CFLAGS
"-fstack-protector-all -Wno
-uninitialized -Wno-unused-parameter -Wno-unused-result \
-Wno-unused-but-set-variable -fPIC -D_FORTIFY_SOURCE=2 -O2"
)
else
()
set
(
tiff_CXXFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-unused-result \
-Wno-unused-but-set-variable -fPIC -D_FORTIFY_SOURCE=2 -O2"
)
set
(
tiff_CFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-unused-result \
-Wno-unused-but-set-variable -fPIC -D_FORTIFY_SOURCE=2 -O2"
)
endif
()
set
(
tiff_LDFLAGS
"-Wl,-z,relro,-z,now,-z,noexecstack"
)
mindspore_add_pkg
(
tiff
...
...
cmake/external_libs/opencv.cmake
浏览文件 @
e9594596
set
(
opencv_CXXFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2"
)
set
(
opencv_CFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2"
)
set
(
opencv_LDFLAGS
"-Wl,-z,relro,-z,now,-z,noexecstack"
)
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
set
(
opencv_CXXFLAGS
"-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2"
)
set
(
opencv_CFLAGS
"-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2"
)
set
(
opencv_LDFLAGS
"-Wl"
)
else
()
set
(
opencv_CXXFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2"
)
set
(
opencv_CFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2"
)
set
(
opencv_LDFLAGS
"-Wl,-z,relro,-z,now,-z,noexecstack"
)
endif
()
mindspore_add_pkg
(
opencv
VER 4.2.0
...
...
cmake/external_libs/protobuf.cmake
浏览文件 @
e9594596
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"
)
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
set
(
protobuf_CXXFLAGS
"-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2"
)
else
()
set
(
protobuf_CXXFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2"
)
endif
()
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
}
)
...
...
cmake/external_libs/sqlite.cmake
浏览文件 @
e9594596
set
(
sqlite_USE_STATIC_LIBS ON
)
set
(
sqlite_CXXFLAGS
)
set
(
sqlite_CFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2"
)
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
set
(
sqlite_CFLAGS
"-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2"
)
else
()
set
(
sqlite_CFLAGS
"-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2"
)
endif
()
set
(
sqlite_LDFLAGS
"-Wl,-z,relro,-z,now,-z,noexecstack"
)
mindspore_add_pkg
(
sqlite
...
...
mindspore/ccsrc/CMakeLists.txt
浏览文件 @
e9594596
...
...
@@ -330,10 +330,10 @@ set(PYTHON_MODULE_SOURCE
set
(
CMAKE_BUILD_WITH_INSTALL_RPATH TRUE
)
pybind11_add_module
(
_c_expression
${
PYTHON_MODULE_SOURCE
}
)
target_link_options
(
_c_expression PRIVATE -Wl,-init,mindspore_log_init
)
MESSAGE
(
STATUS
"operation system is
${
CMAKE_SYSTEM
}
"
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"Linux"
)
target_link_options
(
_c_expression PRIVATE -Wl,-init,mindspore_log_init
)
set
(
ORIGIN_PATH $ORIGIN
)
elseif
(
CMAKE_SYSTEM_NAME MATCHES
"Darwin"
)
set_target_properties
(
_c_expression PROPERTIES MACOSX_RPATH ON
)
...
...
@@ -498,7 +498,7 @@ set(MS_LIB_PATH ${CMAKE_SOURCE_DIR}/build/package/mindspore/lib/)
add_custom_target
(
add_ms_lib ALL
COMMAND mkdir -pv
${
MS_LIB_PATH
}
COMMAND cp
${
MS_CCSRC_BUILD_PATH
}
/_c_expression*
${
MS_PACK_PATH
}
COMMAND cp
${
MS_CCSRC_BUILD_PATH
}
/libmindspore_gvar
.so
${
MS_LIB_PATH
}
COMMAND cp
${
MS_CCSRC_BUILD_PATH
}
/libmindspore_gvar
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
${
MS_LIB_PATH
}
)
add_dependencies
(
add_ms_lib _c_expression
)
...
...
@@ -550,9 +550,11 @@ if (ENABLE_GPU)
endif
()
if
(
ENABLE_CPU
)
add_custom_target
(
add_cpu_lib ALL
COMMAND cp
${
onednn_LIBPATH
}
/libdnnl.so.1.1
${
MS_LIB_PATH
}
/libdnnl.so.1
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"Darwin"
)
add_custom_target
(
add_cpu_lib ALL COMMAND cp
${
onednn_LIBPATH
}
/libdnnl.1.1.dylib
${
MS_LIB_PATH
}
/libdnnl.1.1.dylib
)
else
()
add_custom_target
(
add_cpu_lib ALL COMMAND cp
${
onednn_LIBPATH
}
/libdnnl.so.1.1
${
MS_LIB_PATH
}
/libdnnl.so.1
)
endif
()
add_dependencies
(
add_cpu_lib add_ms_lib
)
endif
()
...
...
@@ -574,8 +576,9 @@ endif()
if
(
USE_GLOG
)
target_link_libraries
(
_c_expression PRIVATE mindspore::glog
)
add_custom_target
(
add_glog_lib ALL
COMMAND cp
${
glog_LIBPATH
}
/libglog*.so.0
${
MS_LIB_PATH
}
)
add_dependencies
(
add_glog_lib add_ms_lib
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"Darwin"
)
add_custom_target
(
add_glog_lib ALL COMMAND cp
${
glog_LIBPATH
}
/libglog*.dylib
${
MS_LIB_PATH
}
)
else
()
add_custom_target
(
add_glog_lib ALL COMMAND cp
${
glog_LIBPATH
}
/libglog*.so.0
${
MS_LIB_PATH
}
)
endif
()
endif
()
mindspore/ccsrc/dataset/CMakeLists.txt
浏览文件 @
e9594596
...
...
@@ -3,7 +3,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder")
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-switch"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-sequence-point"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-unused-variable"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-maybe-uninitialized"
)
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-uninitialized"
)
else
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-maybe-uninitialized"
)
endif
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-format"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-attributes"
)
...
...
mindspore/ccsrc/kernel/common_utils.cc
浏览文件 @
e9594596
...
...
@@ -89,13 +89,13 @@ bool IsAtomicNode(const CNodePtr &kernel_node) {
parameters_indexs
.
push_back
(
0
);
}
}
std
::
vector
<
size_
t
>
clean_output_indexs
;
std
::
vector
<
in
t
>
clean_output_indexs
;
// in parameters data sort as input->workspace->output
size_t
index
=
0
;
while
(
index
<
output_num
)
{
if
(
parameters_indexs
[
input_num
+
workspace_num
+
index
]
==
1
)
{
atomic_flag
=
true
;
clean_output_indexs
.
push_back
(
index
);
clean_output_indexs
.
push_back
(
SizeToInt
(
index
)
);
}
index
++
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录