Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#17578 closed defect (fixed)

gdal links with libraries it doesn't declare dependencies on

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: seanasy@…
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: Cc:
Port: gdal

Description

gdal links with many libraries that it doesn't declare dependencies on.

It declares dependencies on proj, jpeg, tiff, libgeotiff, zlib, libpng, and giflib. However:

$ otool -L   /mp/lib/libgdal.1.dylib
/mp/lib/libgdal.1.dylib:
        /mp/lib/libgdal.1.dylib (compatibility version 14.0.0, current version 14.1.0)
        /mp/lib/libproj.0.dylib (compatibility version 6.0.0, current version 6.4.0)
        /mp/lib/libgeos_c.1.dylib (compatibility version 6.0.0, current version 6.2.0)
        /mp/lib/libgeos-3.0.3.dylib (compatibility version 0.0.0, current version 0.0.0)
        /mp/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0)
        /mp/lib/libjasper.1.dylib (compatibility version 2.0.0, current version 2.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.10)
        /mp/lib/libgif.4.dylib (compatibility version 6.0.0, current version 6.6.0)
        /usr/X11R6/lib/libSM.6.dylib (compatibility version 6.0.0, current version 6.0.0)
        /usr/X11R6/lib/libICE.6.dylib (compatibility version 6.3.0, current version 6.3.0)
        /mp/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
        /mp/lib/libgeotiff.1.2.1.dylib (compatibility version 1.2.1, current version 0.0.0)
        /mp/lib/libtiff.3.dylib (compatibility version 12.0.0, current version 12.2.0)
        /mp/lib/libjpeg.62.dylib (compatibility version 63.0.0, current version 63.0.0)
        /mp/lib/libpng12.0.dylib (compatibility version 34.0.0, current version 34.0.0)
        /mp/lib/libcurl.4.dylib (compatibility version 6.0.0, current version 6.1.0)
        /mp/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
        /mp/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
        /mp/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

As you see, it links with those and also X11, openssl, curl, jasper, sqlite3 (even if you don't select the +sqlite3 variant), geos (even if you don't select the +geos variant)...

Change History (10)

comment:1 Changed 15 years ago by seanasy@…

I'm not sure this is a problem.

  1. I don't want to create variants for every configure option, but only for 'non-standard' ones that depend on other non-standard ports.
  2. I'm assuming it's safe to link things like geos and sqlite3 if they're already installed.
  3. Some things should just be linked if they are available. e.g. libz, libcurl.

I could be convinced I'm wrong, especially about #2.

comment:2 Changed 15 years ago by blb@…

The problem is that (using sqlite3 for the example here) if it links against sqlite3 without declaring the dependency, then the sqlite3 port can be removed with 'port uninstall sqlite3' without complaint. After that, the gdal port is broken since it is now linked against uninstalled files, hence anything linked to libgdal will fail.

comment:3 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

So, the moral is, a port must declare dependencies on things it links with. If the software can optionally link with something, the port must either declare a dependency on it, or it must disable the feature so that it never links with it even if the library is present. If you want to make features available optionally in your port, then you make variants which remove the disable configure switch and add the enable configure switch and the dependency for that feature.

comment:4 in reply to:  3 ; Changed 15 years ago by seanasy@…

Thank you, both. That clears it up for me. The explanation by ryandesign should be added to the documentation.

comment:5 in reply to:  4 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to seanasy@…:

The explanation by ryandesign should be added to the documentation.

I always like to improve our documentation. Is there a specific section of the Guide where you think it would be most helpful?

comment:6 Changed 15 years ago by seanasy@…

Part of the problem is that gdal links with libraries like giflib which link the X11 libraries. I don't see any way around this.

comment:7 in reply to:  6 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to seanasy@…:

Part of the problem is that gdal links with libraries like giflib which link the X11 libraries. I don't see any way around this.

It's fine that gdal links with giflib since gdal declares a dependency on giflib. If giflib links with X11 libraries, then giflib must declare dependencies on the X11 libraries; that's ticket #18182. If gdal doesn't use X11 itself, then gdal doesn't need to declare dependencies on X11 itself.

What about sqlite3 and geos?

comment:8 Changed 15 years ago by mf2k (Frank Schima)

Ryan, does r46597 fix this ticket?

comment:9 in reply to:  8 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Replying to macsforever2000@…:

Ryan, does r46597 fix this ticket?

Yes, it looks good, thanks.

comment:10 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.