Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems building AliceVision v3.2.0 for Win x64 #1817

Open
jpasfol opened this issue Jan 29, 2025 · 0 comments
Open

Problems building AliceVision v3.2.0 for Win x64 #1817

jpasfol opened this issue Jan 29, 2025 · 0 comments

Comments

@jpasfol
Copy link

jpasfol commented Jan 29, 2025

Hi all,

I'm trying to build the last version (currently v3.2.0) of AliceVision library for Windows x64. I've encountered an error when building the library with Visual Studio. That's my situation:

  • I've CUDA installed, several versions (11.2, 11.6, 12.6 and 12.8). I switch among them by setting the PATH environment variable. I' ve checked this by typing nvcc --version.

  • I have Visual Studio Community 2017, 2019 and 2022. Although I have realized that the 2022 version gives me CUDA compatibility problems, so I have ruled it out. Maybe I should use version 2022? But how do I need to configure my system to not to have problems with the OpenCV compilation with CUDA through VCPKG?

  • The only combination that has allowed me to compile OPENCV with CUDA is: CUDA 11.2 + VISUAL STUDIO 2019.

  • I'm taking into account that, for the compilation of the dependencies with VCPKG and for Alicevision himself, I'm using the Visual Studio terminal: Developer Command Prompt for VS <version>. With this I intend to make sure that all the environment variables are being configured correctly.

  • I'm not sure if I should use Visual Studio 2019 because in the instructions for the installation of Alicevision does not mention it ... only Visual 2022 + Powershell,Visual 2022 and Visual 2017.

  • With the vcpkg forked of Alicevision cloned with git within the repo itself that I have cloned from Alicevision (\Alicevision\vcpkg\), I have managed to compile all the dependencies with the command:

    vcpkg install boost-algorithm boost-accumulators boost-atomic boost-container boost-date-time boost-exception boost-filesystem boost-geometry boost-graph boost-json boost-log boost-program-options boost-property-tree boost-ptr-container boost-regex boost-serialization boost-system boost-test boost-thread boost-timer lz4 liblemon openexr alembic geogram eigen3 expat flann onnxruntime-gpu opencv[eigen,ffmpeg,webp,contrib,nonfree,cuda] openimageio[libraw,ffmpeg,freetype,opencv,gif,openjpeg,webp] ceres[suitesparse,cxsparse] cuda tbb assimp pcl clp --triplet x64-windows
    
  • However, when I launch Cmake to configure the entire Alicevision project from the folder``\AliceVision\build`:

    # Visual Studio 2019
    cmake .. -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -G "Visual Studio 16 2019" -A x64 -T host=x64
    

    I get the following output:

    ...
    
    -- EIGEN:
    -- CERES: 2.1.0
    -- FLANN:
    -- CLP: 1.16.11
    -- COINUTILS: 2.10.14
    -- OSI: 0.107.9
    -- LEMON:
    
    ...
    

    The thing I see is that cmake is not correctly linking the libraries, although I think it is the way they show the versions...

  • Should I modify any CMakeLists.txt to alter the configuration or libraries that must be taken? I have seen that by default: trilean_option(ALICEVISION_USE_OPENCV "Enable use of OpenCV algorithms" OFF), I should turn it ON, I understand that OPENCV is practically a requirement for everything to work.

  • However, it doesn't warn me of any error, so I proceed to open the solution generated with Visual Studio 2019, I selected Release x64 and I make a Build of the entire solution. The program compiles but many errors jump, in the following style:

    Error LNK2019 unresolved external symbol "__declspec(dllimport) private: static unsigned int __cdecl boost::log::v2_mt_nt6::attribute_name::get_id_from_string(char const *)" (__imp_?get_id_from_string@attribute_name@v2_mt_nt6@log@boost@@CAIPEBD@Z) referenced in function "private: __cdecl aliceVision::system::Logger::Logger(void)" (??0Logger@system@aliceVision@@AEAA@XZ)	aliceVision_system	C:\Repos\AliceVision\build\src\aliceVision\system\Logger.obj	1
    
    Error	LNK2001	unresolved external symbol "__declspec(dllimport) public: static void __cdecl boost::log::v2_mt_nt6::record_view::public_data::destroy(struct boost::log::v2_mt_nt6::record_view::public_data const *)" (__imp_?destroy@public_data@record_view@v2_mt_nt6@log@boost@@SAXPEBU12345@@Z)	aliceVision_image	C:\Repos\AliceVision\build\src\aliceVision\image\cache.obj	1
    
    Error	C2338	You've instantiated std::aligned_storage<Len, Align> with an extended alignment (in other words, Align > alignof(max_align_t)). Before VS 2017 15.8, the member type would non-conformingly have an alignment of only alignof(max_align_t). VS 2017 15.8 was fixed to handle this correctly, but the fix inherently changes layout and breaks binary compatibility (*only* for uses of aligned_storage with extended alignments). Please define either (1) _ENABLE_EXTENDED_ALIGNED_STORAGE to acknowledge that you understand this message and that you actually want a type with an extended alignment, or (2) _DISABLE_EXTENDED_ALIGNED_STORAGE to silence this message and get the old non-conformant behavior. (compiling source file C:\Repos\AliceVision\src\aliceVision\lightingEstimation\lightingCalibration.cpp)	aliceVision_lightingEstimation	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\type_traits	1271
    
  • I think the problem is that I'm mixing Visual Studio versions during the dependencies installation.

Please, could anyone describe the compilation flow that I have to follow together with the versions of CUDA, Visual Studio... that I have to dispose? I'm learning and I'm a little confused with what I must to do. Maybe the INSTALL.md is outdated.

Thank you very much in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant