2 # ##### BEGIN GPL LICENSE BLOCK #####
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 # ##### END GPL LICENSE BLOCK #####
20 # A shell script installing/building all needed dependencies to build Blender, for some Linux distributions.
22 ##### Args and Help Handling #####
28 --long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,use-cxx11,\
29 with-all,with-opencollada,\
30 ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\
31 force-all,force-python,force-numpy,force-boost,\
32 force-ocio,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\
33 force-ffmpeg,force-opencollada,force-alembic,\
34 build-all,build-python,build-numpy,build-boost,\
35 build-ocio,build-openexr,build-oiio,build-llvm,build-osl,build-osd,build-openvdb,\
36 build-ffmpeg,build-opencollada,build-alembic,\
37 skip-python,skip-numpy,skip-boost,\
38 skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,skip-openvdb,\
39 skip-ffmpeg,skip-opencollada,skip-alembic \
47 SRC="$HOME/src/blender-deps"
52 SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
54 # Do not install some optional, potentially conflicting libs by default...
57 # Do not yet enable opencollada, use --with-opencollada (or --with-all) option to try it.
58 WITH_OPENCOLLADA=false
62 COMMON_INFO="\"Source code of dependencies needed to be compiled will be downloaded and extracted into '\$SRC'.
63 Built libs of dependencies needed to be compiled will be installed into '\$INST'.
64 Please edit \\\$SRC and/or \\\$INST variables at the beginning of this script,
65 or use --source/--install options, if you want to use other paths!
67 Number of threads for building: \$THREADS (automatically detected, use --threads=<nbr> to override it).
68 Full install: \$WITH_ALL (use --with-all option to enable it).
69 Building OpenCOLLADA: \$WITH_OPENCOLLADA (use --with-opencollada option to enable it).
72 Full install without OpenCOLLADA: --with-all --skip-opencollada
74 Use --help to show all available options!\""
76 ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
78 Show this message and exit.
81 Show main dependencies of Blender (including officially supported versions) and exit.
83 -s <path>, --source=<path>
84 Use a specific path where to store downloaded libraries sources (defaults to '\$SRC').
86 -i <path>, --install=<path>
87 Use a specific path where to install built libraries (defaults to '\$INST').
90 Use a specific temp path (defaults to '\$TMP').
93 Use a specific info path (to store BUILD_NOTES.txt, defaults to '\$INFO_PATH').
96 Use a specific number of threads when building the libraries (auto-detected as '\$THREADS').
99 Disable use of sudo (this script won't be able to do much though, will just print needed packages...).
102 Do not build (compile) anything, dependencies not installable with the package manager will remain missing.
105 Disable any interaction with user (suitable for automated run).
108 Build all libraries in cpp11 'mode' (will be mandatory soon in blender2.8 branch).
109 NOTE: If your compiler is gcc-6.0 or above, you probably *want* to enable this option (since it's default
110 standard starting from this version).
113 By default, a number of optional and not-so-often needed libraries are not installed.
114 This option will try to install them, at the cost of potential conflicts (depending on
115 how your package system is set…).
116 Note this option also implies all other (more specific) --with-foo options below.
119 Build and install the OpenCOLLADA libraries.
122 Force version of OCIO library.
125 Force version of OIIO library.
128 Force version of LLVM library.
131 Force version of OSL library.
134 Force version of OSD library.
137 Force version of OpenVDB library.
139 Note about the --ver-foo options:
140 It may not always work as expected (some libs are actually checked out from a git rev...), yet it might help
141 to fix some build issues (like LLVM mismatch with the version used by your graphic system).
144 Force the build of all possible libraries.
147 Force the build of Python.
150 Force the build of NumPy.
153 Force the build of Boost.
156 Force the build of OpenColorIO.
159 Force the build of OpenEXR.
162 Force the build of OpenImageIO.
165 Force the build of LLVM.
168 Force the build of OpenShadingLanguage.
171 Force the build of OpenSubdiv.
174 Force the build of OpenVDB.
177 Force the build of Alembic.
180 Force the build of OpenCOLLADA.
183 Force the build of FFMpeg.
185 Note about the --build-foo options:
186 * They force the script to prefer building dependencies rather than using available packages.
187 This may make things simpler and allow working around some distribution bugs, but on the other hand it will
188 use much more space on your hard drive.
189 * Please be careful with the Blender building options if you have both 'official' dev packages and
190 install_deps' built ones on your system, by default CMake will prefer official packages, which may lead to
191 linking issues. Please ensure your CMake configuration always uses all correct library paths.
192 * If the “force-built” library is a dependency of others, it will force the build
193 of those libraries as well (e.g. --build-boost also implies --build-oiio and --build-osl...).
196 Force the rebuild of all built libraries.
199 Force the rebuild of Python.
202 Force the rebuild of NumPy.
205 Force the rebuild of Boost.
208 Force the rebuild of OpenColorIO.
211 Force the rebuild of OpenEXR.
214 Force the rebuild of OpenImageIO.
217 Force the rebuild of LLVM.
220 Force the rebuild of OpenShadingLanguage.
223 Force the rebuild of OpenSubdiv.
226 Force the rebuild of OpenVDB.
229 Force the rebuild of Alembic.
232 Force the rebuild of OpenCOLLADA.
235 Force the rebuild of FFMpeg.
237 Note about the --force-foo options:
238 * They obviously only have an effect if those libraries are built by this script
239 (i.e. if there is no available and satisfactory package)!
240 * If the “force-rebuilt” library is a dependency of others, it will force the rebuild
241 of those libraries too (e.g. --force-boost will also rebuild oiio and osl...).
244 Unconditionally skip Python installation/building.
247 Unconditionally skip NumPy installation/building.
250 Unconditionally skip Boost installation/building.
253 Unconditionally skip OpenColorIO installation/building.
256 Unconditionally skip OpenEXR installation/building.
259 Unconditionally skip OpenImageIO installation/building.
262 Unconditionally skip LLVM installation/building.
265 Unconditionally skip OpenShadingLanguage installation/building.
268 Unconditionally skip OpenSubdiv installation/building.
271 Unconditionally skip OpenVDB installation/building.
274 Unconditionally skip Alembic installation/building.
277 Unconditionally skip OpenCOLLADA installation/building.
280 Unconditionally skip FFMpeg installation/building.\""
282 ##### Main Vars #####
292 PYTHON_VERSION="3.5.2"
293 PYTHON_VERSION_MIN="3.5"
294 PYTHON_FORCE_BUILD=false
295 PYTHON_FORCE_REBUILD=false
298 NUMPY_VERSION="1.10.1"
299 NUMPY_VERSION_MIN="1.8"
300 NUMPY_FORCE_BUILD=false
301 NUMPY_FORCE_REBUILD=false
304 BOOST_VERSION="1.60.0"
305 BOOST_VERSION_MIN="1.49"
306 BOOST_FORCE_BUILD=false
307 BOOST_FORCE_REBUILD=false
311 OCIO_VERSION_MIN="1.0"
312 OCIO_FORCE_BUILD=false
313 OCIO_FORCE_REBUILD=false
316 OPENEXR_VERSION="2.2.0"
317 OPENEXR_VERSION_MIN="2.0.1"
318 ILMBASE_VERSION="2.2.0"
319 ILMBASE_VERSION_MIN="2.2"
320 OPENEXR_FORCE_BUILD=false
321 OPENEXR_FORCE_REBUILD=false
323 _with_built_openexr=false
325 OIIO_VERSION="1.7.13"
326 OIIO_VERSION_MIN="1.7.13"
327 OIIO_VERSION_MAX="1.9.0" # UNKNOWN currently # Not supported by current OSL...
328 OIIO_FORCE_BUILD=false
329 OIIO_FORCE_REBUILD=false
333 LLVM_VERSION_MIN="3.4"
334 LLVM_VERSION_FOUND=""
335 LLVM_FORCE_BUILD=false
336 LLVM_FORCE_REBUILD=false
339 # OSL needs to be compiled for now!
341 OSL_VERSION_MIN=$OSL_VERSION
342 OSL_FORCE_BUILD=false
343 OSL_FORCE_REBUILD=false
346 # OpenSubdiv needs to be compiled for now
348 OSD_VERSION_MIN=$OSD_VERSION
349 OSD_FORCE_BUILD=false
350 OSD_FORCE_REBUILD=false
353 # OpenVDB needs to be compiled for now
354 OPENVDB_BLOSC_VERSION="1.7.0"
356 OPENVDB_VERSION="3.1.0"
357 OPENVDB_VERSION_MIN=$OPENVDB_VERSION
358 OPENVDB_FORCE_BUILD=false
359 OPENVDB_FORCE_REBUILD=false
362 # Alembic needs to be compiled for now
363 ALEMBIC_VERSION="1.7.1"
364 ALEMBIC_VERSION_MIN=$ALEMBIC_VERSION
365 ALEMBIC_FORCE_BUILD=false
366 ALEMBIC_FORCE_REBUILD=false
370 OPENCOLLADA_VERSION="1.3"
371 OPENCOLLADA_FORCE_BUILD=false
372 OPENCOLLADA_FORCE_REBUILD=false
373 OPENCOLLADA_SKIP=false
375 FFMPEG_VERSION="3.2.1"
376 FFMPEG_VERSION_MIN="2.8.4"
377 FFMPEG_FORCE_BUILD=false
378 FFMPEG_FORCE_REBUILD=false
382 # FFMPEG optional libs.
393 X264_VERSION_MIN=0.118
395 VPX_VERSION_MIN=0.9.7
402 # Whether to use system GLEW or not (OpenSubDiv needs recent glew to work).
405 # Switch to english language, else some things (like check_package_DEB()) won't work!
410 ##### Generic Helpers #####
412 BLACK=$(tput setaf 0)
414 GREEN=$(tput setaf 2)
415 YELLOW=$(tput setaf 3)
416 LIME_YELLOW=$(tput setaf 190)
417 POWDER_BLUE=$(tput setaf 153)
419 MAGENTA=$(tput setaf 5)
421 WHITE=$(tput setaf 7)
426 UNDERLINE=$(tput smul)
429 if [ "X$1" = "X-n" ]; then
430 shift; printf "%s" "$@"
437 _echo "${BRIGHT}${RED}ERROR! ${NORMAL}${RED}$@${NORMAL}"
441 _echo "${BRIGHT}${YELLOW}WARNING! ${NORMAL}${YELLOW}$@${NORMAL}"
445 _echo "${GREEN}$@${NORMAL}"
452 ##### Args Handling #####
454 # Finish parsing the commandline args.
459 SRC="$2"; shift; shift; continue
462 INST="$2"; shift; shift; continue
465 TMP="$2"; shift; shift; continue
468 INFO_PATH="$2"; shift; shift; continue
471 THREADS="$2"; shift; shift; continue
477 PRINT "`eval _echo "$COMMON_INFO"`"
479 PRINT "`eval _echo "$ARGUMENTS_INFO"`"
484 # We have to defer...
485 DO_SHOW_DEPS=true; shift; continue
489 WARNING "--no-sudo enabled, this script might not be able to do much..."
491 SUDO=""; shift; continue
495 WARNING "--no-build enabled, this script will not be able to install all dependencies..."
497 NO_BUILD=true; shift; continue
500 NO_CONFIRM=true; shift; continue
503 USE_CXX11=true; shift; continue
506 WITH_ALL=true; shift; continue
509 WITH_OPENCOLLADA=true; shift; continue
513 OCIO_VERSION_MIN=$OCIO_VERSION
514 shift; shift; continue
518 OIIO_VERSION_MIN=$OIIO_VERSION
519 shift; shift; continue
523 LLVM_VERSION_MIN=$LLVM_VERSION
524 shift; shift; continue
528 OSL_VERSION_MIN=$OSL_VERSION
529 shift; shift; continue
533 OSD_VERSION_MIN=$OSD_VERSION
534 shift; shift; continue
538 OPENVDB_VERSION_MIN=$OPENVDB_VERSION
539 shift; shift; continue
542 PYTHON_FORCE_BUILD=true
543 NUMPY_FORCE_BUILD=true
544 BOOST_FORCE_BUILD=true
545 OCIO_FORCE_BUILD=true
546 OPENEXR_FORCE_BUILD=true
547 OIIO_FORCE_BUILD=true
548 LLVM_FORCE_BUILD=true
551 OPENVDB_FORCE_BUILD=true
552 OPENCOLLADA_FORCE_BUILD=true
553 FFMPEG_FORCE_BUILD=true
554 ALEMBIC_FORCE_BUILD=true
558 PYTHON_FORCE_BUILD=true
559 NUMPY_FORCE_BUILD=true
563 PYTHON_FORCE_BUILD=true
564 NUMPY_FORCE_BUILD=true
568 BOOST_FORCE_BUILD=true; shift; continue
571 OCIO_FORCE_BUILD=true; shift; continue
574 OPENEXR_FORCE_BUILD=true; shift; continue
577 OIIO_FORCE_BUILD=true; shift; continue
580 LLVM_FORCE_BUILD=true; shift; continue
583 OSL_FORCE_BUILD=true; shift; continue
586 OSD_FORCE_BUILD=true; shift; continue
589 OPENVDB_FORCE_BUILD=true; shift; continue
592 OPENCOLLADA_FORCE_BUILD=true; shift; continue
595 FFMPEG_FORCE_BUILD=true; shift; continue
598 ALEMBIC_FORCE_BUILD=true; shift; continue
601 PYTHON_FORCE_REBUILD=true
602 NUMPY_FORCE_REBUILD=true
603 BOOST_FORCE_REBUILD=true
604 OCIO_FORCE_REBUILD=true
605 OPENEXR_FORCE_REBUILD=true
606 OIIO_FORCE_REBUILD=true
607 LLVM_FORCE_REBUILD=true
608 OSL_FORCE_REBUILD=true
609 OSD_FORCE_REBUILD=true
610 OPENVDB_FORCE_REBUILD=true
611 OPENCOLLADA_FORCE_REBUILD=true
612 FFMPEG_FORCE_REBUILD=true
613 ALEMBIC_FORCE_REBUILD=true
617 PYTHON_FORCE_REBUILD=true
618 NUMPY_FORCE_REBUILD=true
622 NUMPY_FORCE_REBUILD=true; shift; continue
625 BOOST_FORCE_REBUILD=true; shift; continue
628 OCIO_FORCE_REBUILD=true; shift; continue
631 OPENEXR_FORCE_REBUILD=true; shift; continue
634 OIIO_FORCE_REBUILD=true; shift; continue
637 LLVM_FORCE_REBUILD=true; shift; continue
640 OSL_FORCE_REBUILD=true; shift; continue
643 OSD_FORCE_REBUILD=true; shift; continue
646 OPENVDB_FORCE_REBUILD=true; shift; continue
649 OPENCOLLADA_FORCE_REBUILD=true; shift; continue
652 FFMPEG_FORCE_REBUILD=true; shift; continue
655 ALEMBIC_FORCE_REBUILD=true; shift; continue
658 PYTHON_SKIP=true; shift; continue
661 NUMPY_SKIP=true; shift; continue
664 BOOST_SKIP=true; shift; continue
667 OCIO_SKIP=true; shift; continue
670 OPENEXR_SKIP=true; shift; continue
673 OIIO_SKIP=true; shift; continue
676 LLVM_SKIP=true; shift; continue
679 OSL_SKIP=true; shift; continue
682 OSD_SKIP=true; shift; continue
685 OPENVDB_SKIP=true; shift; continue
688 OPENCOLLADA_SKIP=true; shift; continue
691 FFMPEG_SKIP=true; shift; continue
694 ALEMBIC_SKIP=true; shift; continue
697 # no more arguments to parse
702 ERROR "Wrong parameter! Usage:"
704 PRINT "`eval _echo "$COMMON_INFO"`"
711 if [ "$WITH_ALL" = true -a "$OPENCOLLADA_SKIP" = false ]; then
712 WITH_OPENCOLLADA=true
716 WARNING "****WARNING****"
717 PRINT "If you are experiencing issues building Blender, _*TRY A FRESH, CLEAN BUILD FIRST*_!"
718 PRINT "The same goes for install_deps itself, if you encounter issues, please first erase everything in $SRC and $INST"
719 PRINT "(provided obviously you did not add anything yourself in those dirs!), and run install_deps.sh again!"
720 PRINT "Often, changes in the libs built by this script, or in your distro package, cannot be handled simply, so..."
722 PRINT "You may also try to use the '--build-foo' options to bypass your distribution's packages"
723 PRINT "for some troublesome/buggy libraries..."
727 PRINT " install_deps.sh $COMMANDLINE"
732 # This has to be done here, because user might force some versions...
733 PYTHON_SOURCE=( "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" )
734 NUMPY_SOURCE=( "http://sourceforge.net/projects/numpy/files/NumPy/$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
736 _boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
737 BOOST_SOURCE=( "http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_$_boost_version_nodots.tar.bz2/download" )
738 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"
740 OCIO_SOURCE=( "https://github.com/imageworks/OpenColorIO/tarball/v$OCIO_VERSION" )
742 OPENEXR_USE_REPO=false
743 OPENEXR_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/openexr-$OPENEXR_VERSION.tar.gz" )
744 OPENEXR_SOURCE_REPO=( "https://github.com/mont29/openexr.git" )
745 OPENEXR_SOURCE_REPO_UID="2787aa1cf652d244ed45ae124eb1553f6cff11ee"
746 ILMBASE_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/ilmbase-$ILMBASE_VERSION.tar.gz" )
749 OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz" )
750 OIIO_SOURCE_REPO=( "https://github.com/OpenImageIO/oiio.git" )
751 OIIO_SOURCE_REPO_UID="c9e67275a0b248ead96152f6d2221cc0c0f278a4"
753 LLVM_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.gz" )
754 LLVM_CLANG_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.gz" "http://llvm.org/releases/$LLVM_VERSION/cfe-$LLVM_VERSION.src.tar.gz" )
757 OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" )
758 #~ OSL_SOURCE=( "https://github.com/Nazg-Gul/OpenShadingLanguage/archive/Release-1.5.11.tar.gz" )
759 #~ OSL_SOURCE_REPO=( "https://github.com/imageworks/OpenShadingLanguage.git" )
760 #~ OSL_SOURCE_REPO=( "https://github.com/mont29/OpenShadingLanguage.git" )
761 #~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
762 #~ OSL_SOURCE_REPO_BRANCH="master"
763 OSL_SOURCE_REPO=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" )
764 OSL_SOURCE_REPO_UID="7d40ff5fe8e47b030042afb92d0e955f5aa96f48"
765 OSL_SOURCE_REPO_BRANCH="blender-fixes"
768 # Script foo to make the version string compliant with the archive name:
769 # ${Varname//SearchForThisChar/ReplaceWithThisChar}
770 OSD_SOURCE=( "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v${OSD_VERSION//./_}.tar.gz" )
771 OSD_SOURCE_REPO=( "https://github.com/PixarAnimationStudios/OpenSubdiv.git" )
772 OSD_SOURCE_REPO_UID="404659fffa659da075d1c9416e4fc939139a84ee"
773 OSD_SOURCE_REPO_BRANCH="dev"
775 OPENVDB_USE_REPO=false
776 OPENVDB_BLOSC_SOURCE=( "https://github.com/Blosc/c-blosc/archive/v${OPENVDB_BLOSC_VERSION}.tar.gz" )
777 OPENVDB_SOURCE=( "https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz" )
778 #~ OPENVDB_SOURCE_REPO=( "https:///dreamworksanimation/openvdb.git" )
779 #~ OPENVDB_SOURCE_REPO_UID="404659fffa659da075d1c9416e4fc939139a84ee"
780 #~ OPENVDB_SOURCE_REPO_BRANCH="dev"
782 ALEMBIC_USE_REPO=false
783 ALEMBIC_SOURCE=( "https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz" )
784 # ALEMBIC_SOURCE_REPO=( "https://github.com/alembic/alembic.git" )
785 # ALEMBIC_SOURCE_REPO_UID="e6c90d4faa32c4550adeaaf3f556dad4b73a92bb"
786 # ALEMBIC_SOURCE_REPO_BRANCH="master"
788 OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" )
789 OPENCOLLADA_REPO_UID="3335ac164e68b2512a40914b14c74db260e6ff7d"
790 OPENCOLLADA_REPO_BRANCH="master"
792 FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
794 CXXFLAGS_BACK=$CXXFLAGS
795 if [ "$USE_CXX11" = true ]; then
796 WARNING "You are trying to use c++11, this *should* go smoothely with any very recent distribution
797 However, if you are experiencing linking errors (also when building Blender itself), please try the following:
798 * Re-run this script with '--build-all --force-all' options.
799 * Ensure your gcc version is at the very least 4.8, if possible you should really rather use gcc-5.1 or above.
801 Please note that until the transition to C++11-built libraries if completed in your distribution, situation will
802 remain fuzzy and incompatibilities may happen..."
805 CXXFLAGS="$CXXFLAGS -std=c++11"
809 #### Show Dependencies ####
811 # Need those to be after we defined versions...
812 DEPS_COMMON_INFO="\"COMMON DEPENDENCIES:
814 Those libraries should be available as packages in all recent distributions (optional ones are [between brackets]):
816 * Basics of dev environment (cmake, gcc, svn , git, ...).
817 * libjpeg, libpng, libtiff, [libopenjpeg], [libopenal].
818 * libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
819 * libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
820 * libsdl1.2, libglew, [libglewmx].\""
822 DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
824 The following libraries will probably not all be available as packages in your distribution
825 (install_deps will by default try to install packages, and fall back to building missing ones).
826 You can force install_deps to build those with '--build-all' or relevant 'build-foo' options, see '--help' message.
827 You may also want to build them yourself (optional ones are [between brackets]):
829 * Python $PYTHON_VERSION_MIN (from $PYTHON_SOURCE).
830 * [NumPy $NUMPY_VERSION_MIN] (from $NUMPY_SOURCE).
831 * Boost $BOOST_VERSION_MIN (from $BOOST_SOURCE, modules: $BOOST_BUILD_MODULES).
832 * [FFMpeg $FFMPEG_VERSION_MIN (needs libvorbis, libogg, libtheora, libx264, libmp3lame, libxvidcore, libvpx, ...)] (from $FFMPEG_SOURCE).
833 * [OpenColorIO $OCIO_VERSION_MIN] (from $OCIO_SOURCE).
834 * ILMBase $ILMBASE_VERSION_MIN (from $ILMBASE_SOURCE).
835 * OpenEXR $OPENEXR_VERSION_MIN (from $OPENEXR_SOURCE).
836 * OpenImageIO $OIIO_VERSION_MIN (from $OIIO_SOURCE).
837 * [LLVM $LLVM_VERSION_MIN (with clang)] (from $LLVM_SOURCE, and $LLVM_CLANG_SOURCE).
838 * [OpenShadingLanguage $OSL_VERSION_MIN] (from $OSL_SOURCE_REPO, branch $OSL_SOURCE_REPO_BRANCH, commit $OSL_SOURCE_REPO_UID).
839 * [OpenSubDiv $OSD_VERSION_MIN] (from $OSD_SOURCE_REPO, branch $OSD_SOURCE_REPO_BRANCH, commit $OSD_SOURCE_REPO_UID).
840 * [OpenVDB $OPENVDB_VERSION_MIN] (from $OPENVDB_SOURCE), [Blosc $OPENVDB_BLOSC_VERSION] (from $OPENVDB_BLOSC_SOURCE).
841 * [OpenCollada] (from $OPENCOLLADA_SOURCE, branch $OPENCOLLADA_REPO_BRANCH, commit $OPENCOLLADA_REPO_UID).
842 * [Alembic $ALEMBIC_VERSION] (from $ALEMBIC_SOURCE).\""
844 if [ "$DO_SHOW_DEPS" = true ]; then
846 PRINT "Blender dependencies (libraries needed to build it):"
848 PRINT "`eval _echo "$DEPS_COMMON_INFO"`"
850 PRINT "`eval _echo "$DEPS_SPECIFIC_INFO"`"
857 ##### Generic Helpers #####
859 # Check return code of wget for success...
861 declare -a sources=("${!1}")
862 sources_count=${#sources[@]}
865 for (( i=0; $i < $sources_count; i++ ))
867 wget -c ${sources[$i]} -O $2
868 if [ $? -eq 0 ]; then
874 if [ $error -eq 1 ]; then
875 ERROR "wget could not find ${sources[@]}, or could not write it to $2, exiting"
880 # Return 0 if $1 = $2 (i.e. 1.01.0 = 1.1, but 1.1.1 != 1.1), else 1.
881 # $1 and $2 should be version numbers made of numbers only.
886 # Split both version numbers into their numeric elements.
894 if [ $count2 -ge $count1 ]; then
903 for (( i=0; $i < $count2; i++ ))
905 if [ $(( 10#${arr1[$i]} )) -ne $(( 10#${arr2[$i]} )) ]; then
911 for (( i=$count2; $i < $count1; i++ ))
913 if [ $(( 10#${arr1[$i]} )) -ne 0 ]; then
923 # Return 0 if $1 >= $2, else 1.
924 # $1 and $2 should be version numbers made of numbers only.
927 if [ $? -eq 1 -a $(_echo "$1" "$2" | sort --version-sort | head --lines=1) = "$1" ]; then
934 # Return 0 if $3 > $1 >= $2, else 1.
935 # $1 and $2 should be version numbers made of numbers only.
938 if [ $? -eq 0 ]; then
946 # Return 0 if $1 is into $2 (e.g. 3.3.2 is into 3.3, but not 3.3.0 or 3.3.5), else 1.
947 # $1 and $2 should be version numbers made of numbers only.
948 # $1 should be at least as long as $2!
953 # Split both version numbers into their numeric elements.
961 if [ $count1 -ge $count2 ]; then
963 for (( i=0; $i < $count2; i++ ))
965 if [ $(( 10#${arr1[$i]} )) -ne $(( 10#${arr2[$i]} )) ]; then
976 ##### Generic compile helpers #####
978 INFO "Ensuring $INST exists and is writable by us"
980 WARNING "--no-sudo enabled, might be impossible to create install dir..."
982 if [ ! -d $INST ]; then
986 if [ ! -w $INST ]; then
987 $SUDO chown $USER $INST
988 $SUDO chmod 775 $INST
992 # Check whether the current package needs to be recompiled, based on a dummy file containing a magic number in its name...
993 magic_compile_check() {
994 if [ -f $INST/.$1-magiccheck-$2-$USE_CXX11 ]; then
1001 magic_compile_set() {
1002 rm -f $INST/.$1-magiccheck-*
1003 touch $INST/.$1-magiccheck-$2-$USE_CXX11
1006 # Note: should clean nicely in $INST, but not in $SRC, when we switch to a new version of a lib...
1008 rm -rf `readlink -f $_inst_shortcut`
1009 # Only remove $_src dir when not using git repo (avoids to re-clone the whole repo every time!!!).
1010 if [ $_git == false ]; then
1014 rm -rf $_inst_shortcut
1017 _create_inst_shortcut() {
1018 rm -f $_inst_shortcut
1019 ln -s $_inst $_inst_shortcut
1024 _lib_path="$INST/$1/lib"
1025 _ldconf_path="/etc/ld.so.conf.d/$1.conf"
1027 if [ ! $SUDO ]; then
1028 WARNING "--no-sudo enabled, impossible to run ldconfig for $1, you'll have to do it yourself..."
1030 INFO "Running ldconfig for $1..."
1031 $SUDO sh -c "echo \"$_lib_path\" > $_ldconf_path"
1032 $SUDO /sbin/ldconfig # XXX OpenSuse does not include sbin in command path with sudo!!!
1037 #### Build Python ####
1039 _src=$SRC/Python-$PYTHON_VERSION
1041 _inst=$INST/python-$PYTHON_VERSION
1042 _inst_shortcut=$INST/python-$PYTHON_VERSION_MIN
1052 if [ "$NO_BUILD" = true ]; then
1053 WARNING "--no-build enabled, Python will not be compiled!"
1057 # To be changed each time we make edits that would modify the compiled result!
1061 # Clean install if needed!
1062 magic_compile_check python-$PYTHON_VERSION $py_magic
1063 if [ $? -eq 1 -o "$PYTHON_FORCE_REBUILD" = true ]; then
1067 if [ ! -d $_inst ]; then
1068 INFO "Building Python-$PYTHON_VERSION"
1072 if [ ! -d $_src ]; then
1074 download PYTHON_SOURCE[@] $_src.tgz
1076 INFO "Unpacking Python-$PYTHON_VERSION"
1077 tar -C $SRC -xf $_src.tgz
1082 ./configure --prefix=$_inst --libdir=$_inst/lib --enable-ipv6 \
1083 --enable-loadable-sqlite-extensions --with-dbmliborder=bdb \
1084 --with-computed-gotos --with-pymalloc
1086 make -j$THREADS && make install
1089 if [ -d $_inst ]; then
1090 _create_inst_shortcut
1092 ERROR "Python--$PYTHON_VERSION failed to compile, exiting"
1096 magic_compile_set python-$PYTHON_VERSION $py_magic
1099 INFO "Done compiling Python-$PYTHON_VERSION!"
1101 INFO "Own Python-$PYTHON_VERSION is up to date, nothing to do!"
1102 INFO "If you want to force rebuild of this lib, use the --force-python option."
1106 ##### Build Numpy #####
1108 _src=$SRC/numpy-$NUMPY_VERSION
1110 _inst=$INST/numpy-$NUMPY_VERSION
1111 _python=$INST/python-$PYTHON_VERSION
1112 _site=lib/python$PYTHON_VERSION_MIN/site-packages
1113 _inst_shortcut=$_python/$_site/numpy
1122 if [ "$NO_BUILD" = true ]; then
1123 WARNING "--no-build enabled, Numpy will not be compiled!"
1127 # To be changed each time we make edits that would modify the compiled result!
1131 # Clean install if needed!
1132 magic_compile_check numpy-$NUMPY_VERSION $numpy_magic
1133 if [ $? -eq 1 -o "$NUMPY_FORCE_REBUILD" = true ]; then
1137 if [ ! -d $_inst ]; then
1138 INFO "Building Numpy-$NUMPY_VERSION"
1142 if [ ! -d $_src ]; then
1144 download NUMPY_SOURCE[@] $_src.tar.gz
1146 INFO "Unpacking Numpy-$NUMPY_VERSION"
1147 tar -C $SRC -xf $_src.tar.gz
1152 $_python/bin/python3 setup.py install --prefix=$_inst
1154 if [ -d $_inst ]; then
1155 # Can't use _create_inst_shortcut here...
1156 rm -f $_inst_shortcut
1157 ln -s $_inst/$_site/numpy $_inst_shortcut
1159 ERROR "Numpy-$NUMPY_VERSION failed to compile, exiting"
1163 magic_compile_set numpy-$NUMPY_VERSION $numpy_magic
1166 INFO "Done compiling Numpy-$NUMPY_VERSION!"
1168 INFO "Own Numpy-$NUMPY_VERSION is up to date, nothing to do!"
1169 INFO "If you want to force rebuild of this lib, use the --force-numpy option."
1173 #### Build Boost ####
1175 _src=$SRC/boost-$BOOST_VERSION
1177 _inst=$INST/boost-$BOOST_VERSION
1178 _inst_shortcut=$INST/boost
1187 if [ "$NO_BUILD" = true ]; then
1188 WARNING "--no-build enabled, Boost will not be compiled!"
1192 # To be changed each time we make edits that would modify the compiled result!
1197 # Clean install if needed!
1198 magic_compile_check boost-$BOOST_VERSION $boost_magic
1199 if [ $? -eq 1 -o "$BOOST_FORCE_REBUILD" = true ]; then
1203 if [ ! -d $_inst ]; then
1204 INFO "Building Boost-$BOOST_VERSION"
1206 # Rebuild dependecies as well!
1207 OIIO_FORCE_BUILD=true
1208 OIIO_FORCE_REBUILD=true
1209 OSL_FORCE_BUILD=true
1210 OSL_FORCE_REBUILD=true
1211 OPENVDB_FORCE_BUILD=true
1212 OPENVDB_FORCE_REBUILD=true
1216 if [ ! -d $_src ]; then
1217 INFO "Downloading Boost-$BOOST_VERSION"
1219 download BOOST_SOURCE[@] $_src.tar.bz2
1220 tar -C $SRC --transform "s,\w*,boost-$BOOST_VERSION,x" -xf $_src.tar.bz2
1224 if [ ! -f $_src/b2 ]; then
1227 ./b2 -j$THREADS -a $BOOST_BUILD_MODULES \
1228 --prefix=$_inst --disable-icu boost.locale.icu=off install
1231 if [ -d $_inst ]; then
1232 _create_inst_shortcut
1234 ERROR "Boost-$BOOST_VERSION failed to compile, exiting"
1238 magic_compile_set boost-$BOOST_VERSION $boost_magic
1241 INFO "Done compiling Boost-$BOOST_VERSION!"
1243 INFO "Own Boost-$BOOST_VERSION is up to date, nothing to do!"
1244 INFO "If you want to force rebuild of this lib, use the --force-boost option."
1247 # Just always run it, much simpler this way!
1248 run_ldconfig "boost"
1251 #### Build OCIO ####
1253 _src=$SRC/OpenColorIO-$OCIO_VERSION
1255 _inst=$INST/ocio-$OCIO_VERSION
1256 _inst_shortcut=$INST/ocio
1265 if [ "$NO_BUILD" = true ]; then
1266 WARNING "--no-build enabled, OpenColorIO will not be compiled!"
1270 # To be changed each time we make edits that would modify the compiled result!
1274 # Clean install if needed!
1275 magic_compile_check ocio-$OCIO_VERSION $ocio_magic
1276 if [ $? -eq 1 -o "$OCIO_FORCE_REBUILD" = true ]; then
1280 if [ ! -d $_inst ]; then
1281 INFO "Building OpenColorIO-$OCIO_VERSION"
1285 if [ ! -d $_src ]; then
1286 INFO "Downloading OpenColorIO-$OCIO_VERSION"
1288 download OCIO_SOURCE[@] $_src.tar.gz
1290 INFO "Unpacking OpenColorIO-$OCIO_VERSION"
1291 tar -C $SRC --transform "s,(.*/?)imageworks-OpenColorIO[^/]*(.*),\1OpenColorIO-$OCIO_VERSION\2,x" \
1296 # Always refresh the whole build!
1297 if [ -d build ]; then
1303 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1304 cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
1305 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1306 cmake_d="$cmake_d -D OCIO_BUILD_APPS=OFF"
1307 cmake_d="$cmake_d -D OCIO_BUILD_PYGLUE=OFF"
1309 if file /bin/cp | grep -q '32-bit'; then
1310 cflags="-fPIC -m32 -march=i686"
1315 cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ..
1317 make -j$THREADS && make install
1319 # Force linking against static libs
1320 rm -f $_inst/lib/*.so*
1322 # Additional depencencies
1323 cp ext/dist/lib/libtinyxml.a $_inst/lib
1324 cp ext/dist/lib/libyaml-cpp.a $_inst/lib
1328 if [ -d $_inst ]; then
1329 _create_inst_shortcut
1331 ERROR "OpenColorIO-$OCIO_VERSION failed to compile, exiting"
1335 magic_compile_set ocio-$OCIO_VERSION $ocio_magic
1338 INFO "Done compiling OpenColorIO-$OCIO_VERSION!"
1340 INFO "Own OpenColorIO-$OCIO_VERSION is up to date, nothing to do!"
1341 INFO "If you want to force rebuild of this lib, use the --force-ocio option."
1347 #### Build ILMBase ####
1349 _src=$SRC/ILMBase-$ILMBASE_VERSION
1351 _inst=$TMP/ilmbase-$ILMBASE_VERSION
1352 _inst_shortcut=$TMP/ilmbase
1361 if [ "$NO_BUILD" = true ]; then
1362 WARNING "--no-build enabled, ILMBase will not be compiled!"
1366 # To be changed each time we make edits that would modify the compiled result!
1370 # Clean install if needed!
1371 magic_compile_check ilmbase-$ILMBASE_VERSION $ilmbase_magic
1372 if [ $? -eq 1 -o "$OPENEXR_FORCE_REBUILD" = true ]; then
1374 rm -rf $_openexr_inst
1377 if [ ! -d $_openexr_inst ]; then
1378 INFO "Building ILMBase-$ILMBASE_VERSION"
1380 # Rebuild dependecies as well!
1381 OPENEXR_FORCE_BUILD=true
1382 OPENEXR_FORCE_REBUILD=true
1386 if [ ! -d $_src ]; then
1387 INFO "Downloading ILMBase-$ILMBASE_VERSION"
1389 download ILMBASE_SOURCE[@] $_src.tar.gz
1391 INFO "Unpacking ILMBase-$ILMBASE_VERSION"
1392 tar -C $SRC --transform "s,(.*/?)ilmbase-[^/]*(.*),\1ILMBase-$ILMBASE_VERSION\2,x" -xf $_src.tar.gz
1397 # Always refresh the whole build!
1398 if [ -d build ]; then
1404 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1405 cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
1406 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1407 cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
1408 cmake_d="$cmake_d -D NAMESPACE_VERSIONING=OFF" # VERY IMPORTANT!!!
1410 if file /bin/cp | grep -q '32-bit'; then
1411 cflags="-fPIC -m32 -march=i686"
1416 cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ..
1418 make -j$THREADS && make install
1422 if [ -d $_inst ]; then
1423 _create_inst_shortcut
1425 ERROR "ILMBase-$ILMBASE_VERSION failed to compile, exiting"
1429 INFO "Done compiling ILMBase-$ILMBASE_VERSION!"
1431 INFO "Own ILMBase-$ILMBASE_VERSION is up to date, nothing to do!"
1432 INFO "If you want to force rebuild of this lib (and openexr), use the --force-openexr option."
1435 magic_compile_set ilmbase-$ILMBASE_VERSION $ilmbase_magic
1438 #### Build OpenEXR ####
1440 _src=$SRC/OpenEXR-$OPENEXR_VERSION
1442 _inst=$_openexr_inst
1443 _inst_shortcut=$INST/openexr
1453 if [ "$NO_BUILD" = true ]; then
1454 WARNING "--no-build enabled, OpenEXR will not be compiled!"
1458 # To be changed each time we make edits that would modify the compiled result!
1461 # Clean install if needed!
1462 magic_compile_check openexr-$OPENEXR_VERSION $openexr_magic
1463 if [ $? -eq 1 -o "$OPENEXR_FORCE_REBUILD" = true ]; then
1467 _openexr_inst=$INST/openexr-$OPENEXR_VERSION
1470 _ilmbase_inst=$_inst_shortcut
1473 if [ ! -d $_inst ]; then
1474 INFO "Building OpenEXR-$OPENEXR_VERSION"
1476 # Rebuild dependecies as well!
1477 OIIO_FORCE_BUILD=true
1478 OIIO_FORCE_REBUILD=true
1482 if [ ! -d $_src ]; then
1483 INFO "Downloading OpenEXR-$OPENEXR_VERSION"
1486 if [ "$OPENEXR_USE_REPO" = true ]; then
1487 git clone ${OPENEXR_SOURCE_REPO[0]} $_src
1489 download OPENEXR_SOURCE[@] $_src.tar.gz
1490 INFO "Unpacking OpenEXR-$OPENEXR_VERSION"
1491 tar -C $SRC --transform "s,(.*/?)openexr[^/]*(.*),\1OpenEXR-$OPENEXR_VERSION\2,x" -xf $_src.tar.gz
1498 if [ "$OPENEXR_USE_REPO" = true ]; then
1499 # XXX For now, always update from latest repo...
1500 git pull origin master
1501 # Stick to same rev as windows' libs...
1502 git checkout $OPENEXR_SOURCE_REPO_UID
1504 oiio_src_path="../OpenEXR"
1509 # Always refresh the whole build!
1510 if [ -d build ]; then
1516 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1517 cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
1518 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1519 cmake_d="$cmake_d -D ILMBASE_PACKAGE_PREFIX=$_ilmbase_inst"
1520 cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
1521 cmake_d="$cmake_d -D NAMESPACE_VERSIONING=OFF" # VERY IMPORTANT!!!
1523 if file /bin/cp | grep -q '32-bit'; then
1524 cflags="-fPIC -m32 -march=i686"
1529 cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" $oiio_src_path
1531 make -j$THREADS && make install
1535 if [ -d $_inst ]; then
1536 _create_inst_shortcut
1537 # Copy ilmbase files here (blender expects same dir for ilmbase and openexr :/).
1538 cp -an $_ilmbase_inst/* $_inst_shortcut
1540 ERROR "OpenEXR-$OPENEXR_VERSION failed to compile, exiting"
1544 magic_compile_set openexr-$OPENEXR_VERSION $openexr_magic
1547 INFO "Done compiling OpenEXR-$OPENEXR_VERSION!"
1549 INFO "Own OpenEXR-$OPENEXR_VERSION is up to date, nothing to do!"
1550 INFO "If you want to force rebuild of this lib, use the --force-openexr option."
1553 _with_built_openexr=true
1555 # Just always run it, much simpler this way!
1556 run_ldconfig "openexr"
1559 #### Build OIIO ####
1561 _src=$SRC/OpenImageIO-$OIIO_VERSION
1563 _inst=$INST/oiio-$OIIO_VERSION
1564 _inst_shortcut=$INST/oiio
1573 if [ "$NO_BUILD" = true ]; then
1574 WARNING "--no-build enabled, OpenImageIO will not be compiled!"
1578 # To be changed each time we make edits that would modify the compiled result!
1582 # Clean install if needed!
1583 magic_compile_check oiio-$OIIO_VERSION $oiio_magic
1584 if [ $? -eq 1 -o "$OIIO_FORCE_REBUILD" = true ]; then
1588 if [ ! -d $_inst ]; then
1589 INFO "Building OpenImageIO-$OIIO_VERSION"
1591 # Rebuild dependecies as well!
1592 OSL_FORCE_BUILD=true
1593 OSL_FORCE_REBUILD=true
1597 if [ ! -d $_src ]; then
1600 if [ "$OIIO_USE_REPO" = true ]; then
1601 git clone ${OIIO_SOURCE_REPO[0]} $_src
1603 download OIIO_SOURCE[@] "$_src.tar.gz"
1604 INFO "Unpacking OpenImageIO-$OIIO_VERSION"
1605 tar -C $SRC --transform "s,(.*/?)oiio-Release-[^/]*(.*),\1OpenImageIO-$OIIO_VERSION\2,x" -xf $_src.tar.gz
1611 if [ "$OIIO_USE_REPO" = true ]; then
1612 # XXX For now, always update from latest repo...
1613 git pull origin master
1614 # Stick to same rev as windows' libs...
1615 git checkout $OIIO_SOURCE_REPO_UID
1619 # Always refresh the whole build!
1620 if [ -d build ]; then
1626 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1627 cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
1628 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1629 cmake_d="$cmake_d -D STOP_ON_WARNING=OFF"
1630 cmake_d="$cmake_d -D BUILDSTATIC=OFF"
1631 cmake_d="$cmake_d -D LINKSTATIC=OFF"
1632 cmake_d="$cmake_d -D USE_SIMD=sse2"
1634 cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
1635 cmake_d="$cmake_d -D OPENEXR_VERSION=$OPENEXR_VERSION"
1637 if [ "$_with_built_openexr" = true ]; then
1638 cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr"
1639 cmake_d="$cmake_d -D OPENEXR_HOME=$INST/openexr"
1640 INFO "ILMBASE_HOME=$INST/openexr"
1643 # Optional tests and cmd tools
1644 cmake_d="$cmake_d -D USE_QT=OFF"
1645 cmake_d="$cmake_d -D USE_PYTHON=OFF"
1646 cmake_d="$cmake_d -D USE_FFMPEG=OFF"
1647 cmake_d="$cmake_d -D BUILD_TESTING=OFF"
1648 cmake_d="$cmake_d -D OIIO_BUILD_TESTS=OFF"
1649 cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=OFF"
1650 #cmake_d="$cmake_d -D CMAKE_EXPORT_COMPILE_COMMANDS=ON"
1651 #cmake_d="$cmake_d -D CMAKE_VERBOSE_MAKEFILE=ON"
1653 if [ -d $INST/boost ]; then
1654 cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost -D Boost_NO_SYSTEM_PATHS=ON"
1657 # Looks like we do not need ocio in oiio for now...
1658 # if [ -d $INST/ocio ]; then
1659 # cmake_d="$cmake_d -D OCIO_PATH=$INST/ocio"
1661 cmake_d="$cmake_d -D USE_OCIO=OFF"
1663 if [ "$USE_CXX11" = true ]; then
1664 cmake_d="$cmake_d -D OIIO_BUILD_CPP11=ON"
1667 if file /bin/cp | grep -q '32-bit'; then
1668 cflags="-fPIC -m32 -march=i686"
1673 cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ..
1675 make -j$THREADS && make install
1678 if [ -d $_inst ]; then
1679 _create_inst_shortcut
1681 ERROR "OpenImageIO-$OIIO_VERSION failed to compile, exiting"
1685 magic_compile_set oiio-$OIIO_VERSION $oiio_magic
1688 INFO "Done compiling OpenImageIO-$OIIO_VERSION!"
1690 INFO "Own OpenImageIO-$OIIO_VERSION is up to date, nothing to do!"
1691 INFO "If you want to force rebuild of this lib, use the --force-oiio option."
1694 # Just always run it, much simpler this way!
1698 #### Build LLVM ####
1700 _src=$SRC/LLVM-$LLVM_VERSION
1701 _src_clang=$SRC/CLANG-$LLVM_VERSION
1703 _inst=$INST/llvm-$LLVM_VERSION
1704 _inst_shortcut=$INST/llvm
1713 if [ "$NO_BUILD" = true ]; then
1714 WARNING "--no-build enabled, LLVM will not be compiled!"
1718 # To be changed each time we make edits that would modify the compiled result!
1722 # Clean install if needed!
1723 magic_compile_check llvm-$LLVM_VERSION $llvm_magic
1724 if [ $? -eq 1 -o "$LLVM_FORCE_REBUILD" = true ]; then
1728 if [ ! -d $_inst ]; then
1729 INFO "Building LLVM-$LLVM_VERSION (CLANG included!)"
1731 # Rebuild dependecies as well!
1732 OSL_FORCE_BUILD=true
1733 OSL_FORCE_REBUILD=true
1737 if [ ! -d $_src -o true ]; then
1739 download LLVM_SOURCE[@] "$_src.tar.gz"
1740 download LLVM_CLANG_SOURCE[@] "$_src_clang.tar.gz"
1742 INFO "Unpacking LLVM-$LLVM_VERSION"
1743 tar -C $SRC --transform "s,([^/]*/?)llvm-[^/]*(.*),\1LLVM-$LLVM_VERSION\2,x" \
1745 INFO "Unpacking CLANG-$LLVM_VERSION to $_src/tools/clang"
1746 # Stupid clang guys renamed 'clang' to 'cfe' for now handle both cases... :(
1747 tar -C $_src/tools \
1748 --transform "s,([^/]*/?)(clang|cfe)-[^/]*(.*),\1clang\3,x" \
1749 -xf $_src_clang.tar.gz
1753 # XXX Ugly patching hack!
1754 patch -p1 -i "$SCRIPT_DIR/install_deps_patches/llvm.patch"
1762 # Always refresh the whole build!
1763 if [ -d build ]; then
1769 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1770 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1771 cmake_d="$cmake_d -D LLVM_ENABLE_FFI=ON"
1772 cmake_d="$cmake_d -D LLVM_TARGETS_TO_BUILD=X86"
1773 cmake_d="$cmake_d -D LLVM_ENABLE_TERMINFO=OFF"
1775 if [ -d $_FFI_INCLUDE_DIR ]; then
1776 cmake_d="$cmake_d -D FFI_INCLUDE_DIR=$_FFI_INCLUDE_DIR"
1781 make -j$THREADS && make install
1784 if [ -d $_inst ]; then
1785 _create_inst_shortcut
1787 ERROR "LLVM-$LLVM_VERSION failed to compile, exiting"
1791 magic_compile_set llvm-$LLVM_VERSION $llvm_magic
1794 INFO "Done compiling LLVM-$LLVM_VERSION (CLANG included)!"
1796 INFO "Own LLVM-$LLVM_VERSION (CLANG included) is up to date, nothing to do!"
1797 INFO "If you want to force rebuild of this lib, use the --force-llvm option."
1803 _src=$SRC/OpenShadingLanguage-$OSL_VERSION
1805 _inst=$INST/osl-$OSL_VERSION
1806 _inst_shortcut=$INST/osl
1815 if [ "$NO_BUILD" = true ]; then
1816 WARNING "--no-build enabled, OpenShadingLanguage will not be compiled!"
1820 # To be changed each time we make edits that would modify the compiled result!
1824 # Clean install if needed!
1825 magic_compile_check osl-$OSL_VERSION $osl_magic
1826 if [ $? -eq 1 -o "$OSL_FORCE_REBUILD" = true ]; then
1827 #~ rm -Rf $_src # XXX Radical, but not easy to change remote repo fully automatically
1831 if [ ! -d $_inst ]; then
1832 INFO "Building OpenShadingLanguage-$OSL_VERSION"
1836 if [ ! -d $_src ]; then
1839 if [ "$OSL_USE_REPO" = true ]; then
1840 git clone ${OSL_SOURCE_REPO[0]} $_src
1842 download OSL_SOURCE[@] "$_src.tar.gz"
1843 INFO "Unpacking OpenShadingLanguage-$OSL_VERSION"
1844 tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
1851 if [ "$OSL_USE_REPO" = true ]; then
1852 git remote set-url origin ${OSL_SOURCE_REPO[0]}
1853 # XXX For now, always update from latest repo...
1854 git pull --no-edit -X theirs origin $OSL_SOURCE_REPO_BRANCH
1855 # Stick to same rev as windows' libs...
1856 git checkout $OSL_SOURCE_REPO_UID
1859 # XXX Ugly patching hack!
1860 patch -p1 -i "$SCRIPT_DIR/install_deps_patches/osl.patch"
1863 # Always refresh the whole build!
1864 if [ -d build ]; then
1870 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1871 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1872 cmake_d="$cmake_d -D BUILD_TESTING=OFF"
1873 cmake_d="$cmake_d -D STOP_ON_WARNING=OFF"
1874 cmake_d="$cmake_d -D BUILDSTATIC=OFF"
1875 cmake_d="$cmake_d -D OSL_BUILD_PLUGINS=OFF"
1876 cmake_d="$cmake_d -D OSL_BUILD_TESTS=OFF"
1877 cmake_d="$cmake_d -D USE_SIMD=sse2"
1878 if [ "$USE_CXX11" = true ]; then
1879 cmake_d="$cmake_d -D OSL_BUILD_CPP11=1"
1882 #~ cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
1884 if [ "$_with_built_openexr" = true ]; then
1885 INFO "ILMBASE_HOME=$INST/openexr"
1886 cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr"
1887 # XXX Temp workaround... sigh, ILMBase really messed the things up by defining their custom names ON by default :(
1888 cmake_d="$cmake_d -D ILMBASE_CUSTOM=ON"
1889 cmake_d="$cmake_d -D ILMBASE_CUSTOM_LIBRARIES='Half;Iex;Imath;IlmThread'"
1892 if [ -d $INST/boost ]; then
1893 cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost -D Boost_NO_SYSTEM_PATHS=ON"
1896 if [ -d $INST/oiio ]; then
1897 cmake_d="$cmake_d -D OPENIMAGEIOHOME=$INST/oiio"
1900 if [ ! -z $LLVM_VERSION_FOUND ]; then
1901 cmake_d="$cmake_d -D LLVM_VERSION=$LLVM_VERSION_FOUND"
1902 if [ -d $INST/llvm ]; then
1903 cmake_d="$cmake_d -D LLVM_DIRECTORY=$INST/llvm"
1904 cmake_d="$cmake_d -D LLVM_STATIC=ON"
1908 #~ cmake_d="$cmake_d -D CMAKE_EXPORT_COMPILE_COMMANDS=ON"
1909 #~ cmake_d="$cmake_d -D CMAKE_VERBOSE_MAKEFILE=ON"
1913 make -j$THREADS && make install
1916 if [ -d $_inst ]; then
1917 _create_inst_shortcut
1919 ERROR "OpenShadingLanguage-$OSL_VERSION failed to compile, exiting"
1923 magic_compile_set osl-$OSL_VERSION $osl_magic
1926 INFO "Done compiling OpenShadingLanguage-$OSL_VERSION!"
1928 INFO "Own OpenShadingLanguage-$OSL_VERSION is up to date, nothing to do!"
1929 INFO "If you want to force rebuild of this lib, use the --force-osl option."
1937 _src=$SRC/OpenSubdiv-$OSD_VERSION
1939 _inst=$INST/osd-$OSD_VERSION
1940 _inst_shortcut=$INST/osd
1949 if [ "$NO_BUILD" = true ]; then
1950 WARNING "--no-build enabled, OpenSubdiv will not be compiled!"
1954 # To be changed each time we make edits that would modify the compiled result!
1958 # Clean install if needed!
1959 magic_compile_check osd-$OSD_VERSION $osd_magic
1960 if [ $? -eq 1 -o "$OSD_FORCE_REBUILD" = true ]; then
1964 if [ ! -d $_inst ]; then
1965 INFO "Building OpenSubdiv-$OSD_VERSION"
1969 if [ ! -d $_src ]; then
1972 if [ "$OSD_USE_REPO" = true ]; then
1973 git clone ${OSD_SOURCE_REPO[0]} $_src
1975 download OSD_SOURCE[@] "$_src.tar.gz"
1976 INFO "Unpacking OpenSubdiv-$OSD_VERSION"
1977 tar -C $SRC --transform "s,(.*/?)OpenSubdiv-[^/]*(.*),\1OpenSubdiv-$OSD_VERSION\2,x" \
1984 if [ "$OSD_USE_REPO" = true ]; then
1985 git remote set-url origin ${OSD_SOURCE_REPO[0]}
1986 # XXX For now, always update from latest repo...
1987 git pull --no-edit -X theirs origin $OSD_SOURCE_REPO_BRANCH
1988 # Stick to same rev as windows' libs...
1989 git checkout $OSD_SOURCE_REPO_UID
1993 # Always refresh the whole build!
1994 if [ -d build ]; then
2000 cmake_d="-D CMAKE_BUILD_TYPE=Release"
2001 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
2002 # ptex is only needed when nicholas bishop is ready
2003 cmake_d="$cmake_d -D NO_PTEX=1"
2004 cmake_d="$cmake_d -D NO_CLEW=1 -D NO_CUDA=1 -D NO_OPENCL=1"
2005 # maya plugin, docs, tutorials, regression tests and examples are not needed
2006 cmake_d="$cmake_d -D NO_MAYA=1 -D NO_DOC=1 -D NO_TUTORIALS=1 -D NO_REGRESSION=1 -DNO_EXAMPLES=1"
2010 make -j$THREADS && make install
2013 if [ -d $_inst ]; then
2014 _create_inst_shortcut
2016 ERROR "OpenSubdiv-$OSD_VERSION failed to compile, exiting"
2020 magic_compile_set osd-$OSD_VERSION $osd_magic
2023 INFO "Done compiling OpenSubdiv-$OSD_VERSION!"
2025 INFO "Own OpenSubdiv-$OSD_VERSION is up to date, nothing to do!"
2026 INFO "If you want to force rebuild of this lib, use the --force-osd option."
2032 #### Build Blosc ####
2034 _src=$SRC/c-blosc-$OPENVDB_BLOSC_VERSION
2036 _inst=$INST/blosc-$OPENVDB_BLOSC_VERSION
2037 _inst_shortcut=$INST/blosc
2046 if [ "$NO_BUILD" = true ]; then
2047 WARNING "--no-build enabled, Blosc will not be compiled!"
2051 # To be changed each time we make edits that would modify the compiled result!
2055 # Clean install if needed!
2056 magic_compile_check blosc-$OPENVDB_BLOSC_VERSION $blosc_magic
2057 if [ $? -eq 1 -o "$OPENVDB_FORCE_REBUILD" = true ]; then
2062 if [ ! -d $_inst ]; then
2063 INFO "Building Blosc-$OPENVDB_BLOSC_VERSION"
2065 # Rebuild dependecies as well!
2066 OPENVDB_FORCE_BUILD=true
2067 OPENVDB_FORCE_REBUILD=true
2071 if [ ! -d $_src ]; then
2072 INFO "Downloading Blosc-$OPENVDB_BLOSC_VERSION"
2074 download OPENVDB_BLOSC_SOURCE[@] $_src.tar.gz
2076 INFO "Unpacking Blosc-$OPENVDB_BLOSC_VERSION"
2077 tar -C $SRC -xf $_src.tar.gz
2081 # Always refresh the whole build!
2082 if [ -d build ]; then
2088 cmake_d="-D CMAKE_BUILD_TYPE=Release"
2089 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
2090 cmake_d="$cmake_d -D BUILD_STATIC=OFF"
2091 cmake_d="$cmake_d -D BUILD_TESTS=OFF"
2092 cmake_d="$cmake_d -D BUILD_BENCHMARKS=OFF"
2097 make -j$THREADS && make install
2101 if [ -d $_inst ]; then
2102 _create_inst_shortcut
2104 ERROR "Blosc-$OPENVDB_BLOSC_VERSION failed to compile, exiting"
2108 INFO "Done compiling Blosc-$OPENVDB_BLOSC_VERSION!"
2110 INFO "Own Blosc-$OPENVDB_BLOSC_VERSION is up to date, nothing to do!"
2111 INFO "If you want to force rebuild of this lib (and openvdb), use the --force-openvdb option."
2114 magic_compile_set blosc-$OPENVDB_BLOSC_VERSION $blosc_magic
2116 run_ldconfig "blosc"
2119 #### Build OpenVDB ####
2121 _src=$SRC/openvdb-$OPENVDB_VERSION
2123 _inst=$INST/openvdb-$OPENVDB_VERSION
2124 _inst_shortcut=$INST/openvdb
2133 if [ "$NO_BUILD" = true ]; then
2134 WARNING "--no-build enabled, OpenVDB will not be compiled!"
2141 # To be changed each time we make edits that would modify the compiled result!
2145 # Clean install if needed!
2146 magic_compile_check openvdb-$OPENVDB_VERSION $openvdb_magic
2147 if [ $? -eq 1 -o "$OPENVDB_FORCE_REBUILD" = true ]; then
2151 if [ ! -d $_inst ]; then
2152 INFO "Building OpenVDB-$OPENVDB_VERSION"
2156 if [ ! -d $_src -o true ]; then
2158 download OPENVDB_SOURCE[@] "$_src.tar.gz"
2160 INFO "Unpacking OpenVDB-$OPENVDB_VERSION"
2161 tar -C $SRC -xf $_src.tar.gz
2166 #~ if [ "$OPENVDB_USE_REPO" = true ]; then
2167 #~ git remote set-url origin ${OPENVDB_SOURCE_REPO[0]}
2168 #~ # XXX For now, always update from latest repo...
2169 #~ git pull --no-edit -X theirs origin $OPENVDB_SOURCE_REPO_BRANCH
2170 #~ # Stick to same rev as windows' libs...
2171 #~ git checkout $OPENVDB_SOURCE_REPO_UID
2175 # Source builds here
2178 make_d="DESTDIR=$_inst"
2179 make_d="$make_d HDSO=/usr"
2181 if [ -d $INST/boost ]; then
2182 make_d="$make_d BOOST_INCL_DIR=$INST/boost/include BOOST_LIB_DIR=$INST/boost/lib"
2185 if [ "$_with_built_openexr" = true ]; then
2186 make_d="$make_d ILMBASE_INCL_DIR=$INST/openexr/include ILMBASE_LIB_DIR=$INST/openexr/lib"
2187 make_d="$make_d EXR_INCL_DIR=$INST/openexr/include EXR_LIB_DIR=$INST/openexr/lib"
2188 INFO "ILMBASE_HOME=$INST/openexr"
2191 if [ -d $INST/blosc ]; then
2192 make_d="$make_d BLOSC_INCL_DIR=$INST/blosc/include BLOSC_LIB_DIR=$INST/blosc/lib"
2195 # Build without log4cplus, glfw, python module & docs
2196 make_d="$make_d LOG4CPLUS_INCL_DIR= GLFW_INCL_DIR= PYTHON_VERSION= DOXYGEN="
2198 make -j$THREADS lib $make_d install
2201 if [ -d $_inst ]; then
2202 _create_inst_shortcut
2204 ERROR "OpenVDB-$OPENVDB_VERSION failed to compile, exiting"
2208 magic_compile_set openvdb-$OPENVDB_VERSION $openvdb_magic
2211 INFO "Done compiling OpenVDB-$OPENVDB_VERSION!"
2213 INFO "Own OpenVDB-$OPENVDB_VERSION is up to date, nothing to do!"
2214 INFO "If you want to force rebuild of this lib, use the --force-openvdb option."
2217 run_ldconfig "openvdb"
2220 #### Build Alembic ####
2222 _src=$SRC/alembic-$ALEMBIC_VERSION
2224 _inst=$INST/alembic-$ALEMBIC_VERSION
2225 _inst_shortcut=$INST/alembic
2234 if [ "$NO_BUILD" = true ]; then
2235 WARNING "--no-build enabled, Alembic will not be compiled!"
2239 # To be changed each time we make edits that would modify the compiled result!
2243 # Clean install if needed!
2244 magic_compile_check alembic-$ALEMBIC_VERSION $alembic_magic
2245 if [ $? -eq 1 -o "$ALEMBIC_FORCE_REBUILD" = true ]; then
2249 if [ ! -d $_inst ]; then
2250 INFO "Building Alembic-$ALEMBIC_VERSION"
2254 if [ ! -d $_src -o true ]; then
2256 download ALEMBIC_SOURCE[@] "$_src.tar.gz"
2258 INFO "Unpacking Alembic-$ALEMBIC_VERSION"
2259 tar -C $SRC -xf $_src.tar.gz
2264 cmake_d="-D CMAKE_INSTALL_PREFIX=$_inst"
2266 # Without Boost or TR1, Alembic requires C++11.
2267 if [ "$USE_CXX11" != true ]; then
2268 cmake_d="$cmake_d -D ALEMBIC_LIB_USES_BOOST=ON"
2269 cmake_d="$cmake_d -D ALEMBIC_LIB_USES_TR1=OFF"
2272 if [ -d $INST/boost ]; then
2273 if [ -d $INST/boost ]; then
2274 cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost"
2276 cmake_d="$cmake_d -D USE_STATIC_BOOST=ON"
2278 cmake_d="$cmake_d -D USE_STATIC_BOOST=OFF"
2281 if [ "$_with_built_openexr" = true ]; then
2282 cmake_d="$cmake_d -D ILMBASE_ROOT=$INST/openexr"
2283 cmake_d="$cmake_d -D USE_ARNOLD=OFF"
2284 cmake_d="$cmake_d -D USE_BINARIES=OFF"
2285 cmake_d="$cmake_d -D USE_EXAMPLES=OFF"
2286 cmake_d="$cmake_d -D USE_HDF5=OFF"
2287 cmake_d="$cmake_d -D USE_MAYA=OFF"
2288 cmake_d="$cmake_d -D USE_PRMAN=OFF"
2289 cmake_d="$cmake_d -D USE_PYALEMBIC=OFF"
2290 cmake_d="$cmake_d -D USE_STATIC_HDF5=OFF"
2291 cmake_d="$cmake_d -D ALEMBIC_ILMBASE_LINK_STATIC=OFF"
2292 cmake_d="$cmake_d -D ALEMBIC_SHARED_LIBS=OFF"
2293 INFO "ILMBASE_ROOT=$INST/openexr"
2297 make -j$THREADS install
2300 if [ -d $_inst ]; then
2301 _create_inst_shortcut
2303 ERROR "Alembic-$ALEMBIC_VERSION failed to compile, exiting"
2307 magic_compile_set alembic-$ALEMBIC_VERSION $alembic_magic
2310 INFO "Done compiling Alembic-$ALEMBIC_VERSION!"
2312 INFO "Own Alembic-$ALEMBIC_VERSION is up to date, nothing to do!"
2313 INFO "If you want to force rebuild of this lib, use the --force-alembic option."
2316 run_ldconfig "alembic"
2319 #### Build OpenCOLLADA ####
2320 _init_opencollada() {
2321 _src=$SRC/OpenCOLLADA-$OPENCOLLADA_VERSION
2323 _inst=$INST/opencollada-$OPENCOLLADA_VERSION
2324 _inst_shortcut=$INST/opencollada
2327 clean_OpenCOLLADA() {
2332 compile_OpenCOLLADA() {
2333 if [ "$NO_BUILD" = true ]; then
2334 WARNING "--no-build enabled, OpenCOLLADA will not be compiled!"
2338 # To be changed each time we make edits that would modify the compiled results!
2342 # Clean install if needed!
2343 magic_compile_check opencollada-$OPENCOLLADA_VERSION $opencollada_magic
2344 if [ $? -eq 1 -o "$OPENCOLLADA_FORCE_REBUILD" = true ]; then
2348 if [ ! -d $_inst ]; then
2349 INFO "Building OpenCOLLADA-$OPENCOLLADA_VERSION"
2353 if [ ! -d $_src ]; then
2355 git clone $OPENCOLLADA_SOURCE $_src
2360 # XXX For now, always update from latest repo...
2361 git pull origin $OPENCOLLADA_REPO_BRANCH
2363 # Stick to same rev as windows' libs...
2364 git checkout $OPENCOLLADA_REPO_UID
2367 # Always refresh the whole build!
2368 if [ -d build ]; then
2374 cmake_d="-D CMAKE_BUILD_TYPE=Release"
2375 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
2376 cmake_d="$cmake_d -D USE_EXPAT=OFF"
2377 cmake_d="$cmake_d -D USE_LIBXML=ON"
2378 # XXX Does not work!
2379 # cmake_d="$cmake_d -D USE_STATIC=OFF"
2380 cmake_d="$cmake_d -D USE_STATIC=ON"
2384 make -j$THREADS && make install
2387 if [ -d $_inst ]; then
2388 _create_inst_shortcut
2390 ERROR "OpenCOLLADA-$OPENCOLLADA_VERSION failed to compile, exiting"
2394 magic_compile_set opencollada-$OPENCOLLADA_VERSION $opencollada_magic
2397 INFO "Done compiling OpenCOLLADA-$OPENCOLLADA_VERSION!"
2399 INFO "Own OpenCOLLADA-$OPENCOLLADA_VERSION is up to date, nothing to do!"
2400 INFO "If you want to force rebuild of this lib, use the --force-opencollada option."
2404 #### Build FFMPEG ####
2406 _src=$SRC/ffmpeg-$FFMPEG_VERSION
2407 _inst=$INST/ffmpeg-$FFMPEG_VERSION
2408 _inst_shortcut=$INST/ffmpeg
2417 if [ "$NO_BUILD" = true ]; then
2418 WARNING "--no-build enabled, ffmpeg will not be compiled!"
2422 # To be changed each time we make edits that would modify the compiled result!
2426 # Clean install if needed!
2427 magic_compile_check ffmpeg-$FFMPEG_VERSION $ffmpeg_magic
2428 if [ $? -eq 1 -o "$FFMPEG_FORCE_REBUILD" = true ]; then
2432 if [ ! -d $_inst ]; then
2433 INFO "Building ffmpeg-$FFMPEG_VERSION"
2437 if [ ! -d $_src ]; then
2438 INFO "Downloading ffmpeg-$FFMPEG_VERSION"
2440 download FFMPEG_SOURCE[@] "$_src.tar.bz2"
2442 INFO "Unpacking ffmpeg-$FFMPEG_VERSION"
2443 tar -C $SRC -xf $_src.tar.bz2
2450 if [ "$VORBIS_USE" = true ]; then
2451 extra="$extra --enable-libvorbis"
2454 if [ "$THEORA_USE" = true ]; then
2455 extra="$extra --enable-libtheora"
2458 if [ "$XVID_USE" = true ]; then
2459 extra="$extra --enable-libxvid"
2462 if [ "$X264_USE" = true ]; then
2463 extra="$extra --enable-libx264"
2466 if [ "$VPX_USE" = true ]; then
2467 extra="$extra --enable-libvpx"
2470 if [ "$MP3LAME_USE" = true ]; then
2471 extra="$extra --enable-libmp3lame"
2474 if [ "$OPENJPEG_USE" = true ]; then
2475 extra="$extra --enable-libopenjpeg"
2478 ./configure --cc="gcc -Wl,--as-needed" \
2479 --extra-ldflags="-pthread -static-libgcc" \
2480 --prefix=$_inst --enable-static \
2481 --disable-ffplay --disable-ffserver --disable-doc \
2483 --enable-avfilter --disable-vdpau \
2484 --disable-bzlib --disable-libgsm --disable-libspeex \
2485 --enable-pthreads --enable-zlib --enable-stripping --enable-runtime-cpudetect \
2486 --disable-vaapi --disable-nonfree --enable-gpl \
2487 --disable-postproc --disable-librtmp --disable-libopencore-amrnb \
2488 --disable-libopencore-amrwb --disable-libdc1394 --disable-version3 --disable-outdev=sdl \
2490 --disable-outdev=xv --disable-indev=sndio --disable-outdev=sndio \
2491 --disable-outdev=alsa --disable-indev=sdl --disable-indev=alsa --disable-indev=jack \
2492 --disable-indev=lavfi $extra
2494 make -j$THREADS && make install
2497 if [ -d $_inst ]; then
2498 _create_inst_shortcut
2500 ERROR "FFmpeg-$FFMPEG_VERSION failed to compile, exiting"
2504 magic_compile_set ffmpeg-$FFMPEG_VERSION $ffmpeg_magic
2507 INFO "Done compiling ffmpeg-$FFMPEG_VERSION!"
2509 INFO "Own ffmpeg-$FFMPEG_VERSION is up to date, nothing to do!"
2510 INFO "If you want to force rebuild of this lib, use the --force-ffmpeg option."
2515 #### Install on DEB-like ####
2516 get_package_version_DEB() {
2517 dpkg-query -W -f '${Version}' $1 | sed -r 's/([0-9]+:)?(([0-9]+\.?)+([0-9]+)).*/\2/'
2520 check_package_DEB() {
2521 r=`apt-cache show $1 | grep -c 'Package:'`
2523 if [ $r -ge 1 ]; then
2530 check_package_installed_DEB() {
2531 r=`dpkg-query -W -f='${Status}' $1 | grep -c "install ok"`
2533 if [ $r -ge 1 ]; then
2540 check_package_version_match_DEB() {
2541 v=`apt-cache policy $1 | grep 'Candidate:' | sed -r 's/.*:\s*([0-9]+:)(([0-9]+\.?)+).*/\2/'`
2543 if [ -z "$v" ]; then
2551 check_package_version_ge_DEB() {
2552 v=`apt-cache policy $1 | grep 'Candidate:' | sed -r 's/.*:\s*([0-9]+:)?(([0-9]+\.?)+).*/\2/'`
2554 if [ -z "$v" ]; then
2562 check_package_version_ge_lt_DEB() {
2563 v=`apt-cache policy $1 | grep 'Candidate:' | sed -r 's/.*:\s*([0-9]+:)?(([0-9]+\.?)+).*/\2/'`
2565 if [ -z "$v" ]; then
2569 version_ge_lt $v $2 $3
2573 install_packages_DEB() {
2574 if [ ! $SUDO ]; then
2575 WARNING "--no-sudo enabled, impossible to run apt-get install for $@, you'll have to do it yourself..."
2577 $SUDO apt-get install -y $@
2578 if [ $? -ge 1 ]; then
2579 ERROR "apt-get failed to install requested packages, exiting."
2587 INFO "Installing dependencies for DEB-based distribution"
2589 PRINT "`eval _echo "$COMMON_INFO"`"
2592 if [ "$NO_CONFIRM" = false ]; then
2593 read -p "Do you want to continue (Y/n)?"
2594 [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" != "y" ] && exit
2597 if [ ! $SUDO ]; then
2598 WARNING "--no-sudo enabled, impossible to run apt-get update, you'll have to do it yourself..."
2600 $SUDO apt-get update
2603 # These libs should always be available in debian/ubuntu official repository...
2604 OPENJPEG_DEV="libopenjpeg-dev"
2605 VORBIS_DEV="libvorbis-dev"
2606 OGG_DEV="libogg-dev"
2607 THEORA_DEV="libtheora-dev"
2609 _packages="gawk cmake cmake-curses-gui build-essential libjpeg-dev libpng-dev libtiff-dev \
2610 git libfreetype6-dev libx11-dev flex bison libtbb-dev libxxf86vm-dev \
2611 libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
2612 libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \
2613 libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
2614 libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev"
2615 # libglewmx-dev (broken in deb testing currently...)
2623 # Some not-so-old distro (ubuntu 12.4) do not have it, do not fail in this case, just warn.
2624 YAMLCPP_DEV="libyaml-cpp-dev"
2625 check_package_DEB $YAMLCPP_DEV
2626 if [ $? -eq 0 ]; then
2627 _packages="$_packages $YAMLCPP_DEV"
2630 WARNING "libyaml-cpp-dev not found, you may have to install it by hand to get Blender compiling..."
2634 if [ "$WITH_ALL" = true ]; then
2635 _packages="$_packages libspnav-dev"
2636 # Only install jack if jack2 is not already installed!
2638 JACK2="libjack-jackd2-dev"
2639 check_package_installed_DEB $JACK2
2640 if [ $? -eq 0 ]; then
2641 _packages="$_packages $JACK2"
2643 _packages="$_packages $JACK"
2648 install_packages_DEB $_packages
2651 SNDFILE_DEV="libsndfile1-dev"
2652 check_package_DEB $SNDFILE_DEV
2653 if [ $? -eq 0 ]; then
2654 install_packages_DEB $SNDFILE_DEV
2658 X264_DEV="libx264-dev"
2659 check_package_version_ge_DEB $X264_DEV $X264_VERSION_MIN
2660 if [ $? -eq 0 ]; then
2661 install_packages_DEB $X264_DEV
2665 if [ "$WITH_ALL" = true ]; then
2667 XVID_DEV="libxvidcore-dev"
2668 check_package_DEB $XVID_DEV
2669 if [ $? -eq 0 ]; then
2670 install_packages_DEB $XVID_DEV
2675 MP3LAME_DEV="libmp3lame-dev"
2676 check_package_DEB $MP3LAME_DEV
2677 if [ $? -eq 0 ]; then
2678 install_packages_DEB $MP3LAME_DEV
2683 VPX_DEV="libvpx-dev"
2684 check_package_version_ge_DEB $VPX_DEV $VPX_VERSION_MIN
2685 if [ $? -eq 0 ]; then
2686 install_packages_DEB $VPX_DEV
2691 # Check cmake/glew versions and disable features for older distros.
2692 # This is so Blender can at least compile.
2694 _cmake=`get_package_version_DEB cmake`
2695 version_ge $_cmake "2.8.10"
2696 if [ $? -eq 1 ]; then
2697 version_ge $_cmake "2.8.8"
2698 if [ $? -eq 1 ]; then
2699 WARNING "OpenVDB and OpenCOLLADA disabled because cmake-$_cmake is not enough"
2701 OPENCOLLADA_SKIP=true
2703 WARNING "OpenVDB disabled because cmake-$_cmake is not enough"
2709 _glew=`get_package_version_DEB libglew-dev`
2710 if [ -z $_glew ]; then
2711 # Stupid virtual package in Ubuntu 12.04 doesn't show version number...
2712 _glew=`apt-cache showpkg libglew-dev|tail -n1|awk '{print $2}'|sed 's/-.*//'`
2714 version_ge $_glew "1.9.0"
2715 if [ $? -eq 1 ]; then
2716 version_ge $_glew "1.7.0"
2717 if [ $? -eq 1 ]; then
2718 WARNING "OpenSubdiv disabled because GLEW-$_glew is not enough"
2719 WARNING "Blender will not use system GLEW library"
2723 WARNING "OpenSubdiv will compile with GLEW-$_glew but with limited capability"
2724 WARNING "Blender will not use system GLEW library"
2731 _do_compile_python=false
2732 if [ "$PYTHON_SKIP" = true ]; then
2733 WARNING "Skipping Python/NumPy installation, as requested..."
2734 elif [ "$PYTHON_FORCE_BUILD" = true ]; then
2735 INFO "Forced Python/NumPy building, as requested..."
2736 _do_compile_python=true
2738 check_package_DEB python$PYTHON_VERSION_MIN-dev
2739 if [ $? -eq 0 ]; then
2740 install_packages_DEB python$PYTHON_VERSION_MIN-dev
2743 if [ "$NUMPY_SKIP" = true ]; then
2744 WARNING "Skipping NumPy installation, as requested..."
2746 check_package_DEB python3-numpy
2747 if [ $? -eq 0 ]; then
2748 install_packages_DEB python3-numpy
2750 WARNING "Sorry, using python package but no valid numpy package available!" \
2751 " Use --build-numpy to force building of both Python and NumPy."
2755 _do_compile_python=true
2759 if $_do_compile_python; then
2762 if [ "$NUMPY_SKIP" = true ]; then
2763 WARNING "Skipping NumPy installation, as requested..."
2771 if [ "$BOOST_SKIP" = true ]; then
2772 WARNING "Skipping Boost installation, as requested..."
2773 elif [ "$BOOST_FORCE_BUILD" = true ]; then
2774 INFO "Forced Boost building, as requested..."
2777 check_package_version_ge_DEB libboost-dev $BOOST_VERSION_MIN
2778 if [ $? -eq 0 ]; then
2779 install_packages_DEB libboost-dev
2781 boost_version=$(echo `get_package_version_DEB libboost-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
2783 install_packages_DEB libboost-{filesystem,iostreams,locale,regex,system,thread,wave,program-options}$boost_version-dev
2792 if [ "$OCIO_SKIP" = true ]; then
2793 WARNING "Skipping OpenColorIO installation, as requested..."
2794 elif [ "$OCIO_FORCE_BUILD" = true ]; then
2795 INFO "Forced OpenColorIO building, as requested..."
2798 # XXX Always force build of own OCIO, until linux distro guys update their package to default libyaml-cpp ver (0.5)!
2799 #check_package_version_ge_DEB libopencolorio-dev $OCIO_VERSION_MIN
2800 #if [ $? -eq 0 ]; then
2801 #install_packages_DEB libopencolorio-dev
2810 if [ "$OPENEXR_SKIP" = true ]; then
2811 WARNING "Skipping ILMBase/OpenEXR installation, as requested..."
2812 elif [ "$OPENEXR_FORCE_BUILD" = true ]; then
2813 INFO "Forced ILMBase/OpenEXR building, as requested..."
2816 check_package_version_ge_DEB libopenexr-dev $OPENEXR_VERSION_MIN
2817 if [ $? -eq 0 ]; then
2818 install_packages_DEB libopenexr-dev
2819 OPENEXR_VERSION=`get_package_version_DEB libopenexr-dev`
2820 ILMBASE_VERSION=$OPENEXR_VERSION
2829 if [ "$OIIO_SKIP" = true ]; then
2830 WARNING "Skipping OpenImageIO installation, as requested..."
2831 elif [ "$OIIO_FORCE_BUILD" = true ]; then
2832 INFO "Forced OpenImageIO building, as requested..."
2835 # XXX Debian Testing / Ubuntu 16.04 pulls in WAY too many deps (gtk2/opencv ?!) incl. OCIO build against libyaml-cpp0.3 so build for now...
2836 #check_package_version_ge_lt_DEB libopenimageio-dev $OIIO_VERSION_MIN $OIIO_VERSION_MAX
2837 #if [ $? -eq 0 -a "$_with_built_openexr" = false ]; then
2838 # install_packages_DEB libopenimageio-dev
2848 _do_compile_llvm=false
2849 if [ "$LLVM_SKIP" = true ]; then
2850 WARNING "Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
2852 elif [ "$LLVM_FORCE_BUILD" = true ]; then
2853 INFO "Forced LLVM building, as requested..."
2854 _do_compile_llvm=true
2856 check_package_DEB clang-$LLVM_VERSION
2857 if [ $? -eq 0 ]; then
2858 install_packages_DEB llvm-$LLVM_VERSION-dev clang-$LLVM_VERSION
2860 LLVM_VERSION_FOUND=$LLVM_VERSION
2863 _do_compile_llvm=true
2867 if [ "$_do_compile_llvm" = true ]; then
2868 install_packages_DEB libffi-dev
2869 # LLVM can't find the debian ffi header dir
2870 _FFI_INCLUDE_DIR=`dpkg -L libffi-dev | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
2874 LLVM_VERSION_FOUND=$LLVM_VERSION
2879 _do_compile_osl=false
2880 if [ "$OSL_SKIP" = true ]; then
2881 WARNING "Skipping OpenShadingLanguage installation, as requested..."
2882 elif [ "$OSL_FORCE_BUILD" = true ]; then
2883 INFO "Forced OpenShadingLanguage building, as requested..."
2884 _do_compile_osl=true
2886 # No package currently!
2887 _do_compile_osl=true
2890 if [ "$_do_compile_osl" = true ]; then
2891 if [ "$have_llvm" = true ]; then
2895 WARNING "No LLVM available, cannot build OSL!"
2901 if [ "$OSD_SKIP" = true ]; then
2902 WARNING "Skipping OpenSubdiv installation, as requested..."
2903 elif [ "$OSD_FORCE_BUILD" = true ]; then
2904 INFO "Forced OpenSubdiv building, as requested..."
2907 # No package currently!
2913 if [ "$OPENVDB_SKIP" = true ]; then
2914 WARNING "Skipping OpenVDB installation, as requested..."
2915 elif [ "$OPENVDB_FORCE_BUILD" = true ]; then
2916 INFO "Forced OpenVDB building, as requested..."
2919 check_package_version_ge_DEB libopenvdb-dev $OPENVDB_VERSION_MIN
2920 if [ $? -eq 0 ]; then
2921 install_packages_DEB libopenvdb-dev libblosc-dev
2929 if [ "$ALEMBIC_SKIP" = true ]; then
2930 WARNING "Skipping Alembic installation, as requested..."
2931 elif [ "$ALEMBIC_FORCE_BUILD" = true ]; then
2932 INFO "Forced Alembic building, as requested..."
2935 # No package currently, only HDF5!
2940 if [ "$WITH_OPENCOLLADA" = true ]; then
2941 _do_compile_collada=false
2943 if [ "$OPENCOLLADA_SKIP" = true ]; then
2944 WARNING "Skipping OpenCOLLADA installation, as requested..."
2945 elif [ "$OPENCOLLADA_FORCE_BUILD" = true ]; then
2946 INFO "Forced OpenCollada building, as requested..."
2947 _do_compile_collada=true
2949 # No package currently!
2950 _do_compile_collada=true
2953 if [ "$_do_compile_collada" = true ]; then
2954 install_packages_DEB libpcre3-dev
2955 # Find path to libxml shared lib...
2956 _XML2_LIB=`dpkg -L libxml2-dev | grep -e ".*/libxml2.so"`
2965 if [ "$FFMPEG_SKIP" = true ]; then
2966 WARNING "Skipping FFMpeg installation, as requested..."
2967 elif [ "$FFMPEG_FORCE_BUILD" = true ]; then
2968 INFO "Forced FFMpeg building, as requested..."
2971 # XXX Debian Testing / Ubuntu 16.04 finally includes FFmpeg, so check as usual
2972 check_package_DEB ffmpeg
2973 if [ $? -eq 0 ]; then
2974 check_package_version_ge_DEB ffmpeg $FFMPEG_VERSION_MIN
2975 if [ $? -eq 0 ]; then
2976 install_packages_DEB libavdevice-dev
2988 #### Install on RPM-like ####
2990 if [ -f /etc/redhat-release ]; then
2991 if [ "`grep '[6-7]\.' /etc/redhat-release`" ]; then
2996 elif [ -f /etc/SuSE-release ]; then
3001 get_package_version_RPM() {
3003 if [ "$RPM" = "RHEL" ]; then
3004 yum info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'
3005 elif [ "$RPM" = "FEDORA" ]; then
3006 dnf info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'
3007 elif [ "$RPM" = "SUSE" ]; then
3008 zypper info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'
3012 check_package_RPM() {
3014 if [ "$RPM" = "RHEL" ]; then
3015 r=`yum info $1 | grep -c 'Summary'`
3016 elif [ "$RPM" = "FEDORA" ]; then
3017 r=`dnf info $1 | grep -c 'Summary'`
3018 elif [ "$RPM" = "SUSE" ]; then
3019 r=`zypper info $1 | grep -c 'Summary'`
3022 if [ $r -ge 1 ]; then
3029 check_package_version_match_RPM() {
3030 v=`get_package_version_RPM $1`
3032 if [ -z "$v" ]; then
3040 check_package_version_ge_RPM() {
3041 v=`get_package_version_RPM $1`
3043 if [ -z "$v" ]; then
3051 check_package_version_ge_lt_RPM() {
3052 v=`get_package_version_RPM $1`
3054 if [ -z "$v" ]; then
3058 version_ge_lt $v $2 $3
3062 install_packages_RPM() {
3064 if [ ! $SUDO ]; then
3065 WARNING "--no-sudo enabled, impossible to install $@, you'll have to do it yourself..."
3067 if [ "$RPM" = "RHEL" ]; then
3068 $SUDO yum install -y $@
3069 if [ $? -ge 1 ]; then
3070 ERROR "yum failed to install requested packages, exiting."
3074 elif [ "$RPM" = "FEDORA" ]; then
3075 $SUDO dnf install -y $@
3076 if [ $? -ge 1 ]; then
3077 ERROR "dnf failed to install requested packages, exiting."
3081 elif [ "$RPM" = "SUSE" ]; then
3082 $SUDO zypper --non-interactive install --auto-agree-with-licenses $@
3083 if [ $? -ge 1 ]; then
3084 ERROR "zypper failed to install requested packages, exiting."
3092 INFO "Installing dependencies for RPM-based distribution"
3094 PRINT "`eval _echo "$COMMON_INFO"`"
3097 if [ "$NO_CONFIRM" = false ]; then
3098 read -p "Do you want to continue (Y/n)?"
3099 [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" != "y" ] && exit
3102 # Enable non-free repositories for all flavours
3103 if [ ! $SUDO ]; then
3104 WARNING "--no-sudo enabled, impossible to install third party repositories, you'll have to do it yourself..."
3107 if [ "$RPM" = "FEDORA" ]; then
3108 _fedora_rel="`egrep "[0-9]{1,}" /etc/fedora-release -o`"
3109 $SUDO dnf -y install --nogpgcheck \
3110 http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$_fedora_rel.noarch.rpm \
3111 http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$_fedora_rel.noarch.rpm
3115 elif [ "$RPM" = "RHEL" ]; then
3116 if [ "`grep '6\.' /etc/redhat-release`" ]; then
3117 ERROR "Building with GCC 4.4 is not supported!"
3120 $SUDO yum -y install --nogpgcheck \
3121 http://download.fedoraproject.org/pub/epel/7/$(uname -i)/e/epel-release-7-6.noarch.rpm \
3122 http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
3127 elif [ "$RPM" = "SUSE" ]; then
3128 # Packman repo now includes name in link...
3129 _suse_rel="`grep -w VERSION /etc/os-release | sed 's/[^0-9.]*//g'`"
3130 _suse_name="`grep -w NAME /etc/os-release | gawk '{print $2}' | sed 's/\"//'`"
3131 if [ $_suse_name ]; then
3132 _suse_rel="${_suse_name}_${_suse_rel}"
3136 INFO "About to add 'packman' repository from http://packman.inode.at/suse/openSUSE_$_suse_rel/"
3137 INFO "This is only needed if you do not already have a packman repository enabled..."
3138 read -p "Do you want to add this repo (Y/n)?"
3139 if [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" == "y" ]; then
3140 INFO " Installing packman..."
3141 $SUDO zypper ar -f -n packman http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_$_suse_rel/ packman
3144 INFO " Skipping packman installation."
3146 $SUDO zypper --non-interactive --gpg-auto-import-keys update --auto-agree-with-licenses
3150 # These libs should always be available in fedora/suse official repository...
3151 OPENJPEG_DEV="openjpeg-devel"
3152 VORBIS_DEV="libvorbis-devel"
3153 OGG_DEV="libogg-devel"
3154 THEORA_DEV="libtheora-devel"
3156 _packages="gcc gcc-c++ git make cmake tar bzip2 xz findutils flex bison \
3157 libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL-devel \
3158 libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
3159 wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
3160 glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
3161 libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel"
3168 if [ "$RPM" = "FEDORA" -o "$RPM" = "RHEL" ]; then
3169 _packages="$_packages freetype-devel tbb-devel"
3171 if [ "$WITH_ALL" = true ]; then
3172 _packages="$_packages jack-audio-connection-kit-devel"
3176 install_packages_RPM $_packages
3179 X264_DEV="x264-devel"
3180 check_package_version_ge_RPM $X264_DEV $X264_VERSION_MIN
3181 if [ $? -eq 0 ]; then
3182 install_packages_RPM $X264_DEV
3186 if [ "$WITH_ALL" = true ]; then
3188 XVID_DEV="xvidcore-devel"
3189 check_package_RPM $XVID_DEV
3190 if [ $? -eq 0 ]; then
3191 install_packages_RPM $XVID_DEV
3196 MP3LAME_DEV="lame-devel"
3197 check_package_RPM $MP3LAME_DEV
3198 if [ $? -eq 0 ]; then
3199 install_packages_RPM $MP3LAME_DEV
3204 elif [ "$RPM" = "SUSE" ]; then
3205 _packages="$_packages freetype2-devel"
3208 install_packages_RPM $_packages
3211 # Install TBB on openSUSE, from temporary repo
3212 check_package_RPM tbb-devel
3213 if [ $? -eq 0 ]; then
3214 install_packages_RPM tbb-devel
3216 $SUDO zypper ar -f http://download.opensuse.org/repositories/devel:/libraries:/c_c++/openSUSE_$_suse_rel/devel:libraries:c_c++.repo
3217 $SUDO zypper -n --gpg-auto-import-keys install tbb-devel
3218 $SUDO zypper rr devel_libraries_c_c++
3222 X264_DEV="libx264-devel"
3223 check_package_version_ge_RPM $X264_DEV $X264_VERSION_MIN
3224 if [ $? -eq 0 ]; then
3225 install_packages_RPM $X264_DEV
3229 if [ "$WITH_ALL" = true ]; then
3231 XVID_DEV="libxvidcore-devel"
3232 check_package_RPM $XVID_DEV
3233 if [ $? -eq 0 ]; then
3234 install_packages_RPM $XVID_DEV
3239 MP3LAME_DEV="libmp3lame-devel"
3240 check_package_RPM $MP3LAME_DEV
3241 if [ $? -eq 0 ]; then
3242 install_packages_RPM $MP3LAME_DEV
3249 SNDFILE_DEV="libsndfile-devel"
3250 check_package_RPM $SNDFILE_DEV
3251 if [ $? -eq 0 ]; then
3252 install_packages_RPM $SNDFILE_DEV
3255 if [ "$WITH_ALL" = true ]; then
3257 VPX_DEV="libvpx-devel"
3258 check_package_version_ge_RPM $VPX_DEV $VPX_VERSION_MIN
3259 if [ $? -eq 0 ]; then
3260 install_packages_RPM $VPX_DEV
3264 install_packages_RPM libspnav-devel
3269 _do_compile_python=false
3270 if [ "$PYTHON_SKIP" = true ]; then
3271 WARNING "Skipping Python installation, as requested..."
3272 elif [ "$PYTHON_FORCE_BUILD" = true ]; then
3273 INFO "Forced Python/NumPy building, as requested..."
3274 _do_compile_python=true
3276 check_package_version_match_RPM python3-devel $PYTHON_VERSION_MIN
3277 if [ $? -eq 0 ]; then
3278 install_packages_RPM python3-devel
3281 if [ "$NUMPY_SKIP" = true ]; then
3282 WARNING "Skipping NumPy installation, as requested..."
3284 check_package_version_ge_RPM python3-numpy $NUMPY_VERSION_MIN
3285 if [ $? -eq 0 ]; then
3286 install_packages_RPM python3-numpy
3288 WARNING "Sorry, using python package but no valid numpy package available!" \
3289 " Use --build-numpy to force building of both Python and NumPy."
3293 _do_compile_python=true
3297 if [ "$_do_compile_python" = true ]; then
3300 if [ "$NUMPY_SKIP" = true ]; then
3301 WARNING "Skipping NumPy installation, as requested..."
3309 _do_compile_boost=false
3310 if [ "$BOOST_SKIP" = true ]; then
3311 WARNING "Skipping Boost installation, as requested..."
3312 elif [ "$BOOST_FORCE_BUILD" = true ]; then
3313 INFO "Forced Boost building, as requested..."
3314 _do_compile_boost=true
3316 check_package_version_ge_RPM boost-devel $BOOST_VERSION_MIN
3317 if [ $? -eq 0 ]; then
3318 install_packages_RPM boost-devel
3321 _do_compile_boost=true
3325 if [ "$_do_compile_boost" = true ]; then
3326 if [ "$RPM" = "SUSE" ]; then
3327 install_packages_RPM gcc-fortran
3329 install_packages_RPM libquadmath-devel bzip2-devel
3337 if [ "$OCIO_SKIP" = true ]; then
3338 WARNING "Skipping OpenColorIO installation, as requested..."
3339 elif [ "$OCIO_FORCE_BUILD" = true ]; then
3340 INFO "Forced OpenColorIO building, as requested..."
3343 if [ "$RPM" = "SUSE" ]; then
3344 check_package_version_ge_RPM OpenColorIO-devel $OCIO_VERSION_MIN
3345 if [ $? -eq 0 ]; then
3346 install_packages_RPM OpenColorIO-devel
3351 # XXX Fedora/RHEL OCIO still depends on libyaml-cpp v0.3 even when system default is v0.5!
3358 if [ "$OPENEXR_SKIP" = true ]; then
3359 WARNING "Skipping ILMBase/OpenEXR installation, as requested..."
3360 elif [ "$OPENEXR_FORCE_BUILD" = true ]; then
3361 INFO "Forced ILMBase/OpenEXR building, as requested..."
3364 check_package_version_ge_RPM openexr-devel $OPENEXR_VERSION_MIN
3365 if [ $? -eq 0 ]; then
3366 install_packages_RPM openexr-devel
3367 OPENEXR_VERSION=`get_package_version_RPM openexr-devel`
3368 ILMBASE_VERSION=$OPENEXR_VERSION
3376 if [ "$OIIO_SKIP" = true ]; then
3377 WARNING "Skipping OpenImageIO installation, as requested..."
3378 elif [ "$OIIO_FORCE_BUILD" = true ]; then
3379 INFO "Forced OpenImageIO building, as requested..."
3382 # XXX RPM distros pulls in too much and depends on old libs, so better to build for now...
3383 #check_package_version_ge_lt_RPM OpenImageIO-devel $OIIO_VERSION_MIN $OIIO_VERSION_MAX
3384 #if [ $? -eq 0 -a $_with_built_openexr == false ]; then
3385 # install_packages_RPM OpenImageIO-devel
3395 _do_compile_llvm=false
3396 if [ "$LLVM_SKIP" = true ]; then
3397 WARNING "Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
3399 elif [ "$LLVM_FORCE_BUILD" = true ]; then
3400 INFO "Forced LLVM building, as requested..."
3401 _do_compile_llvm=true
3403 if [ "$RPM" = "SUSE" ]; then
3404 CLANG_DEV="llvm-clang-devel"
3406 CLANG_DEV="clang-devel"
3408 # XXX RHEL has 3.4 in repo but OSL complains about not finding MCJIT_LIBRARY, so compile for now...
3409 #check_package_version_match_RPM $CLANG_DEV $LLVM_VERSION
3410 #if [ $? -eq 0 ]; then
3411 # install_packages_RPM llvm-devel $CLANG_DEV
3413 # LLVM_VERSION_FOUND=$LLVM_VERSION
3416 _do_compile_llvm=true
3420 if [ "$_do_compile_llvm" = true ]; then
3421 install_packages_RPM libffi-devel
3422 # LLVM can't find the fedora ffi header dir...
3423 _FFI_INCLUDE_DIR=`rpm -ql libffi-devel | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
3427 LLVM_VERSION_FOUND=$LLVM_VERSION
3432 _do_compile_osl=false
3433 if [ "$OSL_SKIP" = true ]; then
3434 WARNING "Skipping OpenShadingLanguage installation, as requested..."
3435 elif [ "$OSL_FORCE_BUILD" = true ]; then
3436 INFO "Forced OpenShadingLanguage building, as requested..."
3437 _do_compile_osl=true
3439 # No package currently!
3440 _do_compile_osl=true
3443 if [ "$_do_compile_osl" = true ]; then
3444 if [ "$have_llvm" = true ]; then
3448 WARNING "No LLVM available, cannot build OSL!"
3454 if [ "$OSD_SKIP" = true ]; then
3455 WARNING "Skipping OpenSubdiv installation, as requested..."
3456 elif [ "$OSD_FORCE_BUILD" = true ]; then
3457 INFO "Forced OpenSubdiv building, as requested..."
3460 # No package currently!
3466 if [ "$OPENVDB_SKIP" = true ]; then
3467 WARNING "Skipping OpenVDB installation, as requested..."
3468 elif [ "$OPENVDB_FORCE_BUILD" = true ]; then
3469 INFO "Forced OpenVDB building, as requested..."
3472 # No package currently!
3477 if [ "$ALEMBIC_SKIP" = true ]; then
3478 WARNING "Skipping Alembic installation, as requested..."
3479 elif [ "$ALEMBIC_FORCE_BUILD" = true ]; then
3480 INFO "Forced Alembic building, as requested..."
3483 # No package currently!
3488 if [ "$WITH_OPENCOLLADA" = true ]; then
3490 _do_compile_collada=false
3491 if [ "$OPENCOLLADA_SKIP" = true ]; then
3492 WARNING "Skipping OpenCOLLADA installation, as requested..."
3493 elif [ "$OPENCOLLADA_FORCE_BUILD" = true ]; then
3494 INFO "Forced OpenCollada building, as requested..."
3495 _do_compile_collada=true
3498 _do_compile_collada=true
3501 if [ "$_do_compile_collada" = true ]; then
3502 install_packages_RPM pcre-devel
3503 # Find path to libxml shared lib...
3504 _XML2_LIB=`rpm -ql libxml2-devel | grep -e ".*/libxml2.so"`
3512 if [ "$FFMPEG_SKIP" = true ]; then
3513 WARNING "Skipping FFMpeg installation, as requested..."
3514 elif [ "$FFMPEG_FORCE_BUILD" = true ]; then
3515 INFO "Forced FFMpeg building, as requested..."
3518 check_package_version_ge_RPM ffmpeg-devel $FFMPEG_VERSION_MIN
3519 if [ $? -eq 0 ]; then
3520 install_packages_RPM ffmpeg ffmpeg-devel
3529 #### Install on ARCH-like ####
3530 get_package_version_ARCH() {
3531 pacman -Si $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+?(([0-9]+\.?)+).*/\1/'
3534 check_package_ARCH() {
3535 r=`pacman -Si $1 | grep -c 'Description'`
3537 if [ $r -ge 1 ]; then
3544 check_package_version_match_ARCH() {
3545 v=`get_package_version_ARCH $1`
3547 if [ -z "$v" ]; then
3555 check_package_version_ge_ARCH() {
3556 v=`get_package_version_ARCH $1`
3558 if [ -z "$v" ]; then
3566 check_package_version_ge_lt_ARCH() {
3567 v=`get_package_version_ARCH $1`
3569 if [ -z "$v" ]; then
3573 version_ge_lt $v $2 $3
3577 install_packages_ARCH() {
3578 if [ ! $SUDO ]; then
3579 WARNING "--no-sudo enabled, impossible to run pacman for $@, you'll have to do it yourself..."
3581 $SUDO pacman -S --needed --noconfirm $@
3582 if [ $? -ge 1 ]; then
3583 ERROR "pacman failed to install requested packages, exiting."
3591 INFO "Installing dependencies for ARCH-based distribution"
3593 PRINT "`eval _echo "$COMMON_INFO"`"
3596 if [ "$NO_CONFIRM" = false ]; then
3597 read -p "Do you want to continue (Y/n)?"
3598 [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" != "y" ] && exit
3603 if [ ! -x "/usr/bin/sudo" ]; then
3605 ERROR "This script requires sudo but it is not installed."
3606 PRINT "Please setup sudo according to:"
3607 PRINT "https://wiki.archlinux.org/index.php/Sudo"
3608 PRINT "and try again."
3614 if [ ! $SUDO ]; then
3615 WARNING "--no-sudo enabled, impossible to run pacman -Sy, you'll have to do it yourself..."
3620 # These libs should always be available in arch official repository...
3621 OPENJPEG_DEV="openjpeg"
3622 VORBIS_DEV="libvorbis"
3624 THEORA_DEV="libtheora"
3626 BASE_DEVEL="base-devel"
3628 # Avoid conflicts when gcc-multilib is installed
3629 pacman -Qi gcc-multilib &>/dev/null
3630 if [ $? -eq 0 ]; then
3631 BASE_DEVEL=`pacman -Sgq base-devel | sed -e 's/^gcc$/gcc-multilib/g' | paste -s -d' '`
3634 _packages="$BASE_DEVEL git cmake \
3635 libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
3636 $OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl fftw intel-tbb \
3637 libxml2 yaml-cpp tinyxml python-requests jemalloc"
3644 if [ "$WITH_ALL" = true ]; then
3645 _packages="$_packages jack libspnav"
3649 install_packages_ARCH $_packages
3652 SNDFILE_DEV="libsndfile"
3653 check_package_ARCH $SNDFILE_DEV
3654 if [ $? -eq 0 ]; then
3655 install_packages_ARCH $SNDFILE_DEV
3660 check_package_version_ge_ARCH $X264_DEV $X264_VERSION_MIN
3661 if [ $? -eq 0 ]; then
3662 install_packages_ARCH $X264_DEV
3666 if [ "$WITH_ALL" = true ]; then
3669 check_package_ARCH $XVID_DEV
3670 if [ $? -eq 0 ]; then
3671 install_packages_ARCH $XVID_DEV
3677 check_package_ARCH $MP3LAME_DEV
3678 if [ $? -eq 0 ]; then
3679 install_packages_ARCH $MP3LAME_DEV
3685 check_package_version_ge_ARCH $VPX_DEV $VPX_VERSION_MIN
3686 if [ $? -eq 0 ]; then
3687 install_packages_ARCH $VPX_DEV