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

Unable to load shared library 'gdal_wrap' or one of its dependencies #1

Closed
KubaSzostak opened this issue Aug 11, 2019 · 5 comments
Closed

Comments

@KubaSzostak
Copy link

KubaSzostak commented Aug 11, 2019

I run MaxRev.Gdal.Core + MaxRev.Gdal.LinuxRuntime.Minimal on CentOS 7 with simple code:

return new string[] {
   "GDAL Version: " + Gdal.VersionInfo("RELEASE_NAME"),
   "GDAL INFO: " + Gdal.VersionInfo("")
};

This code throws an error:

An unhandled exception has occurred while executing the request. System.TypeInitializationException: The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'gdal_wrap' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgdal_wrap: cannot open shared object file: No such file or directory

The same code work smoothly on Windows

@MaxRev-Dev
Copy link
Owner

This may refer to incompatible version of glibc library.
Linux package was build on the top of Debian 9.7 in WSL using GLIBC 2.24-11.
Yet, it works fine on ubuntu:16.04+ and debian:9.7+.
I'm currently adding tests for several distros, including centos and fedora.

@MaxRev-Dev
Copy link
Owner

Just published new version for linux runtime.
In further packages I will also use glibc 2.17
MaxRev.Gdal.LinuxRuntime.Minimal - 3.0.1

I've built and tested it locally on WSL CentOS 7

image

@BaiC
Copy link

BaiC commented Jan 12, 2023

I run MaxRev.Gdal.Core + MaxRev.Gdal.LinuxRuntime.Minimal (3.6.1.100) on Ubuntu-18.04 with simple code:

GdalBase.ConfigureAll();

This code throws an error:

An unhandled exception of type 'System.TypeInitializationException' occurred in MaxRev.Gdal.Core.dll: 'The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception.'
Inner exceptions found, see $exception in variables window for more details.
Innermost exception System.DllNotFoundException : Unable to load shared library 'gdal_wrap' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgdal_wrap: cannot open shared object file: No such file or directory
at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_Gdal(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate)
at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper..cctor()

The same code work fine on Windows

@MaxRev-Dev
Copy link
Owner

@BaiC Ubuntu18.04 support window is until April 30, 2023 EOL.

After much thought, I decided to stay on Debian 11.
There are several reasons why.

  • GDAL requires SWIG 4. There is no RPM package, but of course, It can be installed with some additional efforts on older systems.
  • Some packages failed to install on CentOS7 (boost deps, deprecated rpm packages).
    This will require additional investigation time and is difficult to maintain independently.
  • CentOS will receive updates only for one year (until June 30, 2024). Then we will have to find another LTS distro.
  • Most Microsoft base images are built on top of Debian 11.
  • You receive a newer GLIBC 2.31 (2020).
  • Most systems that use GLIBC lower than 2.31 are out of support or will be soon.

You have several options:

  • Use a Dockerized version of your app (sample)
  • Use a newer environment if you can (Debian 11, Ubuntu 20.04).

@KubaSzostak
Copy link
Author

You can use older version of the package. For example 3.1.2.110 will work with Ubuntu 18.04. But I agree with @MaxRev-Dev, upgrading Ubuntu would be a wise decision. Not only because of maintenance end. Ubuntu 22.04 has great improvement on caching file reading. Take a look at picture bellow. The same code executed on two VMs. On the left is Ubuntu 18.04 and on the right Ubuntu 22.04. Whatever data you want to utilize using MaxRev.Gdal library you will get performance boost by upgrading to Ubuntu 22.04.

afs-ubuntu-dotnet-performance

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

No branches or pull requests

3 participants