[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37982] trunk/lib/darwin-9.x.universal: Cycles: OS X openimageio library, lib/darwin-9.x.universal

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Jun 30 15:27:36 CEST 2011


Revision: 37982
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37982
Author:   blendix
Date:     2011-06-30 13:27:36 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Cycles: OS X openimageio library, lib/darwin-9.x.universal

Added Paths:
-----------
    trunk/lib/darwin-9.x.universal/openimageio/
    trunk/lib/darwin-9.x.universal/openimageio/LICENSE
    trunk/lib/darwin-9.x.universal/openimageio/build.patch
    trunk/lib/darwin-9.x.universal/openimageio/build.sh
    trunk/lib/darwin-9.x.universal/openimageio/include/
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/argparse.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/colortransfer.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/dassert.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/errorhandler.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/export.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/filesystem.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/filter.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/fmath.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/hash.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/imagebuf.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/imagebufalgo.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/imagecache.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/imageio.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/osdep.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/paramlist.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/plugin.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/pugiconfig.hpp
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/pugixml.hpp
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/refcnt.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/strutil.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/sysutil.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/texture.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/thread.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/timer.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/typedesc.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/ustring.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/varyingref.h
    trunk/lib/darwin-9.x.universal/openimageio/include/OpenImageIO/version.h
    trunk/lib/darwin-9.x.universal/openimageio/lib/
    trunk/lib/darwin-9.x.universal/openimageio/lib/libOpenImageIO.a
    trunk/lib/darwin-9.x.universal/openimageio/readme.txt

Added: trunk/lib/darwin-9.x.universal/openimageio/LICENSE
===================================================================
--- trunk/lib/darwin-9.x.universal/openimageio/LICENSE	                        (rev 0)
+++ trunk/lib/darwin-9.x.universal/openimageio/LICENSE	2011-06-30 13:27:36 UTC (rev 37982)
@@ -0,0 +1,30 @@
+OpenImageIO and all code, documentation, and other materials contained
+therein are:
+
+Copyright 2008 Larry Gritz and the other authors and contributors.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in the
+  documentation and/or other materials provided with the distribution.
+* Neither the name of the software's owners nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(This is the Modified BSD License)

Added: trunk/lib/darwin-9.x.universal/openimageio/build.patch
===================================================================
--- trunk/lib/darwin-9.x.universal/openimageio/build.patch	                        (rev 0)
+++ trunk/lib/darwin-9.x.universal/openimageio/build.patch	2011-06-30 13:27:36 UTC (rev 37982)
@@ -0,0 +1,234 @@
+diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake
+index 595ba92..d3b5c3d 100644
+--- a/src/cmake/externalpackages.cmake
++++ b/src/cmake/externalpackages.cmake
+@@ -82,7 +82,7 @@ endmacro ()
+ 
+ message (STATUS "BOOST_ROOT ${BOOST_ROOT}")
+ 
+-set (Boost_ADDITIONAL_VERSIONS "1.45" "1.44" 
++set (Boost_ADDITIONAL_VERSIONS "1.46" "1_46_1" "1.45" "1.44" 
+                                "1.43" "1.43.0" "1.42" "1.42.0" 
+                                "1.41" "1.41.0" "1.40" "1.40.0"
+                                "1.39" "1.39.0" "1.38" "1.38.0"
+diff --git a/src/include/thread.h b/src/include/thread.h
+index 2303c3e..8e417e2 100644
+--- a/src/include/thread.h
++++ b/src/include/thread.h
+@@ -245,93 +245,6 @@ private:
+ 
+ 
+ 
+-/// Atomic version of:  r = *at, *at += x, return r
+-/// For each of several architectures.
+-inline int
+-atomic_exchange_and_add (volatile int *at, int x)
+-{
+-#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
+-    return __sync_fetch_and_add ((int *)at, x);
+-#elif USE_TBB
+-    atomic<int> *a = (atomic<int> *)at;
+-    return a->fetch_and_add (x);
+-#elif defined(__APPLE__)
+-    // Apple, not inline for Intel (only PPC?)
+-    return OSAtomicAdd32Barrier (x, at) - x;
+-#elif defined(_WIN32)
+-    // Windows
+-    return InterlockedExchangeAdd ((volatile LONG *)at, x);
+-#else
+-    error ("No atomics on this platform.")
+-#endif
+-}
+-
+-
+-
+-inline long long
+-atomic_exchange_and_add (volatile long long *at, long long x)
+-{
+-#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
+-    return __sync_fetch_and_add (at, x);
+-#elif USE_TBB
+-    atomic<long long> *a = (atomic<long long> *)at;
+-    return a->fetch_and_add (x);
+-#elif defined(__APPLE__)
+-    // Apple, not inline for Intel (only PPC?)
+-    return OSAtomicAdd64Barrier (x, at) - x;
+-#elif defined(_WIN32)
+-    // Windows
+-    return InterlockedExchangeAdd64 ((volatile LONGLONG *)at, x);
+-#else
+-    error ("No atomics on this platform.")
+-#endif
+-}
+-
+-
+-
+-/// Atomic version of:
+-///    if (*at == compareval) {
+-///        *at = newval;  return true;
+-///    } else {
+-///        return false;
+-///
+-inline bool
+-atomic_compare_and_exchange (volatile int *at, int compareval, int newval)
+-{
+-#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
+-    return __sync_bool_compare_and_swap (at, compareval, newval);
+-#elif USE_TBB
+-    atomic<int> *a = (atomic<int> *)at;
+-    return a->compare_and_swap (newval, compareval) == newval;
+-#elif defined(__APPLE__)
+-    return OSAtomicCompareAndSwap32Barrier (compareval, newval, at);
+-#elif defined(_WIN32)
+-    return (InterlockedCompareExchange ((volatile LONG *)at, newval, compareval) == compareval);
+-#else
+-    error ("No atomics on this platform.")
+-#endif
+-}
+-
+-
+-
+-inline bool
+-atomic_compare_and_exchange (volatile long long *at, long long compareval, long long newval)
+-{
+-#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
+-    return __sync_bool_compare_and_swap (at, compareval, newval);
+-#elif USE_TBB
+-    atomic<long long> *a = (atomic<long long> *)at;
+-    return a->compare_and_swap (newval, compareval) == newval;
+-#elif defined(__APPLE__)
+-    return OSAtomicCompareAndSwap64Barrier (compareval, newval, at);
+-#elif defined(_WIN32)
+-    return (InterlockedCompareExchange64 ((volatile LONGLONG *)at, newval, compareval) == compareval);
+-#else
+-    error ("No atomics on this platform.")
+-#endif
+-}
+-
+-
+ 
+ #if (! USE_TBB)
+ // If we're not using TBB, we need to define our own atomic<>.
+@@ -540,6 +453,104 @@ typedef spin_mutex::lock_guard spin_lock;
+ 
+ #endif
+ 
++/// Atomic version of:  r = *at, *at += x, return r
++/// For each of several architectures.
++inline int
++atomic_exchange_and_add (volatile int *at, int x)
++{
++#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
++    return __sync_fetch_and_add ((int *)at, x);
++#elif USE_TBB
++    atomic<int> *a = (atomic<int> *)at;
++    return a->fetch_and_add (x);
++#elif defined(__APPLE__)
++    // Apple, not inline for Intel (only PPC?)
++    return OSAtomicAdd32Barrier (x, at) - x;
++#elif defined(_WIN32)
++    // Windows
++    return InterlockedExchangeAdd ((volatile LONG *)at, x);
++#else
++    error ("No atomics on this platform.")
++#endif
++}
++
++extern spin_mutex atomic_mutex;
++
++inline long long
++atomic_exchange_and_add (volatile long long *at, long long x)
++{
++#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
++    return __sync_fetch_and_add (at, x);
++#elif USE_TBB
++    atomic<long long> *a = (atomic<long long> *)at;
++    return a->fetch_and_add (x);
++#elif defined(__APPLE__)
++    // Apple, not inline for Intel (only PPC?)
++	atomic_mutex.lock();
++	long long tmp = *at;
++	*at += x;
++	atomic_mutex.unlock();
++	return tmp;
++#elif defined(_WIN32)
++    // Windows
++    return InterlockedExchangeAdd64 ((volatile LONGLONG *)at, x);
++#else
++    error ("No atomics on this platform.")
++#endif
++}
++
++
++
++/// Atomic version of:
++///    if (*at == compareval) {
++///        *at = newval;  return true;
++///    } else {
++///        return false;
++///
++inline bool
++atomic_compare_and_exchange (volatile int *at, int compareval, int newval)
++{
++#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
++    return __sync_bool_compare_and_swap (at, compareval, newval);
++#elif USE_TBB
++    atomic<int> *a = (atomic<int> *)at;
++    return a->compare_and_swap (newval, compareval) == newval;
++#elif defined(__APPLE__)
++    return OSAtomicCompareAndSwap32Barrier (compareval, newval, at);
++#elif defined(_WIN32)
++    return (InterlockedCompareExchange ((volatile LONG *)at, newval, compareval) == compareval);
++#else
++    error ("No atomics on this platform.")
++#endif
++}
++
++
++
++inline bool
++atomic_compare_and_exchange (volatile long long *at, long long compareval, long long newval)
++{
++#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
++    return __sync_bool_compare_and_swap (at, compareval, newval);
++#elif USE_TBB
++    atomic<long long> *a = (atomic<long long> *)at;
++    return a->compare_and_swap (newval, compareval) == newval;
++#elif defined(__APPLE__)
++	bool success;
++	atomic_mutex.lock();
++	success = (*at == compareval);
++	if(success)
++		*at = newval;
++	atomic_mutex.unlock();
++	return success;
++#elif defined(_WIN32)
++    return (InterlockedCompareExchange64 ((volatile LONGLONG *)at, newval, compareval) == compareval);
++#else
++    error ("No atomics on this platform.")
++#endif
++}
++
++
++
+ 
+ }
+ OIIO_NAMESPACE_EXIT
+diff --git a/src/libutil/sysutil.cpp b/src/libutil/sysutil.cpp
+index 7d85f4a..e0b6989 100644
+--- a/src/libutil/sysutil.cpp
++++ b/src/libutil/sysutil.cpp
+@@ -62,10 +62,13 @@
+ #include "dassert.h"
+ 
+ #include "sysutil.h"
++#include "thread.h"
+ 
+ OIIO_NAMESPACE_ENTER
+ {
+ 
++spin_mutex atomic_mutex;
++
+ using namespace Sysutil;
+ 
+ 

Added: trunk/lib/darwin-9.x.universal/openimageio/build.sh
===================================================================
--- trunk/lib/darwin-9.x.universal/openimageio/build.sh	                        (rev 0)
+++ trunk/lib/darwin-9.x.universal/openimageio/build.sh	2011-06-30 13:27:36 UTC (rev 37982)
@@ -0,0 +1,103 @@
+#!/bin/sh
+
+LIBDIR=$PWD/../..
+
+mkdir -p build/macosx_i386
+cd build/macosx_i386
+
+cmake ../../src \
+ -DCMAKE_OSX_ARCHITECTURES="i386" \
+ -DCMAKE_INSTALL_PREFIX=$LIBDIR/openimageio/i386 \
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.5 \
+ -DCMAKE_OSX_SYSROOT="/Developer/SDKs/MacOSX10.5.sdk" \
+ -DILMBASE_HOME=$LIBDIR/openexr \
+ -DILMBASE_INCLUDE_DIR=$LIBDIR/openexr/include \
+ -DOPENEXR_INCLUDE_DIR=$LIBDIR/openexr/include \
+ -DOPENEXR_HOME=$LIBDIR/openexr \
+ -DLINKSTATIC=ON \
+ -DBUILDSTATIC=ON \
+ -DBOOST_ROOT=$LIBDIR/boost \
+ -DPNG_PNG_INCLUDE_DIR=$LIBDIR/png/include \
+ -DPNG_LIBRARY=$LIBDIR/png/lib/libpng.a \
+ -DJPEG_INCLUDE_DIR=$LIBDIR/jpeg/include \
+ -DJPEG_LIBRARY=$LIBDIR/jpeg/lib/libjpeg.a \
+ -DTIFF_INCLUDE_DIR=$LIBDIR/tiff/include \
+ -DTIFF_LIBRARY=$LIBDIR/tiff/lib/libtiff.a \
+ -DUSE_OPENGL=OFF \
+ -DUSE_TBB=OFF \
+ -DUSE_FIELD3D=OFF \
+ -DUSE_QT=OFF \
+ -DUSE_PYTHON=OFF \
+ -DCMAKE_BUILD_TYPE=Release
+

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list