diff --git a/CMakeLists.txt b/CMakeLists.txt index 3dd84ca95d0..d595437f3a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/cmake/options.cmake b/cmake/options.cmake index cfdf946b0ff..66306dc9834 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -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) diff --git a/cmake/package.cmake b/cmake/package.cmake index dc3585ebcfd..61396f48db7 100644 --- a/cmake/package.cmake +++ b/cmake/package.cmake @@ -21,23 +21,44 @@ if(ENABLE_GE) elseif(ENABLE_GPU) set(CPACK_MS_BACKEND "ms") set(CPACK_MS_TARGET "gpu or cpu") - set(CPACK_MS_PACKAGE_NAME "mindspore-gpu") + 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") - set(CPACK_MS_PACKAGE_NAME "mindspore-ascend") + 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") - set(CPACK_MS_PACKAGE_NAME "mindspore") + 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") - set(CPACK_MS_PACKAGE_NAME "mindspore-ascend") + 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") - set(CPACK_MS_PACKAGE_NAME "mindspore") + if(BUILD_DEV_MODE) + set(CPACK_MS_PACKAGE_NAME "mindspore-dev") + else() + set(CPACK_MS_PACKAGE_NAME "mindspore") + endif() endif() include(CPack) diff --git a/cmake/package_tar.cmake b/cmake/package_tar.cmake index bf9c1ab4f4a..70cd5bf900f 100644 --- a/cmake/package_tar.cmake +++ b/cmake/package_tar.cmake @@ -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") diff --git a/cmake/package_win.cmake b/cmake/package_win.cmake index a2cfa701d40..1890ff9e260 100644 --- a/cmake/package_win.cmake +++ b/cmake/package_win.cmake @@ -16,15 +16,28 @@ set(CPACK_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR}) if(ENABLE_GPU) set(CPACK_MS_BACKEND "ms") set(CPACK_MS_TARGET "gpu or cpu") - set(CPACK_MS_PACKAGE_NAME "mindspore-gpu") + 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") - set(CPACK_MS_PACKAGE_NAME "mindspore") + 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") - set(CPACK_MS_PACKAGE_NAME "mindspore") + if(BUILD_DEV_MODE) + set(CPACK_MS_PACKAGE_NAME "mindspore-dev") + else() + set(CPACK_MS_PACKAGE_NAME "mindspore") + endif() endif() include(CPack)