alicevision / CCTag

Detection of CCTag markers made up of concentric circles.
https://cctag.readthedocs.io
Mozilla Public License 2.0
355 stars 89 forks source link

Doesn't build on windows 10, using vcpkg, VS 2019 #126

Closed julianrendell closed 4 years ago

julianrendell commented 4 years ago

I'm trying to build Meshroom, and at the (optional) pre-reqs stage.

The outline of what I've done is here- gist:da6372201234d943d3e4f77e43674fd2

I've used vcpkg to install the pre-reqs, and am using VS 2019, community edition.

Final error:

D:\Users\MakeItZone\Documents\vcpkg\installed\x64-windows\include\Eigen\src/Core/arch/CUDA/Half.h(212): error: more than one instance of overloaded function "__hadd" matches the argument list:
            function "__hadd(int, int)"
            function "__hadd(__half, __half)"
            argument types are: (const Eigen::half, const Eigen::half)

D:\Users\MakeItZone\Documents\vcpkg\installed\x64-windows\include\Eigen\src/Core/products/Parallelizer.h(20): warning: variable "m_maxThreads" was set but never used

D:\Users\MakeItZone\Documents\vcpkg\installed\x64-windows\include\Eigen\src/Core/ArrayWrapper.h(94): warning: __declspec attributes ignored

1 error detected in the compilation of "C:/Users/MAKEIT~1/AppData/Local/Temp/tmpxft_00004498_00000000-17_debug_image.compute_75.cpp1.ii".
nvcc warning : option '--relaxed-constexpr' has been deprecated and replaced by option '--expt-relaxed-constexpr'.
nvcc warning : The -std=c++11 flag is not supported with the configured host compiler. Flag will be ignored.
debug_image.cu
CMake Error at CCTag_generated_debug_image.cu.obj.Release.cmake:280 (message):
  Error generating file
  D:/Meshroom_Src/CCTag/build/src/CMakeFiles/CCTag.dir/./cctag/cuda/./CCTag_generated_debug_image.cu.obj

NMAKE : fatal error U1077: 'echo' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.

cmake configuration output:

D:\Meshroom_Src\CCTag\build>cmake .. -DCMAKE_TOOLCHAIN_FILE=%TCF% -DCMAKE_PREFIX_PATH=%PREFIX% -DVCPKG_TARGET_TRIPLET=x64-windows -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%INSTALL% -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is MSVC 19.25.28614.0
-- The CXX compiler identification is MSVC 19.25.28614.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found Boost: D:/Users/MakeItZone/Documents/vcpkg/installed/x64-windows/include (found suitable version "1.73.0", minimum required is "1.66.0") found components: atomic chrono date_time filesystem program_options serialization system thread timer stacktrace_windbg unit_test_framework
-- Try finding CUDA
-- BUILD_SHARED_LIBS OFF
-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2 (found suitable version "10.2", minimum required is "7.0")
-- Building in release mode
nvcc warning : option '--relaxed-constexpr' has been deprecated and replaced by option '--expt-relaxed-constexpr'.
nvcc fatal   : No input files specified; use option --help for more information
-- Found OpenCV: D:/Users/MakeItZone/Documents/vcpkg/installed/x64-windows (found version "4.1.1") found components: core videoio imgproc imgcodecs
-- Found Eigen: D:/Users/MakeItZone/Documents/vcpkg/installed/x64-windows/include/eigen3 (found version "3.3.7")
-- Found TBB: D:/Users/MakeItZone/Documents/vcpkg/installed/x64-windows/include (found suitable version "2020.1", minimum required is "4")
CMake Deprecation Warning at src/CMakeLists.txt:2 (cmake_policy):
  The OLD behavior for policy CMP0054 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

-- testprop: $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include;D:/Users/MakeItZone/Documents/vcpkg/installed/x64-windows/include;D:/Users/MakeItZone/Documents/vcpkg/installed/x64-windows/include/eigen3;D:/Users/MakeItZone/Documents/vcpkg/installed/x64-windows/include
-- CCTAG already there
-- BOOST already there
-- Found OpenCV: D:/Users/MakeItZone/Documents/vcpkg/installed/x64-windows (found version "4.1.1") found components: core videoio imgproc imgcodecs highgui
-- TBB already there
-- Found DevIL: D:/Users/MakeItZone/Documents/vcpkg/installed/x64-windows/lib/DevIL.lib
-- DevIL found
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Meshroom_Src/CCTag/build

As this is optional, I'm going to move on; but I'd like to see this working as plan to use the tags in some upcoming photogrammetry projects. But I'm happy to try any suggestions and report back.

simogasp commented 4 years ago

The GPU part is not yet finished to be ported on windows, we should finish that. For now, you can use the CPU part, which is a little slower but it is fine for photogrammetry. You can pass -DCCTAG_WITH_CUDA:BOOL=OFF at cmake to disable the cuda part.

julianrendell commented 4 years ago

That got it working, thanks!

Created #128 to update the docs.

julianrendell commented 4 years ago

(and yes please re finishing the CUDA support for windows ;-) )

simogasp commented 4 years ago

now that I remember the problems were related to Eigen and Cuda, the error we are having is the same as https://github.com/tensorflow/tensorflow/issues/19198

simogasp commented 4 years ago

well the good news is that with this patch https://bitbucket.org/eigen/eigen/pull-requests/481/bug-1526-cuda-compilation-fails-on-cuda-9x/diff everything builds fine. Sadly it is not yet part of any eigen release, we need to wait for the next one (it's in the develop branch)

julianrendell commented 4 years ago

Good news! Thanks for following up @simogasp ! Sounds like this should sort itself out in the (near) future 😃