[GRASS-dev] [GRASS GIS] #3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
-----------------------+---------------------------------
Reporter: vince | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: LibRaster | Version: svn-releasebranch72
Keywords: | CPU: Unspecified
Platform: MacOSX |
-----------------------+---------------------------------
{{{
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! :stuck_out_tongue: :stuck_out_tongue:

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.6
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------
Changes (by martinl):

* keywords: => macosx
* milestone: => 7.0.6

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.6
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by martinl):

Based on (1) correct identification is

{{{
__APPLE__ && __MACH__
}}}

or

{{{
__APPLE__
}}}

is enough?

(1) https://sourceforge.net/p/predef/wiki/OperatingSystems/

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.6
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by vince):

Will try and let you know. Thanks for your reactivity

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.6
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by vince):

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!
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.6
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by martinl):

Replying to [comment:3 vince]:
> Will try and let you know. Thanks for your reactivity

really for my reactivity? No, thanks :slight_smile:

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.6
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by vince):

Woops, sorry. I didn’t mean you were sour. :stuck_out_tongue:
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?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.6
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by vince):

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…

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:7&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.1
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------
Changes (by neteler):

* milestone: 7.0.7 => 7.4.1

Comment:

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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:9&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.2
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by neteler):

Replying to [comment:9 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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:11&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.2
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by neteler):

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?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:12&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.5
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by vince):

This hasn't been corrected in 7.6 :frowning:

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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:16&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.5
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by neteler):

@vince: do you see a chance to provide a patch?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:17&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.5
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by vince):

Yes, I could probably do that within a few days, if you’re willing to
integrate it.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:18&gt;
GRASS GIS <https://grass.osgeo.org>

#3230: lib/raster/gdal.c – missing libgdal.20.dylib in the GDAL library names list
--------------------------+---------------------------------
  Reporter: vince | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.5
Component: LibRaster | Version: svn-releasebranch72
Resolution: | Keywords: macosx
       CPU: Unspecified | Platform: MacOSX
--------------------------+---------------------------------

Comment (by neteler):

Replying to [comment:18 vince]:
> Yes, I could probably do that within a few days, if you’re willing to
integrate it.

Problem solving contributions are always welcome :slight_smile:

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3230#comment:19&gt;
GRASS GIS <https://grass.osgeo.org>