[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56998] trunk/blender/build_files/ build_environment/install_deps.sh: First attempt to handle openexr/ ilmbase 2.0 in install_deps.sh (linux builds).

Bastien Montagne montagne29 at wanadoo.fr
Fri May 24 12:16:07 CEST 2013


Revision: 56998
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56998
Author:   mont29
Date:     2013-05-24 10:16:07 +0000 (Fri, 24 May 2013)
Log Message:
-----------
First attempt to handle openexr/ilmbase 2.0 in install_deps.sh (linux builds).

Only activated for Deb-like distro for now, only tested with testing/amd64. Notes?\194?\160:
* Had to add a hell of patches to ilmbase/openexr/oiio cmake files (some are real, stupid bugs fixing [like files missing in lists or wrong linking order], others are "enhancements" [like being able to compile both static and dyn libs for openexr]).
* Unfortunately, I could not manage to keep oiio static (can't compile osl later, as it does not link all deps of oiio, tiff, jpeg, png, etc.). I?\226?\128?\153ll try to fix this later, but for now, you'll have to do as with boost (ldconfig).

I won't say here what I think about not having any (reliable) way to really link a static lib into another one... :/

Will test and enable other distro in following day(s), I do not *expect* much difficulties here.

Modified Paths:
--------------
    trunk/blender/build_files/build_environment/install_deps.sh

Modified: trunk/blender/build_files/build_environment/install_deps.sh
===================================================================
--- trunk/blender/build_files/build_environment/install_deps.sh	2013-05-24 10:15:20 UTC (rev 56997)
+++ trunk/blender/build_files/build_environment/install_deps.sh	2013-05-24 10:16:07 UTC (rev 56998)
@@ -113,6 +113,9 @@
     --force-ocio
         Force the rebuild of OpenColorIO.
 
+    --force-openexr
+        Force the rebuild of OpenEXR.
+
     --force-oiio
         Force the rebuild of OpenImageIO.
 
@@ -147,6 +150,9 @@
     --skip-ocio
         Unconditionally skip OpenColorIO installation/building.
 
+    --skip-openexr
+        Unconditionally skip OpenEXR installation/building.
+
     --skip-oiio
         Unconditionally skip OpenImageIO installation/building.
 
@@ -187,8 +193,17 @@
 OCIO_FORCE_REBUILD=false
 OCIO_SKIP=false
 
-OIIO_VERSION="1.1.7"
-OIIO_SOURCE="https://github.com/OpenImageIO/oiio/tarball/Release-$OIIO_VERSION"
+OPENEXR_VERSION="2.0.0"
+OPENEXR_SOURCE="http://download.savannah.nongnu.org/releases/openexr/openexr-$OPENEXR_VERSION.tar.gz"
+OPENEXR_VERSION_MIN="2.0"
+ILMBASE_VERSION="2.0.0"
+ILMBASE_SOURCE="http://download.savannah.nongnu.org/releases/openexr/ilmbase-$ILMBASE_VERSION.tar.gz"
+OPENEXR_FORCE_REBUILD=false
+OPENEXR_SKIP=false
+_with_built_openexr=false
+
+OIIO_VERSION="1.1.10"
+OIIO_SOURCE="https://github.com/OpenImageIO/oiio/tarball/Release-$OIIO_VERSION.tar.gz"
 OIIO_VERSION_MIN="1.1"
 OIIO_FORCE_REBUILD=false
 OIIO_SKIP=false
@@ -203,7 +218,7 @@
 
 # OSL needs to be compiled for now!
 OSL_VERSION="1.3.0"
-OSL_SOURCE="https://github.com/imageworks/OpenShadingLanguage/archive/Release-1.3.0.tar.gz"
+OSL_SOURCE="https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz"
 OSL_FORCE_REBUILD=false
 OSL_SKIP=false
 
@@ -308,7 +323,9 @@
       shift; continue
     ;;
     --force-python)
-      PYTHON_FORCE_REBUILD=true; shift; continue
+      PYTHON_FORCE_REBUILD=true
+      NUMPY_FORCE_REBUILD=true
+      shift; continue
     ;;
     --force-numpy)
       NUMPY_FORCE_REBUILD=true; shift; continue
@@ -319,11 +336,17 @@
     --force-ocio)
       OCIO_FORCE_REBUILD=true; shift; continue
     ;;
+    --force-openexr)
+      OPENEXR_FORCE_REBUILD=true; shift; continue
+    ;;
     --force-oiio)
-      OIIO_FORCE_REBUILD=true; shift; continue
+      OIIO_FORCE_REBUILD=true
+      shift; continue
     ;;
     --force-llvm)
-      LLVM_FORCE_REBUILD=true; shift; continue
+      LLVM_FORCE_REBUILD=true
+      OSL_FORCE_REBUILD=true
+      shift; continue
     ;;
     --force-osl)
       OSL_FORCE_REBUILD=true; shift; continue
@@ -346,6 +369,9 @@
     --skip-ocio)
       OCIO_SKIP=true; shift; continue
     ;;
+    --skip-openexr)
+      OPENEXR_SKIP=true; shift; continue
+    ;;
     --skip-oiio)
       OIIO_SKIP=true; shift; continue
     ;;
@@ -632,6 +658,10 @@
   if [ ! -d $_inst ]; then
     INFO "Building Boost-$BOOST_VERSION"
 
+    # Rebuild dependecies as well!
+    OIIO_FORCE_REBUILD=true
+    OSL_FORCE_REBUILD=true
+
     prepare_opt
 
     if [ ! -d $_src ]; then
@@ -659,10 +689,6 @@
 
     magic_compile_set boost-$BOOST_VERSION $boost_magic
 
-    # Rebuild dependecies as well!
-    OIIO_FORCE_REBUILD=true
-    OSL_FORCE_REBUILD=true
-
     cd $CWD
     INFO "Done compiling Boost-$BOOST_VERSION!"
   else
@@ -751,9 +777,296 @@
   fi
 }
 
+compile_ILMBASE() {
+  # To be changed each time we make edits that would modify the compiled result!
+  ilmbase_magic=4
+
+  _src=$SRC/ILMBase-$ILMBASE_VERSION
+  _inst=$INST/ilmbase-$ILMBASE_VERSION
+
+  # Clean install if needed!
+  magic_compile_check ilmbase-$ILMBASE_VERSION $ilmbase_magic
+
+  if [ $? -eq 1 -o $OPENEXR_FORCE_REBUILD == true ]; then
+    rm -rf $_src
+    rm -rf $_inst
+  fi
+
+  if [ ! -d $_inst ]; then
+    INFO "Building ILMBase-$ILMBASE_VERSION"
+
+    prepare_opt
+
+    if [ ! -d $_src ]; then
+      INFO "Downloading ILMBase-$ILMBASE_VERSION"
+      mkdir -p $SRC
+      wget -c $ILMBASE_SOURCE -O $_src.tar.gz
+
+      INFO "Unpacking ILMBase-$ILMBASE_VERSION"
+      tar -C $SRC --transform "s,(.*/?)ilmbase-[^/]*(.*),\1ILMBase-$ILMBASE_VERSION\2,x" \
+          -xf $_src.tar.gz
+
+      cd $_src
+
+      # XXX Ugly patching hack!
+      cat << EOF | patch -p1
+--- a/Half/CMakeLists.txt
++++ b/Half/CMakeLists.txt
+@@ -47,6 +47,7 @@
+ 
+ INSTALL ( FILES 
+   half.h
++  halfExport.h
+   halfFunction.h
+   halfLimits.h
+   DESTINATION
+EOF
+
+      cd $CWD
+
+    fi
+
+    cd $_src
+    # Always refresh the whole build!
+    if [ -d build ]; then
+      rm -rf build
+    fi    
+    mkdir build
+    cd build
+
+    cmake_d="-D CMAKE_BUILD_TYPE=Release"
+    cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
+    cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
+
+    if file /bin/cp | grep -q '32-bit'; then
+      cflags="-fPIC -m32 -march=i686"
+    else
+      cflags="-fPIC"
+    fi
+
+    cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ..
+
+    make -j$THREADS && make install
+
+    make clean
+
+    if [ -d $_inst ]; then
+      rm -f $INST/ilmbase
+      ln -s ilmbase-$ILMBASE_VERSION $INST/ilmbase
+    else
+      ERROR "ILMBase-$ILMBASE_VERSION failed to compile, exiting"
+      exit 1
+    fi
+  else
+    INFO "Own ILMBase-$ILMBASE_VERSION is up to date, nothing to do!"
+    INFO "If you want to force rebuild of this lib (and openexr), use the --force-openexr option."
+  fi
+
+  magic_compile_set ilmbase-$ILMBASE_VERSION $ilmbase_magic
+
+  cd $CWD
+  INFO "Done compiling ILMBase-$ILMBASE_VERSION!"
+}
+
+compile_OPENEXR() {
+  compile_ILMBASE
+
+  # To be changed each time we make edits that would modify the compiled result!
+  openexr_magic=10
+
+  _src=$SRC/OpenEXR-$OPENEXR_VERSION
+  _inst=$INST/openexr-$OPENEXR_VERSION
+
+  # Clean install if needed!
+  magic_compile_check openexr-$OPENEXR_VERSION $openexr_magic
+  if [ $? -eq 1 -o $OPENEXR_FORCE_REBUILD == true ]; then
+    rm -rf $_src
+    rm -rf $_inst
+  fi
+
+  if [ ! -d $_inst ]; then
+    INFO "Building OpenEXR-$OPENEXR_VERSION"
+
+    # Rebuild dependecies as well!
+    OIIO_FORCE_REBUILD=true
+    OSL_FORCE_REBUILD=true
+
+    prepare_opt
+
+    if [ ! -d $_src ]; then
+      INFO "Downloading OpenEXR-$OPENEXR_VERSION"
+      mkdir -p $SRC
+      wget -c $OPENEXR_SOURCE -O $_src.tar.gz
+
+      INFO "Unpacking OpenEXR-$OPENEXR_VERSION"
+      tar -C $SRC --transform "s,(.*/?)openexr[^/]*(.*),\1OpenEXR-$OPENEXR_VERSION\2,x" \
+          -xf $_src.tar.gz
+
+      cd $_src
+
+      # XXX Ugly patching hack!
+      cat << EOF | patch -p1
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -42,7 +42,7 @@
+ ADD_SUBDIRECTORY ( exrmakepreview )
+ ADD_SUBDIRECTORY ( exrenvmap )
+ ADD_SUBDIRECTORY ( exrmultiview )
+-ADD_SUBDIRECTORY ( exr2aces )
++#ADD_SUBDIRECTORY ( exr2aces )
+ ADD_SUBDIRECTORY ( exrmultipart )
+ 
+ ##########################
+@@ -52,11 +52,11 @@
+ # Documentation
+ INSTALL ( FILES
+   doc/TechnicalIntroduction.pdf
+-  doc/TechnicalIntroduction_2.0.pdf
++#  doc/TechnicalIntroduction_2.0.pdf
+   doc/ReadingAndWritingImageFiles.pdf
+   doc/OpenEXRFileLayout.pdf
+-  doc/OpenEXRFileLayout_2.0.pdf
+-  doc/ReadingAndWritingImageFiles_2.0.pdf
++#  doc/OpenEXRFileLayout_2.0.pdf
++#  doc/ReadingAndWritingImageFiles_2.0.pdf
+   doc/MultiViewOpenEXR.pdf
+   DESTINATION
+   ${CMAKE_INSTALL_PREFIX}/share/doc/OpenEXR-2.0.0
+--- a/IlmImfFuzzTest/CMakeLists.txt
++++ b/IlmImfFuzzTest/CMakeLists.txt
+@@ -4,7 +4,9 @@
+   fuzzFile.cpp
+   main.cpp
+   testFuzzScanLines.cpp
++  testFuzzDeepScanLines.cpp
+   testFuzzTiles.cpp
++  testFuzzDeepTiles.cpp
+   )
+ 
+ TARGET_LINK_LIBRARIES ( IlmImfFuzzTest IlmImf Iex Imath Half IlmThread ${PTHREAD_LIB} ${Z_LIB})
+--- a/IlmImfTest/CMakeLists.txt
++++ b/IlmImfTest/CMakeLists.txt
+@@ -19,22 +19,26 @@
+   testCustomAttributes.cpp
+   testDeepScanLineBasic.cpp
+   testDeepScanLineHuge.cpp
++  testDeepScanLineMultipleRead.cpp
+   testDeepTiledBasic.cpp
+   testExistingStreams.cpp
++  testFutureProofing.cpp
+   testHuf.cpp
+   testInputPart.cpp
+   testIsComplete.cpp
+   testLineOrder.cpp
+   testLut.cpp
+   testMagic.cpp
+   testMultiPartApi.cpp
+   testMultiPartFileMixingBasic.cpp
+   testMultiPartSharedAttributes.cpp
+   testMultiPartThreading.cpp
+   testMultiScanlinePartThreading.cpp
+   testMultiTiledPartThreading.cpp
+   testMultiView.cpp
+   testNativeFormat.cpp
++  testOptimized.cpp
++  testPartHelper.cpp
+   testPreviewImage.cpp
+   testRgba.cpp
+   testRgbaThreading.cpp
+--- a/IlmImf/CMakeLists.txt
++++ b/IlmImf/CMakeLists.txt
+@@ -153,18 +153,18 @@
+   ImfCompositeDeepScanLine.cpp
+ )
+ 
+-ADD_LIBRARY ( IlmImf STATIC
+-  \${ILMIMF_SRCS}
+-)
+-
+-# TARGET_LINK_LIBRARIES ( IlmImf)
+-
+-ADD_DEPENDENCIES ( IlmImf b44ExpLogTable )
++ADD_LIBRARY ( IlmImf STATIC \${ILMIMF_SRCS} )
++ADD_DEPENDENCIES ( IlmImf b44ExpLogTable )
++
++ADD_LIBRARY ( IlmImf_dyn SHARED \${ILMIMF_SRCS} )
++SET_TARGET_PROPERTIES ( IlmImf_dyn PROPERTIES OUTPUT_NAME IlmImf)
++ADD_DEPENDENCIES ( IlmImf_dyn b44ExpLogTable )
++TARGET_LINK_LIBRARIES ( IlmImf_dyn Iex Imath Half IlmThread \${Z_LIB} \${PTHREAD_LIB} )
+ 
+ # Libraries
+ 
+ INSTALL ( TARGETS
+-  IlmImf
++  IlmImf IlmImf_dyn
+   DESTINATION
+   \${CMAKE_INSTALL_PREFIX}/lib
+ )
+@@ -168,6 +167,7 @@
+ INSTALL ( FILES
+   ${CMAKE_SOURCE_DIR}/config/OpenEXRConfig.h
+   ImfForward.h
++  ImfNamespace.h
+   ImfExport.h
+   ImfAttribute.h
+   ImfBoxAttribute.h
+EOF
+
+      cd $CWD
+
+    fi
+
+    cd $_src
+    # Always refresh the whole build!
+    if [ -d build ]; then
+      rm -rf build
+    fi    
+    mkdir build
+    cd build
+
+    cmake_d="-D CMAKE_BUILD_TYPE=Release"
+    cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
+    cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
+    cmake_d="$cmake_d -D ILMBASE_PACKAGE_PREFIX=$INST/ilmbase-$ILMBASE_VERSION"
+
+    if file /bin/cp | grep -q '32-bit'; then
+      cflags="-fPIC -m32 -march=i686"
+    else
+      cflags="-fPIC"
+    fi
+
+    cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ..
+
+    make -j$THREADS && make install
+
+    # Force linking against static libs
+#    rm -f $_inst/lib/*.so*
+
+    make clean
+
+    if [ -d $_inst ]; then
+      rm -f $INST/openexr
+      ln -s openexr-$OPENEXR_VERSION $INST/openexr
+    else
+      ERROR "OpenEXR-$OPENEXR_VERSION failed to compile, exiting"
+      exit 1
+    fi
+
+    magic_compile_set openexr-$OPENEXR_VERSION $openexr_magic
+
+    cd $CWD
+    INFO "Done compiling OpenEXR-$OPENEXR_VERSION!"
+  else
+    INFO "Own OpenEXR-$OPENEXR_VERSION is up to date, nothing to do!"

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list