First of all, I wish you to be patient & bring your snacks. Compilation from scratch takes nearly for 1 hour. But from version 3.6 it looks faster with CMake.
NOTE: this pipeline will build only dynamic libraries package.
C# Bindings (aka Core) are currently build in windows
I'm compiling on Debian 11 with GLIBC 2.31 (2020). See CI/CD pipeline for details.
sudo apt-get install g++ make cmake git curl zip unzip tar pkg-config linux-headers-amd64 autoconf automake python3 autoconf-archive swig patchelf
https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian#debian-11.
Libraries can be installed in two ways.
- VPKG - recommended. Latest versions, no collisions with other dynamic libraries.
- APT package manager - if vcpkg does not provide any. Can create conficts with other library dependencies.
Each library enables one driver
sudo apt-get install libhdf4-dev libnetcdf-dev
sudo apt-get install libspatialite-dev libpoppler-dev
Simply run make
in current folder to start GNUmakefile which constists of steps described below.
Still, you can execute them sequentially if needed.
# install libraries with VCPKG
make -f vcpkg-makefile BUILD_ARCH=arm64
# install main libraries (proj,gdal)
# > optional use [target]-force to run from scratch, ex. gdal-force
make -f gdal-makefile BUILD_ARCH=arm64
# collect dynamic libraries
make -f collect-deps-makefile BUILD_ARCH=arm64
# create packages (output to 'nuget' folder)
make -f publish-makefile pack BUILD_ARCH=arm64
# testing packages
# > optional PRERELEASE=1 - testing pre-release versions
# > optional APP_RUN=1 - testing via console app run (quick, to ensure deps were loaded correctly)
make -f test-makefile test BUILD_ARCH=arm64
Run tests. If everything loads correctly - you're good.
Or after collecting libraries, run readelf.
Don't forget to set LD_LIBRARY_PATH. See copy-deps target in collect-deps for details. Assumming the repo path is /root/gdal.netcore
.
readelf -d "/root/gdal.netcore/build-unix/gdal-build/lib/libgdal.so" | grep NEEDED
Or using ldd:
ldd "/root/gdal.netcore/build-unix/gdal-build/lib/libgdal.so"