-
Notifications
You must be signed in to change notification settings - Fork 188
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
Failed to link libqhullstatic_r.a to a shared library on linux #107
Comments
POSITION_INDEPENDENT_CODE is set for qhull_CPP (#47). Is another change needed? fPIC is tricky to get right. It apparently needs matching settings in multiple places. See the discussion and changes made for Can someone suggest the best way to resolve larshg's problem? larshg, Please extract the relevant log lines from your build. Also the build link is no longer applicable. |
A rule of thumb is that PIC should never be hardcoded in build files of libraries (anything which is not a usage requirement of a library should not be hardcoded in build files), except when some object or static target is linked to a shared library internally. (In conan package manager, we have to patch qhull CMakeLists to remove these hardcoded CMAKE_POSITION_INDEPENDENT_CODE). |
@SpaceIm Did you have to make a custom conan recipe for Qhull?
not sure why it tries to build a shared library even if
did you have a similar issue? Update: It turned out that the library was trying to build some shared libraries and I have Conan/Data directory on an external HDD, so cmake couldn't create symbolic links for these shared libs. |
I agree with spacelm's comment that CMAKE_POSITION_INDEPENDENT_CODE should be the user's responsibility. Is it (1) better to leave CMakeLists.txt as is or (2) revert #47 and thus remove 'POSITION_INDEPENDENT_CODE' from the qhull_CPP configuration? If reverted, users who depend on this setting will need to update their build scripts. |
See https://dev.azure.com/PointCloudLibrary/pcl/_build/results?buildId=20517&view=logs&j=9d3980c9-0219-58cf-8caa-f76ff3e2f24a&t=5bf54fc2-bd9f-533d-02a6-0ecd7f58b56a&l=32458.
It seems the flag -fPIC is not present in the current Cmake build files.
Should we enable it generally or only for the static libraries?
ie. add
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
or set it per target.
The text was updated successfully, but these errors were encountered: