Is that possible to compile the lib on the windows by using the mingw32-make?

wter26: <p>I use the cmake to configure the cmakelist to get a Makefile.<br>
By inputing the command of mingw32-make -f Makefile<br>
the compiler start working ,but it occured the errors that mentioned the protoc.exe cannt linked to the absl module funciton.<br>
When i compiled the protobuf alone,it will work fine and nothing to be wrong.<br>
So I wonrdered if I make the right configure of the cmake or is that possible to compile the lib by using the windows mingw32-make???<br>
So boring.<br>
Heres the cmake configure output.</p>
<p>`<br>
CMake Warning (dev) at C:/CMAKE/share/cmake-3.24/Modules/CMakeDependentOption.cmake:89 (message):<br>
Policy CMP0127 is not set: cmake_dependent_option() supports full Condition<br>
Syntax.  Run “cmake --help-policy CMP0127” for policy details.  Use the<br>
cmake_policy command to set the policy and suppress this warning.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:259 (cmake_dependent_option)<br>
This warning is for project developers.  Use -Wno-dev to suppress it.</p>
<p>CMake Warning (dev) at C:/CMAKE/share/cmake-3.24/Modules/CMakeDependentOption.cmake:89 (message):<br>
Policy CMP0127 is not set: cmake_dependent_option() supports full Condition<br>
Syntax.  Run “cmake --help-policy CMP0127” for policy details.  Use the<br>
cmake_policy command to set the policy and suppress this warning.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:290 (cmake_dependent_option)<br>
This warning is for project developers.  Use -Wno-dev to suppress it.</p>
<p>CMake Warning at CMakeLists.txt:379 (message):<br>
TensorPipe cannot be used on Windows.  Set it to OFF</p>
<p>std::exception_ptr is supported.<br>
Turning off deprecation warning due to glog.<br>
Current compiler supports avx512f extension. Will build fbgemm.<br>
Building using own protobuf under third_party per request.<br>
Use custom protobuf build.<br>
CMake Warning at third_party/protobuf/cmake/CMakeLists.txt:3 (message):<br>
Calling of cmake with source directory set to “cmake” subdirectory of<br>
Protocol Buffers project is deprecated.  Top-level directory of Protocol<br>
Buffers project should be used instead.</p>
<p>3.21.4.0<br>
Caffe2 protobuf include directory: $&lt;BUILD_INTERFACE:C:/proj/libpytorch/src/third_party/protobuf/src&gt;$&lt;INSTALL_INTERFACE:include&gt;<br>
Trying to find preferred BLAS backend of choice: OpenBLAS<br>
Found OpenBLAS libraries: C:/proj/outputopenblas/lib/libopenblas.dll<br>
Found OpenBLAS include: C:/proj/outputopenblas/include<br>
Using pocketfft in directory: C:/proj/libpytorch/src/third_party/pocketfft/<br>
CMake Warning at cmake/Dependencies.cmake:844 (message):<br>
Turning USE_FAKELOWP off as it depends on USE_FBGEMM.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:708 (include)</p>
<p>Using third party subdirectory Eigen.<br>
Using third_party/pybind11.<br>
pybind11 include dirs: C:/proj/libpytorch/src/cmake/…/third_party/pybind11/include<br>
Generated: C:/proj/libpytorch/src/build/third_party/onnx/onnx/onnx_onnx_torch-ml.proto<br>
Generated: C:/proj/libpytorch/src/build/third_party/onnx/onnx/onnx-operators_onnx_torch-ml.proto<br>
Generated: C:/proj/libpytorch/src/build/third_party/onnx/onnx/onnx-data_onnx_torch.proto</p>
<p>******** Summary ********<br>
CMake version             : 3.24.0<br>
CMake command             : C:/CMAKE/bin/cmake.exe<br>
System                    : Windows<br>
C++ compiler              : C:/qt/Tools/mingw730_32/bin/c++.exe<br>
C++ compiler version      : 7.3.0<br>
CXX flags                 :  -Wno-deprecated -fvisibility-inlines-hidden -Wnon-virtual-dtor<br>
Build type                : Release<br>
Compile definitions       : ONNX_ML=1;ONNXIFI_ENABLE_EXT=1;__STDC_FORMAT_MACROS<br>
CMAKE_PREFIX_PATH         :<br>
CMAKE_INSTALL_PREFIX      : C:/Program Files (x86)/Torch<br>
CMAKE_MODULE_PATH         : C:/proj/libpytorch/src/cmake/Modules</p>
<p>ONNX version              : 1.12.0<br>
ONNX NAMESPACE            : onnx_torch<br>
ONNX_USE_LITE_PROTO       : OFF<br>
USE_PROTOBUF_SHARED_LIBS  : OFF<br>
Protobuf_USE_STATIC_LIBS  : ON<br>
ONNX_DISABLE_EXCEPTIONS   : OFF<br>
ONNX_WERROR               : OFF<br>
ONNX_BUILD_TESTS          : OFF<br>
ONNX_BUILD_BENCHMARKS     : OFF</p>
<p>Protobuf compiler         :<br>
Protobuf includes         :<br>
Protobuf libraries        :<br>
BUILD_ONNX_PYTHON         : OFF</p>
<p>******** Summary ********<br>
CMake version         : 3.24.0<br>
CMake command         : C:/CMAKE/bin/cmake.exe<br>
System                : Windows<br>
C++ compiler          : C:/qt/Tools/mingw730_32/bin/c++.exe<br>
C++ compiler version  : 7.3.0<br>
CXX flags             :  -Wno-deprecated -fvisibility-inlines-hidden -Wnon-virtual-dtor<br>
Build type            : Release<br>
Compile definitions   : ONNX_ML=1;ONNXIFI_ENABLE_EXT=1<br>
CMAKE_PREFIX_PATH     :<br>
CMAKE_INSTALL_PREFIX  : C:/Program Files (x86)/Torch<br>
CMAKE_MODULE_PATH     : C:/proj/libpytorch/src/cmake/Modules</p>
<p>ONNX version          : 1.4.1<br>
ONNX NAMESPACE        : onnx_torch<br>
ONNX_BUILD_TESTS      : OFF<br>
ONNX_BUILD_BENCHMARKS : OFF<br>
ONNX_USE_LITE_PROTO   : OFF<br>
ONNXIFI_DUMMY_BACKEND :</p>
<p>Protobuf compiler     :<br>
Protobuf includes     :<br>
Protobuf libraries    :<br>
BUILD_ONNX_PYTHON     : OFF<br>
Could not find CUDA with FP16 support, compiling without torch.CudaHalfTensor<br>
Adding -DNDEBUG to compile flags<br>
MAGMA not found. Compiling without MAGMA support<br>
Could not find hardware support for NEON on this machine.<br>
No OMAP3 processor on this machine.<br>
No OMAP4 processor on this machine.<br>
Found a library with LAPACK API (open).<br>
disabling CUDA because NOT USE_CUDA is set<br>
USE_CUDNN is set to 0. Compiling without cuDNN support<br>
disabling ROCM because NOT USE_ROCM is set<br>
MIOpen not found. Compiling without MIOpen support<br>
disabling MKLDNN because USE_MKLDNN is not set<br>
Module support is disabled.<br>
Version: 9.1.1<br>
Build type: Release<br>
CXX_STANDARD: 14<br>
Required features: cxx_variadic_templates<br>
GCC 7.3.0: Adding gcc and gcc_s libs to link line<br>
Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)<br>
don’t use NUMA<br>
headers outputs:<br>
sources outputs:<br>
declarations_yaml outputs:<br>
Using ATen parallel backend: NATIVE<br>
disabling CUDA because USE_CUDA is set false<br>
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)<br>
Configuring build for SLEEF-v3.6.0<br>
Target system: Windows-6.1.7601<br>
Target processor: AMD64<br>
Host system: Windows-6.1.7601<br>
Host processor: AMD64<br>
Detected C compiler: GNU @ C:/qt/Tools/mingw730_32/bin/gcc.exe<br>
CMake: 3.24.0<br>
Make program: C:/qt/Tools/mingw730_32/bin/mingw32-make.exe<br>
Using option <code>-Wall -Wno-unused-function -Wno-attributes -Wno-unused-result -Wno-psabi -ffp-contract=off -msse2 -mfpmath=sse -fno-math-errno -fno-trapping-math -fno-asynchronous-unwind-tables</code> to compile libsleef<br>
Building shared libs : OFF<br>
Building static test bins: OFF<br>
MPFR : LIB_MPFR-NOTFOUND<br>
GMP : LIBGMP-NOTFOUND<br>
RT :<br>
FFTW3 : LIBFFTW3-NOTFOUND<br>
OPENSSL :<br>
SDE : SDE_COMMAND-NOTFOUND<br>
RUNNING_ON_TRAVIS :<br>
COMPILER_SUPPORTS_OPENMP : 1</p>
<p>*** Note: Parallel build is only supported with Ninja ***</p>
<p>AT_INSTALL_INCLUDE_DIR include/ATen/core<br>
core header install: C:/proj/libpytorch/src/build/aten/src/ATen/core/TensorBody.h<br>
core header install: C:/proj/libpytorch/src/build/aten/src/ATen/core/aten_interned_strings.h<br>
core header install: C:/proj/libpytorch/src/build/aten/src/ATen/core/enum_tag.h<br>
NCCL operators skipped due to no CUDA support<br>
Excluding FakeLowP operators<br>
Excluding ideep operators as we are not using ideep<br>
Excluding image processing operators due to no opencv<br>
Excluding video processing operators due to no opencv<br>
MPI operators skipped due to no MPI support<br>
CMake Warning (dev) at torch/CMakeLists.txt:467:<br>
Syntax Warning in cmake code at column 107</p>
<p>Argument not separated from preceding token by whitespace.<br>
This warning is for project developers.  Use -Wno-dev to suppress it.</p>
<p>CMake Warning (dev) at torch/CMakeLists.txt:467:<br>
Syntax Warning in cmake code at column 115</p>
<p>Argument not separated from preceding token by whitespace.<br>
This warning is for project developers.  Use -Wno-dev to suppress it.</p>
<p>CMake Warning at CMakeLists.txt:1073 (message):<br>
Generated cmake files are only fully tested if one builds with system glog,<br>
gflags, and protobuf.  Other settings may generate files that are not well<br>
tested.</p>
<p>******** Summary ********<br>
General:<br>
CMake version         : 3.24.0<br>
CMake command         : C:/CMAKE/bin/cmake.exe<br>
System                : Windows<br>
C++ compiler          : C:/qt/Tools/mingw730_32/bin/c++.exe<br>
C++ compiler id       : GNU<br>
C++ compiler version  : 7.3.0<br>
Using ccache if found : OFF<br>
CXX flags             :  -Wno-deprecated -fvisibility-inlines-hidden -DNDEBUG -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow<br>
Build type            : Release<br>
Compile definitions   : ONNX_ML=1;ONNXIFI_ENABLE_EXT=1;ONNX_NAMESPACE=onnx_torch;USE_EXTERNAL_MZCRC;MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS<br>
CMAKE_PREFIX_PATH     :<br>
CMAKE_INSTALL_PREFIX  : C:/Program Files (x86)/Torch<br>
USE_GOLD_LINKER       : OFF</p>
<p>TORCH_VERSION         : 1.13.0<br>
CAFFE2_VERSION        : 1.13.0<br>
BUILD_CAFFE2          : ON<br>
BUILD_CAFFE2_OPS      : ON<br>
BUILD_CAFFE2_MOBILE   : OFF<br>
BUILD_STATIC_RUNTIME_BENCHMARK: OFF<br>
BUILD_TENSOREXPR_BENCHMARK: OFF<br>
BUILD_NVFUSER_BENCHMARK: OFF<br>
BUILD_BINARY          : OFF<br>
BUILD_CUSTOM_PROTOBUF : ON<br>
Protobuf compiler   :<br>
Protobuf includes   :<br>
Protobuf libraries  :<br>
BUILD_DOCS            : OFF<br>
BUILD_PYTHON          : OFF<br>
BUILD_SHARED_LIBS     : ON<br>
CAFFE2_USE_MSVC_STATIC_RUNTIME     : OFF<br>
BUILD_TEST            : OFF<br>
BUILD_JNI             : OFF<br>
BUILD_MOBILE_AUTOGRAD : OFF<br>
BUILD_LITE_INTERPRETER: OFF<br>
INTERN_BUILD_MOBILE   :<br>
USE_BLAS              : 1<br>
BLAS                : open<br>
BLAS_HAS_SBGEMM     :<br>
USE_LAPACK            : 1<br>
LAPACK              : open<br>
USE_ASAN              : OFF<br>
USE_CPP_CODE_COVERAGE : OFF<br>
USE_CUDA              : OFF<br>
USE_ROCM              : OFF<br>
USE_EIGEN_FOR_BLAS    :<br>
USE_FBGEMM            : OFF<br>
USE_FAKELOWP          : OFF<br>
USE_KINETO            : OFF<br>
USE_FFMPEG            : OFF<br>
USE_GFLAGS            : OFF<br>
USE_GLOG              : OFF<br>
USE_LEVELDB           : OFF<br>
USE_LITE_PROTO        : OFF<br>
USE_LMDB              : OFF<br>
USE_METAL             : OFF<br>
USE_PYTORCH_METAL     : OFF<br>
USE_PYTORCH_METAL_EXPORT     : OFF<br>
USE_MPS               : OFF<br>
USE_FFTW              : OFF<br>
USE_MKL               :<br>
USE_MKLDNN            : OFF<br>
USE_UCC               : OFF<br>
USE_ITT               : OFF<br>
USE_NCCL              : OFF<br>
USE_NNPACK            : OFF<br>
USE_NUMPY             : ON<br>
USE_OBSERVERS         : OFF<br>
USE_OPENCL            : OFF<br>
USE_OPENCV            : OFF<br>
USE_OPENMP            : OFF<br>
USE_TBB               : OFF<br>
USE_VULKAN            : OFF<br>
USE_PROF              : OFF<br>
USE_QNNPACK           : OFF<br>
USE_PYTORCH_QNNPACK   : OFF<br>
USE_XNNPACK           : OFF<br>
USE_REDIS             : OFF<br>
USE_ROCKSDB           : OFF<br>
USE_ZMQ               : OFF<br>
USE_DISTRIBUTED       : OFF<br>
USE_DEPLOY           : OFF<br>
Public Dependencies  : caffe2::Threads<br>
Private Dependencies : C:/proj/outputopenblas/lib/libopenblas.dll;cpuinfo;fp16;aten_op_header_gen;foxi_loader;fmt::fmt-header-only;gcc_s;gcc<br>
USE_COREML_DELEGATE     : OFF<br>
BUILD_LAZY_TS_BACKEND   : ON<br>
Configuring done<br>
Generating done<br>
`</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/4/8/4893b750ef1f08bd9546dd438f9cda8b6e475666.png" data-download-href="https://discuss.pytorch.org/uploads/default/4893b750ef1f08bd9546dd438f9cda8b6e475666" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/4/8/4893b750ef1f08bd9546dd438f9cda8b6e475666.png" alt="image" data-base62-sha1="am2RczXTEPZ7EPmJ8bHmhkmuNyS" width="690" height="188" data-dominant-color="0E120E"><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">965×264 6.04 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>
I solved the problem upside,but now it occured the new problem with onnx_protobuf<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/5/a5e76a228244d0ef45ccb3d5463cf558e9b7c0f7.png" data-download-href="https://discuss.pytorch.org/uploads/default/a5e76a228244d0ef45ccb3d5463cf558e9b7c0f7" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/a/5/a5e76a228244d0ef45ccb3d5463cf558e9b7c0f7.png" alt="image" data-base62-sha1="nFEAkWJRLmLfHhxJH7ZdPmHYREz" width="690" height="167" data-dominant-color="131211"><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">960×233 5.52 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>

wter26: <p>In fact,after modifing some codes which could not run under the windows mingw and<br>
by using the gcc11 version of the 64bit mingw32-make,I’ve compiled the static lib of the libtorch.<br>
Now I just dont hava a gcc11 for the 32 bit,anyone has compiled the 32bit version of the libtorch on windows successfully ?<br>
And how to compile a dynamica lib?The args BUILD_SHARED_LIBS Ive put into the cmake seemed unuseful,and it comes out the static one.</p>