[gdal-dev] Antwort: Re: Build static GDAL-Lib and static GDAL-Apps

Michael Otto michael.otto at data-experts.de
Tue Feb 20 03:22:05 PST 2024


Hi Robert,

because I'm not getting anywhere with the "standard" CMake solution, I've 
now used the vcpkg you mentioned and am using it in a Virtualbox VM with 
Linux Mint.

I got the installation instructions from here: 
https://github.com/microsoft/vcpkg?tab=readme-ov-file#quick-start-unix. I 
have installed the Linux developer tools (see instructions).

I have installed vcpkg under 
'root at vmuser-VirtualBox:/home/vmuser/Git/vcpkg'.

When installing the libraries, it seems that a lot of dependencies are 
also loaded, compiled and installed in the now large set of directories.

The directory './vcpkg/packages/<packageName>_x64-linux' now contains the 
compiled static versions of the libraries. But where can I find the GDAL 
apps? These are not contained in this directory. 

I am still new to the topic of "self-compiling".
Do you have any tips on what else I need to do?

Michael




Von:    "Robert Coup" <robert.coup at koordinates.com>
An:     "Michael Otto" <michael.otto at data-experts.de>
Kopie:  gdal-dev at lists.osgeo.org
Datum:  12.02.2024 15:43
Betreff:        Re: [gdal-dev] Build static GDAL-Lib and static GDAL-Apps



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/20240220/00c89f89/attachment.htm>


More information about the gdal-dev mailing list