Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
akg
提交
e53d6452
A
akg
项目概览
MindSpore
/
akg
通知
58
Star
7
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
akg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e53d6452
编写于
6月 22, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
6月 22, 2020
浏览文件
操作
浏览文件
下载
差异文件
!7 in incremental compilation, patching only first
Merge pull request !7 from peiwenfang/0622_update_cmake
上级
7d2b856e
623f8ed4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
64 deletion
+13
-64
CMakeLists.txt
CMakeLists.txt
+1
-1
cmake/external_libs/isl.cmake
cmake/external_libs/isl.cmake
+0
-2
cmake/utils.cmake
cmake/utils.cmake
+12
-61
未找到文件。
CMakeLists.txt
浏览文件 @
e53d6452
...
...
@@ -37,7 +37,7 @@ else()
set
(
TVM_DIR
"
${
CMAKE_BINARY_DIR
}
/ktvm"
)
endif
()
set
(
ISL_DIR
"
${
CMAKE_BINARY_DIR
}
/
_deps/isl-src
"
)
set
(
ISL_DIR
"
${
CMAKE_BINARY_DIR
}
/
isl
"
)
file
(
COPY
${
AKG_SOURCE_DIR
}
/python/akg DESTINATION
${
CMAKE_CURRENT_BINARY_DIR
}
)
...
...
cmake/external_libs/isl.cmake
浏览文件 @
e53d6452
set
(
isl_CXXFLAGS
"-D_FORTIFY_SOURCE=2 -O2"
)
set
(
isl_CFLAGS
"-D_FORTIFY_SOURCE=2 -O2"
)
mindspore_add_pkg
(
isl
VER 0.22
URL http://isl.gforge.inria.fr/isl-0.22.tar.gz
...
...
cmake/utils.cmake
浏览文件 @
e53d6452
...
...
@@ -208,14 +208,6 @@ function(mindspore_add_pkg pkg_name )
set
(
multiValueArgs CMAKE_OPTION LIBS PRE_CONFIGURE_COMMAND CONFIGURE_COMMAND BUILD_OPTION INSTALL_INCS INSTALL_LIBS PATCHES SUBMODULES SOURCEMODULES
)
cmake_parse_arguments
(
PKG
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
if
(
NOT PKG_LIB_PATH
)
set
(
PKG_LIB_PATH lib
)
endif
()
if
(
NOT PKG_EXE
)
set
(
PKG_EXE 0
)
endif
()
set
(
__FIND_PKG_NAME
${
pkg_name
}
)
string
(
TOLOWER
${
pkg_name
}
pkg_name
)
message
(
"pkg name:
${
__FIND_PKG_NAME
}
,
${
pkg_name
}
"
)
...
...
@@ -236,37 +228,9 @@ function(mindspore_add_pkg pkg_name )
message
(
"
${
pkg_name
}
config hash:
${${
pkg_name
}
_CONFIG_HASH
}
"
)
set
(
${
pkg_name
}
_BASE_DIR
${
_MS_LIB_CACHE
}
/
${
pkg_name
}
_
${${
pkg_name
}
_CONFIG_HASH
}
)
set
(
${
pkg_name
}
_BASE_DIR
${
_MS_LIB_CACHE
}
/
${
pkg_name
}
)
set
(
${
pkg_name
}
_DIRPATH
${${
pkg_name
}
_BASE_DIR
}
CACHE STRING INTERNAL
)
if
(
EXISTS
${${
pkg_name
}
_BASE_DIR
}
/options.txt AND PKG_HEAD_ONLY
)
set
(
${
pkg_name
}
_INC
${${
pkg_name
}
_BASE_DIR
}
/
${
PKG_HEAD_ONLY
}
PARENT_SCOPE
)
add_library
(
${
pkg_name
}
INTERFACE
)
target_include_directories
(
${
pkg_name
}
INTERFACE
${${
pkg_name
}
_INC
}
)
if
(
${
PKG_RELEASE
}
)
__find_pkg_then_add_target
(
${
pkg_name
}
${
PKG_EXE
}
${
PKG_LIB_PATH
}
${
PKG_LIBS
}
)
endif
()
return
()
endif
()
set
(
${
__FIND_PKG_NAME
}
_ROOT
${${
pkg_name
}
_BASE_DIR
}
)
set
(
${
__FIND_PKG_NAME
}
_ROOT
${${
pkg_name
}
_BASE_DIR
}
PARENT_SCOPE
)
if
(
PKG_LIBS
)
__find_pkg_then_add_target
(
${
pkg_name
}
${
PKG_EXE
}
${
PKG_LIB_PATH
}
${
PKG_LIBS
}
)
if
(
${
pkg_name
}
_LIBS
)
set
(
${
pkg_name
}
_INC
${${
pkg_name
}
_BASE_DIR
}
/include PARENT_SCOPE
)
message
(
"Found libs:
${${
pkg_name
}
_LIBS
}
"
)
return
()
endif
()
elseif
(
NOT PKG_HEAD_ONLY
)
find_package
(
${
__FIND_PKG_NAME
}
${
PKG_VER
}
${
MS_FIND_NO_DEFAULT_PATH
}
)
if
(
${
__FIND_PKG_NAME
}
_FOUND
)
set
(
${
pkg_name
}
_INC
${${
pkg_name
}
_BASE_DIR
}
/include PARENT_SCOPE
)
message
(
"Found pkg:
${
__FIND_PKG_NAME
}
"
)
return
()
endif
()
endif
()
if
(
NOT PKG_DIR
)
if
(
PKG_GIT_REPOSITORY
)
__download_pkg_with_git
(
${
pkg_name
}
${
PKG_GIT_REPOSITORY
}
${
PKG_GIT_TAG
}
${
PKG_MD5
}
)
...
...
@@ -283,21 +247,27 @@ function(mindspore_add_pkg pkg_name )
else
()
set
(
${
pkg_name
}
_SOURCE_DIR
${
PKG_DIR
}
)
endif
()
file
(
WRITE
${${
pkg_name
}
_BASE_DIR
}
/options.txt
${${
pkg_name
}
_CONFIG_TXT
}
)
message
(
"
${
pkg_name
}
_SOURCE_DIR :
${${
pkg_name
}
_SOURCE_DIR
}
"
)
set
(
${
pkg_name
}
_PATCHED_DIR
${
CMAKE_BINARY_DIR
}
/
${
pkg_name
}
)
if
(
EXISTS
${${
pkg_name
}
_PATCHED_DIR
}
)
file
(
REMOVE_RECURSE
${${
pkg_name
}
_PATCHED_DIR
}
)
endif
()
file
(
MAKE_DIRECTORY
"
${
CMAKE_BINARY_DIR
}
/
${
pkg_name
}
"
)
file
(
COPY
${${
pkg_name
}
_SOURCE_DIR
}
/ DESTINATION
${${
pkg_name
}
_PATCHED_DIR
}
)
message
(
"
${
pkg_name
}
_PATCHED_DIR :
${${
pkg_name
}
_PATCHED_DIR
}
"
)
foreach
(
_PATCH_FILE
${
PKG_PATCHES
}
)
get_filename_component
(
_PATCH_FILE_NAME
${
_PATCH_FILE
}
NAME
)
set
(
_LF_PATCH_FILE
${
CMAKE_BINARY_DIR
}
/_ms_patch/
${
_PATCH_FILE_NAME
}
)
configure_file
(
${
_PATCH_FILE
}
${
_LF_PATCH_FILE
}
NEWLINE_STYLE LF
)
message
(
"patching
${${
pkg_name
}
_SOURCE_DIR
}
-p1 <
${
_LF_PATCH_FILE
}
"
)
execute_process
(
COMMAND patch -p1 INPUT_FILE
${
_LF_PATCH_FILE
}
WORKING_DIRECTORY
${${
pkg_name
}
_SOURCE
_DIR
}
RESULT_VARIABLE Result
)
WORKING_DIRECTORY
${${
pkg_name
}
_PATCHED
_DIR
}
RESULT_VARIABLE Result
)
if
(
NOT Result EQUAL
"0"
)
message
(
FATAL_ERROR
"Failed patch:
${
_LF_PATCH_FILE
}
"
)
endif
()
endif
()
endforeach
(
_PATCH_FILE
)
file
(
LOCK
${${
pkg_name
}
_BASE_DIR
}
DIRECTORY GUARD FUNCTION RESULT_VARIABLE
${
pkg_name
}
_LOCK_RET TIMEOUT 600
)
...
...
@@ -305,23 +275,4 @@ function(mindspore_add_pkg pkg_name )
message
(
FATAL_ERROR
"error! when try lock
${${
pkg_name
}
_BASE_DIR
}
:
${${
pkg_name
}
_LOCK_RET
}
"
)
endif
()
if
(
PKG_CUSTOM_CMAKE
)
file
(
GLOB
${
pkg_name
}
_cmake
${
PKG_CUSTOM_CMAKE
}
/CMakeLists.txt
)
file
(
COPY
${${
pkg_name
}
_cmake
}
DESTINATION
${${
pkg_name
}
_SOURCE_DIR
}
)
endif
()
if
(
PKG_LIBS
)
__find_pkg_then_add_target
(
${
pkg_name
}
${
PKG_EXE
}
${
PKG_LIB_PATH
}
${
PKG_LIBS
}
)
set
(
${
pkg_name
}
_INC
${${
pkg_name
}
_BASE_DIR
}
/include PARENT_SCOPE
)
if
(
NOT
${
pkg_name
}
_LIBS
)
message
(
FATAL_ERROR
"Can not find pkg:
${
pkg_name
}
"
)
endif
()
else
()
find_package
(
${
__FIND_PKG_NAME
}
${
PKG_VER
}
QUIET
${
MS_FIND_NO_DEFAULT_PATH
}
)
if
(
${
__FIND_PKG_NAME
}
_FOUND
)
set
(
${
pkg_name
}
_INC
${${
pkg_name
}
_BASE_DIR
}
/include PARENT_SCOPE
)
message
(
"Found pkg:
${${
__FIND_PKG_NAME
}
_LIBRARIES
}
"
)
return
()
endif
()
endif
()
endfunction
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录