forked from mindspore-Ecosystem/mindspore
support for incredibuild
This commit is contained in:
parent
eacd6324f6
commit
d048c11aa0
33
build.bat
33
build.bat
|
@ -23,7 +23,9 @@ SET BUILD_PATH=%BASE_PATH%/build
|
||||||
|
|
||||||
SET threads=8
|
SET threads=8
|
||||||
SET ENABLE_GITEE=OFF
|
SET ENABLE_GITEE=OFF
|
||||||
|
SET ENABLE_INCREDIBUILD=OFF
|
||||||
|
SET ENABLE_MSVC=OFF
|
||||||
|
set BUILD_TYPE=Release
|
||||||
set VERSION_STR=''
|
set VERSION_STR=''
|
||||||
for /f "tokens=1" %%a in (version.txt) do (set VERSION_STR=%%a)
|
for /f "tokens=1" %%a in (version.txt) do (set VERSION_STR=%%a)
|
||||||
|
|
||||||
|
@ -37,6 +39,22 @@ IF "%FROM_GITEE%" == "1" (
|
||||||
SET ENABLE_GITEE=ON
|
SET ENABLE_GITEE=ON
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ECHO %1%|FINDSTR "^ms_vs"
|
||||||
|
IF %errorlevel% == 0 (
|
||||||
|
echo "use msvc compiler"
|
||||||
|
SET ENABLE_MSVC=ON
|
||||||
|
) else (
|
||||||
|
echo "use mingw compiler"
|
||||||
|
)
|
||||||
|
|
||||||
|
where buildconsole
|
||||||
|
IF %errorlevel% == 0 (
|
||||||
|
echo "use buildconsole to speed up compile"
|
||||||
|
SET ENABLE_INCREDIBUILD=ON
|
||||||
|
) else (
|
||||||
|
echo "fail to find buildconsole"
|
||||||
|
)
|
||||||
|
|
||||||
IF NOT EXIST "%BUILD_PATH%" (
|
IF NOT EXIST "%BUILD_PATH%" (
|
||||||
md "build"
|
md "build"
|
||||||
)
|
)
|
||||||
|
@ -70,6 +88,7 @@ IF "%1%" == "lite" (
|
||||||
echo "======Start gen VS2019 Project for MS cpu debug======"
|
echo "======Start gen VS2019 Project for MS cpu debug======"
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug -DDEBUG_MODE=ON -DENABLE_CPU=ON -DENABLE_MINDDATA=ON -DUSE_GLOG=ON -DENABLE_GITEE=%ENABLE_GITEE% ^
|
cmake -DCMAKE_BUILD_TYPE=Debug -DDEBUG_MODE=ON -DENABLE_CPU=ON -DENABLE_MINDDATA=ON -DUSE_GLOG=ON -DENABLE_GITEE=%ENABLE_GITEE% ^
|
||||||
-G "Visual Studio 16 2019" -A x64 ../..
|
-G "Visual Studio 16 2019" -A x64 ../..
|
||||||
|
set BUILD_TYPE=Debug
|
||||||
) ELSE (
|
) ELSE (
|
||||||
echo "======Start gen MinGW64 Project for MS cpu ======"
|
echo "======Start gen MinGW64 Project for MS cpu ======"
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CPU=ON -DENABLE_MINDDATA=ON -DUSE_GLOG=ON -DENABLE_GITEE=%ENABLE_GITEE% ^
|
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CPU=ON -DENABLE_MINDDATA=ON -DUSE_GLOG=ON -DENABLE_GITEE=%ENABLE_GITEE% ^
|
||||||
|
@ -82,12 +101,12 @@ IF NOT %errorlevel% == 0 (
|
||||||
EXIT /b 1
|
EXIT /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
IF "%1%" == "ms_vs_gpu" (
|
IF ON == %ENABLE_MSVC% (
|
||||||
cmake --build . --config Release --target package
|
IF ON == %ENABLE_INCREDIBUILD% (
|
||||||
) ELSE IF "%1%" == "ms_vs_cpu" (
|
buildconsole /command="cmake --build . --config %BUILD_TYPE% --target package"
|
||||||
cmake --build . --config Release --target package
|
) ELSE (
|
||||||
) ELSE IF "%1%" == "ms_vs_cpu_debug" (
|
cmake --build . --config %BUILD_TYPE% --target package
|
||||||
cmake --build . --config Debug --target package
|
)
|
||||||
) ELSE (
|
) ELSE (
|
||||||
cmake --build . --target package -- -j%threads%
|
cmake --build . --target package -- -j%threads%
|
||||||
)
|
)
|
||||||
|
|
|
@ -94,6 +94,9 @@ function(set_nvcc_flag CUDA_NVCC_FLAGS)
|
||||||
list(APPEND CUDA_NVCC_FLAGS -arch=sm_53)
|
list(APPEND CUDA_NVCC_FLAGS -arch=sm_53)
|
||||||
endif()
|
endif()
|
||||||
list(APPEND CUDA_NVCC_FLAGS --expt-relaxed-constexpr)
|
list(APPEND CUDA_NVCC_FLAGS --expt-relaxed-constexpr)
|
||||||
|
if(MSVC)
|
||||||
|
list(APPEND CUDA_NVCC_FLAGS -t0)
|
||||||
|
endif()
|
||||||
set(${CUDA_NVCC_FLAGS} ${${CUDA_NVCC_FLAGS}} PARENT_SCOPE)
|
set(${CUDA_NVCC_FLAGS} ${${CUDA_NVCC_FLAGS}} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue