[Bf-blender-cvs] [6dd3e7d84da] master: install_deps: fix several issues.

Bastien Montagne noreply at git.blender.org
Tue Feb 25 15:59:38 CET 2020


Commit: 6dd3e7d84da632402bab3ee136fc7d3b47b3b697
Author: Bastien Montagne
Date:   Tue Feb 25 15:56:32 2020 +0100
Branches: master
https://developer.blender.org/rB6dd3e7d84da632402bab3ee136fc7d3b47b3b697

install_deps: fix several issues.

Lots of fixes and cleanups, mainly addressing:
* OpenEXR building was fully broken.
* Missing dependencies of Alembic to Boost and openEXR.
* OSL had changed its CMake parameters for custom OpenEXR install path.
* Dependencies between libs were not properly handles when switching a
lib from own build to system package.

===================================================================

M	build_files/build_environment/install_deps.sh

===================================================================

diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh
index 6294ab8bdd3..0553f615805 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -377,9 +377,7 @@ OCIO_FORCE_REBUILD=false
 OCIO_SKIP=false
 
 OPENEXR_VERSION="2.4.0"
-OPENEXR_VERSION_MIN="2.0.1"
-ILMBASE_VERSION="2.4.0"
-ILMBASE_VERSION_MIN="2.3"
+OPENEXR_VERSION_MIN="2.3"
 OPENEXR_FORCE_BUILD=false
 OPENEXR_FORCE_REBUILD=false
 OPENEXR_SKIP=false
@@ -868,16 +866,15 @@ BOOST_SOURCE=( "http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION
 BOOST_BUILD_MODULES="--with-system --with-filesystem --with-thread --with-regex --with-locale --with-date_time --with-wave --with-iostreams --with-python --with-program_options"
 
 OCIO_USE_REPO=false
-OCIO_SOURCE=( "https://github.com/imageworks/OpenColorIO/archive/v$OCIO_VERSION.tar.gz")
+OCIO_SOURCE=( "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v$OCIO_VERSION.tar.gz")
 #~ OCIO_SOURCE_REPO=( "https://github.com/imageworks/OpenColorIO.git" )
 #~ OCIO_SOURCE_REPO_UID="6de971097c7f552300f669ed69ca0b6cf5a70843"
 
 OPENEXR_USE_REPO=false
-#~ OPENEXR_SOURCE=( "https://github.com/openexr/openexr/releases/download/v$OPENEXR_VERSION/openexr-$OPENEXR_VERSION.tar.gz" )
+OPENEXR_SOURCE=( "https://github.com/AcademySoftwareFoundation/openexr/archive/v$OPENEXR_VERSION.tar.gz" )
+OPENEXR_SOURCE_REPO=( "https://github.com/AcademySoftwareFoundation/openexr.git" )
 OPENEXR_SOURCE_REPO_UID="0ac2ea34c8f3134148a5df4052e40f155b76f6fb"
-OPENEXR_SOURCE=( "https://github.com/openexr/openexr/archive/$OPENEXR_SOURCE_REPO_UID.tar.gz" )
-#~ OPENEXR_SOURCE_REPO=( "https://github.com/mont29/openexr.git" )
-ILMBASE_SOURCE=( "https://github.com/openexr/openexr/releases/download/v$ILMBASE_VERSION/ilmbase-$ILMBASE_VERSION.tar.gz" )
+#~ OPENEXR_SOURCE=( "https://github.com/openexr/openexr/archive/$OPENEXR_SOURCE_REPO_UID.tar.gz" )
 
 OIIO_USE_REPO=false
 OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz" )
@@ -974,7 +971,7 @@ You may also want to build them yourself (optional ones are [between brackets]):
     * Boost $BOOST_VERSION_MIN (from $BOOST_SOURCE, modules: $BOOST_BUILD_MODULES).
     * [FFMpeg $FFMPEG_VERSION_MIN (needs libvorbis, libogg, libtheora, libx264, libmp3lame, libxvidcore, libvpx, ...)] (from $FFMPEG_SOURCE).
     * [OpenColorIO $OCIO_VERSION_MIN] (from $OCIO_SOURCE).
-    * ILMBase $ILMBASE_VERSION_MIN (from $ILMBASE_SOURCE).
+    * ILMBase $OPENEXR_VERSION_MIN (from $OPENEXR_SOURCE).
     * OpenEXR $OPENEXR_VERSION_MIN (from $OPENEXR_SOURCE).
     * OpenImageIO $OIIO_VERSION_MIN (from $OIIO_SOURCE).
     * [LLVM $LLVM_VERSION_MIN (with clang)] (from $LLVM_SOURCE, and $LLVM_CLANG_SOURCE).
@@ -1201,10 +1198,15 @@ _init_python() {
   _inst_shortcut=$INST/python-$PYTHON_VERSION_MIN
 }
 
+_update_deps_python() {
+  :
+}
+
 clean_Python() {
   clean_Numpy
   _init_python
   _clean
+  _update_deps_python
 }
 
 compile_Python() {
@@ -1225,6 +1227,10 @@ compile_Python() {
 
   if [ ! -d $_inst ]; then
     INFO "Building Python-$PYTHON_VERSION"
+    _is_building=true
+
+    # Rebuild dependencies as well!
+    _update_deps_python
 
     prepare_opt
 
@@ -1256,6 +1262,7 @@ compile_Python() {
 
     cd $CWD
     INFO "Done compiling Python-$PYTHON_VERSION!"
+    _is_building=false
   else
     INFO "Own Python-$PYTHON_VERSION is up to date, nothing to do!"
     INFO "If you want to force rebuild of this lib, use the --force-python option."
@@ -1274,9 +1281,14 @@ _init_numpy() {
   _inst_shortcut=$_python/$_site/numpy
 }
 
+_update_deps_numpy() {
+  :
+}
+
 clean_Numpy() {
   _init_numpy
   _clean
+  _update_deps_numpy
 }
 
 compile_Numpy() {
@@ -1297,6 +1309,10 @@ compile_Numpy() {
 
   if [ ! -d $_inst ]; then
     INFO "Building Numpy-$NUMPY_VERSION"
+    _is_building=true
+
+    # Rebuild dependencies as well!
+    _update_deps_numpy
 
     prepare_opt
 
@@ -1325,6 +1341,7 @@ compile_Numpy() {
 
     cd $CWD
     INFO "Done compiling Numpy-$NUMPY_VERSION!"
+    _is_building=false
   else
     INFO "Own Numpy-$NUMPY_VERSION is up to date, nothing to do!"
     INFO "If you want to force rebuild of this lib, use the --force-numpy option."
@@ -1341,9 +1358,23 @@ _init_boost() {
   _inst_shortcut=$INST/boost
 }
 
+_update_deps_boost() {
+  OIIO_FORCE_REBUILD=true
+  OSL_FORCE_REBUILD=true
+  OPENVDB_FORCE_REBUILD=true
+  ALEMBIC_FORCE_REBUILD=true
+  if [ "$_is_building" = true ]; then
+    OIIO_FORCE_BUILD=true
+    OSL_FORCE_BUILD=true
+    OPENVDB_FORCE_BUILD=true
+    ALEMBIC_FORCE_BUILD=true
+  fi
+}
+
 clean_Boost() {
   _init_boost
   _clean
+  _update_deps_boost
 }
 
 compile_Boost() {
@@ -1365,14 +1396,10 @@ compile_Boost() {
 
   if [ ! -d $_inst ]; then
     INFO "Building Boost-$BOOST_VERSION"
+    _is_building=true
 
     # Rebuild dependencies as well!
-    OIIO_FORCE_BUILD=true
-    OIIO_FORCE_REBUILD=true
-    OSL_FORCE_BUILD=true
-    OSL_FORCE_REBUILD=true
-    OPENVDB_FORCE_BUILD=true
-    OPENVDB_FORCE_REBUILD=true
+    _update_deps_boost
 
     prepare_opt
 
@@ -1402,6 +1429,7 @@ compile_Boost() {
 
     cd $CWD
     INFO "Done compiling Boost-$BOOST_VERSION!"
+    _is_building=false
   else
     INFO "Own Boost-$BOOST_VERSION is up to date, nothing to do!"
     INFO "If you want to force rebuild of this lib, use the --force-boost option."
@@ -1425,9 +1453,14 @@ _init_ocio() {
   _inst_shortcut=$INST/ocio
 }
 
+_update_deps_ocio() {
+  :
+}
+
 clean_OCIO() {
   _init_ocio
   _clean
+  _update_deps_ocio
 }
 
 compile_OCIO() {
@@ -1448,6 +1481,10 @@ compile_OCIO() {
 
   if [ ! -d $_inst ]; then
     INFO "Building OpenColorIO-$OCIO_VERSION"
+    _is_building=true
+    
+    # Rebuild dependencies as well!
+    _update_deps_ocio
 
     prepare_opt
 
@@ -1520,6 +1557,7 @@ compile_OCIO() {
 
     cd $CWD
     INFO "Done compiling OpenColorIO-$OCIO_VERSION!"
+    _is_building=false
   else
     INFO "Own OpenColorIO-$OCIO_VERSION is up to date, nothing to do!"
     INFO "If you want to force rebuild of this lib, use the --force-ocio option."
@@ -1529,112 +1567,28 @@ compile_OCIO() {
 }
 
 # ----------------------------------------------------------------------------
-# Build ILMBase
-
-_init_ilmbase() {
-  _src=$SRC/ILMBase-$ILMBASE_VERSION
-  _git=false
-  _inst=$TMP/ilmbase-$ILMBASE_VERSION
-  _inst_shortcut=$TMP/ilmbase
-}
-
-clean_ILMBASE() {
-  _init_ilmbase
-  _clean
-}
-
-compile_ILMBASE() {
-  if [ "$NO_BUILD" = true ]; then
-    WARNING "--no-build enabled, ILMBase will not be compiled!"
-    return
-  fi
-
-  # To be changed each time we make edits that would modify the compiled result!
-  ilmbase_magic=10
-  _init_ilmbase
-
-  # Clean install if needed!
-  magic_compile_check ilmbase-$ILMBASE_VERSION $ilmbase_magic
-  if [ $? -eq 1 -o "$OPENEXR_FORCE_REBUILD" = true ]; then
-    clean_ILMBASE
-    rm -rf $_openexr_inst
-  fi
-
-  if [ ! -d $_openexr_inst ]; then
-    INFO "Building ILMBase-$ILMBASE_VERSION"
-
-    # Rebuild dependencies as well!
-    OPENEXR_FORCE_BUILD=true
-    OPENEXR_FORCE_REBUILD=true
-
-    prepare_opt
-
-    if [ ! -d $_src ]; then
-      INFO "Downloading ILMBase-$ILMBASE_VERSION"
-      mkdir -p $SRC
-      download ILMBASE_SOURCE[@] $_src.tar.gz
-
-      INFO "Unpacking ILMBase-$ILMBASE_VERSION"
-      tar -C $SRC --transform "s,(.*/?)ilmbase-[^/]*(.*),\1ILMBase-$ILMBASE_VERSION\2,x" -xf $_src.tar.gz
-
-    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 BUILD_SHARED_LIBS=ON"
-    cmake_d="$cmake_d -D NAMESPACE_VERSIONING=OFF"  # VERY IMPORTANT!!!
-
-    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
-      _create_inst_shortcut
-    else
-      ERROR "ILMBase-$ILMBASE_VERSION failed to compile, exiting"
-      exit 1
-    fi
-    cd $CWD
-    INFO "Done compiling ILMBase-$ILMBASE_VERSION!"
-  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
-}
-
-# ----------------------------------------------------------------------------
-# Build OpenEXR
+# Build OpenEXR (and ILMBase).
 
 _init_openexr() {
   _src=$SRC/OpenEXR-$OPENEXR_VERSION
-  _git=true
+  _git=false
   _inst=$_openexr_inst
   _inst_shortcut=$INST/openexr
 }
 
+_update_deps_openexr() {
+  OIIO_FORCE_REBUILD=true
+  ALEMBIC_FORCE_REBUILD=true
+  if [ "$_is_building" = true ]; then
+    OIIO_FORCE_BUILD=true
+    ALEMBIC_FORCE_BUILD=true
+  fi
+}
+
 clean_OPENEXR() {
-  clean_ILMBASE
   _init_openexr
   _clean
+  _update_deps_openexr
 }
 
 compile_OPENEXR() {
@@ -1644,7 +1598,7 @@ compile_OPENEXR() {
   fi
 
   # To be changed each time we make edits that would modify the compiled result!
-  openexr_magic=14
+  openexr_magic=15
 
   # Clean install if needed!
   magic_compile_check openexr-$OPENEXR_VERSION $openexr_magic
@@ -1653,17 +1607,15 @@ compile_OPENEXR() {
   fi
 
   _openexr_inst=$INST/openexr-$OPENEXR_VERSION
-  compile_ILMBASE
   PRINT ""
-  _ilmbase_inst=$_inst_shortcut
   _init_openexr
 
   if [ ! -d $_inst ]; then
-    INFO "Building OpenEXR-$OPENEXR_VERSION"
+    INFO "Building ILMBase-$OPENEXR_VERSION and OpenEXR-$OPENEXR_VERSION"
+    _is_building=true
 
     # Rebuild dependencies as well!
-    OIIO_FORCE_BUILD=true
-    OIIO_FORCE_REBUILD=true
+    _update_deps_openexr
 
     prepare_opt
 
@@ -1688,9 +1640,9 @@ compile_OPENEXR() {
       git pull origin master
       git checkout $OPENEXR_SOURCE_REPO_UID
       git reset --hard
-      oiio_src_path="../OpenEXR"
+      openexr_src_path="../OpenEXR"
     else
-      oiio_src_path=".."
+      openexr_src_path="

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list