Skip to content

Windows build failed  #3327

@dc986

Description

@dc986
  • OS: Microsoft Windows 7 Professional
  • CMake version: version 3.17.1
  • Python version: 3.7 (64-bit runtime)
  • Is CUDA available: N/A
  • [pip3] numpy==1.18.5
  • [pip3] torch==1.7.1+cpu
  • [pip3] torchaudio==0.7.2
  • [pip3] torchvision==0.8.2+cpu

I am trying to build torch vision 0.8.2 from source using CMake but build fails.

I used the command:
cmake -DCMAKE_PREFIX_PATH="E:/Dev/ext/libs/libtorch-win-shared-with-deps-debug-1.7.1+cpu/libtorch; -DCMAKE_INSTALL_PREFIX="E:/Dev/ext/libs/pytorch_vision/install" -DCMAKE_BUILD_TYPE=Release --DWITH_CUDA=OFF ...

but then running
cmake --build .
the output is:

1>deform_conv2d.cpp
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\deform_conv2d.cpp(86,24): error C2065: 'torchvision': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\deform_conv2d.cpp(86,37): error C2065: 'm': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\deform_conv2d.cpp(86,38): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\deform_conv2d.cpp(86,40): error C2448: 'vision::ops::TORCH_LIBRARY_FRAGMENT': function-style initializer appears to be a function definition
1>nms.cpp
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\nms.cpp(18,24): error C2065: 'torchvision': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\nms.cpp(18,37): error C2065: 'm': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\nms.cpp(18,38): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\nms.cpp(18,40): error C2448: 'vision::ops::TORCH_LIBRARY_FRAGMENT': function-style initializer appears to be a function definition
1>ps_roi_align.cpp
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\ps_roi_align.cpp(56,24): error C2065: 'torchvision': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\ps_roi_align.cpp(56,37): error C2065: 'm': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\ps_roi_align.cpp(56,38): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\ps_roi_align.cpp(56,40): error C2448: 'vision::ops::TORCH_LIBRARY_FRAGMENT': function-style initializer appears to be a function definition
1>ps_roi_pool.cpp
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\ps_roi_pool.cpp(52,24): error C2065: 'torchvision': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\ps_roi_pool.cpp(52,37): error C2065: 'm': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\ps_roi_pool.cpp(52,38): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\ps_roi_pool.cpp(52,40): error C2448: 'vision::ops::TORCH_LIBRARY_FRAGMENT': function-style initializer appears to be a function definition
1>roi_align.cpp
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\roi_align.cpp(66,24): error C2065: 'torchvision': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\roi_align.cpp(66,37): error C2065: 'm': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\roi_align.cpp(66,38): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\roi_align.cpp(66,40): error C2448: 'vision::ops::TORCH_LIBRARY_FRAGMENT': function-style initializer appears to be a function definition
1>roi_pool.cpp
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\roi_pool.cpp(51,24): error C2065: 'torchvision': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\roi_pool.cpp(51,37): error C2065: 'm': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\roi_pool.cpp(51,38): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\ops\roi_pool.cpp(51,40): error C2448: 'vision::ops::TORCH_LIBRARY_FRAGMENT': function-style initializer appears to be a function definition
1>vision.cpp
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\vision.cpp(31,24): error C2065: 'torchvision': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\vision.cpp(31,37): error C2065: 'm': undeclared identifier
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\vision.cpp(31,38): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>E:\Dev\ext\libs\pytorch_vision\torchvision\csrc\vision.cpp(31,40): error C2448: 'vision::TORCH_LIBRARY_FRAGMENT': function-style initializer appears to be a function definition
1>Generating Code...
1>Done building project "torchvision.vcxproj" -- FAILED.
2>------ Build started: Project: ALL_BUILD, Configuration: Debug x64 ------
2>Building Custom Rule E:/Dev/ext/libs/pytorch_vision/CMakeLists.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions