Skip to content

[qhull] Fix target cannot be found by cmake#9923

Closed
NancyLi1013 wants to merge 2 commits intomicrosoft:masterfrom
NancyLi1013:dev/NancyLi/9836-fix-Qhull
Closed

[qhull] Fix target cannot be found by cmake#9923
NancyLi1013 wants to merge 2 commits intomicrosoft:masterfrom
NancyLi1013:dev/NancyLi/9836-fix-Qhull

Conversation

@NancyLi1013
Copy link
Copy Markdown
Contributor

When we using find_package(Qhull CONFIG REQUIRED) to find Qhull, it will always use QhullTargets-debug.cmake and all the targets are not found.
Since before exporting targets, all libs are added suffix -d if build debug type.

I remove the suffix -d and also do the related changes.

Related issue #9836

Note: No feature needs to test.

@jafrado
Copy link
Copy Markdown

jafrado commented Feb 6, 2020

Ran into this issue today. Any news when it could be fixed? Thank you!

@NancyLi1013
Copy link
Copy Markdown
Contributor Author

@jafrado thanks for your feedback.
I'm so sorry that I missed to add new patch. Have updated now.
Could you please update and try it again?

@JackBoosY JackBoosY marked this pull request as ready for review February 6, 2020 03:10
@JackBoosY JackBoosY added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Feb 6, 2020
@jafrado
Copy link
Copy Markdown

jafrado commented Feb 6, 2020

@NancyLi1013 - thank you for your fix, looks good. However, now VTK with QT and OpenGL Is broken. Let me raise a separate PR for that one and send you the fix for VTK- target is PCL+QTOpenGL...
This is unrelated, but found when I just synched with microsoft/vcpkg upstream...

@jafrado
Copy link
Copy Markdown

jafrado commented Feb 6, 2020

Hi @NancyLi1013 - still no joy. I have this in my CMakeLists.txt

find_package(Qt5 CONFIG REQUIRED Widgets)
find_package(VTK CONFIG REQUIRED)
find_package(QHull CONFIG REQUIRED)
find_package(PCL 1.7.1 CONFIG REQUIRED)

When I configure, I get the below (Windows 10):

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:9 (set_property):
set_property could not find TARGET Qhull::qhullcpp_d. Perhaps it has not
yet been created.
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:10 (set_target_properties):
set_target_properties Can not find target to add properties to:
Qhull::qhullcpp_d
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:19 (set_property):
set_property could not find TARGET Qhull::qhullstatic_d. Perhaps it has
not yet been created.
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:20 (set_target_properties):
set_target_properties Can not find target to add properties to:
Qhull::qhullstatic_d
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:29 (set_property):
set_property could not find TARGET Qhull::qhullstatic_rd. Perhaps it has
not yet been created.
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:30 (set_target_properties):
set_target_properties Can not find target to add properties to:
Qhull::qhullstatic_rd
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:39 (set_property):
set_property could not find TARGET Qhull::qhull_rd. Perhaps it has not yet
been created.
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:40 (set_target_properties):
set_target_properties Can not find target to add properties to:
Qhull::qhull_rd
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:103 (set_property):
set_property could not find TARGET Qhull::qhull_d. Perhaps it has not yet
been created.
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:104 (set_target_properties):
set_target_properties Can not find target to add properties to:
Qhull::qhull_d
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:113 (set_property):
set_property could not find TARGET Qhull::qhull_pd. Perhaps it has not yet
been created.
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:114 (set_target_properties):
set_target_properties Can not find target to add properties to:
Qhull::qhull_pd
Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

CMake Error at C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:150 (message):
The imported target "Qhull::qhullcpp_d" references the file

 "C:/vcpkg/installed/x64-windows/share/qhull/../../debug/lib/qhullcpp_d.lib"

but this file does not exist. Possible reasons include:

  • The file was deleted, renamed, or moved to another location.

  • An install or uninstall procedure did not complete successfully.

  • The installation package was faulty and contained

    "C:/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake"

but not all the files it references.

Call Stack (most recent call first):
C:/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
CMakeLists.txt:23 (find_package)

@NancyLi1013
Copy link
Copy Markdown
Contributor Author

Hi @jafrado
Could you please help confirm if you have updated to the latest commits?
I noticed that there are still some targets that contain the suffix -d in above error info.
I can confirm you used old ***targets.cmake file.
Please double check this.

Thanks.

@larshg
Copy link
Copy Markdown
Contributor

larshg commented Feb 7, 2020

@NancyLi1013 Thanks for looking into it.

It seems that when I configure PCL it find, but find the release version as both release and debug:
QHULL found (include: D:/libraries/vcpkg/installed/x64-windows/include, lib: optimized;D:/libraries/vcpkg/installed/x64-windows/lib/qhull_p.lib;debug;D:/libraries/vcpkg/installed/x64-windows/lib/qhull_p.lib)
My small test project only find the includes - investigating how to add the libraries as well.

@jafrado
Copy link
Copy Markdown

jafrado commented Feb 7, 2020

@larshg - thank you so much for finding this first; I'm now trying to build all PCL packages using vcpkg as well. Running into the same issue.

@NancyLi1013 - thanks, yes, I did update my repo and include all of your changes. If you have the time, could you test the sample qhull test application which is representative of what Lars and I are trying to get working. I did test this with the PCL pre-installed (1.9.1) and I also tested this both on Linux and Windows with my build. If we can get the QHull to work correctly with vcpkg, we could use vcpkg for everything!

Here is my test app, I just added it: https://github.com/jafrado/qhulltest

@jafrado
Copy link
Copy Markdown

jafrado commented Feb 7, 2020

@NancyLi1013 - just tried from current master, same thing:

CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:9 (set_property):
  set_property could not find TARGET Qhull::qhullcpp_d.  Perhaps it has not
  yet been created.
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:10 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  Qhull::qhullcpp_d
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:19 (set_property):
  set_property could not find TARGET Qhull::qhullstatic_d.  Perhaps it has
  not yet been created.
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:20 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  Qhull::qhullstatic_d
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:29 (set_property):
  set_property could not find TARGET Qhull::qhullstatic_rd.  Perhaps it has
  not yet been created.
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:30 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  Qhull::qhullstatic_rd
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:39 (set_property):
  set_property could not find TARGET Qhull::qhull_rd.  Perhaps it has not yet
  been created.
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:40 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  Qhull::qhull_rd
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:103 (set_property):
  set_property could not find TARGET Qhull::qhull_d.  Perhaps it has not yet
  been created.
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:104 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  Qhull::qhull_d
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:113 (set_property):
  set_property could not find TARGET Qhull::qhull_pd.  Perhaps it has not yet
  been created.
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets-debug.cmake:114 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  Qhull::qhull_pd
Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:140 (include)
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)


CMake Error at C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake:150 (message):
  The imported target "Qhull::qhullcpp_d" references the file

     "C:/msft/vcpkg/installed/x64-windows/share/qhull/../../debug/lib/qhullcpp_d.lib"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullTargets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  C:/msft/vcpkg/installed/x64-windows/share/qhull/QhullConfig.cmake:1 (include)
  CMakeLists.txt:25 (find_package)

The version I compiled works fine, but with my app and the test app I just sent you. Please try my test app after doing:

vcpkg install qhull --triplet x64-windows
vcpkg install pcl[opengl] pcl[tools] pcl --triplet x64-windows

It should compile and run as in the example I provided here:
https://github.com/jafrado/qhulltest

@ras0219-msft ras0219-msft removed the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Feb 7, 2020
@jafrado
Copy link
Copy Markdown

jafrado commented Feb 10, 2020

Hi @NancyLi1013 - could you take a look? Thanks.

@larshg
Copy link
Copy Markdown
Contributor

larshg commented Feb 10, 2020

@jafrado you wrote you used latest master, but have you explicitly merged this PR as well?

@jafrado
Copy link
Copy Markdown

jafrado commented Feb 10, 2020

@larshg - I pulled master last Friday and tried to build the sample. No joy. However, if I build qhull by hand (manually via cmake-gui) and use this instead, it works fine. Did you get it working? Maybe there is some trick :)

@NancyLi1013
Copy link
Copy Markdown
Contributor Author

Hi @jafrado and @larshg
thanks for your info about this.
I will check this again and test the issue you provided above. But in fact, there should be no the suffix -d in debug mode. Since I have removed it.

@jafrado
Copy link
Copy Markdown

jafrado commented Feb 11, 2020

Hi @NancyLi1013,

Some good news, I think I figured out what was wrong. On my system, I had two installs of vcpkg, one in c:\vcpkg and the other in c:\msft\vcpkg - now to answer your question and that from @larshg - I did patch my local vcpkg build in both, with your changes, however, I got the strange errors you see above.

Now here is where it gets interesting. I deleted my c:\msft\vcpkg (and there is another issue with that in that you can't remove wildcards), but alas I wrote a .bat file and deleted everything. I then went back and rebuild EVERYTHING from c:\vcpkg and when completed, I did the usual "vcpkg integrate install"

Guess what! It works now ... it seems like there are now a couple more issues - 1) you can't have two copies of vcpkg on your system (even if you only did vcpkg integrate install it somehow gets screwed up) 2) reg-ex doesn't work and 3) VTK with QT+OpenGL doesn't build (I will open a separate issue and provide a patch and test-app for that tomorrow if you can confirm the above).

To recreate my whole dev environment from scratch, here is what I use to build:

vcpkg install eigen3 flann gtest qhull --triplet x64-windows
vcpkg install vtk[qtopengl] --triplet x64-windows
vcpkg install pcl[opengl] pcl[qt] pcl[pcap] pcl[tools] pcl --triplet x64-windows --recurse
vcpkg install opencv --triplet x64-windows

Then, to build PCL app and configure the qhulltest I listed above:

C:\src\qhulltest\build>cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_APPLOCAL_DEPS=ON -DPCL_BUILD_WITH_BOOST_DYNAMIC_LINKING_WIN32=ON -DPCL_BUILD_WITH_FLANN_DYNAMIC_LINKING_WIN32=ON -DPCL_BUILD_WITH_QHULL_DYNAMIC_LINKING_WIN32=ON -DBUILD_global_tests=ON -DBUILD_tools=OFF -DBUILD_surface_on_nurbs=ON
C:\src\qhulltest\build>devenv /rebuild Release qhull_gpf_test.sln

It works and generates an exe in:

Release\qhull_gpf_test.exe

Regarding the debug postfix:

I use CMAKE_DEBUG_POSTFIX="d" for my build options. In most cases, applications correctly set the suffix for debug builds to include "d" at the end. When you set this CMake variable it ensures that everthing works. I guess you're saying I don't need that.

Anyhow, if you could test out the above and build the app; please commit the changes and sorry for any confusion this caused. Thank you very much!

@jafrado
Copy link
Copy Markdown

jafrado commented Feb 11, 2020

@larshg - yes, I did patch it. I found out you can't have more than one vcpkg in your system and I could build today with a clean vcpkg install - I guess there can be only one, thank you!

@larshg
Copy link
Copy Markdown
Contributor

larshg commented Feb 11, 2020

@NancyLi1013 yes, I noticed that the library names are the same, but paths as well.

Shouldn't the debug library find the one on debug\lib folder instead?

@NancyLi1013
Copy link
Copy Markdown
Contributor Author

@jafrado thanks for your so detailed description and test about this issue.
First, it is possible to clone two vcpkgs. When you used the library in different directories, you need to update toolchain to new directory.
I am testing the app you provided above. I will tell you the result once the test is end.

@larshg as you said, the debug library should find the one on debug\lib folder. If not like this, please post the error info or describe it more clearly. I also will check this later.

Thanks.

@larshg
Copy link
Copy Markdown
Contributor

larshg commented Feb 11, 2020

Well, there is no error per se. Only that it find the same folder path as I posted earlier.

It adds the same path to both debug and release.

@jafrado
Copy link
Copy Markdown

jafrado commented Feb 11, 2020

@NancyLi1013 - thank you for looking into this; well, I have not had any success with two copies of vcpkg, that sent me out in the wrong direction so I will wait until this issue is fixed before I try that again.

Today I tried testing what I built yesterday. A few things to mention:

C:\src\qhulltest\build>cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake 
C:\src\qhulltest\build>devenv /rebuild Release qhull_gpf_test.sln
C:\src\qhulltest\build>devenv /rebuild Debug qhull_gpf_test.sln

That builds everything from scratch with your patch now and links correctly.

However, NEITHER THE RELEASE OR DEBUG VERSION RUNS!

In Debug build, it does not find lz4.dll, or libpng16.dll; however, both lz4d.dll and libpng16d.dll are in the Debug directory. Copying the non-debug versions it is looking for (lz4.dll and libpng16.dll) gives the runtime error:

The procedure entry point inflateValidate could not be located in the dynamic link library C:\src\qhulltest\build\Debug\libpng16.dll

See below images:
image
image
image

In Release mode, the app simply crashes with a back-trace that makes no sense. See image below:
image

So as @larshg said earlier, the debug mode is broken; and unfortunately it seems I still cannot build pcl/qhull with vcpkg. Looking forward to your findings (and fix) for qhull with the sample app.
Thank you very much!

@NancyLi1013
Copy link
Copy Markdown
Contributor Author

Hi @jafrado

Sorry for the late reply.

I have tested the sample app you provided above.
Of course, I found something wrong too. lz4 and libpng can't be found when execute *.exe.

This only happened when building debug type.

But I don't agree with that this is related with qhull.
Since pcl depends on qhull ,vtk, libpng. vtk depends on lz4, libpng. it doesn't mater with qhull.
It might be the way that is to use lz4 and libpng in pcl or vtk is not correct.

Could you please check it again?

@jafrado
Copy link
Copy Markdown

jafrado commented Feb 13, 2020

Hi @NancyLi1013,

No problem; thank you for your reply. Well, I did check it again this morning, it doesn't make sense that the release build fails, and I realized I had my command line argument wrong in the debug arguments (it requires a PCD file as in the documentation) and also, I missed the VC Runtime DLL's, these somehow do not get copied with devenv:


C:\src\qhulltest\build\Release>dumpbin /dependents qhull_gpf_test.exe
Microsoft (R) COFF/PE Dumper Version 14.24.28314.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file qhull_gpf_test.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

    vtkRenderingOpenGL2-8.2.dll
    vtkInteractionStyle-8.2.dll
    vtkRenderingFreeType-8.2.dll
    vtkCommonCore-8.2.dll
    pcl_io_release.dll
    pcl_common_release.dll
    KERNEL32.dll
    ADVAPI32.dll
    MSVCP140.dll
    VCRUNTIME140.dll
    VCRUNTIME140_1.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-time-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll

  Summary

        4000 .data
        4000 .pdata
       13000 .rdata
        1000 .reloc
        1000 .rsrc
       4E000 .text

The files below were missing so I copied them into the release directory:


    KERNEL32.dll
    ADVAPI32.dll
    MSVCP140.dll
    VCRUNTIME140.dll
    VCRUNTIME140_1.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-time-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll

And now when you run from command line:


C:\src\qhulltest\build\Release>qhull_gpf_test.exe c:\src\qhulltest\countertop\1.pcd
Planar segmentation:101279 points
Convex hull:18 points
Prism:93461 points

C:\src\qhulltest\build\Release>

(Press 'r' to resize and recenter the point cloud in PCL Viewer, and then 'q' to quit)
So the issue is exactly as @larshg mentioned, the path to the debug libraries is incorrect.
To demonstrate that, all you need to do is issue these commands in your debug directory:


C:\src\qhulltest\build\Debug>xcopy C:\vcpkg\installed\x64-windows\debug\bin\libpng16d.dll libpng16.dll
Overwrite C:\src\qhulltest\build\Debug\libpng16.dll (Yes/No/All)? y
C:\vcpkg\installed\x64-windows\debug\bin\libpng16d.dll
1 File(s) copied

C:\src\qhulltest\build\Debug>xcopy C:\vcpkg\installed\x64-windows\debug\bin\lz4d.dll lz4.dll
Overwrite C:\src\qhulltest\build\Debug\lz4.dll (Yes/No/All)? y
C:\vcpkg\installed\x64-windows\debug\bin\lz4d.dll
1 File(s) copied

C:\src\qhulltest\build\Debug>qhull_gpf_test.exe c:\src\qhulltest\countertop\1.pcd
Planar segmentation:101279 points
Convex hull:18 points
Prism:93461 points

C:\src\qhulltest\build\Debug>

I think it might be worth testing to see if you add the below flags, it fixes the problem, or at least if we force this then we're guaranteeing that the correct flavor of debug library is built:


C:\src\qhulltest\build>cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_DEBUG_POSTFIX=d

Could you check this issue? I just added command line checking to the test app; and just did a commit. I also added an ifdef where you can link with just PCL and VTK and do RANSAC and no Pyramidal extraction/Qhull operations.

Thank you very much!

@larshg
Copy link
Copy Markdown
Contributor

larshg commented Feb 16, 2020

Hi @NancyLi1013

I think that PCL has a bug in how it finds qhull - after I added qhull like this

its properly added with correct paths to both release and debug version.

@jafrado You can try link to qhull using Qhull::qhull_p or the version that you now would like, ie static version depending on how you build it with PCL.

regards, Lars

@NancyLi1013
Copy link
Copy Markdown
Contributor Author

Hi @larshg
thanks for your test and info.
I also noticed that the values of QHULL_LIBRARIES linked are like this:
QHULL_LIBRARIES:optimized;E:/vcpkg/installed/x64-windows/debug/lib/qhull_p.lib;debug;E:/vcpkg/installed/x64-windows/debug/lib/qhull_p.lib

Either in debug type or release type, it seems that both of them target at debug/lib. This is also a bug in the test app that provided by @jafrado .

So could you help check it again to confirm if you used qhull successfully?

@jafrado
Copy link
Copy Markdown

jafrado commented Feb 17, 2020

@NancyLi1013, @larshg - I use

target_link_libraries(${PROJECT_NAME} ${PCL_LIBRARIES} ${QHULL_LIBRARIES})

and the line that @larshg provided uses:

target_link_libraries(TestQhull Qhull::qhull_p)

It doesn't matter if you use either line, the behavior is the same as my last post and status report. I just confirmed the same.

@larshg
Copy link
Copy Markdown
Contributor

larshg commented Mar 5, 2020

@NancyLi1013 I think this patch works fine with my minimal example using both dynamic or static linking.

However is there a reason to remove the "d" from debug libraries? Then you can't have both debug and release side by side if it is removed?

As of PCL there needs to be some update for PCL to properly find the correct libraries. Supporting both the old way and the new way with CONFIG.

Edit:
The old in PCL way search for library names with d for the debug versions, so this would be required to keep for easier implementation.

@larshg
Copy link
Copy Markdown
Contributor

larshg commented May 12, 2020

@NancyLi1013 Can we maybe revive this one, as we have a pending PR at PCL to find qhull with a new method and now we get the above mentioned errors again.

See PointCloudLibrary/pcl#3741 for reference.

@NancyLi1013
Copy link
Copy Markdown
Contributor Author

@larshg
Sorry for the delay for this PR.
I will check this PR today.

@larshg
Copy link
Copy Markdown
Contributor

larshg commented May 14, 2020

Is there some way to only limit to build only whats required/asked for - right now it build all the different versions, dynamic and static, qhull/qhull_p, qhull_r and tools?

@NancyLi1013
Copy link
Copy Markdown
Contributor Author

If you have the requirements, it might be better to bring up this to the upstream.

@larshg
Copy link
Copy Markdown
Contributor

larshg commented May 15, 2020

Ah yes, it should probably be part of their CMake script, to enable/disable wanted libraries. Just wanted to reduce required time/cpu/power.

@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label Jun 11, 2020
@kunaltyagi
Copy link
Copy Markdown

Has there been any progress towards merging this?

@NancyLi1013
Copy link
Copy Markdown
Contributor Author

The current solution is not suitable. So it cannot be merged now.

@strega-nil
Copy link
Copy Markdown
Contributor

strega-nil commented Jul 9, 2020

Should we close this PR then @NancyLi1013 ?

@NancyLi1013
Copy link
Copy Markdown
Contributor Author

Thanks for your kindly reminder. It might be better to open a new PR to fix this in the future. So I'm closing this PR now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-bug The issue is with a library, which is something the port should already support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants