Why would someone be running OIIO on an i386 system?  Are there enough
users that honestly need this that it's worth the increased developer time
and code complexity to support?

On Thu, Jan 28, 2016 at 1:35 AM, Shane Ambler <[email protected]> wrote:

> I seem to have an odd build issue that has me stumped.
>
> Building on FreeBSD 9.3 both amd64 and i386 using both clang and gcc works.
>
> Building on 10.2 amd64 using clang works.
> Building on 10.2 i386 using clang fails.
> clang 3.4.1 is the base compiler on 10.2
>
> What I have found is that SHA1.h contains -
>
> #ifndef UINT_32
> #ifdef _MSC_VER // Compiling with Microsoft compiler
> #define UINT_32 unsigned __int32
> #else // !_MSC_VER
> #if (ULONG_MAX == 0xFFFFFFFF)
> #define UINT_32 unsigned long
> #else
> #define UINT_32 unsigned int
> #endif
> #endif // _MSC_VER
> #endif // UINT_32
>
> When building on 10.2 i386 - different files get different definitions
> of UINT_32 which leads to an issue. Both systems use identical
> _limits.h which defines ULONG_MAX as __ULONG_MAX which comes from -
>
> #ifdef  __LP64__
> #define __ULONG_MAX     0xffffffffffffffff      /* max for an unsigned
> long */
> #define __LONG_MAX      0x7fffffffffffffff      /* max for a long */
> #define __LONG_MIN      (-0x7fffffffffffffff - 1) /* min for a long */
> #else
> #define __ULONG_MAX     0xffffffffUL
> #define __LONG_MAX      0x7fffffffL
> #define __LONG_MIN      (-0x7fffffffL - 1)
> #endif
>
> This all leads to libOpenImageIO getting two versions of SHA1::Update
>
> strings build/src/libOpenImageIO/libOpenImageIO.so | grep CSHA | grep
> Update
> _ZN11OpenImageIO4v1_65CSHA16UpdateEPKhm
> _ZN11OpenImageIO4v1_65CSHA16UpdateEPKhj
>
> One appears to come from libutil/strutil.cpp the other from
> libOpenImageIO/imagebufalgo_compare.cpp as the make commands are the
> same up to the source and output values I don't get how they come out
> different.
>
> While libOpenImageIO builds, binaries linking to it fail with -
>
> /usr/bin/make -f
> src/libOpenImageIO/CMakeFiles/imagebufalgo_test.dir/build.make
> src/libOpenImageIO/CMakeFiles/imagebufalgo_test.dir/build
> --- src/libOpenImageIO/CMakeFiles/imagespec_test.dir/all ---
> libOpenImageIO.so.1.6.9: undefined reference to
> `OpenImageIO::v1_6::CSHA1::Update(unsigned char const*, unsigned long)'
> c++: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> --- src/libOpenImageIO/CMakeFiles/imagebuf_test.dir/all ---
> libOpenImageIO.so.1.6.9: undefined reference to
> `OpenImageIO::v1_6::CSHA1::Update(unsigned char const*, unsigned long)'
> c++: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> --- src/libOpenImageIO/CMakeFiles/imagecache_test.dir/all ---
> libOpenImageIO.so.1.6.9: undefined reference to
> `OpenImageIO::v1_6::CSHA1::Update(unsigned char const*, unsigned long)'
> --- src/libOpenImageIO/CMakeFiles/imagebuf_test.dir/all ---
>
>
>
>
> While I can force SHA1.h to set UINT_32 to always use the same
> definition and it builds, it seems odd that it can't agree, and I
> expect that if I choose one then other apps linking to it will choose
> the other.
>
> By adding a couple of #warnings in SHA1.h I get the following during
> libOpenImageIO build -
>
>
> grep -C5 "####" oiio.build
> cd /wrkdirs/usr/ports/graphics/openimageio/work/.build/src/libutil &&
> /usr/local/libexec/ccache/c++   -DOpenImageIO_Util_EXPORTS -DUSE_FREETYPE
> -DUSE_OCIO=1 -DUSE_OPENCV -DUSE_OPENEXR_VERSION2=1 -D__STDC_CONSTANT_MACROS
> -D__STDC_LIMIT_MACROS -isystem /usr/local/include
> -I/usr/local/include/OpenEXR -I/usr/local/include/libraw
> -I/wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/include
> -I/wrkdirs/usr/ports/graphics/openimageio/work/.build/include/OpenImageIO
> -O2 -pipe -fstack-protector -fno-strict-aliasing -march=i586 -O2 -pipe
> -fstack-protector -fno-strict-aliasing -fPIC   -Wall -fno-math-errno
> -Wno-unused-function -Wno-overloaded-virtual
> -Wno-unneeded-internal-declaration -Wno-unused-private-field
> -Wno-tautological-compare -Qunused-arguments -Wunknown-warning-option
> -UUSE_FIELD3D -o CMakeFiles/OpenImageIO_Util.dir/SHA1.cpp.o -c
> /wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/libutil/SHA1.cpp
> --- src/libutil/CMakeFiles/OpenImageIO_Util.dir/strutil.cpp.o ---
> cd /wrkdirs/usr/ports/graphics/openimageio/work/.build/src/libutil &&
> /usr/local/libexec/ccache/c++   -DOpenImageIO_Util_EXPORTS -DUSE_FREETYPE
> -DUSE_OCIO=1 -DUSE_OPENCV -DUSE_OPENEXR_VERSION2=1 -D__STDC_CONSTANT_MACROS
> -D__STDC_LIMIT_MACROS -isystem /usr/local/include
> -I/usr/local/include/OpenEXR -I/usr/local/include/libraw
> -I/wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/include
> -I/wrkdirs/usr/ports/graphics/openimageio/work/.build/include/OpenImageIO
> -O2 -pipe -fstack-protector -fno-strict-aliasing -march=i586 -O2 -pipe
> -fstack-protector -fno-strict-aliasing -fPIC   -Wall -fno-math-errno
> -Wno-unused-function -Wno-overloaded-virtual
> -Wno-unneeded-internal-declaration -Wno-unused-private-field
> -Wno-tautological-compare -Qunused-arguments -Wunknown-warning-option
> -UUSE_FIELD3D -o CMakeFiles/OpenImageIO_Util.dir/strutil.cpp.o -c
> /wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/libutil/strutil.cpp
> --- src/libutil/CMakeFiles/OpenImageIO_Util.dir/SHA1.cpp.o ---
> In file included from
> /wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/libutil/SHA1.cpp:11:
> /wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/include/OpenImageIO/SHA1.h:171:2:
> warning: ######## using UINT_32 as int [-W#warnings]
> #warning ######## using UINT_32 as int
>  ^
> 1 warning generated.
> --- src/libutil/CMakeFiles/OpenImageIO_Util.dir/sysutil.cpp.o ---
> [  5%] Building CXX object
> src/libutil/CMakeFiles/OpenImageIO_Util.dir/sysutil.cpp.o
> cd /wrkdirs/usr/ports/graphics/openimageio/work/.build/src/libutil &&
> /usr/local/libexec/ccache/c++   -DOpenImageIO_Util_EXPORTS -DUSE_FREETYPE
> -DUSE_OCIO=1 -DUSE_OPENCV -DUSE_OPENEXR_VERSION2=1 -D__STDC_CONSTANT_MACROS
> -D__STDC_LIMIT_MACROS -isystem /usr/local/include
> -I/usr/local/include/OpenEXR -I/usr/local/include/libraw
> -I/wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/include
> -I/wrkdirs/usr/ports/graphics/openimageio/work/.build/include/OpenImageIO
> -O2 -pipe -fstack-protector -fno-strict-aliasing -march=i586 -O2 -pipe
> -fstack-protector -fno-strict-aliasing -fPIC   -Wall -fno-math-errno
> -Wno-unused-function -Wno-overloaded-virtual
> -Wno-unneeded-internal-declaration -Wno-unused-private-field
> -Wno-tautological-compare -Qunused-arguments -Wunknown-warning-option
> -UUSE_FIELD3D -o CMakeFiles/OpenImageIO_Util.dir/sysutil.cpp.o -c
> /wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/libutil/sysutil.cpp
> --
> [ 25%] Building CXX object
> src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/imagebufalgo_deep.cpp.o
> cd /wrkdirs/usr/ports/graphics/openimageio/work/.build/src/libOpenImageIO
> && /usr/local/libexec/ccache/c++   -DBOOST_TEST_DYN_LINK -DEMBED_PLUGINS=1
> -DOpenImageIO_EXPORTS -DPTEX_EXPORTS -DUSE_BOOST_ASIO=1 -DUSE_FFMPEG
> -DUSE_FREETYPE -DUSE_GIF -DUSE_LIBRAW=1 -DUSE_OCIO=1 -DUSE_OPENCV
> -DUSE_OPENEXR_VERSION2=1 -DUSE_OPENJPEG -DUSE_PTEX -DUSE_WEBP=1
> -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -isystem /usr/local/include
> -I/usr/local/include/OpenEXR -I/usr/local/include/libraw
> -I/wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/include
> -I/wrkdirs/usr/ports/graphics/openimageio/work/.build/include/OpenImageIO
> -I/wrkdirs/usr/ports/graphics/openimageio/work/.build/src/libOpenImageIO
> -I/usr/local/include/freetype2 -I/usr/local/include/freetype2/freetype2
> -I/usr/local/include/freetype2/freetype2/freetype -O2 -pipe
> -fstack-protector -fno-strict-aliasing -march=i586 -O2 -pipe
> -fstack-protector -fno-strict-aliasing -fPIC   -Wall -fno-math-errno
> -Wno-unused-function -Wno-overloaded-virtual
> -Wno-unneeded-internal-declaration -Wno-unused-private-field
> -Wno-tautological-compare -Qunused-arguments -Wunknown-warning-option
> -UUSE_FIELD3D -o CMakeFiles/OpenImageIO.dir/imagebufalgo_deep.cpp.o -c
> /wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/libOpenImageIO/imagebufalgo_deep.cpp
> --- src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/imagebufalgo_draw.cpp.o
> ---
> ---
> src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/imagebufalgo_compare.cpp.o ---
> In file included from
> /wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/libOpenImageIO/imagebufalgo_compare.cpp:45:
> /wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/include/OpenImageIO/SHA1.h:168:2:
> warning: ######## using UINT_32 as long [-W#warnings]
> #warning ######## using UINT_32 as long
>  ^
> 1 warning generated.
> --- src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/imagebufalgo_draw.cpp.o
> ---
> [ 26%] Building CXX object
> src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/imagebufalgo_draw.cpp.o
> ---
> src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/imagebufalgo_pixelmath.cpp.o
> ---
> --
> --- src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/libutil/strutil.cpp.o
> ---
> [ 33%] Building CXX object
> src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/libutil/strutil.cpp.o
> cd /wrkdirs/usr/ports/graphics/openimageio/work/.build/src/libOpenImageIO
> && /usr/local/libexec/ccache/c++   -DBOOST_TEST_DYN_LINK -DEMBED_PLUGINS=1
> -DOpenImageIO_EXPORTS -DPTEX_EXPORTS -DUSE_BOOST_ASIO=1 -DUSE_FFMPEG
> -DUSE_FREETYPE -DUSE_GIF -DUSE_LIBRAW=1 -DUSE_OCIO=1 -DUSE_OPENCV
> -DUSE_OPENEXR_VERSION2=1 -DUSE_OPENJPEG -DUSE_PTEX -DUSE_WEBP=1
> -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -isystem /usr/local/include
> -I/usr/local/include/OpenEXR -I/usr/local/include/libraw
> -I/wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/include
> -I/wrkdirs/usr/ports/graphics/openimageio/work/.build/include/OpenImageIO
> -I/wrkdirs/usr/ports/graphics/openimageio/work/.build/src/libOpenImageIO
> -I/usr/local/include/freetype2 -I/usr/local/include/freetype2/freetype2
> -I/usr/local/include/freetype2/freetype2/freetype -O2 -pipe
> -fstack-protector -fno-strict-aliasing -march=i586 -O2 -pipe
> -fstack-protector -fno-strict-aliasing -fPIC   -Wall -fno-math-errno
> -Wno-unused-function -Wno-overloaded-virtual
> -Wno-unneeded-internal-declaration -Wno-unused-private-field
> -Wno-tautological-compare -Qunused-arguments -Wunknown-warning-option
> -UUSE_FIELD3D -o CMakeFiles/OpenImageIO.dir/__/libutil/strutil.cpp.o -c
> /wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/libutil/strutil.cpp
> --- src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/libutil/SHA1.cpp.o ---
> In file included from
> /wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/libutil/SHA1.cpp:11:
> /wrkdirs/usr/ports/graphics/openimageio/work/oiio-Release-1.6.9/src/include/OpenImageIO/SHA1.h:171:2:
> warning: ######## using UINT_32 as int [-W#warnings]
> #warning ######## using UINT_32 as int
>  ^
> 1 warning generated.
>
>
>
> --
> FreeBSD - the place to B...Software Developing
>
> Shane Ambler
>
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to