mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Summary: aaronmarkham this solves your Windows build issue. Basically: (1) VS 2017 does not have CUDA support yet, and we will be waiting on NVidia to do so. (2) VS 2015 and 2017 need different cmake generator strings. This PR shows how to determine those and also updates appveyor to do contbuild guard for the following 3 settings: - VS2015 without cuda - VS2017 without cuda - VS2015 with cuda Closes https://github.com/caffe2/caffe2/pull/210 Differential Revision: D4745007 Pulled By: Yangqing fbshipit-source-id: 50952552843abd0eb6f4145d9f132daeee3a6794
47 lines
No EOL
1.6 KiB
Batchfile
47 lines
No EOL
1.6 KiB
Batchfile
:: ###########################################################################
|
|
:: Build script to build the protoc compiler for the host platform.
|
|
:: ###########################################################################
|
|
:: This script builds the protoc compiler for Windows, which is needed
|
|
:: if protobuf is not installed already on windows, as we will need to convert
|
|
:: the protobuf source files to cc files.
|
|
|
|
:: After the execution of the file, one should be able to find the host protoc
|
|
:: binary at build_host_protoc/bin/protoc.exe.
|
|
|
|
@echo on
|
|
|
|
SET ORIGINAL_DIR=%cd%
|
|
SET CAFFE2_ROOT=%~dp0%..
|
|
if not exist %CAFFE2_ROOT%\build_host_protoc mkdir %CAFFE2_ROOT%\build_host_protoc
|
|
echo "Created %CAFFE2_ROOT%\build_host_protoc"
|
|
|
|
cd %CAFFE2_ROOT%\build_host_protoc
|
|
|
|
if NOT DEFINED CMAKE_GENERATOR (
|
|
if DEFINED APPVEYOR_BUILD_WORKER_IMAGE (
|
|
if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" (
|
|
set CMAKE_GENERATOR="Visual Studio 15 2017 Win64"
|
|
) else if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2015" (
|
|
set CMAKE_GENERATOR="Visual Studio 14 2015 Win64"
|
|
) else (
|
|
echo "You made a programming error: unknown APPVEYOR_BUILD_WORKER_IMAGE:"
|
|
echo %APPVEYOR_BUILD_WORKER_IMAGE%
|
|
exit /b
|
|
)
|
|
) else (
|
|
:: In default we use win64 VS 2017.
|
|
set CMAKE_GENERATOR="Visual Studio 15 2017 Win64"
|
|
)
|
|
)
|
|
|
|
cmake ..\third_party\protobuf\cmake ^
|
|
-G%CMAKE_GENERATOR% ^
|
|
-DCMAKE_INSTALL_PREFIX=. ^
|
|
-Dprotobuf_BUILD_TESTS=OFF ^
|
|
-DCMAKE_BUILD_TYPE=Debug ^
|
|
|| exit /b
|
|
|
|
:: Actually run the build
|
|
msbuild INSTALL.vcxproj
|
|
|
|
cd %ORIGINAL_DIR% |