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

PlusBuild fails with OpenCV set to ON and PLUSBUILD_BUILD_SHARED_LIBS set to OFF #1030

Open
jamesobutler opened this issue Dec 21, 2022 · 7 comments
Assignees

Comments

@jamesobutler
Copy link
Contributor

As of PlusToolkit/PlusBuild@b481ec8 when the OpenCV version was updated from 3.4.7 to 4.5.5 (cc: @Sunderlandkyl), PlusBuild fails when PLUSBUILD_USE_OpenCV is turned on and PLUSBUILD_BUILD_SHARED_LIBS is turned off. The OpenCV build project is successful, but ultimately it is the PlusLib project that fails followed by the PlusApp project.

Expand to see failed build output here:
9>------ Build started: Project: PlusLib, Configuration: Release x64 ------
9>Creating directories for 'PlusLib'
9>Building Custom Rule C:/GitHub/PlusBuild/CMakeLists.txt
9>Performing download step (git clone) for 'PlusLib'
9>Cloning into 'PlusLib'...
9>Already on 'master'
9>Your branch is up to date with 'origin/master'.
9>Submodule 'PlusDoc' (https://github.com/PlusToolkit/PlusDoc.git) registered for path 'PlusDoc'
9>Cloning into 'C:/SP/PR22/PlusLib/PlusDoc'...
9>Submodule path 'PlusDoc': checked out '10c9be9cbd297bcec9e006fd0654f48f9fbe546b'
9>Performing update step for 'PlusLib'
9>No patch step for 'PlusLib'
9>Performing configure step for 'PlusLib'
9>CUSTOMBUILD : CMake warning :
9>  Ignoring extra path from command line:
9>
9>   "/"
9>
9>
9>CUSTOMBUILD : CMake warning :
9>  Ignoring extra path from command line:
9>
9>   "device"
9>
9>
9>-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19044.
9>-- The C compiler identification is MSVC 19.34.31935.0
9>-- The CXX compiler identification is MSVC 19.34.31935.0
9>-- Detecting C compiler ABI info
9>-- Detecting C compiler ABI info - done
9>-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
9>-- Detecting C compile features
9>-- Detecting C compile features - done
9>-- Detecting CXX compiler ABI info
9>-- Detecting CXX compiler ABI info - done
9>-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
9>-- Detecting CXX compile features
9>-- Detecting CXX compile features - done
9>-- Configuring PLUS toolkit version 2.9.0.
9>-- Detected platform: Win64.
9>-- Found Git: C:/Users/butlej30383/AppData/Local/Programs/Git/cmd/git.exe (found version "2.37.3.windows.1")
9>-- Current git hash is af58ab102770cdc954eaaebc07294f8e3c650b4f
9>-- Performing Test HAVE_FUTURE
9>-- Performing Test HAVE_FUTURE - Success
9>-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
9>-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
9>-- Looking for pthread_create in pthreads
9>-- Looking for pthread_create in pthreads - not found
9>-- Looking for pthread_create in pthread
9>-- Looking for pthread_create in pthread - not found
9>-- Found Threads: TRUE
9>-- Found OpenGL: opengl32  found components: OpenGL
9>-- ITK is setting PlusLib's MSVC_RUNTIME_LIBRARY to dynamic
9>-- ITK is setting RANSAC's MSVC_RUNTIME_LIBRARY to dynamic
9>CMake Error at C:/SP/PR22/OpenCV-bin/OpenCVModules.cmake:46 (message):
9>  Some (but not all) targets in this export set were already defined.
9>
9>  Targets Defined: zlib
9>
9>  Targets not yet defined: libjpeg-turbo, libtiff, libwebp, libopenjp2,
9>  libpng, IlmImf, ippiw, libprotobuf, quirc, ittnotify, ade, opencv_core,
9>  opencv_flann, opencv_imgproc, opencv_ml, opencv_photo, opencv_dnn,
9>  opencv_features2d, opencv_imgcodecs, ocv.3rdparty.dshow, ocv.3rdparty.msmf,
9>  ocv.3rdparty.ffmpeg, opencv_videoio, opencv_calib3d, opencv_highgui,
9>  opencv_objdetect, opencv_stitching, opencv_video, opencv_gapi
9>
9>Call Stack (most recent call first):
9>  C:/SP/PR22/OpenCV-bin/OpenCVConfig.cmake:133 (include)
9>  src/PlusDataCollection/CMakeLists.txt:645 (FIND_PACKAGE)
9>
9>
9>-- Configuring incomplete, errors occurred!
9>See also "C:/SP/PR22/PlusLib-bin/CMakeFiles/CMakeOutput.log".
9>See also "C:/SP/PR22/PlusLib-bin/CMakeFiles/CMakeError.log".
9>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: Custom build for 'C:\SP\PR22\CMakeFiles\014a5b54a6c7faf5b88e3928c25b8055\PlusLib-mkdir.rule;C:\SP\PR22\CMakeFiles\014a5b54a6c7faf5b88e3928c25b8055\PlusLib-download.rule;C:\SP\PR22\CMakeFiles\014a5b54a6c7faf5b88e3928c25b8055\PlusLib-update.rule;C:\SP\PR22\CMakeFiles\014a5b54a6c7faf5b88e3928c25b8055\PlusLib-patch.rule;C:\SP\PR22\CMakeFiles\014a5b54a6c7faf5b88e3928c25b8055\PlusLib-configure.rule;C:\SP\PR22\CMakeFiles\014a5b54a6c7faf5b88e3928c25b8055\PlusLib-build.rule;C:\SP\PR22\CMakeFiles\014a5b54a6c7faf5b88e3928c25b8055\PlusLib-install.rule;C:\SP\PR22\CMakeFiles\b0cee52aedbe04f78e0e5238b9bb19d4\PlusLib-complete.rule;C:\SP\PR22\CMakeFiles\9680428a15451bc367fdbff78fd603ac\PlusLib.rule;C:\GitHub\PlusBuild\CMakeLists.txt' exited with code 1.
9>Done building project "PlusLib.vcxproj" -- FAILED.
@jamesobutler
Copy link
Contributor Author

@Sunderlandkyl Is there a static build run type that is on the perkdata cdashboard? I'm wondering if this was caught there or if any other option types fail for static builds.

@Sunderlandkyl
Copy link
Contributor

There is, although it doesn't have OpenCV enabled.

@adamrankin adamrankin self-assigned this Nov 20, 2023
@adamrankin
Copy link
Member

I was able to make a manual static build with OpenCV by setting the zlib build OFF and using ITK's zlib build.

I can incorporate this into the CMake, but I'm not sure if it's ITK and OpenCV version specific. I'll keep thinking about it.

@adamrankin
Copy link
Member

VTK zlib and ITK zlib co-exist nicely because VTK namespaces its zlib as VTK::zlib, but both opencv and itk define the target zlib

@adamrankin
Copy link
Member

@Sunderlandkyl @lassoan Is it reasonable to disable OpenCV build of zlib when doing a static build, and pass in the ITK include/lib values to OpenCV? It might break if people manually choose older versions of either ITK or OpenCV?

@lassoan
Copy link
Contributor

lassoan commented Nov 20, 2023

ITK builds a target named ITKZLIB, with a library filename like itkzlib-5.0.lib and all symbols in the file prefixed with _itkzlib_. So, it should not interfere with OpenCV.

@adamrankin
Copy link
Member

ITK is exporting a zlib target:

From ITKTargets.cmake::19

foreach(_expectedTarget itkdouble-conversion itksys itkvcl itkv3p_netlib ... zlib ... ITKVideoCore ITKVideoIO)

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

4 participants