AcademySoftwareFoundation / openexr

The OpenEXR project provides the specification and reference implementation of the EXR file format, the professional-grade image storage format of the motion picture industry.
http://www.openexr.com/
BSD 3-Clause "New" or "Revised" License
1.63k stars 619 forks source link

Not building on Archlinux #1589

Closed Brensom closed 10 months ago

Brensom commented 11 months ago
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -D__ANSI__ -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibTIFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath -ISource/OpenEXR/IexMath -ISource/LibRawLite -ISource/LibRawLite/dcraw -ISource/LibRawLite/internal -ISource/LibRawLite/libraw -ISource/LibRawLite/src -ISource/LibWebP -ISource/LibJXR -ISource/LibJXR/common/include -ISource/LibJXR/image/sys -ISource/LibJXR/jxrgluelib -fPIC -c Source/FreeImage/PluginEXR.cpp -o Source/FreeImage/PluginEXR.o
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -D__ANSI__ -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibTIFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath -ISource/OpenEXR/IexMath -ISource/LibRawLite -ISource/LibRawLite/dcraw -ISource/LibRawLite/internal -ISource/LibRawLite/libraw -ISource/LibRawLite/src -ISource/LibWebP -ISource/LibJXR -ISource/LibJXR/common/include -ISource/LibJXR/image/sys -ISource/LibJXR/jxrgluelib -fPIC -c Source/FreeImage/PluginG3.cpp -o Source/FreeImage/PluginG3.o
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -D__ANSI__ -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibTIFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath -ISource/OpenEXR/IexMath -ISource/LibRawLite -ISource/LibRawLite/dcraw -ISource/LibRawLite/internal -ISource/LibRawLite/libraw -ISource/LibRawLite/src -ISource/LibWebP -ISource/LibJXR -ISource/LibJXR/common/include -ISource/LibJXR/image/sys -ISource/LibJXR/jxrgluelib -fPIC -c Source/FreeImage/PluginGIF.cpp -o Source/FreeImage/PluginGIF.o
In file included from Source/FreeImage/../OpenEXR/IlmImf/ImfHeader.h:51,
                 from Source/FreeImage/../OpenEXR/IlmImf/ImfOutputFile.h:46,
                 from Source/FreeImage/PluginEXR.cpp:33:
Source/OpenEXR/Imath/ImathVec.h:228:41: error: ISO C++17 does not allow dynamic exception specifications
  228 |     const Vec2 &        normalizeExc () throw (IEX_NAMESPACE::MathExc);
      |                                         ^~~~~
Source/OpenEXR/Imath/ImathVec.h:232:48: error: ISO C++17 does not allow dynamic exception specifications
  232 |     Vec2<T>             normalizedExc () const throw (IEX_NAMESPACE::MathExc);
      |                                                ^~~~~
Source/OpenEXR/Imath/ImathVec.h:440:41: error: ISO C++17 does not allow dynamic exception specifications
  440 |     const Vec3 &        normalizeExc () throw (IEX_NAMESPACE::MathExc);
      |                                         ^~~~~
Source/OpenEXR/Imath/ImathVec.h:444:48: error: ISO C++17 does not allow dynamic exception specifications
  444 |     Vec3<T>             normalizedExc () const throw (IEX_NAMESPACE::MathExc);
      |                                                ^~~~~
Source/OpenEXR/Imath/ImathVec.h:622:37: error: ISO C++17 does not allow dynamic exception specifications
  622 |     const Vec4 &    normalizeExc () throw (IEX_NAMESPACE::MathExc);
      |                                     ^~~~~
Source/OpenEXR/Imath/ImathVec.h:626:44: error: ISO C++17 does not allow dynamic exception specifications
  626 |     Vec4<T>         normalizedExc () const throw (IEX_NAMESPACE::MathExc);
      |                                            ^~~~~
Source/OpenEXR/Imath/ImathVec.h:714:30: error: ISO C++17 does not allow dynamic exception specifications
  714 | Vec2<short>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
      |                              ^~~~~
Source/OpenEXR/Imath/ImathVec.h:723:37: error: ISO C++17 does not allow dynamic exception specifications
  723 | Vec2<short>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
      |                                     ^~~~~
Source/OpenEXR/Imath/ImathVec.h:738:28: error: ISO C++17 does not allow dynamic exception specifications
  738 | Vec2<int>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
      |                            ^~~~~
Source/OpenEXR/Imath/ImathVec.h:747:35: error: ISO C++17 does not allow dynamic exception specifications
  747 | Vec2<int>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
      |                                   ^~~~~
Source/OpenEXR/Imath/ImathVec.h:762:30: error: ISO C++17 does not allow dynamic exception specifications
  762 | Vec3<short>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
      |                              ^~~~~
Source/OpenEXR/Imath/ImathVec.h:771:37: error: ISO C++17 does not allow dynamic exception specifications
  771 | Vec3<short>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
      |                                     ^~~~~
Source/OpenEXR/Imath/ImathVec.h:786:28: error: ISO C++17 does not allow dynamic exception specifications
  786 | Vec3<int>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
      |                            ^~~~~
Source/OpenEXR/Imath/ImathVec.h:795:35: error: ISO C++17 does not allow dynamic exception specifications
  795 | Vec3<int>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
      |                                   ^~~~~
Source/OpenEXR/Imath/ImathVec.h:809:30: error: ISO C++17 does not allow dynamic exception specifications
  809 | Vec4<short>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
      |                              ^~~~~
Source/OpenEXR/Imath/ImathVec.h:818:37: error: ISO C++17 does not allow dynamic exception specifications
  818 | Vec4<short>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
      |                                     ^~~~~
Source/OpenEXR/Imath/ImathVec.h:833:28: error: ISO C++17 does not allow dynamic exception specifications
  833 | Vec4<int>::normalizeExc () throw (IEX_NAMESPACE::MathExc);
      |                            ^~~~~
Source/OpenEXR/Imath/ImathVec.h:842:35: error: ISO C++17 does not allow dynamic exception specifications
  842 | Vec4<int>::normalizedExc () const throw (IEX_NAMESPACE::MathExc);
      |                                   ^~~~~
Source/OpenEXR/Imath/ImathVec.h:1212:26: error: ISO C++17 does not allow dynamic exception specifications
 1212 | Vec2<T>::normalizeExc () throw (IEX_NAMESPACE::MathExc)
      |                          ^~~~~
Source/OpenEXR/Imath/ImathVec.h:1249:33: error: ISO C++17 does not allow dynamic exception specifications
 1249 | Vec2<T>::normalizedExc () const throw (IEX_NAMESPACE::MathExc)
      |                                 ^~~~~
Source/OpenEXR/Imath/ImathVec.h:1704:26: error: ISO C++17 does not allow dynamic exception specifications
 1704 | Vec3<T>::normalizeExc () throw (IEX_NAMESPACE::MathExc)
      |                          ^~~~~
Source/OpenEXR/Imath/ImathVec.h:1743:33: error: ISO C++17 does not allow dynamic exception specifications
 1743 | Vec3<T>::normalizedExc () const throw (IEX_NAMESPACE::MathExc)
      |                                 ^~~~~
Source/OpenEXR/Imath/ImathVec.h:2109:26: error: ISO C++17 does not allow dynamic exception specifications
 2109 | Vec4<T>::normalizeExc () throw (IEX_NAMESPACE::MathExc)
      |                          ^~~~~
Source/OpenEXR/Imath/ImathVec.h:2150:33: error: ISO C++17 does not allow dynamic exception specifications
 2150 | Vec4<T>::normalizedExc () const throw (IEX_NAMESPACE::MathExc)
      |                                 ^~~~~
In file included from Source/FreeImage/../OpenEXR/IlmImf/ImfXdr.h:108,
                 from Source/FreeImage/../OpenEXR/IlmImf/ImfGenericOutputFile.h:40,
                 from Source/FreeImage/../OpenEXR/IlmImf/ImfOutputFile.h:49:
Source/OpenEXR/Half/half.h: In constructor ‘half::half(float)’:
Source/OpenEXR/Half/half.h:462:22: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  462 |         register int e = (x.i >> 23) & 0x000001ff;
      |                      ^
Source/OpenEXR/Half/half.h:473:26: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  473 |             register int m = x.i & 0x007fffff;
      |                          ^
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -D__ANSI__ -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibTIFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath -ISource/OpenEXR/IexMath -ISource/LibRawLite -ISource/LibRawLite/dcraw -ISource/LibRawLite/internal -ISource/LibRawLite/libraw -ISource/LibRawLite/src -ISource/LibWebP -ISource/LibJXR -ISource/LibJXR/common/include -ISource/LibJXR/image/sys -ISource/LibJXR/jxrgluelib -fPIC -c Source/FreeImage/PluginHDR.cpp -o Source/FreeImage/PluginHDR.o
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -D__ANSI__ -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibTIFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath -ISource/OpenEXR/IexMath -ISource/LibRawLite -ISource/LibRawLite/dcraw -ISource/LibRawLite/internal -ISource/LibRawLite/libraw -ISource/LibRawLite/src -ISource/LibWebP -ISource/LibJXR -ISource/LibJXR/common/include -ISource/LibJXR/image/sys -ISource/LibJXR/jxrgluelib -fPIC -c Source/FreeImage/PluginICO.cpp -o Source/FreeImage/PluginICO.o
make: *** [Makefile.gnu:64: Source/FreeImage/PluginEXR.o] Error 1
make: *** Waiting for unfinished jobs....
Source/FreeImage/PluginHDR.cpp: In function ‘BOOL Save(FreeImageIO*, FIBITMAP*, fi_handle, int, int, void*)’:
Source/FreeImage/PluginHDR.cpp:286:30: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  286 |         sprintf(buffer, "%s\n", info->comment);
      |                              ^
In file included from /usr/include/stdio.h:964,
                 from Source/Utilities.h:35,
                 from Source/FreeImage/PluginHDR.cpp:23:
In function ‘int sprintf(char*, const char*, ...)’,
    inlined from ‘BOOL rgbe_WriteHeader(FreeImageIO*, fi_handle, unsigned int, unsigned int, rgbeHeaderInfo*)’ at Source/FreeImage/PluginHDR.cpp:286:9,
    inlined from ‘BOOL Save(FreeImageIO*, FIBITMAP*, fi_handle, int, int, void*)’ at Source/FreeImage/PluginHDR.cpp:702:22:
/usr/include/bits/stdio2.h:30:34: note: ‘__builtin___sprintf_chk’ output between 2 and 257 bytes into a destination of size 256
   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 |                                   __glibc_objsize (__s), __fmt,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |                                   __va_arg_pack ());
      |                                   ~~~~~~~~~~~~~~~~~
==> ERROR: A failure occurred in build().

My build system:

COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,objc,obj-c++ --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.1 20230801 (GCC) 
meshula commented 11 months ago

IMATH_NOEXCEPT controls the behavior. see https://github.com/AcademySoftwareFoundation/Imath/pull/157/files

Judging by the error messages, I wonder if you are building a version of OpenEXR that precedes c++17 support?

cary-ilm commented 11 months ago

It looks like you're building an old 2.x version of OpenEXR, no longer supported. The error message:

Source/OpenEXR/Half/half.h:

indicates a reference to the Half library, which was retired in the 3.x release. Your best option is to update to a more recent release.