[Bf-blender-cvs] [f31e82d] master: install_deps.sh: add option to force building libs instead of using packages, and limited fallback for unsuported distro.

Bastien Montagne noreply at git.blender.org
Mon Nov 23 21:08:52 CET 2015


Commit: f31e82d448a6732eeeb877088c2205ccacc4bb44
Author: Bastien Montagne
Date:   Mon Nov 23 19:54:25 2015 +0100
Branches: master
https://developer.blender.org/rBf31e82d448a6732eeeb877088c2205ccacc4bb44

install_deps.sh: add option to force building libs instead of using packages, and limited fallback for unsuported distro.

This commit adds '--build-foo' options to force the script to build relevant libraries
instead of trying to use packages from the distribution.

In addition, it also now offers (with those '--build-foo' options) the possibility
to build libraries on distributions that are not fully supported.

This is limited, but should still help people once they have installed themselves
the basics of dependencies - boost, llvm, osl/osd etc. are not libraries that are
really easy to build.

DISCLAIMER: I did not take the 20 (or more) hours needed to test all combinations
over all distributions, and given the size of the changes, bad sneaky typos are quite
probable, so please report if you get some errors!

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

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 02c5116..ade7d1e 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -29,9 +29,10 @@ getopt \
 ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,\
 force-all,force-python,force-numpy,force-boost,force-ocio,force-openexr,force-oiio,force-llvm,force-osl,force-osd,\
 force-ffmpeg,force-opencollada,\
+build-all,build-python,build-numpy,build-boost,build-ocio,build-openexr,build-oiio,build-llvm,build-osl,build-osd,\
+build-ffmpeg,build-opencollada,\
 skip-python,skip-numpy,skip-boost,skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,\
-skip-ffmpeg,skip-opencollada,\
-required-numpy: \
+skip-ffmpeg,skip-opencollada\
 -- "$@" \
 )
 
@@ -118,6 +119,52 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
         It may not always work as expected (some libs are actually checked out from a git rev...), yet it might help
         to fix some build issues (like LLVM mismatch with the version used by your graphic system).
 
+    --build-all
+        Force the build of all possible libraries.
+
+    --build-python
+        Force the build of Python.
+
+    --build-numpy
+        Force the build of NumPy.
+
+    --build-boost
+        Force the build of Boost.
+
+    --build-ocio
+        Force the build of OpenColorIO.
+
+    --build-openexr
+        Force the build of OpenEXR.
+
+    --build-oiio
+        Force the build of OpenImageIO.
+
+    --build-llvm
+        Force the build of LLVM.
+
+    --build-osl
+        Force the build of OpenShadingLanguage.
+
+    --build-osd
+        Force the build of OpenSubdiv.
+
+    --build-opencollada
+        Force the build of OpenCOLLADA.
+
+    --build-ffmpeg
+        Force the build of FFMpeg.
+
+    Note about the --build-foo options:
+        * They force the script to prefer building dependencies rather than using available packages.
+          This may make things simpler and allow working around some distribution bugs, but on the other hand it will
+          use much more space on your hard drive.
+        * Please be careful with the Blender building options if you have both 'official' dev packages and
+          install_deps' built ones on your system, by default CMake will prefer official packages, which may lead to
+          linking issues. Please ensure your CMake configuration always uses all correct library paths.
+        * If the “force-built” library is a dependency of others, it will force the build
+          of those libraries as well (e.g. --build-boost also implies --build-oiio and --build-osl...).
+
     --force-all
         Force the rebuild of all built libraries.
 
@@ -191,11 +238,7 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
         Unconditionally skip OpenCOLLADA installation/building.
 
     --skip-ffmpeg
-        Unconditionally skip FFMpeg installation/building.
-
-    --required-numpy
-        Use this in case your distro features a valid python package, but no matching Numpy one.
-        It will force compilation of both python and numpy\""
+        Unconditionally skip FFMpeg installation/building.\""
 
 ##### Main Vars #####
 
@@ -205,22 +248,25 @@ SUDO="sudo"
 
 PYTHON_VERSION="3.4.0"
 PYTHON_VERSION_MIN="3.4"
+PYTHON_FORCE_BUILD=false
 PYTHON_FORCE_REBUILD=false
 PYTHON_SKIP=false
 
 NUMPY_VERSION="1.8.1"
 NUMPY_VERSION_MIN="1.8"
+NUMPY_FORCE_BUILD=false
 NUMPY_FORCE_REBUILD=false
 NUMPY_SKIP=false
-NUMPY_REQUIRED=false
 
 BOOST_VERSION="1.51.0"
 BOOST_VERSION_MIN="1.49"
+BOOST_FORCE_BUILD=false
 BOOST_FORCE_REBUILD=false
 BOOST_SKIP=false
 
 OCIO_VERSION="1.0.9"
 OCIO_VERSION_MIN="1.0"
+OCIO_FORCE_BUILD=false
 OCIO_FORCE_REBUILD=false
 OCIO_SKIP=false
 
@@ -228,6 +274,7 @@ OPENEXR_VERSION="2.2.0"
 OPENEXR_VERSION_MIN="2.0.1"
 ILMBASE_VERSION="2.2.0"
 ILMBASE_VERSION_MIN="2.2"
+OPENEXR_FORCE_BUILD=false
 OPENEXR_FORCE_REBUILD=false
 OPENEXR_SKIP=false
 _with_built_openexr=false
@@ -235,34 +282,40 @@ _with_built_openexr=false
 OIIO_VERSION="1.4.16"
 OIIO_VERSION_MIN="1.4.0"
 OIIO_VERSION_MAX="1.5.0"  # Not supported by current OSL...
+OIIO_FORCE_BUILD=false
 OIIO_FORCE_REBUILD=false
 OIIO_SKIP=false
 
 LLVM_VERSION="3.4"
 LLVM_VERSION_MIN="3.4"
 LLVM_VERSION_FOUND=""
+LLVM_FORCE_BUILD=false
 LLVM_FORCE_REBUILD=false
 LLVM_SKIP=false
 
 # OSL needs to be compiled for now!
 OSL_VERSION="1.5.11"
 OSL_VERSION_MIN=$OSL_VERSION
+OSL_FORCE_BUILD=false
 OSL_FORCE_REBUILD=false
 OSL_SKIP=false
 
 # OpenSubdiv needs to be compiled for now
 OSD_VERSION="3.0.2"
 OSD_VERSION_MIN=$OSD_VERSION
+OSD_FORCE_BUILD=false
 OSD_FORCE_REBUILD=false
 OSD_SKIP=false
 
 # Version??
 OPENCOLLADA_VERSION="1.3"
+OPENCOLLADA_FORCE_BUILD=true  # no package!
 OPENCOLLADA_FORCE_REBUILD=false
 OPENCOLLADA_SKIP=false
 
 FFMPEG_VERSION="2.1.5"
 FFMPEG_VERSION_MIN="2.1.5"
+FFMPEG_FORCE_BUILD=false
 FFMPEG_FORCE_REBUILD=false
 FFMPEG_SKIP=false
 _ffmpeg_list_sep=";"
@@ -402,11 +455,65 @@ while true; do
       OSL_VERSION_MIN=$OSL_VERSION
       shift; shift; continue
     ;;
-  --ver-osd)
+    --ver-osd)
       OSD_VERSION="$2"
       OSD_VERSION_MIN=$OSD_VERSION
       shift; shift; continue
     ;;
+    --build-all)
+      PYTHON_FORCE_BUILD=true
+      NUMPY_FORCE_BUILD=true
+      BOOST_FORCE_BUILD=true
+      OCIO_FORCE_BUILD=true
+      OPENEXR_FORCE_BUILD=true
+      OIIO_FORCE_BUILD=true
+      LLVM_FORCE_BUILD=true
+      OSL_FORCE_BUILD=true
+      OSD_FORCE_BUILD=true
+      OPENCOLLADA_FORCE_BUILD=true
+      FFMPEG_FORCE_BUILD=true
+      shift; continue
+    ;;
+    --build-python)
+      PYTHON_FORCE_BUILD=true
+      NUMPY_FORCE_BUILD=true
+      shift; continue
+    ;;
+    --build-numpy)
+      PYTHON_FORCE_BUILD=true
+      NUMPY_FORCE_BUILD=true
+      shift; continue
+    ;;
+    --build-boost)
+      BOOST_FORCE_BUILD=true; shift; continue
+    ;;
+    --build-ocio)
+      OCIO_FORCE_BUILD=true; shift; continue
+    ;;
+    --build-openexr)
+      OPENEXR_FORCE_BUILD=true; shift; continue
+    ;;
+    --build-oiio)
+      OIIO_FORCE_BUILD=true
+      shift; continue
+    ;;
+    --build-llvm)
+      LLVM_FORCE_BUILD=true
+      OSL_FORCE_BUILD=true
+      shift; continue
+    ;;
+    --build-osl)
+      OSL_FORCE_BUILD=true; shift; continue
+    ;;
+    --build-osd)
+      OSD_FORCE_BUILD=true; shift; continue
+    ;;
+    --build-opencollada)
+      OPENCOLLADA_FORCE_BUILD=true; shift; continue
+    ;;
+    --build-ffmpeg)
+      FFMPEG_FORCE_BUILD=true; shift; continue
+    ;;
     --force-all)
       PYTHON_FORCE_REBUILD=true
       NUMPY_FORCE_REBUILD=true
@@ -492,9 +599,6 @@ while true; do
     --skip-ffmpeg)
       FFMPEG_SKIP=true; shift; continue
     ;;
-    --required-numpy)
-      NUMPY_REQUIRED=true; shift; continue
-    ;;
     --)
       # no more arguments to parse
       break
@@ -517,7 +621,7 @@ fi
 
 
 # This has to be done here, because user might force some versions...
-PYTHON_SOURCE=( "http://python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" )
+PYTHON_SOURCE=( "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" )
 NUMPY_SOURCE=( "http://sourceforge.net/projects/numpy/files/NumPy/$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
 
 _boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
@@ -584,6 +688,7 @@ DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
 
 The following libraries will probably not all be available as packages in your distribution
 (install_deps will by default try to install packages, and fall back to building missing ones).
+You can force install_deps to build those with '--build-all' or relevant 'build-foo' options, see '--help' message.
 You may also want to build them yourself (optional ones are [between brackets]):
 
     * Python $PYTHON_VERSION_MIN (from $PYTHON_SOURCE).
@@ -2146,14 +2251,19 @@ install_DEB() {
     fi
   fi
 
+
   PRINT ""
+  _do_compile_python=false
   if $PYTHON_SKIP; then
-    WARNING "Skipping Python installation, as requested..."
+    WARNING "Skipping Python/NumPy installation, as requested..."
+  elif [ "$PYTHON_FORCE_BUILD" = true ]; then
+    INFO "Forced Python/NumPy building, as requested..."
+    _do_compile_python=true
   else
-    _do_compile=false
     check_package_DEB python$PYTHON_VERSION_MIN-dev
     if [ $? -eq 0 ]; then
       install_packages_DEB python$PYTHON_VERSION_MIN-dev
+      clean_Python
       PRINT ""
       if $NUMPY_SKIP; then
         WARNING "Skipping NumPy installation, as requested..."
@@ -2161,35 +2271,33 @@ install_DEB() {
         check_package_DEB python3-numpy
         if [ $? -eq 0 ]; then
           install_packages_DEB python3-numpy
-        elif $NUMPY_REQUIRED; then
-          WARNING "Valid python package but no valid numpy package!" \
-                 "    Building both Python and Numpy from sources!"
-          _do_compile=true
         else
           WARNING "Sorry, using python package but no valid numpy package available!" \
-                  "    Use --required-numpy to force building of both Python and numpy."
+                  "    Use --build-numpy to force building of both Python and NumPy."
         fi
       fi
     else
-      _do_compile=true
+      _do_compile_python=true
     fi
+  fi
 
-    if $_do_compile; then
-      compile_Python
-      PRINT ""
-      if $NUMPY_SKIP; then
-        WARNING "Skipping NumPy installation, as requested..."
-      else
-        compile_Numpy
-      fi
+  if $_do_compile_python; then
+    compile_Python
+    PRINT ""
+    if $NUMPY_SKIP; then
+      WARNING "Skipping NumPy installation, as requested..."
     else
-      clean_Python
+      compile_Numpy
     fi
   fi
 
+
   PRINT ""
   if $BOOST_SKIP; then
     WARNING "Skipping Boost installation, as requested..."
+  elif [ "$BOOST_FORCE_BUILD" = true ]; then
+    INFO "Forced Boost building, as requested..."
+    compile_Boost
   else
     check_package_version_ge_DEB libboost-dev $BOOST_VERSION_MIN
     if [ $? -eq 0 ]; then
@@ -2211,9 +2319,13 @@ install_DEB() {
     fi
   fi
 
+
   PRINT ""
   if $OCIO_SKIP; then
     WARNING "Skipping OpenColorIO installation, as requested..."
+  elif [ "$OCIO_FORCE_BUILD" = true ]; then
+    INFO "Forced OpenColorIO building

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list