Hi!
We encountered compile errors triggered by OpenImageIO headers on our
Arch Linux systems after recent updates. Both version 1.4.13 and current
git head are affected. The errors only happen when compiling software
using OIIO, not when compiling OIIO itself.
For the current git head the relevant compiler errors are:
In file included from
/home/gregor/progs/OIIO/oiio/dist/linux64/include/OpenImageIO/fmath.h:63:0,
from
/home/gregor/progs/OIIO/oiio/dist/linux64/include/OpenImageIO/imagebuf.h:47,
from
/home/gregor/progs/pathtracer/workspace/LTTK/include/LTTK/texture.h:14,
from
/home/gregor/progs/pathtracer/workspace/LTTK/include/LTTK/brdf.h:19,
from
/home/gregor/progs/pathtracer/workspace/LTTK/include/LTTK/abrdf.h:16,
from
/home/gregor/progs/pathtracer/workspace/LTTK/src/abrdf.cpp:17:
/home/gregor/progs/OIIO/oiio/dist/linux64/include/OpenImageIO/missing_math.h:297:13:
error: ‘constexpr bool std::isnan(double)’ conflicts with a previous
declaration
In file included from /usr/include/features.h:365:0,
from
/usr/include/c++/4.9.1/x86_64-unknown-linux-gnu/bits/os_defines.h:39,
from
/usr/include/c++/4.9.1/x86_64-unknown-linux-gnu/bits/c++config.h:430,
from /usr/include/c++/4.9.1/iosfwd:38,
from /usr/include/c++/4.9.1/ios:38,
from /usr/include/c++/4.9.1/istream:38,
from /usr/include/c++/4.9.1/fstream:38,
from
/home/gregor/progs/pathtracer/workspace/LTTK/src/abrdf.cpp:8:
/usr/include/bits/mathcalls.h:234:1: note: previous declaration ‘int
isnan(double)’
In file included from
/home/gregor/progs/OIIO/oiio/dist/linux64/include/OpenImageIO/fmath.h:63:0,
from
/home/gregor/progs/OIIO/oiio/dist/linux64/include/OpenImageIO/imagebuf.h:47,
from
/home/gregor/progs/pathtracer/workspace/LTTK/include/LTTK/texture.h:14,
from
/home/gregor/progs/pathtracer/workspace/LTTK/include/LTTK/brdf.h:19,
from
/home/gregor/progs/pathtracer/workspace/LTTK/include/LTTK/abrdf.h:16,
from
/home/gregor/progs/pathtracer/workspace/LTTK/src/abrdf.cpp:17:
/home/gregor/progs/OIIO/oiio/dist/linux64/include/OpenImageIO/missing_math.h:298:13:
error: ‘constexpr bool std::isinf(double)’ conflicts with a previous
declaration
In file included from /usr/include/features.h:365:0,
from
/usr/include/c++/4.9.1/x86_64-unknown-linux-gnu/bits/os_defines.h:39,
from
/usr/include/c++/4.9.1/x86_64-unknown-linux-gnu/bits/c++config.h:430,
from /usr/include/c++/4.9.1/iosfwd:38,
from /usr/include/c++/4.9.1/ios:38,
from /usr/include/c++/4.9.1/istream:38,
from /usr/include/c++/4.9.1/fstream:38,
from
/home/gregor/progs/pathtracer/workspace/LTTK/src/abrdf.cpp:8:
/usr/include/bits/mathcalls.h:201:1: note: previous declaration ‘int
isinf(double)’
The compiler is:
[gregor@skynet oiio]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc-4.9-20140903/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-cloog-backend=isl
--disable-isl-version-check --disable-cloog-version-check --enable-lto
--enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu
--disable-multilib --disable-werror --enable-checking=release
Thread model: posix
gcc version 4.9.1 20140903 (prerelease) (GCC)
The offending snippet of code is:
#ifndef _MSC_VER
// Some systems have isnan, isinf and isfinite in the std namespace.
using std::isnan;
using std::isinf;
using std::isfinite;
#endif
[this code was in fmath.h lines 1301ff. in 1.4.13 and recently moved]
The compiler check around this block seems to be too broad. As I do not
know why it is there (vague comment) I cannot provide a proper patch for
this issue. Commenting out this block works for us. OpenImageIO still
compiles fine without it and our compile errors go away.
Gregor
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org