Remove local source copied zlib files#6399
Conversation
75bc47f to
a45d48c
Compare
mvieth
left a comment
There was a problem hiding this comment.
I think I would keep the HAVE_ZLIB preprocessor-define and the WITH_SYSTEM_ZLIB option, and either warn or error-out if WITH_SYSTEM_ZLIB is FALSE. That's a smoother transition for people who use one or the other. And zlib.cmake can probably be removed now?
|
Have updated accordingly. |
There was a problem hiding this comment.
Pull request overview
This pull request removes locally bundled zlib source files from the PCL codebase and transitions to using external system zlib exclusively. The PR description states "External zlib has been default and is the preferred usage."
Changes:
- Removes all local zlib source and header files from
surface/src/3rdparty/opennurbs/andsurface/include/pcl/surface/3rdparty/opennurbs/ - Removes
zlib.cmakebuild configuration file - Updates CMakeLists.txt files to require external ZLIB package and use the modern
ZLIB::ZLIBtarget - Simplifies header files to always use external zlib instead of conditionally using bundled zlib
- Adds deprecation warning for
WITH_SYSTEM_ZLIBoption
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| surface/src/on_nurbs/fitting_curve_2d_asdm.cpp | UNRELATED: Removes m_data->interior_normals.clear() call - appears to be an accidental inclusion |
| surface/src/3rdparty/opennurbs/*.c | Removes all bundled zlib C source files (zutil, uncompr, trees, inftrees, inflate, inffast, infback, crc32, compress, adler32) |
| surface/src/3rdparty/opennurbs/zlib.cmake | Removes zlib CMake configuration file |
| surface/src/3rdparty/opennurbs/opennurbs_zlib.cpp | Removes conditional compilation blocks for bundled zlib, adds include for pcl_config.h |
| surface/include/pcl/surface/3rdparty/opennurbs/*.h | Removes all bundled zlib header files (zutil, zconf, trees, opennurbs_zlib, inftrees, inflate, inffixed, inffast, examples_linking_pragmas, deflate) |
| surface/CMakeLists.txt | Replaces conditional zlib logic with required find_package(ZLIB) and uses modern ZLIB::ZLIB target |
| io/CMakeLists.txt | Adds ZLIB to optional dependencies and links ZLIB::ZLIB when PNG is found |
| CMakeLists.txt | Deprecates WITH_SYSTEM_ZLIB option and always searches for system ZLIB |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -265,7 +265,6 @@ FittingCurve2dASDM::assembleInterior (double wInt, double sigma2, double rScale, | |||
| m_data->interior_line_start.clear (); | |||
| m_data->interior_line_end.clear (); | |||
| m_data->interior_error.clear (); | |||
There was a problem hiding this comment.
This line deletion appears to be unrelated to the purpose of this PR which is to remove local zlib files. The removal of m_data->interior_normals.clear() is a functional change to the code logic. Looking at the rest of the function, interior_normals is still being used at lines 275, 331, and 341, so this deletion may cause inconsistent state. This change should either be removed from this PR or explained in the PR description if it's intentional.
mvieth
left a comment
There was a problem hiding this comment.
Why did you remove examples_linking_pragmas.h? That belongs to opennurbs, not zlib
CMakeLists.txt
Outdated
| endif() | ||
| else() | ||
| message(WARNING "CMake will use a ZLIB version bundled with the PCL source code. However, that is an older version which may pose a risk and may be removed in a future PCL release. It is recommended to install an up-to-date version of ZLIB on your system and set WITH_SYSTEM_ZLIB=TRUE.") | ||
| message(WARNING "WITH_SYSTEM_ZLIB option is deprecated, has no effect and will be removed in 1.18.") |
There was a problem hiding this comment.
| message(WARNING "WITH_SYSTEM_ZLIB option is deprecated, has no effect and will be removed in 1.18.") | |
| if(NOT WITH_SYSTEM_ZLIB) | |
| message(WARNING "WITH_SYSTEM_ZLIB option is deprecated, has no effect and will be removed in 1.18.") | |
| endif() |
Maybe like this, so that the warning is not always displayed, only when someone chooses the deprecated behaviour?
There was a problem hiding this comment.
Yeah, I guess when we remove it, people will just see a warning if the supply the argument on cmake call, that it won't be used. Thats why I went with showing always. Maybe it can be checked if the variable is defined or not and if defined, then we print the message.
|
Ahh, maybe I was too quick - I probably removed since I saw zlib in there: https://github.com/PointCloudLibrary/pcl/pull/6399/changes#diff-a4d0602f96c844e85341ecf937a6d4d39aeb46a4c8acbc51fda8ee7a67033450L62 But we can keep it. |
Using system installed zlib.
…causes a out-of-vector bound if its cleared. Example works afterwards.
1aabed4 to
e134f0f
Compare
mvieth
left a comment
There was a problem hiding this comment.
Okay sure, the CMake default not-used warning is fine, too.
External zlib has been default and is the preferred usage.
Makes #6396 obsolete.