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

[Bug] .dylib GDAL libs should be listed in lib/raster/gdal.c #326

Closed
Veence opened this issue Feb 3, 2020 · 7 comments · Fixed by #2290
Closed

[Bug] .dylib GDAL libs should be listed in lib/raster/gdal.c #326

Veence opened this issue Feb 3, 2020 · 7 comments · Fixed by #2290
Labels
macOS macOS specific

Comments

@Veence
Copy link

Veence commented Feb 3, 2020

The file lib/raster/gdal.c has a list of possible GDAL lib names it can dlopen () in the load_library function. However, this list so far has only included .so or .dll suffixes, which are fine for Linux and Windows, but obviously not for MacOS. It would be nice to add something like:

# ifdef _ _APPLE_ _
"libgdal.26.dylib",

That would help eliminate a patch file. Thanks!

@neteler
Copy link
Member

neteler commented Feb 3, 2020

So, something like this?

index 6d1545e10..98fd9ddde 100644
--- a/lib/raster/gdal.c
+++ b/lib/raster/gdal.c
@@ -133,6 +133,9 @@ static void load_library(void)
        "gdal.1.0.dll",
        "libgdal-1.dll",
        "gdal.dll",
+# endif
+# ifdef __APPLE__
+       "libgdal.26.dylib",
 # endif
        NULL
     };

If you have a working patch, please submit it (easier...), thanks

@neteler
Copy link
Member

neteler commented Feb 26, 2020

@metzm may I apply my proposed fix? Any harm to be expected?

@neteler neteler added the macOS macOS specific label Feb 29, 2020
@metzm
Copy link
Contributor

metzm commented Mar 1, 2020

For a proper fix, you would need to list all supported GDAL dylib versions, not only libgdal.26.dylib.

Who could provide such a list of GDAL dylib versions?

@neteler
Copy link
Member

neteler commented Mar 19, 2020

@Veence any idea?

@neteler
Copy link
Member

neteler commented Apr 26, 2020

(un)related: https://trac.osgeo.org/grass/ticket/3230

@neteler
Copy link
Member

neteler commented Apr 26, 2020

For a proper fix, you would need to list all supported GDAL dylib versions, not only libgdal.26.dylib.

Who could provide such a list of GDAL dylib versions?

@rouault do you have an idea for us?

@rouault
Copy link
Member

rouault commented Apr 26, 2020

do you have an idea for us?

yes, but probably not the one you expect: use standard build-time linking mechanism instead of run-time one :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS macOS specific
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants