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

Build failure without libpng installed with -DGDAL_USE_PNG=OFF #5742

Closed
thesamesam opened this issue May 17, 2022 · 3 comments
Closed

Build failure without libpng installed with -DGDAL_USE_PNG=OFF #5742

thesamesam opened this issue May 17, 2022 · 3 comments
Assignees

Comments

@thesamesam
Copy link
Contributor

Expected behavior and actual behavior.

When libpng is not installed, the build fails:

-- The following RECOMMENDED packages have not been found:

 * PNG
   PNG compression library (external)
 * QHULL
   Enable QHULL (external)
 * LERC
   Enable LERC (external)
 * BRUNSLI
   Enable BRUNSLI for JPEG packing in MRF

-- Disabled components:

 * MYSQL component has been detected, but is disabled with GDAL_USE_MYSQL=no
 * ZSTD component has been detected, but is disabled with GDAL_USE_ZSTD=no
 * JPEG component has been detected, but is disabled with GDAL_USE_JPEG=OFF, and the internal library is also disabled with GDAL_USE_JPEG_INTERNAL=OFF
 * SQLITE3 component has been detected, but is disabled with GDAL_USE_SQLITE3=no
 * WEBP component has been detected, but is disabled with GDAL_USE_WEBP=no
 * POSTGRESQL component has been detected, but is disabled with GDAL_USE_POSTGRESQL=no
 * LIBLZMA component has been detected, but is disabled with GDAL_USE_LIBLZMA=no
 * LZ4 component has been detected, but is disabled with GDAL_USE_LZ4=OFF
 * OPENJPEG component has been detected, but is disabled with GDAL_USE_OPENJPEG=no


-- Internal libraries enabled:

 * SHAPELIB internal library enabled


-- <<< Gentoo configuration >>>
Build type      RelWithDebInfo
Install path    /usr
Compiler flags:
C               -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches     -ggdb3 -Werror=format-security -Werror=implicit-function-declaration -fvisibility=hidden
C++             -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -D_GLIBCXX_ASSERTIONS -ggdb3 -Werror=format-security -fvisibility=hidden
Linker flags:
Executable      -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0
Module          -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,--no-undefined
Shared          -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,--no-undefined

-- Configuring done
CMake Error at gdal.cmake:478 (target_link_libraries):
  Target "GDAL" links to:

    PNG::PNG

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  CMakeLists.txt:218 (include)


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
 * ERROR: sci-libs/gdal-3.5.0-r2::gentoo failed (configure phase):
 *   cmake failed

Full log: build.log

Steps to reproduce the problem.

  1. Have a system without libpng installed.
  2. Attempt to build gdal using the CMake build system with -DGDAL_USE_PNG=OFF

Operating system

Gentoo

GDAL version and provenance

3.5.0

@thesamesam
Copy link
Contributor Author

Very similar to #5741. I don't know enough about GDAL to quickly spot where the missing conditionals are, as I odn't know which plugins make sense without PNG (and JPEG -- which is harder to follow as an outsider b/c of the internal version too) respectively.

gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue May 17, 2022
Force on jpeg & png for now. It's not ideal but reported both upstream
and I lack the gdal internals knowledge to deduce whether the various
plugins which depend on each of them are functional (enough?) without
each of them.

They're both pretty small dependencies and hard to avoid in general,
although I accept it's an inconvenience, some of this stuff was fairly
expected & unavoidable with the big port to CMake.

Bug: OSGeo/gdal#5741
Bug: OSGeo/gdal#5742
Bug: https://bugs.gentoo.org/844751
Signed-off-by: Sam James <sam@gentoo.org>
@rouault rouault self-assigned this May 17, 2022
rouault added a commit to rouault/gdal that referenced this issue May 17, 2022
rouault added a commit that referenced this issue May 19, 2022
CMake: fix build without PNG and JPEG (fixes #5741, fixes #5742)
github-actions bot pushed a commit that referenced this issue May 19, 2022
CMake: fix build without PNG and JPEG (fixes #5741, fixes #5742)
rouault added a commit that referenced this issue May 19, 2022
[Backport release/3.5] CMake: fix build without PNG and JPEG (fixes #5741, fixes #5742)
@thesamesam
Copy link
Contributor Author

Thanks a lot for the fixes!

@DrChai
Copy link

DrChai commented May 24, 2022

Just built it without exception. Thanks for the quick fix!

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

3 participants