Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
ff464bbc
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看板
提交
ff464bbc
编写于
4月 16, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
4月 16, 2020
浏览文件
操作
浏览文件
下载
差异文件
!397 [MS]support building and packaging on windows 10
Merge pull request !397 from chenjianping/building-on-windows-3
上级
c84385d7
c8da1cf8
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
54 addition
and
10 deletion
+54
-10
README.md
README.md
+1
-0
build.bat
build.bat
+2
-2
cmake/external_libs/libtiff.cmake
cmake/external_libs/libtiff.cmake
+3
-0
cmake/external_libs/opencv.cmake
cmake/external_libs/opencv.cmake
+3
-0
cmake/package.cmake
cmake/package.cmake
+23
-2
mindspore/ccsrc/CMakeLists.txt
mindspore/ccsrc/CMakeLists.txt
+9
-1
mindspore/ops/_op_impl/__init__.py
mindspore/ops/_op_impl/__init__.py
+4
-2
setup.py
setup.py
+6
-0
third_party/securec/CMakeLists.txt
third_party/securec/CMakeLists.txt
+3
-3
未找到文件。
README.md
浏览文件 @
ff464bbc
...
...
@@ -69,6 +69,7 @@ MindSpore offers build options across multiple backends:
| GPU CUDA 9.2 | Ubuntu-x86 | ✔️ |
| GPU CUDA 10.1 | Ubuntu-x86 | ✔️ |
| CPU | Ubuntu-x86 | ✔️ |
| CPU | Windows-x86 | ✔️ |
For installation using
`pip`
, take
`CPU`
and
`Ubuntu-x86`
build version as an example:
...
...
build.bat
浏览文件 @
ff464bbc
...
...
@@ -21,9 +21,9 @@ IF NOT %errorlevel% == 0 (
)
IF
"
%
1
%
"
==
""
(
cmake
--build
.
--target
all
--
-j
6
cmake
--build
.
--target
package
--
-j
6
)
ELSE
(
cmake
--build
.
--target
all
--
-j
%
1
%
cmake
--build
.
--target
package
--
-j
%
1
%
)
IF
NOT
%errorlevel%
==
0
(
goto
run_fail
...
...
cmake/external_libs/libtiff.cmake
浏览文件 @
ff464bbc
...
...
@@ -8,6 +8,9 @@ else()
-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"
)
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Windows"
)
set
(
tiff_CFLAGS
"
${
tiff_CFLAGS
}
-Wno-int-to-pointer-cast -Wno-implicit-fallthrough -Wno-pointer-to-int-cast"
)
endif
()
endif
()
set
(
tiff_LDFLAGS
"-Wl,-z,relro,-z,now,-z,noexecstack"
)
...
...
cmake/external_libs/opencv.cmake
浏览文件 @
ff464bbc
...
...
@@ -5,6 +5,8 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
elseif
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Windows"
)
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_CXXFLAGS
"
${
opencv_CXXFLAGS
}
-Wno-attributes -Wno-unknown-pragmas"
)
set
(
opencv_CXXFLAGS
"
${
opencv_CXXFLAGS
}
-Wno-unused-value -Wno-implicit-fallthrough"
)
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"
)
...
...
@@ -28,6 +30,7 @@ if (WIN32)
-DBUILD_opencv_apps=OFF
-DCMAKE_SKIP_RPATH=TRUE
-DBUILD_opencv_python3=OFF
-DBUILD_opencv_videoio=OFF
-DWITH_FFMPEG=OFF
-DWITH_TIFF=ON
-DBUILD_TIFF=OFF
...
...
cmake/package.cmake
浏览文件 @
ff464bbc
...
...
@@ -30,9 +30,18 @@ include(CPack)
# set install path
set
(
INSTALL_LIB_DIR
${
CMAKE_INSTALL_LIBDIR
}
CACHE PATH
"Installation directory for libraries"
)
set
(
INSTALL_PY_DIR
"."
)
set
(
INSTALL_LIB_DIR
"lib"
)
set
(
INSTALL_BASE_DIR
"."
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"Windows"
)
set
(
INSTALL_LIB_DIR
"."
)
set
(
onednn_LIBPATH
${
onednn_LIBPATH
}
/../bin/
)
set
(
glog_LIBPATH
${
glog_LIBPATH
}
/../bin/
)
set
(
opencv_LIBPATH
${
opencv_LIBPATH
}
/../bin/
)
set
(
jpeg_turbo_LIBPATH
${
jpeg_turbo_LIBPATH
}
/../bin/
)
else
()
set
(
INSTALL_LIB_DIR
"lib"
)
endif
()
# set package files
install
(
TARGETS _c_expression
...
...
@@ -80,7 +89,7 @@ if (ENABLE_CPU)
elseif
(
CMAKE_SYSTEM_NAME MATCHES
"Darwin"
)
file
(
GLOB_RECURSE DNNL_LIB_LIST
${
onednn_LIBPATH
}
/libdnnl*
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
*
)
elseif
(
CMAKE_SYSTEM_NAME MATCHES
"Windows"
)
file
(
GLOB_RECURSE DNNL_LIB_LIST
${
onednn_LIBPATH
}
/dnnl.
lib
)
file
(
GLOB_RECURSE DNNL_LIB_LIST
${
onednn_LIBPATH
}
/dnnl.
dll
)
endif
()
install
(
FILES
${
DNNL_LIB_LIST
}
...
...
@@ -140,6 +149,18 @@ if (NOT ENABLE_GE)
endif
()
endif
()
if
(
CMAKE_SYSTEM_NAME MATCHES
"Windows"
)
get_filename_component
(
CXX_DIR
${
CMAKE_CXX_COMPILER
}
PATH
)
file
(
GLOB CXX_LIB_LIST
${
CXX_DIR
}
/*.dll
)
file
(
GLOB JPEG_LIB_LIST
${
jpeg_turbo_LIBPATH
}
/*.dll
)
file
(
GLOB SQLITE_LIB_LIST
${
sqlite_LIBPATH
}
/*.dll
)
install
(
FILES
${
CXX_LIB_LIST
}
${
JPEG_LIB_LIST
}
${
SQLITE_LIB_LIST
}
DESTINATION
${
INSTALL_LIB_DIR
}
COMPONENT mindspore
)
endif
()
# set python files
file
(
GLOB MS_PY_LIST
${
CMAKE_SOURCE_DIR
}
/mindspore/*.py
)
install
(
...
...
mindspore/ccsrc/CMakeLists.txt
浏览文件 @
ff464bbc
...
...
@@ -533,5 +533,13 @@ endif()
if
(
ENABLE_MINDDATA
)
add_subdirectory
(
mindrecord
)
add_subdirectory
(
dataset
)
if
(
WIN32
)
set
(
_md_tmp_CMAKE_CXX_FLAGS_RELEASE
${
CMAKE_CXX_FLAGS_RELEASE
}
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"$ENV{CXXFLAGS} -O0 -Wl,--allow-shlib-undefined -DHALF_ENABLE_CPP11_USER_LITERALS=0"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
-D_FORTIFY_SOURCE=2"
)
add_subdirectory
(
dataset
)
set
(
CMAKE_CXX_FLAGS_RELEASE
${
_md_tmp_CMAKE_CXX_FLAGS_RELEASE
}
)
else
()
add_subdirectory
(
dataset
)
endif
()
endif
()
mindspore/ops/_op_impl/__init__.py
浏览文件 @
ff464bbc
...
...
@@ -14,8 +14,10 @@
# ============================================================================
"""Operators info register."""
from
.akg.gpu
import
*
from
.tbe
import
*
import
platform
from
.aicpu
import
*
if
"Windows"
not
in
platform
.
system
():
from
.akg.gpu
import
*
from
.tbe
import
*
__all__
=
[]
setup.py
浏览文件 @
ff464bbc
...
...
@@ -17,6 +17,7 @@
"""setup package."""
import
os
import
stat
import
platform
from
setuptools
import
setup
,
find_packages
from
setuptools.command.egg_info
import
egg_info
...
...
@@ -97,6 +98,8 @@ required_package = [
package_data
=
{
''
:
[
'*.so*'
,
'*.pyd'
,
'*.dll'
,
'lib/*.so*'
,
'lib/*.a'
,
'.commit_id'
,
...
...
@@ -111,6 +114,9 @@ def update_permissions(path):
Args:
path (str): Target directory path.
"""
if
platform
.
system
()
==
"Windows"
:
return
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
path
):
for
dirname
in
dirnames
:
dir_fullpath
=
os
.
path
.
join
(
dirpath
,
dirname
)
...
...
third_party/securec/CMakeLists.txt
浏览文件 @
ff464bbc
SET
(
CMAKE_BUILD_TYPE
"Debug"
)
if
(
WIN32
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"Windows"
)
SET
(
CMAKE_C_FLAGS_DEBUG
"$ENV{CFLAGS} -fPIC -O0 -Wall -Wno-deprecated-declarations -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer"
)
else
()
SET
(
CMAKE_C_FLAGS_DEBUG
"$ENV{CFLAGS} -fPIC -O0 -Wall -Wno-deprecated-declarations -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer -D_LIBCPP_INLINE_VISIBILITY='' -D'_LIBCPP_EXTERN_TEMPLATE(...)='"
)
...
...
@@ -8,8 +8,8 @@ SET(CMAKE_C_FLAGS_RELEASE "$ENV{CFLAGS} -fPIC -O3 -Wall -Wno-deprecated-declarat
set
(
CMAKE_EXPORT_COMPILE_COMMANDS ON
)
#add flags
if
(
WIN32
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-I/usr/local/include"
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"Windows"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-I/usr/local/include
-Wno-attributes
"
)
else
()
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-I/usr/local/include -Werror"
)
endif
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录