Getting C1001 Internal compiler error when building pytorch on windows

Shisho_Sama: <p>hello everyone.<br>
Is building Pytorch on windows using visual studio 2019 supported?</p>

Shisho_Sama: <p>OK, This is what I have done to build pytorch on windows. Using Visual Studio 2019 enterprise (16.7.2) :</p>
<pre><code class="lang-auto">git clone --branch v1.6.0 https://github.com/pytorch/pytorch.git pytorch-1.6.0
cd pytorch-1.6.0
git submodule update --init --recursive
set CUDAHOSTCXX=
set DISTUTILS_USE_SDK=1
for /f "usebackq tokens=*" %i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath`) do call "%i\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.27
python setup.py build --cmake-only
cmake-gui
</code></pre>
<p>and this is what I did afterward:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/2/b/2ba8fe2bce0b2d79de50df88270b06882ecf8ad1.gif" data-download-href="https://discuss.pytorch.org/uploads/default/2ba8fe2bce0b2d79de50df88270b06882ecf8ad1" title="pytorch_build"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/2/b/2ba8fe2bce0b2d79de50df88270b06882ecf8ad1_2_690x323.gif" alt="pytorch_build" data-base62-sha1="6eeAZV0LMOnSNFmYDSTYyz8SVB7" width="690" height="323" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/2/b/2ba8fe2bce0b2d79de50df88270b06882ecf8ad1_2_690x323.gif, https://discuss.pytorch.org/uploads/default/optimized/3X/2/b/2ba8fe2bce0b2d79de50df88270b06882ecf8ad1_2_1035x484.gif 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/2/b/2ba8fe2bce0b2d79de50df88270b06882ecf8ad1_2_1380x646.gif 2x"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">pytorch_build</span><span class="informations">1560×732 3.1 MB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>I managed to open the visual studio and nearly build everything. but out of 46 targets, 11 failed with these errors.<br>
I dont have any cuda installed and I’m using the cpu version.<br>
Here are the errros I get:<br>
build outout:</p>
<pre><code class="lang-auto">1&gt;------ Build started: Project: defs.bzl, Configuration: Release x64 ------
2&gt;------ Build started: Project: ATEN_CPU_FILES_GEN_TARGET, Configuration: Release x64 ------
3&gt;------ Build started: Project: dnnl_cpu, Configuration: Release x64 ------
4&gt;------ Build started: Project: generate-torch-sources, Configuration: Release x64 ------
5&gt;------ Build started: Project: python_copy_files, Configuration: Release x64 ------
6&gt;------ Build started: Project: gen_onnx_proto, Configuration: Release x64 ------
4&gt;Generating ../../torch/csrc/autograd/generated/Functions.cpp, ../../torch/csrc/jit/generated/generated_unboxing_wrappers_0.cpp, ../../torch/csrc/jit/generated/generated_unboxing_wrappers_1.cpp, ../../torch/csrc/jit/generated/generated_unboxing_wrappers_2.cpp, ../../torch/csrc/autograd/generated/VariableType_0.cpp, ../../torch/csrc/autograd/generated/VariableType_1.cpp, ../../torch/csrc/autograd/generated/VariableType_2.cpp, ../../torch/csrc/autograd/generated/VariableType_3.cpp, ../../torch/csrc/autograd/generated/VariableType_4.cpp, ../../torch/csrc/autograd/generated/ProfiledType_0.cpp, ../../torch/csrc/autograd/generated/ProfiledType_1.cpp, ../../torch/csrc/autograd/generated/ProfiledType_2.cpp, ../../torch/csrc/autograd/generated/ProfiledType_3.cpp, ../../torch/csrc/autograd/generated/ProfiledType_4.cpp, ../../torch/csrc/autograd/generated/TraceType_0.cpp, ../../torch/csrc/autograd/generated/TraceType_1.cpp, ../../torch/csrc/autograd/generated/TraceType_2.cpp, ../../torch/csrc/autograd/generated/TraceType_3.cpp, ../../torch/csrc/autograd/generated/TraceType_4.cpp, ../../torch/csrc/autograd/generated/Functions.h, ../../torch/csrc/autograd/generated/variable_factories.h, ../../torch/csrc/autograd/generated/VariableType.h, ../../torch/csrc/autograd/generated/python_functions.cpp, ../../torch/csrc/autograd/generated/python_variable_methods.cpp, ../../torch/csrc/autograd/generated/python_torch_functions.cpp, ../../torch/csrc/autograd/generated/python_nn_functions.cpp, ../../torch/csrc/autograd/generated/python_functions.h
7&gt;------ Build started: Project: __aten_op_header_gen, Configuration: Release x64 ------
8&gt;------ Build started: Project: torch_python_stubs, Configuration: Release x64 ------
3&gt;cl : command line warning D9025: overriding '/W1' with '/w'
3&gt;cl : command line warning D9025: overriding '/W1' with '/w'
3&gt;cpu_concat.cpp
3&gt;cl : command line warning D9025: overriding '/W1' with '/w'
3&gt;cl : command line warning D9025: overriding '/W1' with '/w'
3&gt;cpu_layer_normalization_list.cpp
3&gt;cpu_shuffle_list.cpp
3&gt;cl : command line warning D9025: overriding '/W1' with '/w'
3&gt;gemm_convolution_utils.cpp
3&gt;cl : command line warning D9025: overriding '/W1' with '/w'
3&gt;cl : command line warning D9025: overriding '/W1' with '/w'
3&gt;ref_convolution.cpp
3&gt;ref_deconvolution.cpp
3&gt;cl : command line warning D9025: overriding '/W1' with '/w'
3&gt;ref_eltwise.cpp
3&gt;cl : command line warning D9025: overriding '/W1' with '/w'
3&gt;ref_inner_product.cpp
3&gt;ref_layer_normalization.cpp
3&gt;ref_lrn.cpp
3&gt;ref_pooling.cpp
3&gt;ref_resampling.cpp
3&gt;ref_shuffle.cpp
3&gt;ref_softmax.cpp
3&gt;D:\Codes\pytorch-1.6.0\third_party\ideep\mkl-dnn\src\cpu\gemm_convolution_utils.cpp(401): fatal error C1001: Internal compiler error.
3&gt;(compiler file 'd:\agent\_work\7\s\src\vctools\Compiler\Utc\src\p2\main.c', line 195)
3&gt; To work around this problem, try simplifying or changing the program near the locations listed above.
3&gt;If possible please provide a repro here: https://developercommunity.visualstudio.com
3&gt;Please choose the Technical Support command on the Visual C++
3&gt; Help menu, or open the Technical Support help file for more information
3&gt;  CL!RaiseException()+0x69
3&gt;  CL!RaiseException()+0x69
3&gt;  CL!CloseTypeServerPDB()+0x22e6b
3&gt;  CL!CloseTypeServerPDB()+0xcd30a
3&gt;simple_concat.cpp
3&gt;simple_layer_normalization.cpp
3&gt;simple_layer_normalization_kernels.cpp
3&gt;simple_resampling.cpp
3&gt;simple_sum.cpp
3&gt;gemm_utils_f32.cpp
3&gt;ref_gemm_f32.cpp
3&gt;gemm.cpp
3&gt;gemm_pack.cpp
3&gt;ref_gemm_s8x8s32.cpp
3&gt;simple_gemm_s8s8s32.cpp
3&gt;cpu_matmul_list.cpp
3&gt;cl : command line error D8040: error creating or communicating with child process
3&gt;Done building project "dnnl_cpu.vcxproj" -- FAILED.
9&gt;------ Build started: Project: dnnl, Configuration: Release x64 ------
9&gt;Microsoft (R) Library Manager Version 14.27.29111.0
9&gt;Copyright (C) Microsoft Corporation.  All rights reserved.
9&gt;
9&gt;"/OUT:D:\Codes\pytorch-1.6.0\build_dir\lib\Release\dnnl.lib" /NOLOGO /MACHINE:X64 /machine:x64 /ignore:4049 /ignore:4217 dnnl.dir\Release\version.res
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\batch_normalization.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\binary.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\concat.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\convolution.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\convolution_pd.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\deconvolution.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\dnnl_debug.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\dnnl_debug_autogenerated.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\eltwise.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\engine.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\inner_product.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\layer_normalization.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\lrn.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\matmul.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\memory.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\memory_debug.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\memory_desc_wrapper.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\memory_storage.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\memory_zero_pad.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\pooling.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\primitive.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\primitive_attr.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\primitive_cache.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\primitive_desc.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\primitive_exec_types.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\primitive_hashing.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\primitive_iterator.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\query.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\reorder.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\resampling.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\rnn.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\rw_mutex.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\scratchpad.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\scratchpad_debug.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\shuffle.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\softmax.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\stream.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\stream_attr.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\sum.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\utils.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\common\dnnl_common.dir\Release\verbose.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\bfloat16.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_batch_normalization_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_batch_normalization_utils.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_binary_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_concat.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_convolution_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_deconvolution_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_eltwise_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_engine.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_inner_product_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_layer_normalization_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_lrn_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_pooling_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_reorder.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_resampling_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_rnn_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_shuffle_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_softmax_list.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\cpu_sum.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\gemm_convolution.obj"
9&gt;"D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\gemm_convolution_utils.obj"
9&gt;D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\gemm_convolution_utils.obj : fatal error LNK1136: invalid or corrupt file
9&gt;Done building project "dnnl.vcxproj" -- FAILED.
10&gt;------ Build started: Project: torch_cpu, Configuration: Release x64 ------
11&gt;------ Build started: Project: compat_libs, Configuration: Release x64 ------
11&gt;Error copying file "D:/Codes/pytorch-1.6.0/build_dir/lib/Release/dnnl.lib" to "D:/Codes/pytorch-1.6.0/build_dir/lib/Release/mkldnn.lib".
11&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6006: "cmd.exe" exited with code 1.
11&gt;Done building project "compat_libs.vcxproj" -- FAILED.
10&gt;Generating ../../torch/csrc/autograd/generated/Functions.cpp, ../../torch/csrc/jit/generated/generated_unboxing_wrappers_0.cpp, ../../torch/csrc/jit/generated/generated_unboxing_wrappers_1.cpp, ../../torch/csrc/jit/generated/generated_unboxing_wrappers_2.cpp, ../../torch/csrc/autograd/generated/VariableType_0.cpp, ../../torch/csrc/autograd/generated/VariableType_1.cpp, ../../torch/csrc/autograd/generated/VariableType_2.cpp, ../../torch/csrc/autograd/generated/VariableType_3.cpp, ../../torch/csrc/autograd/generated/VariableType_4.cpp, ../../torch/csrc/autograd/generated/ProfiledType_0.cpp, ../../torch/csrc/autograd/generated/ProfiledType_1.cpp, ../../torch/csrc/autograd/generated/ProfiledType_2.cpp, ../../torch/csrc/autograd/generated/ProfiledType_3.cpp, ../../torch/csrc/autograd/generated/ProfiledType_4.cpp, ../../torch/csrc/autograd/generated/TraceType_0.cpp, ../../torch/csrc/autograd/generated/TraceType_1.cpp, ../../torch/csrc/autograd/generated/TraceType_2.cpp, ../../torch/csrc/autograd/generated/TraceType_3.cpp, ../../torch/csrc/autograd/generated/TraceType_4.cpp, ../../torch/csrc/autograd/generated/Functions.h, ../../torch/csrc/autograd/generated/variable_factories.h, ../../torch/csrc/autograd/generated/VariableType.h, ../../torch/csrc/autograd/generated/python_functions.cpp, ../../torch/csrc/autograd/generated/python_variable_methods.cpp, ../../torch/csrc/autograd/generated/python_torch_functions.cpp, ../../torch/csrc/autograd/generated/python_nn_functions.cpp, ../../torch/csrc/autograd/generated/python_functions.h
4&gt;Skipped writing torch/csrc\autograd\generated\python_functions.h
4&gt;Skipped writing torch/csrc\autograd\generated\python_functions.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\python_variable_methods.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\python_torch_functions.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\python_nn_functions.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\VariableType.h
4&gt;Skipped writing torch/csrc\autograd\generated\VariableType_0.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\ProfiledType_0.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\TraceType_0.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\VariableType_1.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\ProfiledType_1.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\TraceType_1.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\VariableType_2.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\ProfiledType_2.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\TraceType_2.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\VariableType_3.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\ProfiledType_3.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\TraceType_3.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\VariableType_4.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\ProfiledType_4.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\TraceType_4.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\VariableTypeEverything.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\ProfiledTypeEverything.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\TraceTypeEverything.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\RegistrationDeclarations.h
4&gt;Skipped writing torch/csrc\autograd\generated\Functions.h
4&gt;Skipped writing torch/csrc\autograd\generated\Functions.cpp
4&gt;Skipped writing torch/csrc\autograd\generated\variable_factories.h
4&gt;Skipped writing torch/csrc\jit\generated\generated_unboxing_wrappers_0.cpp
4&gt;Skipped writing torch/csrc\jit\generated\generated_unboxing_wrappers_1.cpp
4&gt;Skipped writing torch/csrc\jit\generated\generated_unboxing_wrappers_2.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\python_functions.h
10&gt;Skipped writing torch/csrc\autograd\generated\python_functions.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\python_variable_methods.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\python_torch_functions.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\python_nn_functions.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\VariableType.h
10&gt;Skipped writing torch/csrc\autograd\generated\VariableType_0.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\ProfiledType_0.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\TraceType_0.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\VariableType_1.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\ProfiledType_1.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\TraceType_1.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\VariableType_2.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\ProfiledType_2.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\TraceType_2.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\VariableType_3.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\ProfiledType_3.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\TraceType_3.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\VariableType_4.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\ProfiledType_4.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\TraceType_4.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\VariableTypeEverything.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\ProfiledTypeEverything.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\TraceTypeEverything.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\RegistrationDeclarations.h
10&gt;Skipped writing torch/csrc\autograd\generated\Functions.h
10&gt;Skipped writing torch/csrc\autograd\generated\Functions.cpp
10&gt;Skipped writing torch/csrc\autograd\generated\variable_factories.h
10&gt;Skipped writing torch/csrc\jit\generated\generated_unboxing_wrappers_0.cpp
10&gt;Skipped writing torch/csrc\jit\generated\generated_unboxing_wrappers_1.cpp
10&gt;Skipped writing torch/csrc\jit\generated\generated_unboxing_wrappers_2.cpp
10&gt;LINK : fatal error LNK1181: cannot open input file '..\lib\Release\dnnl.lib'
10&gt;Done building project "torch_cpu.vcxproj" -- FAILED.
12&gt;------ Build started: Project: torch, Configuration: Release x64 ------
12&gt;LINK : fatal error LNK1181: cannot open input file '..\lib\Release\torch_cpu.lib'
12&gt;Done building project "torch.vcxproj" -- FAILED.
13&gt;------ Build started: Project: caffe2_pybind11_state, Configuration: Release x64 ------
14&gt;------ Build started: Project: shm, Configuration: Release x64 ------
15&gt;------ Build started: Project: caffe2_observers, Configuration: Release x64 ------
16&gt;------ Build started: Project: caffe2_detectron_ops, Configuration: Release x64 ------
15&gt;LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\torch.lib'
15&gt;Done building project "caffe2_observers.vcxproj" -- FAILED.
14&gt;LINK : fatal error LNK1181: cannot open input file '..\..\..\..\lib\Release\torch.lib'
14&gt;Done building project "shm.vcxproj" -- FAILED.
17&gt;------ Build started: Project: torch_python, Configuration: Release x64 ------
18&gt;------ Build started: Project: windows_python_copy_lib, Configuration: Release x64 ------
16&gt;LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\torch.lib'
16&gt;Done building project "caffe2_detectron_ops.vcxproj" -- FAILED.
18&gt;Error copying file "D:/Codes/pytorch-1.6.0/build_dir/caffe2/python/Release/caffe2_pybind11_state.cp37-win_amd64.pyd" to "D:/Codes/pytorch-1.6.0/build_dir/caffe2/python".
18&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: The command "setlocal
18&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -E copy D:/Codes/pytorch-1.6.0/build_dir/caffe2/python/Release/caffe2_pybind11_state.cp37-win_amd64.pyd D:/Codes/pytorch-1.6.0/build_dir/caffe2/python
18&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
18&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: :cmEnd
18&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
18&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: :cmErrorLevel
18&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: exit /b %1
18&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: :cmDone
18&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
18&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: :VCEnd" exited with code 1.
18&gt;Done building project "windows_python_copy_lib.vcxproj" -- FAILED.
17&gt;LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\shm.lib'
17&gt;Done building project "torch_python.vcxproj" -- FAILED.
========== Build: 7 succeeded, 11 failed, 28 up-to-date, 0 skipped ==========
</code></pre>
<p>Linker errrors:</p>
<pre><code class="lang-auto">Severity	Code	Description	Project	File	Line	Suppression State
Error	C1001	Internal compiler error.	dnnl_cpu	D:\Codes\pytorch-1.6.0\third_party\ideep\mkl-dnn\src\cpu\gemm_convolution_utils.cpp	401	
Error	D8040	error creating or communicating with child process	dnnl_cpu	D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\cl	1	
Error	LNK1136	invalid or corrupt file	dnnl	D:\Codes\pytorch-1.6.0\build_dir\third_party\ideep\mkl-dnn\src\cpu\dnnl_cpu.dir\Release\gemm_convolution_utils.obj	1	
Error	MSB6006	"cmd.exe" exited with code 1.	compat_libs	C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets	234	
Error	LNK1181	cannot open input file '..\lib\Release\dnnl.lib'	torch_cpu	D:\Codes\pytorch-1.6.0\build_dir\caffe2\LINK	1	
Error	LNK1181	cannot open input file '..\lib\Release\torch_cpu.lib'	torch	D:\Codes\pytorch-1.6.0\build_dir\caffe2\LINK	1	
Error	LNK1181	cannot open input file '..\..\lib\Release\torch.lib'	caffe2_observers	D:\Codes\pytorch-1.6.0\build_dir\modules\observers\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\..\lib\Release\torch.lib'	shm	D:\Codes\pytorch-1.6.0\build_dir\caffe2\torch\lib\libshm_windows\LINK	1	
Error	LNK1181	cannot open input file '..\..\lib\Release\torch.lib'	caffe2_detectron_ops	D:\Codes\pytorch-1.6.0\build_dir\modules\detectron\LINK	1	
Error	MSB3073	The command "setlocal
"C:\Program Files\CMake\bin\cmake.exe" -E copy D:/Codes/pytorch-1.6.0/build_dir/caffe2/python/Release/caffe2_pybind11_state.cp37-win_amd64.pyd D:/Codes/pytorch-1.6.0/build_dir/caffe2/python
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1.	windows_python_copy_lib	C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets	149	
Error	LNK1181	cannot open input file '..\..\lib\Release\shm.lib'	torch_python	D:\Codes\pytorch-1.6.0\build_dir\caffe2\torch\LINK	1	
</code></pre>
<p>What am I missing here?<br>
please note that this is the default, and I have not yet changed to MT yet. its all MD by default.<br>
any help is greatly apprecaited.<br>
<a class="mention" href="/u/peterjc123">@peterjc123</a></p>

Shisho_Sama: <p>This is related to this : <a href="https://github.com/oneapi-src/oneDNN/issues/812" rel="noopener nofollow ugc">https://github.com/oneapi-src/oneDNN/issues/812</a><br>
Also it seems the change is a one liner .i.e just change <code>auto zero_val = (data_t)0;</code> to <code>const data_t zero_val = 0;</code> in <code>src/cpu/gemm_convolution_utils.cpp</code> and thats all.<br>
<a href="https://github.com/oneapi-src/oneDNN/commit/c6f9b7a3e5833bfe06580be6c70c7a4e019e3a43" rel="noopener nofollow ugc">ref</a></p>

albanD: <p>Hi,</p>
<p>We updated our version of oneDNN recently and this fix should have been pulled in. Do you still see this problem with the current master branch?</p>

Shisho_Sama: <p>Hi,<br>
Yes I have seen the workaround and it indeed fixes the issue. I have only used this with 1.6.0 not sure if there is any issues with the master branch though I believe the master should be fine too if the fix is already merged.</p>
<p><a class="mention" href="/u/alband">@albanD</a> I built the latest master and all is fine as far as the building process goes. just wanted to update you on this once again</p>

peterjc123: <p>BTW, we usually use <code>python tools\build_libtorch.py</code> when building LibTorch. If you need <code>/MT</code>, please set <code>BUILD_SHARED_LIBS</code> to <code>OFF</code> and then start the build.</p>

Shisho_Sama: <p>Thanks a lot really appreciate it. I surely will give that a try and if something turns up I’ll report back.</p>

Shisho_Sama: <p>I could build the libs both MT and MD using the normal cmake way(setup.py build --cmake-only). but<br>
I’m getting lots of linker errors when I run that script like  this :</p>
<pre><code class="lang-auto">cd tools
set BUILD_SHARED_LIBS=OFF
for /f "usebackq tokens=*" %i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath`) do call "%i\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.27
python build_libtorch.py
</code></pre>
<p>linker errors :</p>
<pre><code class="lang-auto">torch_cpu.lib(conv_dnnlowp_op.cc.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl fbgemm::PackWeightMatrixForGConv&lt;signed char,int,3&gt;::PackWeightMatrixForGConv&lt;signed char,int,3&gt;(enum fbgemm::matrix_op_t,struct fbgemm::conv_param_t&lt;3&gt; const &amp;,signed char const *,signed char *)" (__imp_??0?$PackWeightMatrixForGConv@CH$02@fbgemm@@QEAA@W4matrix_op_t@1@AEBU?$conv_param_t@$02@1@PEBCPEAC@Z)
torch_cpu.lib(fbgemm_pack_op.cc.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl fbgemm::PackWeightMatrixForGConv&lt;signed char,int,3&gt;::~PackWeightMatrixForGConv&lt;signed char,int,3&gt;(void)" (__imp_??1?$PackWeightMatrixForGConv@CH$02@fbgemm@@QEAA@XZ) referenced in function "public: __cdecl std::_Temporary_owner&lt;class fbgemm::PackWeightMatrixForGConv&lt;signed char,int,3&gt; &gt;::~_Temporary_owner&lt;class fbgemm::PackWeightMatrixForGConv&lt;signed char,int,3&gt; &gt;(void)" (??1?$_Temporary_owner@V?$PackWeightMatrixForGConv@CH$02@fbgemm@@@std@@QEAA@XZ)
torch_cpu.lib(conv_dnnlowp_op.cc.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl fbgemm::PackWeightMatrixForGConv&lt;signed char,int,3&gt;::~PackWeightMatrixForGConv&lt;signed char,int,3&gt;(void)" (__imp_??1?$PackWeightMatrixForGConv@CH$02@fbgemm@@QEAA@XZ)
torch_cpu.lib(dnnlowp.cc.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl fbgemm::ChooseRequantizationMultiplier(float,int *,int *,int)" (__imp_?ChooseRequantizationMultiplier@fbgemm@@YAXMPEAH0H@Z) referenced in function "public: struct fbgemm::RequantizationParams __cdecl dnnlowp::QuantizationFactory::ChooseRequantizationMultiplier(float,struct fbgemm::TensorQuantizationParams)const " (?ChooseRequantizationMultiplier@QuantizationFactory@dnnlowp@@QEBA?AURequantizationParams@fbgemm@@MUTensorQuantizationParams@4@@Z)
torch_cpu.lib(conv_dnnlowp_op.cc.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl fbgemm::row_offsets_u8acc32_ref(int,int,int,unsigned char const *,int *)" (__imp_?row_offsets_u8acc32_ref@fbgemm@@YAXHHHPEBEPEAH@Z) referenced in function "protected: void __cdecl caffe2::ConvDNNLowPOp&lt;unsigned char,1&gt;::RunOnDeviceEpilogueNHWC_$omp$1(unsigned char const *,int *)" (?RunOnDeviceEpilogueNHWC_$omp$1@?$ConvDNNLowPOp@E$00@caffe2@@IEAAXPEBEPEAH@Z)
torch_cpu.lib(conv_dnnlowp_op.cc.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl fbgemm::depthwise_3x3x3_per_channel_quantization_pad_1&lt;int&gt;(int,int,int,int,int,int,int,int,int,unsigned char const *,int const *,class fbgemm::PackedDepthWiseConvMatrix const &amp;,float const *,int,unsigned char *,int const *,int const *,bool,float const *,int,int)" (__imp_??$depthwise_3x3x3_per_channel_quantization_pad_1@H@fbgemm@@YAXHHHHHHHHHPEBEPEBHAEBVPackedDepthWiseConvMatrix@0@PEBMHPEAE11_N3HH@Z) referenced in function "private: void __cdecl caffe2::ConvDNNLowPOp&lt;unsigned char,1&gt;::ConvNHWCCore_$omp$1(unsigned char const *,class std::vector&lt;int,class std::allocator&lt;int&gt; &gt; *)" (?ConvNHWCCore_$omp$1@?$ConvDNNLowPOp@E$00@caffe2@@AEAAXPEBEPEAV?$vector@HV?$allocator@H@std@@@std@@@Z)
torch_cpu.lib(conv_dnnlowp_op.cc.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl fbgemm::depthwise_3x3x3_pad_1&lt;int&gt;(int,int,int,int,int,int,int,int,int,unsigned char const *,int,class fbgemm::PackedDepthWiseConvMatrix const &amp;,float,int,unsigned char *,int const *,int const *,bool,float,int,int)" (__imp_??$depthwise_3x3x3_pad_1@H@fbgemm@@YAXHHHHHHHHHPEBEHAEBVPackedDepthWiseConvMatrix@0@MHPEAEPEBH3_NMHH@Z) referenced in function "private: void __cdecl caffe2::ConvDNNLowPOp&lt;unsigned char,1&gt;::ConvNHWCCore_$omp$1(unsigned char const *,class std::vector&lt;int,class std::allocator&lt;int&gt; &gt; *)" (?ConvNHWCCore_$omp$1@?$ConvDNNLowPOp@E$00@caffe2@@AEAAXPEBEPEAV?$vector@HV?$allocator@H@std@@@std@@@Z)
torch_cpu.lib(conv_dnnlowp_op.cc.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl fbgemm::depthwise_2d_per_channel_quantization_same_pad&lt;int&gt;(int,int,int,int,int,int,int,unsigned char const *,int const *,class fbgemm::PackedDepthWiseConvMatrix const &amp;,float const *,int,unsigned char *,int const *,int const *,bool,float const *,int,int)" (__imp_??$depthwise_2d_per_channel_quantization_same_pad@H@fbgemm@@YAXHHHHHHHPEBEPEBHAEBVPackedDepthWiseConvMatrix@0@PEBMHPEAE11_N3HH@Z) referenced in function "private: void __cdecl caffe2::ConvDNNLowPOp&lt;unsigned char,1&gt;::ConvNHWCCore_$omp$2(unsigned char const *,class std::vector&lt;int,class std::allocator&lt;int&gt; &gt; *)" (?ConvNHWCCore_$omp$2@?$ConvDNNLowPOp@E$00@caffe2@@AEAAXPEBEPEAV?$vector@HV?$allocator@H@std@@@std@@@Z)
torch_cpu.lib(conv_dnnlowp_op.cc.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl fbgemm::depthwise_2d_same_pad&lt;int&gt;(int,int,int,int,int,int,int,unsigned char const *,int,class fbgemm::PackedDepthWiseConvMatrix const &amp;,float,int,unsigned char *,int const *,int const *,bool,float,int,int)" (__imp_??$depthwise_2d_same_pad@H@fbgemm@@YAXHHHHHHHPEBEHAEBVPackedDepthWiseConvMatrix@0@MHPEAEPEBH3_NMHH@Z) referenced in function "private: void __cdecl caffe2::ConvDNNLowPOp&lt;unsigned char,1&gt;::ConvNHWCCore_$omp$2(unsigned char const *,class std::vector&lt;int,class std::allocator&lt;int&gt; &gt; *)" (?ConvNHWCCore_$omp$2@?$ConvDNNLowPOp@E$00@caffe2@@AEAAXPEBEPEAV?$vector@HV?$allocator@H@std@@@std@@@Z)
....
</code></pre>
<p>I couldnt set <code>DISTUTILS_USE_SDK=1</code> as doing so would result in the following error :</p>
<pre><code class="lang-auto">D:\Codes\pytorch-1.6.0\tools&gt;python build_libtorch.py
cmake -GNinja -DBUILD_PYTHON=False -DBUILD_SHARED_LIBS=OFF -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=D:\Codes\pytorch-1.6.0\torch -DCMAKE_PREFIX_PATH=C:\Users\User\Anaconda3\Lib\site-packages -DNUMPY_INCLUDE_DIR=C:\Users\User\Anaconda3\Lib\site-packages\numpy\core\include -DPYTHON_EXECUTABLE=C:\Users\User\Anaconda3\python.exe -DPYTHON_INCLUDE_DIR=C:\Users\User\Anaconda3\include -DUSE_NUMPY=True D:\Codes\pytorch-1.6.0
CMake Error at C:/Users/User/Anaconda3/Library/share/cmake-3.17/Modules/CMakeDetermineCXXCompiler.cmake:48 (message):
  Could not find compiler set in environment variable CXX:

  cl.

Call Stack (most recent call first):
  CMakeLists.txt:23 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "D:/Codes/pytorch-1.6.0/tools/build/CMakeFiles/CMakeOutput.log".
See also "D:/Codes/pytorch-1.6.0/tools/build/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "build_libtorch.py", line 23, in &lt;module&gt;
    rerun_cmake=True, cmake_only=False, cmake=CMake())
  File "D:\Codes\pytorch-1.6.0\tools\build_pytorch_libs.py", line 59, in build_caffe2
    rerun_cmake)
  File "D:\Codes\pytorch-1.6.0\tools\setup_helpers\cmake.py", line 329, in generate
    self.run(args, env=my_env)
  File "D:\Codes\pytorch-1.6.0\tools\setup_helpers\cmake.py", line 141, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "C:\Users\User\Anaconda3\Lib\subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '-GNinja', '-DBUILD_PYTHON=False', '-DBUILD_SHARED_LIBS=OFF', '-DBUILD_TEST=True', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_INSTALL_PREFIX=D:\\Codes\\pytorch-1.6.0\\torch', '-DCMAKE_PREFIX_PATH=C:\\Users\\User\\Anaconda3\\Lib\\site-packages', '-DNUMPY_INCLUDE_DIR=C:\\Users\\User\\Anaconda3\\Lib\\site-packages\\numpy\\core\\include', '-DPYTHON_EXECUTABLE=C:\\Users\\User\\Anaconda3\\python.exe', '-DPYTHON_INCLUDE_DIR=C:\\Users\\User\\Anaconda3\\include', '-DUSE_NUMPY=True', 'D:\\Codes\\pytorch-1.6.0']' returned non-zero exit status 1.

</code></pre>
<p>what am I missing here?<br>
could you kindly point that out?</p>

peterjc123: <aside class="quote no-group" data-username="Shisho_Sama" data-post="10" data-topic="98286">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/shisho_sama/48/6926_2.png" class="avatar"> Shisho_Sama:</div>
<blockquote>
<p>I could build the libs both MT and MD using the normal cmake way(setup.py build --cmake-only)</p>
</blockquote>
</aside>
<p>How did you build for <code>/MT</code>?</p>
<aside class="quote no-group" data-username="Shisho_Sama" data-post="10" data-topic="98286">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/shisho_sama/48/6926_2.png" class="avatar"> Shisho_Sama:</div>
<blockquote>
<p>I couldnt set <code>DISTUTILS_USE_SDK=1</code> as doing so would result in the following error :</p>
</blockquote>
</aside>
<p>How you activated the VC shell more than once?</p>
<p>Let’s continue with your first code block. Would you please try the following commands?</p>
<pre data-code-wrap="cmd"><code class="lang-cmd">set PYTORCH_ROOT=C:\pytorch

cd %PYTORCH_ROOT%
set BUILD_SHARED_LIBS=OFF
for /f "usebackq tokens=*" %i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath`) do call "%i\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.27
set CL=/DFBGEMM_STATIC#1
python tools\build_libtorch.py
</code></pre>

Shisho_Sama: <p>Thanks a lot really appreciate your time and kind help.</p>
<blockquote>
<p>How did you build for  <code>/MT</code> ?</p>
</blockquote>
<p>Concerning how I built the \MT . Since I could successfully create a cmake project and then a visual studio project using what I mentioned in post <a href="https://discuss.pytorch.org/t/getting-c1001-internal-compiler-error-when-building-pytorch-on-windows/98286/2">#2</a> , I went on to each single project, right clicked on each of them, went to properties, <code>C/C++ -&gt; Code Generation -&gt; Runtime Library</code> and flipped the option from MD to MT! and it successfully built the libs. although the Python_sth failed, but the main libs that I were after were successfully built.</p>
<p>The weird thing though was that, there were no .dlls despite the fact that I only changed the library runtime option and everything else was intact. I only got .lib files plus .exp files. I used them to successfully link my application , however for execution it needed the dll part (c10.dll for example) which shamelessly I used the prebuilt ones from Pytorch which I believe are built as MD!<br>
I didn’t face any issues though, the app seemed to be running just fine. the  lib version (static build) was fine though.<br>
So I wanted to know is this normal or did I just messed something up ? (I have a gut feeling I did!)</p>
<blockquote>
<p>How you activated the VC shell more than once?<br>
I’m not sure, I didn’t do anything special, maybe my repeated tries resulted in that?</p>
</blockquote>
<p>Anyway, your proposed change seems to be working and its being compiled now. I’ll report back how it goes.</p>
<p><strong>Update:</strong><br>
Its finished successfully and created 247 targets!<br>
Something to note though why is <code>torch_cpu.lib</code> 2.05 GB!? this is huge! :<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/e/e/ee9e046e033450eb8bd6696c1a045068ab0e4123.png" data-download-href="https://discuss.pytorch.org/uploads/default/ee9e046e033450eb8bd6696c1a045068ab0e4123" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/e/e/ee9e046e033450eb8bd6696c1a045068ab0e4123_2_690x426.png" alt="image" data-base62-sha1="y2UbGvISc2RAPKrhB40i1nHGBEv" width="690" height="426" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/e/e/ee9e046e033450eb8bd6696c1a045068ab0e4123_2_690x426.png, https://discuss.pytorch.org/uploads/default/optimized/3X/e/e/ee9e046e033450eb8bd6696c1a045068ab0e4123_2_1035x639.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/e/e/ee9e046e033450eb8bd6696c1a045068ab0e4123.png 2x" data-dominant-color="F7F7F7"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1117×691 47.1 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>wouldn’t this be an issue? specially in ram consumption? This is not related to libtorch anymore, but I’d really appreciate an explanation on this if possible. I know statically linking allows for only the needed parts to be loaded into ram, but this huge amount kind of scares me that lots of stuff is going to end up there (possibly as duplicates?) when I built using my first attempt, my torch_cpu.lib was around 10/20 MBs if I’m not mistaken. how come this is 2GB! is it because this is built statically and I built it dynamically? (in that case, why did I not have any .dll files accompaning the lib files like usual?)</p>

peterjc123: <aside class="quote no-group" data-username="Shisho_Sama" data-post="12" data-topic="98286">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/shisho_sama/48/6926_2.png" class="avatar"> Shisho_Sama:</div>
<blockquote>
<p>is it because this is built statically and I built it dynamically?</p>
</blockquote>
</aside>
<p>I guess the way you try to build for <code>/MT</code> only enables some of the part into <code>/MT</code>. Because some of the flags relies on <code>BUILD_SHARED_LIBS</code>.</p>
<aside class="quote no-group" data-username="Shisho_Sama" data-post="12" data-topic="98286">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/shisho_sama/48/6926_2.png" class="avatar"> Shisho_Sama:</div>
<blockquote>
<p>how come this is 2GB!</p>
</blockquote>
</aside>
<p>Yes, in my memory it is just that big. That’s definitely an issue. But we don’t have time to optimize it. Generally speaking, static libs will be larger than the dynamic libs because all dependencies will be added to the static lib when linking (since /WHOLEARCHIVE is used).</p>

Shisho_Sama: <p>Thanks a lot really apprecaite your kind help on this. I’m really grateful.</p>

Shisho_Sama: <p>Excuse me, but I noticed lots of</p>
<blockquote>
<p>info C5002: Omp simd loop not vectorized due to reason ‘1200’</p>
</blockquote>
<p>during compilation process. is this normal? or is it another bug from visual studio 2019? Do you see this in your builds as well?</p>
<p>I also noticed after statically linking with the newly built libs, upon exeuting the executable, it requires <code>c10.dll</code> and <code>torch_cpu.dll</code> :<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/0/9/0926c35d03da897b88b2656b95a449cb4052b11b.gif" data-download-href="https://discuss.pytorch.org/uploads/default/0926c35d03da897b88b2656b95a449cb4052b11b" title="pytorch_build2"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/0/9/0926c35d03da897b88b2656b95a449cb4052b11b_2_690x323.gif" alt="pytorch_build2" data-base62-sha1="1iXlvnR0rUgPdUtlhFMWDke5iZl" width="690" height="323" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/0/9/0926c35d03da897b88b2656b95a449cb4052b11b_2_690x323.gif, https://discuss.pytorch.org/uploads/default/optimized/3X/0/9/0926c35d03da897b88b2656b95a449cb4052b11b_2_1035x484.gif 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/0/9/0926c35d03da897b88b2656b95a449cb4052b11b_2_1380x646.gif 2x" data-dominant-color="F0F1F1"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">pytorch_build2</span><span class="informations">1560×732 375 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
what am I missing here? it shouldnt be needing the dlls !</p>

peterjc123: <aside class="quote no-group" data-username="Shisho_Sama" data-post="15" data-topic="98286">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/shisho_sama/48/6926_2.png" class="avatar"> Shisho_Sama:</div>
<blockquote>
<p>during compilation process. is this normal? or is it another bug from visual studio 2019? Do you see this in your builds as well?</p>
</blockquote>
</aside>
<p>Nope, it is not a bug. It is just VS adds support for the <code>#pragma omp simd</code> clauses in 2019. But they have strict requirements so they cannot be automatically vectorized. In VS2017, they are not even recognized.</p>
<aside class="quote no-group" data-username="Shisho_Sama" data-post="15" data-topic="98286">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/shisho_sama/48/6926_2.png" class="avatar"> Shisho_Sama:</div>
<blockquote>
<p>I also noticed after statically linking with the newly built libs, upon exeuting the executable, it requires <code>c10.dll</code> and <code>torch_cpu.dll</code> :</p>
</blockquote>
</aside>
<p>It shouldn’t be. Could you please show me how you linked against those libs?</p>

Shisho_Sama: <p>Thanks a lot. do you need to see how my test application is linked to these libs? i.e. how the VS project properties is configured?</p>

peterjc123: <aside class="quote no-group" data-username="Shisho_Sama" data-post="17" data-topic="98286">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/shisho_sama/48/6926_2.png" class="avatar"> Shisho_Sama:</div>
<blockquote>
<p>do you need to see how my test application is linked to these libs? i.e. how the VS project properties is configured?</p>
</blockquote>
</aside>
<p>Yes, please. [20 characters]</p>

Shisho_Sama: <p>OK, I noticed I was linking against the previous build of mine. I changed the libs forlder to the one created by the method you previously told and now I’m getting linker errors. anyway here is the whole config:<br>
<img src="https://discuss.pytorch.org/uploads/default/original/3X/4/2/422eb3e3751639b12167364170d02c4a3c5b695d.gif" alt="pytorch_build3" data-base62-sha1="9rtzwZRx8d5wyvaujkmcVtlgxXv" width="690" height="354" class="animated"></p>
<p>couple of linker errors I get now:</p>
<pre><code class="lang-auto">Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::clamp(class at::Tensor const &amp;,class c10::optional&lt;class c10::Scalar&gt;,class c10::optional&lt;class c10::Scalar&gt;)" (__imp_?clamp@at@@YA?AVTensor@1@AEBV21@V?$optional@VScalar@c10@@@c10@@1@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Context &amp; __cdecl at::globalContext(void)" (__imp_?globalContext@at@@YAAEAVContext@1@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::acos(class at::Tensor const &amp;)" (__imp_?acos@at@@YA?AVTensor@1@AEBV21@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::dot(class at::Tensor const &amp;,class at::Tensor const &amp;)" (__imp_?dot@at@@YA?AVTensor@1@AEBV21@0@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::squeeze(class at::Tensor const &amp;,__int64)" (__imp_?squeeze@at@@YA?AVTensor@1@AEBV21@_J@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class std::vector&lt;__int64,class std::allocator&lt;__int64&gt; &gt; __cdecl at::detail::defaultStrides(class c10::ArrayRef&lt;__int64&gt;)" (__imp_?defaultStrides@detail@at@@YA?AV?$vector@_JV?$allocator@_J@std@@@std@@V?$ArrayRef@_J@c10@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) unsigned __int64 __cdecl at::detail::computeStorageNbytes(class c10::ArrayRef&lt;__int64&gt;,class c10::ArrayRef&lt;__int64&gt;,unsigned __int64)" (__imp_?computeStorageNbytes@detail@at@@YA_KV?$ArrayRef@_J@c10@@0_K@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::scalar_tensor(class c10::Scalar,struct c10::TensorOptions const &amp;)" (__imp_?scalar_tensor@at@@YA?AVTensor@1@VScalar@c10@@AEBUTensorOptions@4@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::frobenius_norm(class at::Tensor const &amp;)" (__imp_?frobenius_norm@at@@YA?AVTensor@1@AEBV21@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::native::tensor(class c10::ArrayRef&lt;float&gt;,struct c10::TensorOptions const &amp;)" (__imp_?tensor@native@at@@YA?AVTensor@2@V?$ArrayRef@M@c10@@AEBUTensorOptions@5@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::empty(class c10::ArrayRef&lt;__int64&gt;,struct c10::TensorOptions const &amp;,class c10::optional&lt;enum c10::MemoryFormat&gt;)" (__imp_?empty@at@@YA?AVTensor@1@V?$ArrayRef@_J@c10@@AEBUTensorOptions@4@V?$optional@W4MemoryFormat@c10@@@4@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp; __cdecl c10::operator&lt;&lt;(class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,struct c10::Half const &amp;)" (__imp_??6c10@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV12@AEBUHalf@0@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) struct torch::jit::Module __cdecl torch::jit::load(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,class c10::optional&lt;struct c10::Device&gt;,class std::unordered_map&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;,class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;,struct std::hash&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; &gt;,struct std::equal_to&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; &gt;,class std::allocator&lt;struct std::pair&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const ,class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; &gt; &gt; &gt; &amp;)" (__imp_?load@jit@torch@@YA?AUModule@12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$optional@UDevice@c10@@@c10@@AEAV?$unordered_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$hash@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@U?$equal_to@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@5@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: void __cdecl torch::serialize::InputArchive::load_from(class std::basic_istream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class c10::optional&lt;struct c10::Device&gt;)" (__imp_?load_from@InputArchive@serialize@torch@@QEAAXAEAV?$basic_istream@DU?$char_traits@D@std@@@std@@V?$optional@UDevice@c10@@@c10@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: void __cdecl torch::serialize::InputArchive::read(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,class at::Tensor &amp;,bool)" (__imp_?read@InputArchive@serialize@torch@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAVTensor@at@@_N@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl torch::serialize::InputArchive::InputArchive(void)" (__imp_??0InputArchive@serialize@torch@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: void __cdecl torch::serialize::OutputArchive::save_to(class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;)" (__imp_?save_to@OutputArchive@serialize@torch@@QEAAXAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: void __cdecl torch::serialize::OutputArchive::write(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,class at::Tensor const &amp;,bool)" (__imp_?write@OutputArchive@serialize@torch@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVTensor@at@@_N@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl torch::serialize::OutputArchive::OutputArchive(class std::shared_ptr&lt;struct torch::jit::CompilationUnit&gt;)" (__imp_??0OutputArchive@serialize@torch@@QEAA@V?$shared_ptr@UCompilationUnit@jit@torch@@@std@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl torch::jit::CompilationUnit::CompilationUnit(void)" (__imp_??0CompilationUnit@jit@torch@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl torch::jit::CompilationUnit::~CompilationUnit(void)" (__imp_??1CompilationUnit@jit@torch@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl torch::serialize::InputArchive::~InputArchive(void)" (__imp_??1InputArchive@serialize@torch@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl torch::serialize::OutputArchive::~OutputArchive(void)" (__imp_??1OutputArchive@serialize@torch@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: struct torch::jit::Module &amp; __cdecl torch::jit::Module::operator=(struct torch::jit::Module const &amp;)" (__imp_??4Module@jit@torch@@QEAAAEAU012@AEBU012@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: struct c10::IValue __cdecl torch::jit::Module::forward(class std::vector&lt;struct c10::IValue,class std::allocator&lt;struct c10::IValue&gt; &gt;)" (__imp_?forward@Module@jit@torch@@QEAA?AUIValue@c10@@V?$vector@UIValue@c10@@V?$allocator@UIValue@c10@@@std@@@std@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl torch::jit::Module::~Module(void)" (__imp_??1Module@jit@torch@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl torch::jit::Module::Module(void)" (__imp_??0Module@jit@torch@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: virtual __cdecl torch::autograd::AutogradMeta::~AutogradMeta(void)" (__imp_??1AutogradMeta@autograd@torch@@UEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl torch::autograd::AutogradMeta::AutogradMeta(struct c10::TensorImpl *,bool,struct torch::autograd::Edge)" (__imp_??0AutogradMeta@autograd@torch@@QEAA@PEAUTensorImpl@c10@@_NUEdge@12@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: virtual class at::Tensor const &amp; __cdecl torch::autograd::AutogradMeta::grad(void)const " (__imp_?grad@AutogradMeta@autograd@torch@@UEBAAEBVTensor@at@@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: virtual class at::Tensor &amp; __cdecl torch::autograd::AutogradMeta::grad(void)" (__imp_?grad@AutogradMeta@autograd@torch@@UEAAAEAVTensor@at@@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: virtual bool __cdecl torch::autograd::AutogradMeta::requires_grad(void)const " (__imp_?requires_grad@AutogradMeta@autograd@torch@@UEBA_NXZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: virtual void __cdecl torch::autograd::AutogradMeta::set_requires_grad(bool,struct c10::TensorImpl *)" (__imp_?set_requires_grad@AutogradMeta@autograd@torch@@UEAAX_NPEAUTensorImpl@c10@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl at::NoGradGuard::~NoGradGuard(void)" (__imp_??1NoGradGuard@at@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl at::NoGradGuard::NoGradGuard(void)" (__imp_??0NoGradGuard@at@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: struct c10::StrongTypePtr &amp; __cdecl c10::StrongTypePtr::operator=(struct c10::StrongTypePtr &amp;&amp;)" (__imp_??4StrongTypePtr@c10@@QEAAAEAU01@$$QEAU01@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: struct c10::StrongTypePtr &amp; __cdecl c10::StrongTypePtr::operator=(struct c10::StrongTypePtr const &amp;)" (__imp_??4StrongTypePtr@c10@@QEAAAEAU01@AEBU01@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl c10::StrongTypePtr::StrongTypePtr(struct c10::StrongTypePtr const &amp;)" (__imp_??0StrongTypePtr@c10@@QEAA@AEBU01@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl c10::ivalue::Future::FutureError::FutureError(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; &amp;&amp;)" (__imp_??0FutureError@Future@ivalue@c10@@QEAA@$$QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: class at::Tensor __cdecl at::Tensor::operator[](__int64)const " (__imp_??ATensor@at@@QEBA?AV01@_J@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl at::AutoNonVariableTypeMode::~AutoNonVariableTypeMode(void)" (__imp_??1AutoNonVariableTypeMode@at@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: struct c10::Device __cdecl at::Context::getDeviceFromPtr(void *,enum c10::DeviceType)" (__imp_?getDeviceFromPtr@Context@at@@QEAA?AUDevice@c10@@PEAXW4DeviceType@4@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl at::AutoNonVariableTypeMode::AutoNonVariableTypeMode(bool)" (__imp_??0AutoNonVariableTypeMode@at@@QEAA@_N@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: class at::Tensor &amp; __cdecl at::Tensor::operator=(class at::Tensor const &amp;)&amp; " (__imp_??4Tensor@at@@QEGAAAEAV01@AEBV01@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: class c10::intrusive_ptr&lt;struct c10::TensorImpl,struct c10::UndefinedTensorImpl&gt; const &amp; __cdecl at::Tensor::getIntrusivePtr(void)const " (__imp_?getIntrusivePtr@Tensor@at@@QEBAAEBV?$intrusive_ptr@UTensorImpl@c10@@UUndefinedTensorImpl@2@@c10@@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: bool __cdecl c10::TensorImpl::unique_version(void)const " (__imp_?unique_version@TensorImpl@c10@@QEBA_NXZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: bool __cdecl c10::TensorOptions::requires_grad(void)const " (__imp_?requires_grad@TensorOptions@c10@@QEBA_NXZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: bool __cdecl c10::TensorOptions::has_dtype(void)const " (__imp_?has_dtype@TensorOptions@c10@@QEBA_NXZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl c10::TensorOptions::TensorOptions(enum c10::ScalarType)" (__imp_??0TensorOptions@c10@@QEAA@W4ScalarType@1@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl c10::Storage::Storage(struct c10::Storage::use_byte_size_t,unsigned __int64,class c10::DataPtr,struct c10::Allocator *,bool)" (__imp_??0Storage@c10@@QEAA@Uuse_byte_size_t@01@_KVDataPtr@1@PEAUAllocator@1@_N@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) protected: class c10::intrusive_ptr_target &amp; __cdecl c10::intrusive_ptr_target::operator=(class c10::intrusive_ptr_target const &amp;)" (__imp_??4intrusive_ptr_target@c10@@IEAAAEAV01@AEBV01@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) protected: __cdecl c10::intrusive_ptr_target::intrusive_ptr_target(class c10::intrusive_ptr_target const &amp;)" (__imp_??0intrusive_ptr_target@c10@@IEAA@AEBV01@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) protected: class c10::intrusive_ptr_target &amp; __cdecl c10::intrusive_ptr_target::operator=(class c10::intrusive_ptr_target &amp;&amp;)" (__imp_??4intrusive_ptr_target@c10@@IEAAAEAV01@$$QEAV01@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) protected: __cdecl c10::intrusive_ptr_target::intrusive_ptr_target(class c10::intrusive_ptr_target &amp;&amp;)" (__imp_??0intrusive_ptr_target@c10@@IEAA@$$QEAV01@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl c10::Scalar::Scalar(int)" (__imp_??0Scalar@c10@@QEAA@H@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl c10::Scalar::Scalar(void)" (__imp_??0Scalar@c10@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\FV.lib(FV.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class std::tuple&lt;class at::Tensor,class at::Tensor,class at::Tensor&gt; __cdecl at::svd(class at::Tensor const &amp;,bool,bool)" (__imp_?svd@at@@YA?AV?$tuple@VTensor@at@@V12@V12@@std@@AEBVTensor@1@_N1@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::true_divide(class at::Tensor const &amp;,class c10::Scalar)" (__imp_?true_divide@at@@YA?AVTensor@1@AEBV21@VScalar@c10@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::zeros(class c10::ArrayRef&lt;__int64&gt;,struct c10::TensorOptions const &amp;)" (__imp_?zeros@at@@YA?AVTensor@1@V?$ArrayRef@_J@c10@@AEBUTensorOptions@4@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: class at::Tensor &amp; __cdecl at::Tensor::index_put_(class std::initializer_list&lt;struct at::indexing::TensorIndex&gt;,class at::Tensor const &amp;)" (__imp_?index_put_@Tensor@at@@QEAAAEAV12@V?$initializer_list@UTensorIndex@indexing@at@@@std@@AEBV12@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: class at::Tensor &amp; __cdecl at::Tensor::index_put_(class std::initializer_list&lt;struct at::indexing::TensorIndex&gt;,class c10::Scalar)" (__imp_?index_put_@Tensor@at@@QEAAAEAV12@V?$initializer_list@UTensorIndex@indexing@at@@@std@@VScalar@c10@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: class at::Tensor __cdecl at::Tensor::index(class std::initializer_list&lt;struct at::indexing::TensorIndex&gt;)const " (__imp_?index@Tensor@at@@QEBA?AV12@V?$initializer_list@UTensorIndex@indexing@at@@@std@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::min(class at::Tensor const &amp;,class at::Tensor const &amp;)" (__imp_?min@at@@YA?AVTensor@1@AEBV21@0@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::min(class at::Tensor const &amp;)" (__imp_?min@at@@YA?AVTensor@1@AEBV21@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::empty_like(class at::Tensor const &amp;,struct c10::TensorOptions const &amp;,class c10::optional&lt;enum c10::MemoryFormat&gt;)" (__imp_?empty_like@at@@YA?AVTensor@1@AEBV21@AEBUTensorOptions@c10@@V?$optional@W4MemoryFormat@c10@@@4@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::zeros_like(class at::Tensor const &amp;,struct c10::TensorOptions const &amp;,class c10::optional&lt;enum c10::MemoryFormat&gt;)" (__imp_?zeros_like@at@@YA?AVTensor@1@AEBV21@AEBUTensorOptions@c10@@V?$optional@W4MemoryFormat@c10@@@4@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class std::tuple&lt;class at::Tensor,class at::Tensor&gt; __cdecl at::lstsq(class at::Tensor const &amp;,class at::Tensor const &amp;)" (__imp_?lstsq@at@@YA?AV?$tuple@VTensor@at@@V12@@std@@AEBVTensor@1@0@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::diag(class at::Tensor const &amp;,__int64)" (__imp_?diag@at@@YA?AVTensor@1@AEBV21@_J@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::argsort(class at::Tensor const &amp;,__int64,bool)" (__imp_?argsort@at@@YA?AVTensor@1@AEBV21@_J_N@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::matrix_rank(class at::Tensor const &amp;,bool)" (__imp_?matrix_rank@at@@YA?AVTensor@1@AEBV21@_N@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::ones(class c10::ArrayRef&lt;__int64&gt;,struct c10::TensorOptions const &amp;)" (__imp_?ones@at@@YA?AVTensor@1@V?$ArrayRef@_J@c10@@AEBUTensorOptions@4@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::stack(class c10::ArrayRef&lt;class at::Tensor&gt;,__int64)" (__imp_?stack@at@@YA?AVTensor@1@V?$ArrayRef@VTensor@at@@@c10@@_J@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::max(class at::Tensor const &amp;,class at::Tensor const &amp;)" (__imp_?max@at@@YA?AVTensor@1@AEBV21@0@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::max(class at::Tensor const &amp;)" (__imp_?max@at@@YA?AVTensor@1@AEBV21@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::eye(__int64,struct c10::TensorOptions const &amp;)" (__imp_?eye@at@@YA?AVTensor@1@_JAEBUTensorOptions@c10@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::cat(class c10::ArrayRef&lt;class at::Tensor&gt;,__int64)" (__imp_?cat@at@@YA?AVTensor@1@V?$ArrayRef@VTensor@at@@@c10@@_J@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::round(class at::Tensor const &amp;)" (__imp_?round@at@@YA?AVTensor@1@AEBV21@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class std::vector&lt;class at::Tensor,class std::allocator&lt;class at::Tensor&gt; &gt; __cdecl at::where(class at::Tensor const &amp;)" (__imp_?where@at@@YA?AV?$vector@VTensor@at@@V?$allocator@VTensor@at@@@std@@@std@@AEBVTensor@1@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::det(class at::Tensor const &amp;)" (__imp_?det@at@@YA?AVTensor@1@AEBV21@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::native::tensor(class c10::ArrayRef&lt;__int64&gt;,struct c10::TensorOptions const &amp;)" (__imp_?tensor@native@at@@YA?AVTensor@2@V?$ArrayRef@_J@c10@@AEBUTensorOptions@5@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: void __cdecl torch::jit::Module::to(struct c10::Device,bool)" (__imp_?to@Module@jit@torch@@QEAAXUDevice@c10@@_N@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
...

Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: class at::Tensor &amp; __cdecl at::Tensor::operator+=(class at::Tensor const &amp;)" (__imp_??YTensor@at@@QEAAAEAV01@AEBV01@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::TensorIndex::~TensorIndex(void)" (__imp_??1TensorIndex@indexing@at@@QEAA@XZ)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::TensorIndex::TensorIndex(class at::Tensor)" (__imp_??0TensorIndex@indexing@at@@QEAA@VTensor@2@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::TensorIndex::TensorIndex(struct at::indexing::Slice)" (__imp_??0TensorIndex@indexing@at@@QEAA@USlice@12@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::TensorIndex::TensorIndex(int)" (__imp_??0TensorIndex@indexing@at@@QEAA@H@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::TensorIndex::TensorIndex(__int64)" (__imp_??0TensorIndex@indexing@at@@QEAA@_J@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::Slice::Slice(class c10::optional&lt;__int64&gt;,class c10::optional&lt;__int64&gt;,class c10::optional&lt;__int64&gt;)" (__imp_??0Slice@indexing@at@@QEAA@V?$optional@_J@c10@@00@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl c10::TensorOptions::TensorOptions(enum c10::MemoryFormat)" (__imp_??0TensorOptions@c10@@QEAA@W4MemoryFormat@1@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl c10::TensorOptions::TensorOptions(class caffe2::TypeMeta)" (__imp_??0TensorOptions@c10@@QEAA@VTypeMeta@caffe2@@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: __cdecl c10::Scalar::Scalar(float)" (__imp_??0Scalar@c10@@QEAA@M@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Detector.lib(Detector.obj)	1	
Error	LNK2001	unresolved external symbol "__declspec(dllimport) class at::Tensor __cdecl at::sigmoid(class at::Tensor const &amp;)" (__imp_?sigmoid@at@@YA?AVTensor@1@AEBV21@@Z)	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\FV_Test_Lib\Blinker.lib(Blinker.obj)	1	
Error	LNK1120	96 unresolved externals	FV_Test_Lib	D:\Codes\fac_ver\cpp\port\LibtorchPort\x64\Release\FV_Test_Lib.exe	1	

</code></pre>
<p>Note:<br>
Just to clear any possible confusion here, I first showed the lib directory I built statically (using the approach mentioned above) and then copied it to the <code>libtorch-release-latest</code> folder which I have in my dependency folder and is showing in the Linker’s <code>Additional Library Directories</code> options.  so I’m using the libs that I built earlier not something else.<br>
Previously that it built fine but needed the dll at runtime, I was using the libs I made earlier from the cmake project (explained <a href="https://discuss.pytorch.org/t/getting-c1001-internal-compiler-error-when-building-pytorch-on-windows/98286/12">here</a>) now that I used the new static libs, I’m getting these linker errors!.</p>

peterjc123: <p>Maybe you’ll need some additional macros. <code>__declspec(dllimport)</code> shouldn’t be appearing in the log since you are using static build.</p>

peterjc123: <p>BTW, did you recreate the project after the build? Some flags have changed when you switch from dynamic build to static build. (e.g. C10_BUILD_SHARED_LIBS)</p>

Shisho_Sama: <p>Do you mean the libtorch build directory? or are you referring to my own project that uses libtorch? if its the first one, no I dont think so. I just ran the commands. but if you refer to the latter, I rebuilt everything every time so all modules (libs, etc) get built again and I dont use any prebuilt/possibly with wrong config libs.</p>