POV-Ray : Newsgroups : povray.unix : Anyone made a static build of 3.8.0-Beta2? : Re: Anyone made a static build of 3.8.0-Beta2? Server Time
2 May 2024 10:33:48 EDT (-0400)
  Re: Anyone made a static build of 3.8.0-Beta2?  
From: William F Pokorny
Date: 7 Oct 2021 08:12:43
Message: <615ee43b$1@news.povray.org>
On 10/6/21 3:48 PM, The Traveler wrote:
> Howdy folks,
> I recently downloaded and compiled 3.8.0-Beta2 with dynamic linking on my
> Lubuntu 20.04 box. Then I though, let's try a static build.
> 
> Nope. Got this error: cannot compute sizeof (size_t)
> 
> A bit more sleuthing turned up ...
> 
> I hadn't noticed it but it appears Ubuntu-based distros have removed practically
> all their system static .a files but also installed a glibc that only compiles
> to dynamic-linked .so builds. To build a static binary, I'd have to do a lot of
> work, including compiling the glibc (gcc) compiler itself with --enable-static
> invoked. It appears a number of the other dependencies would also need
> re-compiling as with static .a libs too.
> 
> Wondering if anyone else, perhaps on another distro, has compiled a static
> version of 3.8.0-Beta2.
> 
> Cheers.
> 
Hi. FWIW.

Not with 3.8.0-Beta2, but I did pay some with LTO, static linking and 
profile guided compiling early this year with my povr branch on my 
Ubuntu 20.04 machine. I never managed to get preview window options to 
statically link (due missing .a archives).

Below the configure command used while linking static for the povr 
branch (povr's configuration set up is different than POV-Ray proper's). 
The v3.8 beta 2 configure options would be somewhat different, but it 
perhaps gives you an idea of what works for a static link.

./configure -q COMPILED_BY="me" CXXFLAGS="-std=c++17 -O3 \
-ffast-math -march=native" LDFLAGS="-s" --with-static-link=\
"-static -Wl,--whole-archive -lpthread -Wl,--no-whole-archive" \
--with-libsdl="no" --with-libsdl2="no" \
--with-x="no" --with-libtiff="no" --with-openexr="no" \
NON_REDISTRIBUTABLE_BUILD=yes --enable-lto

Aside: It looks to me that sometimes the .a archives are not provided 
due security concerns and other times it is due the licensing used for 
one or more parts of any given software package. The tiff libraries, for 
example, are of late defaulted to compression code which requires 
license hooks in anything statically linked with that image library. I 
suspect not providing the .a archives is a way OS distributions can 
avoid being accused of enabling the circumvention of licenses.

Bill P.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.