-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.bat
94 lines (78 loc) · 1.92 KB
/
build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
setlocal
set CONFIG=%1
if %CONFIG%==Release (
set IDL=0
) else if %CONFIG%==Debug (
set IDL=2
) else (
echo %CONFIG%
exit /b 2
)
set MINIMAL=%2
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
set CMAKE_BUILD_TYPE=%CONFIG%
::set BUILD_LIBTORCH_CPU_WITH_DEBUG=ON #RelWithDebInfo
set USE_NINJA=ON
set CMAKE_GENERATOR=Ninja
set CMAKE_VERBOSE_MAKEFILE=1
::mobile
set BUILD_BINARY=OFF
set BUILD_SHARED_LIBS=OFF
set BUILD_CUSTOM_PROTOBUF=OFF
set BUILD_PYTORCH_MOBILE_WITH_HOST_TOOLCHAIN=%MINIMAL%
set BUILDING_WITH_TORCH_LIBS=OFF
set BUILD_TEST=OFF
set BUILD_MOBILE_TEST=OFF
set BUILD_MOBILE_BENCHMARK=OFF
set BUILD_PYTHON=OFF
set BUILD_CAFFE2=OFF
set BUILD_CAFFE2_OPS=OFF
set BUILD_MOBILE_AUTOGRAD=OFF
set BUILD_EXECUTORCH=OFF
set STATIC_DISPATCH_BACKEND=CPU
::set USE_LIGHTWEIGHT_DISPATCH=ON
::set MKL_THREADING=SEQ
@REM set USE_LAPACK=ON
@REM set USE_EIGEN_FOR_BLAS=ON
@REM set USE_MKL=OFF
@REM set USE_MKLDNN=OFF
set USE_LITE_PROTO=ON
set USE_DISTRIBUTED=OFF
set USE_OPENMP=OFF
set USE_NUMPY=OFF
set USE_OBSERVERS=OFF
set MSVC_Z7_OVERRIDE=OFF
::parallel
set USE_MPI=OFF
set USE_CUDA=OFF
set USE_ROCM=OFF
set USE_GFLAGS=OFF
set USE_OPENCV=OFF
set USE_LMDB=OFF
set USE_LEVELDB=OFF
set USE_KINETO=OFF
set USE_TENSORPIPE=OFF
set USE_MAGMA=OFF
set USE_METAL=OFF
::quantize
set USE_FBGEMM=OFF
set USE_PYTORCH_QNNPACK=OFF
set USE_QNNPACK=OFF
set USE_XNNPACK=OFF
set USE_NNPACK=OFF
::onnx
set ONNX_ML=OFF
set ONNX_USE_LITE_PROTO=ON
set ONNXIFI_ENABLE_EXT=0
set ONNX_NAMESPACE=onnx
set CMAKE_CXX_FLAGS=/DWIN32 /EHs
set USE_LITE_INTERPRETER_PROFILER=OFF
set USE_ITT=OFF
set MAX_JOBS=6
set CMAKE_BUILD_PARALLEL_LEVEL=6
:: set SELECTED_OP_LIST=%cd%\ops.yaml
::cd scripts
::call build_windows.bat
python pytorch\tools\build_libtorch.py
cmake --install build --prefix install\libtorch\%CONFIG% --config=%CONFIG%
endlocal