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

[bug] Unable to build 1.0.3 with msvc 14.2 #209

Closed
Michael-Liao opened this issue May 16, 2023 · 2 comments
Closed

[bug] Unable to build 1.0.3 with msvc 14.2 #209

Michael-Liao opened this issue May 16, 2023 · 2 comments
Labels

Comments

@Michael-Liao
Copy link

Michael-Liao commented May 16, 2023

Describe the bug
I have installed all the dependencies and cctag does find them during cmake configuration. However, the build gives me linker error

LINK : fatal error LNK1104: cannot open file 'libboost_serialization-vc142-mt-x64-1_76.lib'

To Reproduce
Steps to reproduce the behavior:

  • OpenCV 4.5.5 (custom build and added to path)
  • boost 1.76.0 (prebuilt binaries from sourceforge, also added to path)
  • oneTBB 2021.9.0 (custom build)
  • eigen 3.3.9 (custom "build")
  • Visual Studio 16 2019 (cl version 14.29)
    configure options
# cuda seems to not be supported yet from previous issues
cmake <source_dir> -B<build_dir> -DCCTAG_WITH_CUDA=OFF -DCCTAG_BUILD_APPS=OFF

Expected behavior
Should be able to build and run successfully from the various issues I've seen.

Log

-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.29.30141.0
-- The CXX compiler identification is MSVC 19.29.30141.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building in  configuration
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE  
-- Found Boost: C:/local/boost_1_76_0 (found suitable version "1.76.0", minimum required is "1.66.0") found components: atomic chrono date_time filesystem program_options serialization system thread timer math_c99 stacktrace_windbg unit_test_framework
-- Found Boost: version 107600
-- Building without CUDA
-- OpenCV ARCH: x64
-- OpenCV RUNTIME: vc16
-- OpenCV STATIC: OFF
-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1 (found suitable exact version "10.1") 
-- Found OpenCV: <opencv-local-install-dir> (found version "4.5.5") found components: core videoio imgproc imgcodecs 
-- Found OpenCV 4.5.5 in <opencv-local-install-dir>/x64/vc16/lib
-- You might need to add <opencv-local-install-dir>\x64\vc16\bin to your PATH to be able to run your applications.
-- Found Eigen: version 3.3.9
-- Found TBB: version 2021.9.0
-- Declare CCTag library


******************************************
Building configuration:

-- CCTag version: 1.0.3
-- Build type:
-- Build Shared libs: ON
-- Build applications: OFF
-- Build tests: ON
-- Build documentation: OFF
-- Cuda support: OFF
-- Enable Eigen alignment: OFF
-- Enable AVX2 optimizations: OFF
-- [debug] Serialize all the output: OFF
-- [debug] Enable visual debug: OFF
-- [debug] Disable output stream: ON
-- [debug] nvcc additional warnings: OFF
-- Install path: <local-install-dir>

******************************************

Desktop (please complete the following and other pertinent information):

  • OS: windows 10
  • Cuda version: unavaiable on windows but I have 10.1
  • Other dependencies version: specified above
  • CCTag version: please specify if you are using a release version or your own build
    • building from source with 1.0.3

Additional context
the boost linker error seems to be related to header only libraries but adding -DBOOST_SERIALIZATION_NO_LIB=ON did not help resolving the error

@Michael-Liao
Copy link
Author

Michael-Liao commented May 16, 2023

I have identify the problem, it seems that it is due to the autolink feature of boost, which will get confused with static and dynamic libraries since their symbols are the same.
It can be solved similarly like imageworks/Field3D#96 (comment)

In the end I set the CL environment variable to include /DBOOST_ALL_NO_LIB to turn off autolinking manually

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

1 participant