[gdal-dev] Enabling DAP appears to disable several other formats

Charlie Sharpsteen chuck at sharpsteen.net
Fri Apr 20 12:51:26 EDT 2012


On Thu, Apr 19, 2012 at 6:48 PM, Charlie Sharpsteen <chuck at sharpsteen.net>wrote:

> On Thu, Apr 19, 2012 at 6:40 PM, Frank Warmerdam <warmerdam at pobox.com>wrote:
>
>> Charlie,
>>
>> The typical reason would be that adding opendap adds stuff into the
>> libraries list that results in other "test links" failing.  It would
>> be helpful if you could file a bug and attach the config.log.
>>
>> Best regards,
>> Frank
>
>
> I looked through the config.log a little closer, and in all four cases the
> following argument was added to the compiler flags:
>
>     -arch x86_64 i386 ppc
>
> This is bad for two reasons:
>
>   - I'm not trying to build a universal binary and all of my components
> are x86_64 only.
>
>   - `-arch x86_64 i386 ppc` isn't even a valid compiler flag. The proper
> thing to pass would be `-arch x86_64 -arch i386 -arch ppc`, so the compiler
> would error out even if I had the universal binaries to support a 3-way
> build.
>
> I've traced the offending flags to `dap-config` so it looks like this is
> an OpenDAP bug now, not a GDAL bug.
>
> Apologies for the noise.
>
>
> -Charlie
>


A final followup on this situation for anyone else who is trying to build
GDAL with libdap support on OS X.

The root cause of the problem came down to bad pkg-config files shipped
with OS X 10.6 and 10.5. When libdap builds, information on curl is
requested from `pkg-config` using the following:

    pkg-config --static --libs libcurl


On Snow Leopard, the default `libcurl.pc` file will return the following in
answer to the above query:

    -Wl,-weak-lldap -dynamic -arch x86_64 i386 ppc -Os -pipe -g0
-Wno-system-headers -Wl,-search_paths_first -Wl,-weak-lgssapi_krb5
-Wl,-weak-lkrb5 -Wl,-weak-lk5crypto -Wl,-weak-lcom_err -Wl,-weak-lresolv
-lcurl -lssl -lcrypto -lz


As you can see, this contains the string `-arch x86_64 i386 ppc` which is
both troublesome (forces universal binary builds when you don't want them)
and illegal (each architecture _must_ be proceeded by a new -arch flag).
The flags returned by `pkg-config` are also stored in the `dap-config`
script and from there they contamination spreads to other packages like
GDAL. The `libcurl.pc` file shipped with OS X 10.7 is much more sane and
does not suffer from these problems.


Solution:

When configuring libdap on Leopard or Snow Leopard, always pass
"--with-curl=/usr" if you want to build against the system curl. Providing
information on curl will cause the configure script to avoid querying
pkg-config and receiving bad flags.


Hope this helps anyone else who runs into this problem!

-Charlie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120420/9d31fd53/attachment.html


More information about the gdal-dev mailing list