POV-Ray / povray

The Persistence of Vision Raytracer (POV-Ray)
https://www.povray.org/
GNU Affero General Public License v3.0
1.37k stars 282 forks source link

Need -lboost_date_time in non-optimized Unix builds #319

Closed iskunk closed 6 years ago

iskunk commented 7 years ago

I am building POV-Ray Git master from source on Linux.

It builds correctly in an -O3 optimized build. However, when optimization is disabled, I get this error:

g++  -pipe -Wno-multichar -Wno-write-strings -fno-enforce-eh-specs -Wno-non-template-friend -O0 -pthread  -L/usr/lib/x86_64-linux-gnu  -L/usr/lib -o povray disp_sdl.o disp_text.o ../vfe/libvfe.a ../source/libpovray.a ../vfe/libvfe.a ../platform/libplatform.a ../platform/libx86.a ../platform/libx86avx.a ../platform/libx86avxfma4.a ../platform/libx86avx2fma3.a -lSDL -L/usr/lib/x86_64-linux-gnu -lSDL -lXpm  -lSM -lICE -lX11  -lIlmImf -L/usr/lib -lIlmImf -lz -pthread -lImath -lHalf -lIex -lIlmThread  -lIlmThread -ltiff -ljpeg -lpng -lz -lrt -lm -lboost_thread  -pthread  -lboost_system
../source/libpovray.a(metadata.o): In function `boost::date_time::month_formatter<boost::gregorian::greg_month, boost::date_time::iso_extended_format<char>, char>::format_month(boost::gregorian::greg_month const&, std::ostream&)':
metadata.cpp:(.text._ZN5boost9date_time15month_formatterINS_9gregorian10greg_monthENS0_19iso_extended_formatIcEEcE12format_monthERKS3_RSo[_ZN5boost9date_time15month_formatterINS_9gregorian10greg_monthENS0_19iso_extended_formatIcEEcE12format_monthERKS3_RSo]+0x33): undefined reference to `boost::gregorian::greg_month::as_short_string() const'
metadata.cpp:(.text._ZN5boost9date_time15month_formatterINS_9gregorian10greg_monthENS0_19iso_extended_formatIcEEcE12format_monthERKS3_RSo[_ZN5boost9date_time15month_formatterINS_9gregorian10greg_monthENS0_19iso_extended_formatIcEEcE12format_monthERKS3_RSo]+0x56): undefined reference to `boost::gregorian::greg_month::as_long_string() const'
collect2: error: ld returned 1 exit status
Makefile:470: recipe for target 'povray' failed
make[2]: *** [povray] Error 1
make[2]: Leaving directory '/tmp/povray-build/unix'
Makefile:663: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/povray-build'
Makefile:456: recipe for target 'all' failed
make: *** [all] Error 2

This is because the configure script never looks for the libboost_date_time library. It works in an optimized build because everything is inlined from the header file, but in a non-optimized build the library is needed.

This patch (against Git master), along with adding ax_boost_date_time.m4 to the unix/config/ directory, addresses the issue and allows a non-optimized build to complete.

c-lipka commented 6 years ago

On the release/v3.8.0 branch this should be fine now.