add nightly/weekly dev version number

This commit is contained in:
yanghaoran 2021-11-06 16:56:44 +08:00
parent a3441bbfb5
commit 17ce1f5004
5 changed files with 50 additions and 9 deletions

View File

@ -97,6 +97,13 @@ if(ENABLE_TESTCASES OR ENABLE_CPP_ST)
add_subdirectory(tests)
endif()
# packaging
file(READ ${CMAKE_SOURCE_DIR}/version.txt VERSION_NUMBER)
string(REPLACE "\n" "" VERSION_NUMBER ${VERSION_NUMBER})
if(${VERSION_NUMBER} MATCHES ".*dev.*")
message("building dev mode")
set(BUILD_DEV_MODE ON)
endif()
if(MODE_ASCEND_ACL)
include(cmake/package_tar.cmake)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")

View File

@ -26,6 +26,7 @@ option(ENABLE_GLIBCXX "enable_glibcxx" OFF)
option(MODE_ASCEND_ALL "supports all ascend platform" OFF)
option(MODE_ASCEND_ACL "supports ascend acl mode only" OFF)
option(ENABLE_SYM_FILE "enable sym file" OFF)
option(BUILD_DEV_MODE "MindSpore build nightly dev mode" OFF)
if(NOT ENABLE_D AND NOT ENABLE_TESTCASES AND NOT ENABLE_ACL AND NOT ENABLE_GE)
set(ENABLE_GLIBCXX ON)

View File

@ -21,24 +21,45 @@ if(ENABLE_GE)
elseif(ENABLE_GPU)
set(CPACK_MS_BACKEND "ms")
set(CPACK_MS_TARGET "gpu or cpu")
if(BUILD_DEV_MODE)
# providing cuda11 version of dev package only
set(CPACK_MS_PACKAGE_NAME "mindspore-cuda11-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore-gpu")
endif()
elseif(ENABLE_D)
set(CPACK_MS_BACKEND "ms")
set(CPACK_MS_TARGET "ascend or cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-ascend-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore-ascend")
endif()
elseif(ENABLE_CPU)
set(CPACK_MS_BACKEND "ms")
set(CPACK_MS_TARGET "cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore")
endif()
elseif(ENABLE_ACL)
set(CPACK_MS_BACKEND "debug")
set(CPACK_MS_TARGET "ascend or gpu or cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-ascend-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore-ascend")
endif()
else()
set(CPACK_MS_BACKEND "debug")
set(CPACK_MS_TARGET "ascend or gpu or cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore")
endif()
endif()
include(CPack)
# set install path

View File

@ -7,7 +7,6 @@ file(REMOVE_RECURSE ${CMAKE_SOURCE_DIR}/output)
file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/output)
# cpack variables
file(READ ${CMAKE_SOURCE_DIR}/version.txt VERSION_NUMBER)
string(TOLOWER linux_${CMAKE_HOST_SYSTEM_PROCESSOR} PLATFORM_NAME)
set(CPACK_PACKAGE_FILE_NAME mindspore_ascend-${VERSION_NUMBER}-${PLATFORM_NAME})
set(CPACK_GENERATOR "TGZ")

View File

@ -16,16 +16,29 @@ set(CPACK_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
if(ENABLE_GPU)
set(CPACK_MS_BACKEND "ms")
set(CPACK_MS_TARGET "gpu or cpu")
if(BUILD_DEV_MODE)
# providing cuda11 version of dev package only
set(CPACK_MS_PACKAGE_NAME "mindspore-cuda11-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore-gpu")
endif()
elseif(ENABLE_CPU)
set(CPACK_MS_BACKEND "ms")
set(CPACK_MS_TARGET "cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore")
endif()
else()
set(CPACK_MS_BACKEND "debug")
set(CPACK_MS_TARGET "ascend or gpu or cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore")
endif()
endif()
include(CPack)
# set install path