Opened 8 years ago
Last modified 6 years ago
#3230 new defect
lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
Reported by: | vince | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.4.5 |
Component: | LibRaster | Version: | svn-releasebranch72 |
Keywords: | macosx | Cc: | |
CPU: | Unspecified | Platform: | MacOSX |
Description
static void load_library(void) { static const char *const candidates[] = { # ifdef __unix__ "libgdal.so.20", "libgdal.so.1", "libgdal.1.1.so", "gdal.1.0.so", "gdal.so.1.0", "libgdal.so", "libgdal1.6.0.so", "libgdal1.7.0.so", # endif
Humm… where is “libgdal.20.dylib” for poor MacOS X users?
Shame on you! :P :P
Change History (19)
comment:1 by , 8 years ago
Keywords: | macosx added |
---|---|
Milestone: | → 7.0.6 |
comment:2 by , 8 years ago
comment:4 by , 8 years ago
test.c:
#include <stdio.h> int main (int argc, char * argv []) { #ifdef __APPLE__ printf ("Apple!\n"); #else print ("Something else. Yuck :P\n"); #endif }
Air > clang -o test test.c Air > ./test Apple!
comment:5 by , 8 years ago
Replying to vince:
Will try and let you know. Thanks for your reactivity
really for my reactivity? No, thanks :-)
comment:6 by , 8 years ago
Woops, sorry. I didn’t mean you were sour. :P Sometimes when I’m tuckered some French words manage to seep in.
I’m still stuck though. Adding the dylib name won’t suffice, as MacOS X doesn’t define LD_LIBRARY_PATH, so the whole path is needed.
Isn’t there a way to define default library paths at compile time?
comment:7 by , 8 years ago
By the way, unix is not defined by clang on MacOS, so I have to replace all occurrences of unix by APPLE . It would be nice to have both in the code…
comment:8 by , 7 years ago
Milestone: | 7.0.6 → 7.0.7 |
---|
follow-up: 11 comment:9 by , 7 years ago
Milestone: | 7.0.7 → 7.4.1 |
---|
Since GDAL 2.3.0 is due soon, I was wondering how up-to-date the code in question is:
lib/raster/gdal.c
static void load_library(void) { static const char *const candidates[] = { # ifdef __unix__ "libgdal.so.20", "libgdal.so.1", "libgdal.1.1.so", "gdal.1.0.so", "gdal.so.1.0", "libgdal.so", "libgdal1.6.0.so", "libgdal1.7.0.so", # endif # ifdef _WIN32 "gdal202.dll", "gdal201.dll", "gdal200.dll", "gdal111.dll", "gdal110.dll", "gdal19.dll", "gdal18.dll", "gdal17.dll", "gdal16.dll", "gdal15.dll", "gdal11.dll", "gdal.1.0.dll", "libgdal-1.dll", "gdal.dll", # endif NULL }; int i;
This ticket is still open, so probably it should be all revisited now.
comment:10 by , 7 years ago
Milestone: | 7.4.1 → 7.4.2 |
---|
comment:11 by , 6 years ago
Replying to neteler:
Since GDAL 2.3.0 is due soon, I was wondering how up-to-date the code in question is:
lib/raster/gdal.c
... any suggestion? This is now rather imminent.
comment:12 by , 6 years ago
gdal203.dll was added in r73573:73575
Not sure about other needed changes?
# ifdef __unix__
seems to be lagging behind?
@cmbarton: what about MacOS? Should libgdal.20.dylib or similar be added?
comment:16 by , 6 years ago
This hasn't been corrected in 7.6 :(
Also, I think the smartest way to handle this is to make the configure script record the proper path to the GDAL library using gdal-config. Once the access path is known, there is no need for that (silly?) function enumerating all possible names and forgetting about some.
Also more ifdef APPLE are needed here and there in the same file.
follow-up: 19 comment:18 by , 6 years ago
Yes, I could probably do that within a few days, if you’re willing to integrate it.
comment:19 by , 6 years ago
Replying to vince:
Yes, I could probably do that within a few days, if you’re willing to integrate it.
Problem solving contributions are always welcome :-)
Based on (1) correct identification is
or
is enough?
(1) https://sourceforge.net/p/predef/wiki/OperatingSystems/