Browse Source

!656 Check gcc version, check patch is found or not

Merge pull request !656 from zhoufeng/check-toolchain-version
tags/v0.3.0-alpha
mindspore-ci-bot Gitee 5 years ago
parent
commit
7afa6d0974
2 changed files with 19 additions and 2 deletions
  1. +15
    -1
      CMakeLists.txt
  2. +4
    -1
      cmake/package.cmake

+ 15
- 1
CMakeLists.txt View File

@@ -1,5 +1,10 @@
cmake_minimum_required(VERSION 3.14)
project (MindSpore)

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3.0)
message(FATAL_ERROR "GCC vesion ${CMAKE_CXX_COMPILER_VERSION} must not be less than 7.3.0")
endif ()

include(${CMAKE_SOURCE_DIR}/cmake/options.cmake)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")

@@ -18,7 +23,16 @@ set(PYBIND11_CPP_STANDARD -std=c++17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPTION_CXX_FLAGS}")

find_package(Threads)
find_package(Patch)
if (DEFINED ENV{MS_PATCH_PATH})
find_program(Patch_EXECUTABLE patch PATHS $ENV{MS_PATCH_PATH})
set(Patch_FOUND ${Patch_EXECUTABLE})
else ()
find_package(Patch)
endif ()
if (NOT Patch_FOUND)
message(FATAL_ERROR "Patch not found, please set env variable MS_PATCH_PATH, "
"usually locate in GIT_PATH/usr/bin in windows")
endif ()
message(PATCH_EXECUTABLE = ${Patch_EXECUTABLE})

include(${CMAKE_SOURCE_DIR}/cmake/mind_expression.cmake)


+ 4
- 1
cmake/package.cmake View File

@@ -153,7 +153,10 @@ 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 VC_LIB_LIST $ENV{SystemRoot}/System32/msvcp140.dll $ENV{SystemRoot}/System32/vcomp140.dll)

string(REPLACE "\\" "/" SystemRoot $ENV{SystemRoot})
file(GLOB VC_LIB_LIST ${SystemRoot}/System32/msvcp140.dll ${SystemRoot}/System32/vcomp140.dll)

file(GLOB JPEG_LIB_LIST ${jpeg_turbo_LIBPATH}/*.dll)
file(GLOB SQLITE_LIB_LIST ${sqlite_LIBPATH}/*.dll)
install(


Loading…
Cancel
Save