[gdal-dev] Build static GDAL-Lib and static GDAL-Apps

Robert Coup robert.coup at koordinates.com
Mon Feb 12 06:42:47 PST 2024


Hi Michael,

On Mon, 12 Feb 2024 at 12:02, Michael Otto via gdal-dev <
gdal-dev at lists.osgeo.org> wrote:

>
> The goal is to cast GDAL and all its dependencies (PROJ / GEOS / all
> dependencies to system libraries / ...) into a static library and to create
> the GDAL apps as static executable programs.


Which platform are you working on? If you need a fully static compilation
of everything *all* the way down including openssl + zlib + zstd + libtiff
+ all the other libraries, using vcpkg[1] might be a reasonable approach.
By default it does static compilation on macOS & Linux, and it has a static
compilation option on Windows (the default on Windows is dynamic). It
doesn't support every compile option though, but it's customisable and if
you're after a reasonably vanilla GDAL it should work ok.


>
> There should be no dynamic dependencies.


Note that GDAL + Proj (maybe others), have data files they rely on, so
while you may be able to get a single executable, you'll still need to
distribute these files. I can imagine ways around that, but they're getting
fairly complex.


> Unfortunately, I have not had any success so far. The library is created
> statically but the apps are not yet.
> Does anyone have experience with this topic or possibly a procedure that
> leads to success?


Can you share the process you've currently got to?

Rob :)

[1] https://github.com/microsoft/vcpkg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240212/4caf8aec/attachment.htm>


More information about the gdal-dev mailing list