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

Attempt to use the c version of qhull #713

Merged
merged 9 commits into from
Jul 31, 2023
Merged

Attempt to use the c version of qhull #713

merged 9 commits into from
Jul 31, 2023

Conversation

GiulioRomualdi
Copy link
Member

@GiulioRomualdi GiulioRomualdi commented Jul 26, 2023

On ubuntu 22.04 I got the following error

usr/bin/ld: ../../../lib/libBipedalLocomotionFrameworkPlanners.so.0.14.200: undefined reference to `qh_new_qhull(int, int, double*, unsigned int, char*, _IO_FILE*, _IO_FILE*)'
/usr/bin/ld: ../../../lib/libBipedalLocomotionFrameworkPlanners.so.0.14.200: undefined reference to `qh_memfreeshort(int*, int*)'
/usr/bin/ld: ../../../lib/libBipedalLocomotionFrameworkPlanners.so.0.14.200: undefined reference to `qh_freeqhull(unsigned int)'
collect2: error: ld returned 1 exit status
make[3]: *** [src/Planners/tests/CMakeFiles/SwingFootPlannerUnitTests.dir/build.make:108: bin/SwingFootPlannerUnitTests] Error 1
make[2]: *** [CMakeFiles/Makefile2:3853: src/Planners/tests/CMakeFiles/SwingFootPlannerUnitTests.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:3860: src/Planners/tests/CMakeFiles/SwingFootPlannerUnitTests.dir/rule] Error 2
make: *** [Makefile:1141: SwingFootPlannerUnitTests] Error 2

with qhull installed via APT

@GiulioRomualdi
Copy link
Member Author

I switched to qhull_r and the problem seems to be fixed. Now what is missing is a cmake function that allows the user to find qhull in ubuntu 20.04

@GiulioRomualdi GiulioRomualdi self-assigned this Jul 27, 2023
@traversaro
Copy link
Collaborator

New failures:

[ 66%] Linking CXX executable ../../../bin/ConvexHullHelperUnitTests
/usr/bin/ld: ../../../lib/libBipedalLocomotionFrameworkPlanners.so.0.14.200: undefined reference to `qh_freeqhull(qhT*, unsigned int)'
/usr/bin/ld: ../../../lib/libBipedalLocomotionFrameworkPlanners.so.0.14.200: undefined reference to `qh_memfreeshort(qhT*, int*, int*)'
/usr/bin/ld: ../../../lib/libBipedalLocomotionFrameworkPlanners.so.0.14.200: undefined reference to `qh_zero(qhT*, _IO_FILE*)'
/usr/bin/ld: ../../../lib/libBipedalLocomotionFrameworkPlanners.so.0.14.200: undefined reference to `qh_new_qhull(qhT*, int, int, double*, unsigned int, char*, _IO_FILE*, _IO_FILE*)'
collect2: error: ld returned 1 exit status

@traversaro
Copy link
Collaborator

New failures:

[ 66%] Linking CXX executable ../../../bin/ConvexHullHelperUnitTests
/usr/bin/ld: ../../../lib/libBipedalLocomotionFrameworkPlanners.so.0.14.200: undefined reference to `qh_freeqhull(qhT*, unsigned int)'
/usr/bin/ld: ../../../lib/libBipedalLocomotionFrameworkPlanners.so.0.14.200: undefined reference to `qh_memfreeshort(qhT*, int*, int*)'
/usr/bin/ld: ../../../lib/libBipedalLocomotionFrameworkPlanners.so.0.14.200: undefined reference to `qh_zero(qhT*, _IO_FILE*)'
/usr/bin/ld: ../../../lib/libBipedalLocomotionFrameworkPlanners.so.0.14.200: undefined reference to `qh_new_qhull(qhT*, int, int, double*, unsigned int, char*, _IO_FILE*, _IO_FILE*)'
collect2: error: ld returned 1 exit status

As the symbols are in the library but just with C mangling and not with C++ one:

gitpod@traversaro-gitpodubuntu-j71zab8at4q:/usr/lib/x86_64-linux-gnu$ readelf -s libqhull_r.so.7 | grep qh_free
   229: 0000000000006880  1022 FUNC    GLOBAL DEFAULT   12 qh_freebuild
   357: 00000000000065f0   647 FUNC    GLOBAL DEFAULT   12 qh_freebuffers
   359: 000000000002f430     5 FUNC    GLOBAL DEFAULT   12 qh_free
   396: 0000000000006c80   138 FUNC    GLOBAL DEFAULT   12 qh_freeqhull

I think that we are missing extern "C" like in https://github.com/PointCloudLibrary/pcl/blob/3eabe5a772717028874db24a54bc6f88bffffae8/surface/include/pcl/surface/qhull.h#L49 . Probably this is not necessary in newer verson of qhull available in Ubuntu 22.04 as it is already included in the headers of qhull itself.

Co-authored-by: Silvio Traversaro <silvio.traversaro@iit.it>
@traversaro
Copy link
Collaborator

Cool, now a runtime error:

2023-07-31T15:08:24.9658085Z QH6186 qhull error (qh_new_qhull): start qhull_cmd argument with "qhull "

@traversaro
Copy link
Collaborator

Cool, now a runtime error:

2023-07-31T15:08:24.9658085Z QH6186 qhull error (qh_new_qhull): start qhull_cmd argument with "qhull "

Hopefully this will be fixed by #713 (comment) .

@traversaro
Copy link
Collaborator

Ok, now only brew is failing and I guess that is expected.

@GiulioRomualdi
Copy link
Member Author

Thank you @traversaro I will squash and merge

@GiulioRomualdi GiulioRomualdi merged commit 4f37f5a into master Jul 31, 2023
@GiulioRomualdi GiulioRomualdi deleted the qhullc branch July 31, 2023 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants