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,with-jack,\
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 Install the jack libraries.
125 Force version of OCIO library.
128 Force version of OIIO library.
131 Force version of LLVM library.
134 Force version of OSL library.
137 Force version of OSD library.
140 Force version of OpenVDB library.
142 Note about the --ver-foo options:
143 It may not always work as expected (some libs are actually checked out from a git rev...), yet it might help
144 to fix some build issues (like LLVM mismatch with the version used by your graphic system).
147 Force the build of all possible libraries.
150 Force the build of Python.
153 Force the build of NumPy.
156 Force the build of Boost.
159 Force the build of OpenColorIO.
162 Force the build of OpenEXR.
165 Force the build of OpenImageIO.
168 Force the build of LLVM.
171 Force the build of OpenShadingLanguage.
174 Force the build of OpenSubdiv.
177 Force the build of OpenVDB.
180 Force the build of Alembic.
183 Force the build of OpenCOLLADA.
186 Force the build of FFMpeg.
188 Note about the --build-foo options:
189 * They force the script to prefer building dependencies rather than using available packages.
190 This may make things simpler and allow working around some distribution bugs, but on the other hand it will
191 use much more space on your hard drive.
192 * Please be careful with the Blender building options if you have both 'official' dev packages and
193 install_deps' built ones on your system, by default CMake will prefer official packages, which may lead to
194 linking issues. Please ensure your CMake configuration always uses all correct library paths.
195 * If the “force-built” library is a dependency of others, it will force the build
196 of those libraries as well (e.g. --build-boost also implies --build-oiio and --build-osl...).
199 Force the rebuild of all built libraries.
202 Force the rebuild of Python.
205 Force the rebuild of NumPy.
208 Force the rebuild of Boost.
211 Force the rebuild of OpenColorIO.
214 Force the rebuild of OpenEXR.
217 Force the rebuild of OpenImageIO.
220 Force the rebuild of LLVM.
223 Force the rebuild of OpenShadingLanguage.
226 Force the rebuild of OpenSubdiv.
229 Force the rebuild of OpenVDB.
232 Force the rebuild of Alembic.
235 Force the rebuild of OpenCOLLADA.
238 Force the rebuild of FFMpeg.
240 Note about the --force-foo options:
241 * They obviously only have an effect if those libraries are built by this script
242 (i.e. if there is no available and satisfactory package)!
243 * If the “force-rebuilt” library is a dependency of others, it will force the rebuild
244 of those libraries too (e.g. --force-boost will also rebuild oiio and osl...).
247 Unconditionally skip Python installation/building.
250 Unconditionally skip NumPy installation/building.
253 Unconditionally skip Boost installation/building.
256 Unconditionally skip OpenColorIO installation/building.
259 Unconditionally skip OpenEXR installation/building.
262 Unconditionally skip OpenImageIO installation/building.
265 Unconditionally skip LLVM installation/building.
268 Unconditionally skip OpenShadingLanguage installation/building.
271 Unconditionally skip OpenSubdiv installation/building.
274 Unconditionally skip OpenVDB installation/building.
277 Unconditionally skip Alembic installation/building.
280 Unconditionally skip OpenCOLLADA installation/building.
283 Unconditionally skip FFMpeg installation/building.\""
285 ##### Main Vars #####
295 PYTHON_VERSION="3.6.2"
296 PYTHON_VERSION_MIN="3.6"
297 PYTHON_FORCE_BUILD=false
298 PYTHON_FORCE_REBUILD=false
301 NUMPY_VERSION="1.13.1"
302 NUMPY_VERSION_MIN="1.8"
303 NUMPY_FORCE_BUILD=false
304 NUMPY_FORCE_REBUILD=false
307 BOOST_VERSION="1.60.0"
308 BOOST_VERSION_MIN="1.49"
309 BOOST_FORCE_BUILD=false
310 BOOST_FORCE_REBUILD=false
314 OCIO_VERSION_MIN="1.0"
315 OCIO_FORCE_BUILD=false
316 OCIO_FORCE_REBUILD=false
319 OPENEXR_VERSION="2.2.0"
320 OPENEXR_VERSION_MIN="2.0.1"
321 ILMBASE_VERSION="2.2.0"
322 ILMBASE_VERSION_MIN="2.2"
323 OPENEXR_FORCE_BUILD=false
324 OPENEXR_FORCE_REBUILD=false
326 _with_built_openexr=false
328 OIIO_VERSION="1.7.15"
329 OIIO_VERSION_MIN="1.7.15"
330 OIIO_VERSION_MAX="1.9.0" # UNKNOWN currently # Not supported by current OSL...
331 OIIO_FORCE_BUILD=false
332 OIIO_FORCE_REBUILD=false
336 LLVM_VERSION_MIN="3.4"
337 LLVM_VERSION_FOUND=""
338 LLVM_FORCE_BUILD=false
339 LLVM_FORCE_REBUILD=false
342 # OSL needs to be compiled for now!
344 OSL_VERSION_MIN=$OSL_VERSION
345 OSL_FORCE_BUILD=false
346 OSL_FORCE_REBUILD=false
349 # OpenSubdiv needs to be compiled for now
351 OSD_VERSION_MIN=$OSD_VERSION
352 OSD_FORCE_BUILD=false
353 OSD_FORCE_REBUILD=false
356 # OpenVDB needs to be compiled for now
357 OPENVDB_BLOSC_VERSION="1.7.0"
359 OPENVDB_VERSION="3.1.0"
360 OPENVDB_VERSION_MIN=$OPENVDB_VERSION
361 OPENVDB_FORCE_BUILD=false
362 OPENVDB_FORCE_REBUILD=false
365 # Alembic needs to be compiled for now
366 ALEMBIC_VERSION="1.7.1"
367 ALEMBIC_VERSION_MIN=$ALEMBIC_VERSION
368 ALEMBIC_FORCE_BUILD=false
369 ALEMBIC_FORCE_REBUILD=false
372 OPENCOLLADA_VERSION="1.6.51"
373 OPENCOLLADA_FORCE_BUILD=false
374 OPENCOLLADA_FORCE_REBUILD=false
375 OPENCOLLADA_SKIP=false
377 FFMPEG_VERSION="3.2.1"
378 FFMPEG_VERSION_MIN="2.8.4"
379 FFMPEG_FORCE_BUILD=false
380 FFMPEG_FORCE_REBUILD=false
384 # FFMPEG optional libs.
395 X264_VERSION_MIN=0.118
397 VPX_VERSION_MIN=0.9.7
404 # Whether to use system GLEW or not (OpenSubDiv needs recent glew to work).
407 # Switch to english language, else some things (like check_package_DEB()) won't work!
412 ##### Generic Helpers #####
414 BLACK=$(tput setaf 0)
416 GREEN=$(tput setaf 2)
417 YELLOW=$(tput setaf 3)
418 LIME_YELLOW=$(tput setaf 190)
419 POWDER_BLUE=$(tput setaf 153)
421 MAGENTA=$(tput setaf 5)
423 WHITE=$(tput setaf 7)
428 UNDERLINE=$(tput smul)
431 if [ "X$1" = "X-n" ]; then
432 shift; printf "%s" "$@"
439 _echo "${BRIGHT}${RED}ERROR! ${NORMAL}${RED}$@${NORMAL}"
443 _echo "${BRIGHT}${YELLOW}WARNING! ${NORMAL}${YELLOW}$@${NORMAL}"
447 _echo "${GREEN}$@${NORMAL}"
454 ##### Args Handling #####
456 # Finish parsing the commandline args.
461 SRC="$2"; shift; shift; continue
464 INST="$2"; shift; shift; continue
467 TMP="$2"; shift; shift; continue
470 INFO_PATH="$2"; shift; shift; continue
473 THREADS="$2"; shift; shift; continue
479 PRINT "`eval _echo "$COMMON_INFO"`"
481 PRINT "`eval _echo "$ARGUMENTS_INFO"`"
486 # We have to defer...
487 DO_SHOW_DEPS=true; shift; continue
491 WARNING "--no-sudo enabled, this script might not be able to do much..."
493 SUDO=""; shift; continue
497 WARNING "--no-build enabled, this script will not be able to install all dependencies..."
499 NO_BUILD=true; shift; continue
502 NO_CONFIRM=true; shift; continue
505 USE_CXX11=true; shift; continue
508 WITH_ALL=true; shift; continue
511 WITH_OPENCOLLADA=true; shift; continue
514 WITH_JACK=true; shift; continue;
518 OCIO_VERSION_MIN=$OCIO_VERSION
519 shift; shift; continue
523 OIIO_VERSION_MIN=$OIIO_VERSION
524 shift; shift; continue
528 LLVM_VERSION_MIN=$LLVM_VERSION
529 shift; shift; continue
533 OSL_VERSION_MIN=$OSL_VERSION
534 shift; shift; continue
538 OSD_VERSION_MIN=$OSD_VERSION
539 shift; shift; continue
543 OPENVDB_VERSION_MIN=$OPENVDB_VERSION
544 shift; shift; continue
547 PYTHON_FORCE_BUILD=true
548 NUMPY_FORCE_BUILD=true
549 BOOST_FORCE_BUILD=true
550 OCIO_FORCE_BUILD=true
551 OPENEXR_FORCE_BUILD=true
552 OIIO_FORCE_BUILD=true
553 LLVM_FORCE_BUILD=true
556 OPENVDB_FORCE_BUILD=true
557 OPENCOLLADA_FORCE_BUILD=true
558 FFMPEG_FORCE_BUILD=true
559 ALEMBIC_FORCE_BUILD=true
563 PYTHON_FORCE_BUILD=true
564 NUMPY_FORCE_BUILD=true
568 PYTHON_FORCE_BUILD=true
569 NUMPY_FORCE_BUILD=true
573 BOOST_FORCE_BUILD=true; shift; continue
576 OCIO_FORCE_BUILD=true; shift; continue
579 OPENEXR_FORCE_BUILD=true; shift; continue
582 OIIO_FORCE_BUILD=true; shift; continue
585 LLVM_FORCE_BUILD=true; shift; continue
588 OSL_FORCE_BUILD=true; shift; continue
591 OSD_FORCE_BUILD=true; shift; continue
594 OPENVDB_FORCE_BUILD=true; shift; continue
597 OPENCOLLADA_FORCE_BUILD=true; shift; continue
600 FFMPEG_FORCE_BUILD=true; shift; continue
603 ALEMBIC_FORCE_BUILD=true; shift; continue
606 PYTHON_FORCE_REBUILD=true
607 NUMPY_FORCE_REBUILD=true
608 BOOST_FORCE_REBUILD=true
609 OCIO_FORCE_REBUILD=true
610 OPENEXR_FORCE_REBUILD=true
611 OIIO_FORCE_REBUILD=true
612 LLVM_FORCE_REBUILD=true
613 OSL_FORCE_REBUILD=true
614 OSD_FORCE_REBUILD=true
615 OPENVDB_FORCE_REBUILD=true
616 OPENCOLLADA_FORCE_REBUILD=true
617 FFMPEG_FORCE_REBUILD=true
618 ALEMBIC_FORCE_REBUILD=true
622 PYTHON_FORCE_REBUILD=true
623 NUMPY_FORCE_REBUILD=true
627 NUMPY_FORCE_REBUILD=true; shift; continue
630 BOOST_FORCE_REBUILD=true; shift; continue
633 OCIO_FORCE_REBUILD=true; shift; continue
636 OPENEXR_FORCE_REBUILD=true; shift; continue
639 OIIO_FORCE_REBUILD=true; shift; continue
642 LLVM_FORCE_REBUILD=true; shift; continue
645 OSL_FORCE_REBUILD=true; shift; continue
648 OSD_FORCE_REBUILD=true; shift; continue
651 OPENVDB_FORCE_REBUILD=true; shift; continue
654 OPENCOLLADA_FORCE_REBUILD=true; shift; continue
657 FFMPEG_FORCE_REBUILD=true; shift; continue
660 ALEMBIC_FORCE_REBUILD=true; shift; continue
663 PYTHON_SKIP=true; shift; continue
666 NUMPY_SKIP=true; shift; continue
669 BOOST_SKIP=true; shift; continue
672 OCIO_SKIP=true; shift; continue
675 OPENEXR_SKIP=true; shift; continue
678 OIIO_SKIP=true; shift; continue
681 LLVM_SKIP=true; shift; continue
684 OSL_SKIP=true; shift; continue
687 OSD_SKIP=true; shift; continue
690 OPENVDB_SKIP=true; shift; continue
693 OPENCOLLADA_SKIP=true; shift; continue
696 FFMPEG_SKIP=true; shift; continue
699 ALEMBIC_SKIP=true; shift; continue
702 # no more arguments to parse
707 ERROR "Wrong parameter! Usage:"
709 PRINT "`eval _echo "$COMMON_INFO"`"
716 if [ "$WITH_ALL" = true -a "$OPENCOLLADA_SKIP" = false ]; then
717 WITH_OPENCOLLADA=true
719 if [ "$WITH_ALL" = true ]; then
724 WARNING "****WARNING****"
725 PRINT "If you are experiencing issues building Blender, _*TRY A FRESH, CLEAN BUILD FIRST*_!"
726 PRINT "The same goes for install_deps itself, if you encounter issues, please first erase everything in $SRC and $INST"
727 PRINT "(provided obviously you did not add anything yourself in those dirs!), and run install_deps.sh again!"
728 PRINT "Often, changes in the libs built by this script, or in your distro package, cannot be handled simply, so..."
730 PRINT "You may also try to use the '--build-foo' options to bypass your distribution's packages"
731 PRINT "for some troublesome/buggy libraries..."
735 PRINT " install_deps.sh $COMMANDLINE"
740 # This has to be done here, because user might force some versions...
741 PYTHON_SOURCE=( "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" )
742 NUMPY_SOURCE=( "https://github.com/numpy/numpy/releases/download/v$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
744 _boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
745 BOOST_SOURCE=( "http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_$_boost_version_nodots.tar.bz2/download" )
746 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"
749 OCIO_SOURCE=( "https://github.com/imageworks/OpenColorIO/tarball/v$OCIO_VERSION" )
750 OCIO_SOURCE_REPO=( "https://github.com/imageworks/OpenColorIO.git" )
751 OCIO_SOURCE_REPO_UID="6de971097c7f552300f669ed69ca0b6cf5a70843"
753 OPENEXR_USE_REPO=false
754 OPENEXR_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/openexr-$OPENEXR_VERSION.tar.gz" )
755 OPENEXR_SOURCE_REPO=( "https://github.com/mont29/openexr.git" )
756 OPENEXR_SOURCE_REPO_UID="2787aa1cf652d244ed45ae124eb1553f6cff11ee"
757 ILMBASE_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/ilmbase-$ILMBASE_VERSION.tar.gz" )
760 OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz" )
761 OIIO_SOURCE_REPO=( "https://github.com/OpenImageIO/oiio.git" )
762 OIIO_SOURCE_REPO_UID="c9e67275a0b248ead96152f6d2221cc0c0f278a4"
764 LLVM_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.gz" )
765 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" )
768 OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" )
769 #~ OSL_SOURCE=( "https://github.com/Nazg-Gul/OpenShadingLanguage/archive/Release-1.5.11.tar.gz" )
770 #~ OSL_SOURCE_REPO=( "https://github.com/imageworks/OpenShadingLanguage.git" )
771 #~ OSL_SOURCE_REPO=( "https://github.com/mont29/OpenShadingLanguage.git" )
772 #~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
773 #~ OSL_SOURCE_REPO_BRANCH="master"
774 OSL_SOURCE_REPO=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" )
775 OSL_SOURCE_REPO_UID="7d40ff5fe8e47b030042afb92d0e955f5aa96f48"
776 OSL_SOURCE_REPO_BRANCH="blender-fixes"
779 # Script foo to make the version string compliant with the archive name:
780 # ${Varname//SearchForThisChar/ReplaceWithThisChar}
781 OSD_SOURCE=( "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v${OSD_VERSION//./_}.tar.gz" )
782 OSD_SOURCE_REPO=( "https://github.com/PixarAnimationStudios/OpenSubdiv.git" )
783 OSD_SOURCE_REPO_UID="404659fffa659da075d1c9416e4fc939139a84ee"
784 OSD_SOURCE_REPO_BRANCH="dev"
786 OPENVDB_USE_REPO=false
787 OPENVDB_BLOSC_SOURCE=( "https://github.com/Blosc/c-blosc/archive/v${OPENVDB_BLOSC_VERSION}.tar.gz" )
788 OPENVDB_SOURCE=( "https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz" )
789 #~ OPENVDB_SOURCE_REPO=( "https:///dreamworksanimation/openvdb.git" )
790 #~ OPENVDB_SOURCE_REPO_UID="404659fffa659da075d1c9416e4fc939139a84ee"
791 #~ OPENVDB_SOURCE_REPO_BRANCH="dev"
793 ALEMBIC_USE_REPO=false
794 ALEMBIC_SOURCE=( "https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz" )
795 # ALEMBIC_SOURCE_REPO=( "https://github.com/alembic/alembic.git" )
796 # ALEMBIC_SOURCE_REPO_UID="e6c90d4faa32c4550adeaaf3f556dad4b73a92bb"
797 # ALEMBIC_SOURCE_REPO_BRANCH="master"
799 OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" )
800 OPENCOLLADA_REPO_UID="0c2cdc17c22cf42050e4d42154bed2176363549c"
801 OPENCOLLADA_REPO_BRANCH="master"
803 FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
805 CXXFLAGS_BACK=$CXXFLAGS
806 if [ "$USE_CXX11" = true ]; then
807 WARNING "You are trying to use c++11, this *should* go smoothely with any very recent distribution
808 However, if you are experiencing linking errors (also when building Blender itself), please try the following:
809 * Re-run this script with '--build-all --force-all' options.
810 * Ensure your gcc version is at the very least 4.8, if possible you should really rather use gcc-5.1 or above.
812 Please note that until the transition to C++11-built libraries if completed in your distribution, situation will
813 remain fuzzy and incompatibilities may happen..."
816 CXXFLAGS="$CXXFLAGS -std=c++11"
820 #### Show Dependencies ####
822 # Need those to be after we defined versions...
823 DEPS_COMMON_INFO="\"COMMON DEPENDENCIES:
825 Those libraries should be available as packages in all recent distributions (optional ones are [between brackets]):
827 * Basics of dev environment (cmake, gcc, svn , git, ...).
828 * libjpeg, libpng, libtiff, [libopenjpeg], [libopenal].
829 * libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
830 * libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
831 * libsdl1.2, libglew, [libglewmx].\""
833 DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
835 The following libraries will probably not all be available as packages in your distribution
836 (install_deps will by default try to install packages, and fall back to building missing ones).
837 You can force install_deps to build those with '--build-all' or relevant 'build-foo' options, see '--help' message.
838 You may also want to build them yourself (optional ones are [between brackets]):
840 * Python $PYTHON_VERSION_MIN (from $PYTHON_SOURCE).
841 * [NumPy $NUMPY_VERSION_MIN] (from $NUMPY_SOURCE).
842 * Boost $BOOST_VERSION_MIN (from $BOOST_SOURCE, modules: $BOOST_BUILD_MODULES).
843 * [FFMpeg $FFMPEG_VERSION_MIN (needs libvorbis, libogg, libtheora, libx264, libmp3lame, libxvidcore, libvpx, ...)] (from $FFMPEG_SOURCE).
844 * [OpenColorIO $OCIO_VERSION_MIN] (from $OCIO_SOURCE).
845 * ILMBase $ILMBASE_VERSION_MIN (from $ILMBASE_SOURCE).
846 * OpenEXR $OPENEXR_VERSION_MIN (from $OPENEXR_SOURCE).
847 * OpenImageIO $OIIO_VERSION_MIN (from $OIIO_SOURCE).
848 * [LLVM $LLVM_VERSION_MIN (with clang)] (from $LLVM_SOURCE, and $LLVM_CLANG_SOURCE).
849 * [OpenShadingLanguage $OSL_VERSION_MIN] (from $OSL_SOURCE_REPO, branch $OSL_SOURCE_REPO_BRANCH, commit $OSL_SOURCE_REPO_UID).
850 * [OpenSubDiv $OSD_VERSION_MIN] (from $OSD_SOURCE_REPO, branch $OSD_SOURCE_REPO_BRANCH, commit $OSD_SOURCE_REPO_UID).
851 * [OpenVDB $OPENVDB_VERSION_MIN] (from $OPENVDB_SOURCE), [Blosc $OPENVDB_BLOSC_VERSION] (from $OPENVDB_BLOSC_SOURCE).
852 * [OpenCollada] (from $OPENCOLLADA_SOURCE, branch $OPENCOLLADA_REPO_BRANCH, commit $OPENCOLLADA_REPO_UID).
853 * [Alembic $ALEMBIC_VERSION] (from $ALEMBIC_SOURCE).\""
855 if [ "$DO_SHOW_DEPS" = true ]; then
857 PRINT "Blender dependencies (libraries needed to build it):"
859 PRINT "`eval _echo "$DEPS_COMMON_INFO"`"
861 PRINT "`eval _echo "$DEPS_SPECIFIC_INFO"`"
868 ##### Generic Helpers #####
870 # Check return code of wget for success...
872 declare -a sources=("${!1}")
873 sources_count=${#sources[@]}
876 for (( i=0; $i < $sources_count; i++ ))
878 wget -c ${sources[$i]} -O $2
879 if [ $? -eq 0 ]; then
885 if [ $error -eq 1 ]; then
886 ERROR "wget could not find ${sources[@]}, or could not write it to $2, exiting"
891 # Return 0 if $1 = $2 (i.e. 1.01.0 = 1.1, but 1.1.1 != 1.1), else 1.
892 # $1 and $2 should be version numbers made of numbers only.
897 # Split both version numbers into their numeric elements.
905 if [ $count2 -ge $count1 ]; then
914 for (( i=0; $i < $count2; i++ ))
916 if [ $(( 10#${arr1[$i]} )) -ne $(( 10#${arr2[$i]} )) ]; then
922 for (( i=$count2; $i < $count1; i++ ))
924 if [ $(( 10#${arr1[$i]} )) -ne 0 ]; then
934 # Return 0 if $1 >= $2, else 1.
935 # $1 and $2 should be version numbers made of numbers only.
938 if [ $? -eq 1 -a $(_echo "$1" "$2" | sort --version-sort | head --lines=1) = "$1" ]; then
945 # Return 0 if $3 > $1 >= $2, else 1.
946 # $1 and $2 should be version numbers made of numbers only.
949 if [ $? -eq 0 ]; then
957 # 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.
958 # $1 and $2 should be version numbers made of numbers only.
959 # $1 should be at least as long as $2!
964 # Split both version numbers into their numeric elements.
972 if [ $count1 -ge $count2 ]; then
974 for (( i=0; $i < $count2; i++ ))
976 if [ $(( 10#${arr1[$i]} )) -ne $(( 10#${arr2[$i]} )) ]; then
987 ##### Generic compile helpers #####
989 INFO "Ensuring $INST exists and is writable by us"
991 WARNING "--no-sudo enabled, might be impossible to create install dir..."
993 if [ ! -d $INST ]; then
997 if [ ! -w $INST ]; then
998 $SUDO chown $USER $INST
999 $SUDO chmod 775 $INST
1003 # Check whether the current package needs to be recompiled, based on a dummy file containing a magic number in its name...
1004 magic_compile_check() {
1005 if [ -f $INST/.$1-magiccheck-$2-$USE_CXX11 ]; then
1012 magic_compile_set() {
1013 rm -f $INST/.$1-magiccheck-*
1014 touch $INST/.$1-magiccheck-$2-$USE_CXX11
1017 # Note: should clean nicely in $INST, but not in $SRC, when we switch to a new version of a lib...
1019 rm -rf `readlink -f $_inst_shortcut`
1020 # Only remove $_src dir when not using git repo (avoids to re-clone the whole repo every time!!!).
1021 if [ $_git == false ]; then
1025 rm -rf $_inst_shortcut
1028 _create_inst_shortcut() {
1029 rm -f $_inst_shortcut
1030 ln -s $_inst $_inst_shortcut
1035 _lib_path="$INST/$1/lib"
1036 _ldconf_path="/etc/ld.so.conf.d/$1.conf"
1038 if [ ! $SUDO ]; then
1039 WARNING "--no-sudo enabled, impossible to run ldconfig for $1, you'll have to do it yourself..."
1041 INFO "Running ldconfig for $1..."
1042 $SUDO sh -c "echo \"$_lib_path\" > $_ldconf_path"
1043 $SUDO /sbin/ldconfig # XXX OpenSuse does not include sbin in command path with sudo!!!
1048 #### Build Python ####
1050 _src=$SRC/Python-$PYTHON_VERSION
1052 _inst=$INST/python-$PYTHON_VERSION
1053 _inst_shortcut=$INST/python-$PYTHON_VERSION_MIN
1063 if [ "$NO_BUILD" = true ]; then
1064 WARNING "--no-build enabled, Python will not be compiled!"
1068 # To be changed each time we make edits that would modify the compiled result!
1072 # Clean install if needed!
1073 magic_compile_check python-$PYTHON_VERSION $py_magic
1074 if [ $? -eq 1 -o "$PYTHON_FORCE_REBUILD" = true ]; then
1078 if [ ! -d $_inst ]; then
1079 INFO "Building Python-$PYTHON_VERSION"
1083 if [ ! -d $_src ]; then
1085 download PYTHON_SOURCE[@] $_src.tgz
1087 INFO "Unpacking Python-$PYTHON_VERSION"
1088 tar -C $SRC -xf $_src.tgz
1093 ./configure --prefix=$_inst --libdir=$_inst/lib --enable-ipv6 \
1094 --enable-loadable-sqlite-extensions --with-dbmliborder=bdb \
1095 --with-computed-gotos --with-pymalloc
1097 make -j$THREADS && make install
1100 if [ -d $_inst ]; then
1101 _create_inst_shortcut
1103 ERROR "Python--$PYTHON_VERSION failed to compile, exiting"
1107 magic_compile_set python-$PYTHON_VERSION $py_magic
1110 INFO "Done compiling Python-$PYTHON_VERSION!"
1112 INFO "Own Python-$PYTHON_VERSION is up to date, nothing to do!"
1113 INFO "If you want to force rebuild of this lib, use the --force-python option."
1117 ##### Build Numpy #####
1119 _src=$SRC/numpy-$NUMPY_VERSION
1121 _inst=$INST/numpy-$NUMPY_VERSION
1122 _python=$INST/python-$PYTHON_VERSION
1123 _site=lib/python$PYTHON_VERSION_MIN/site-packages
1124 _inst_shortcut=$_python/$_site/numpy
1133 if [ "$NO_BUILD" = true ]; then
1134 WARNING "--no-build enabled, Numpy will not be compiled!"
1138 # To be changed each time we make edits that would modify the compiled result!
1142 # Clean install if needed!
1143 magic_compile_check numpy-$NUMPY_VERSION $numpy_magic
1144 if [ $? -eq 1 -o "$NUMPY_FORCE_REBUILD" = true ]; then
1148 if [ ! -d $_inst ]; then
1149 INFO "Building Numpy-$NUMPY_VERSION"
1153 if [ ! -d $_src ]; then
1155 download NUMPY_SOURCE[@] $_src.tar.gz
1157 INFO "Unpacking Numpy-$NUMPY_VERSION"
1158 tar -C $SRC -xf $_src.tar.gz
1163 $_python/bin/python3 setup.py install --old-and-unmanageable --prefix=$_inst
1165 if [ -d $_inst ]; then
1166 # Can't use _create_inst_shortcut here...
1167 rm -f $_inst_shortcut
1168 ln -s $_inst/$_site/numpy $_inst_shortcut
1170 ERROR "Numpy-$NUMPY_VERSION failed to compile, exiting"
1174 magic_compile_set numpy-$NUMPY_VERSION $numpy_magic
1177 INFO "Done compiling Numpy-$NUMPY_VERSION!"
1179 INFO "Own Numpy-$NUMPY_VERSION is up to date, nothing to do!"
1180 INFO "If you want to force rebuild of this lib, use the --force-numpy option."
1184 #### Build Boost ####
1186 _src=$SRC/boost-$BOOST_VERSION
1188 _inst=$INST/boost-$BOOST_VERSION
1189 _inst_shortcut=$INST/boost
1198 if [ "$NO_BUILD" = true ]; then
1199 WARNING "--no-build enabled, Boost will not be compiled!"
1203 # To be changed each time we make edits that would modify the compiled result!
1208 # Clean install if needed!
1209 magic_compile_check boost-$BOOST_VERSION $boost_magic
1210 if [ $? -eq 1 -o "$BOOST_FORCE_REBUILD" = true ]; then
1214 if [ ! -d $_inst ]; then
1215 INFO "Building Boost-$BOOST_VERSION"
1217 # Rebuild dependecies as well!
1218 OIIO_FORCE_BUILD=true
1219 OIIO_FORCE_REBUILD=true
1220 OSL_FORCE_BUILD=true
1221 OSL_FORCE_REBUILD=true
1222 OPENVDB_FORCE_BUILD=true
1223 OPENVDB_FORCE_REBUILD=true
1227 if [ ! -d $_src ]; then
1228 INFO "Downloading Boost-$BOOST_VERSION"
1230 download BOOST_SOURCE[@] $_src.tar.bz2
1231 tar -C $SRC --transform "s,\w*,boost-$BOOST_VERSION,x" -xf $_src.tar.bz2
1235 if [ ! -f $_src/b2 ]; then
1238 ./b2 -j$THREADS -a $BOOST_BUILD_MODULES \
1239 --prefix=$_inst --disable-icu boost.locale.icu=off install
1242 if [ -d $_inst ]; then
1243 _create_inst_shortcut
1245 ERROR "Boost-$BOOST_VERSION failed to compile, exiting"
1249 magic_compile_set boost-$BOOST_VERSION $boost_magic
1252 INFO "Done compiling Boost-$BOOST_VERSION!"
1254 INFO "Own Boost-$BOOST_VERSION is up to date, nothing to do!"
1255 INFO "If you want to force rebuild of this lib, use the --force-boost option."
1258 # Just always run it, much simpler this way!
1259 run_ldconfig "boost"
1262 #### Build OCIO ####
1264 _src=$SRC/OpenColorIO-$OCIO_VERSION
1266 _inst=$INST/ocio-$OCIO_VERSION
1267 _inst_shortcut=$INST/ocio
1276 if [ "$NO_BUILD" = true ]; then
1277 WARNING "--no-build enabled, OpenColorIO will not be compiled!"
1281 # To be changed each time we make edits that would modify the compiled result!
1285 # Clean install if needed!
1286 magic_compile_check ocio-$OCIO_VERSION $ocio_magic
1287 if [ $? -eq 1 -o "$OCIO_FORCE_REBUILD" = true ]; then
1291 if [ ! -d $_inst ]; then
1292 INFO "Building OpenColorIO-$OCIO_VERSION"
1296 if [ ! -d $_src ]; then
1297 INFO "Downloading OpenColorIO-$OCIO_VERSION"
1300 if [ "$OCIO_USE_REPO" = true ]; then
1301 git clone ${OCIO_SOURCE_REPO[0]} $_src
1303 download OCIO_SOURCE[@] $_src.tar.gz
1304 INFO "Unpacking OpenColorIO-$OCIO_VERSION"
1305 tar -C $SRC --transform "s,(.*/?)imageworks-OpenColorIO[^/]*(.*),\1OpenColorIO-$OCIO_VERSION\2,x" \
1313 if [ "$OCIO_USE_REPO" = true ]; then
1314 # XXX For now, always update from latest repo...
1315 git pull origin master
1316 git checkout $OCIO_SOURCE_REPO_UID
1320 # Always refresh the whole build!
1321 if [ -d build ]; then
1327 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1328 cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
1329 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1330 cmake_d="$cmake_d -D OCIO_BUILD_APPS=OFF"
1331 cmake_d="$cmake_d -D OCIO_BUILD_PYGLUE=OFF"
1333 if file /bin/cp | grep -q '32-bit'; then
1334 cflags="-fPIC -m32 -march=i686"
1339 cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ..
1341 make -j$THREADS && make install
1343 # Force linking against static libs
1344 rm -f $_inst/lib/*.so*
1346 # Additional depencencies
1347 cp ext/dist/lib/libtinyxml.a $_inst/lib
1348 cp ext/dist/lib/libyaml-cpp.a $_inst/lib
1352 if [ -d $_inst ]; then
1353 _create_inst_shortcut
1355 ERROR "OpenColorIO-$OCIO_VERSION failed to compile, exiting"
1359 magic_compile_set ocio-$OCIO_VERSION $ocio_magic
1362 INFO "Done compiling OpenColorIO-$OCIO_VERSION!"
1364 INFO "Own OpenColorIO-$OCIO_VERSION is up to date, nothing to do!"
1365 INFO "If you want to force rebuild of this lib, use the --force-ocio option."
1371 #### Build ILMBase ####
1373 _src=$SRC/ILMBase-$ILMBASE_VERSION
1375 _inst=$TMP/ilmbase-$ILMBASE_VERSION
1376 _inst_shortcut=$TMP/ilmbase
1385 if [ "$NO_BUILD" = true ]; then
1386 WARNING "--no-build enabled, ILMBase will not be compiled!"
1390 # To be changed each time we make edits that would modify the compiled result!
1394 # Clean install if needed!
1395 magic_compile_check ilmbase-$ILMBASE_VERSION $ilmbase_magic
1396 if [ $? -eq 1 -o "$OPENEXR_FORCE_REBUILD" = true ]; then
1398 rm -rf $_openexr_inst
1401 if [ ! -d $_openexr_inst ]; then
1402 INFO "Building ILMBase-$ILMBASE_VERSION"
1404 # Rebuild dependecies as well!
1405 OPENEXR_FORCE_BUILD=true
1406 OPENEXR_FORCE_REBUILD=true
1410 if [ ! -d $_src ]; then
1411 INFO "Downloading ILMBase-$ILMBASE_VERSION"
1413 download ILMBASE_SOURCE[@] $_src.tar.gz
1415 INFO "Unpacking ILMBase-$ILMBASE_VERSION"
1416 tar -C $SRC --transform "s,(.*/?)ilmbase-[^/]*(.*),\1ILMBase-$ILMBASE_VERSION\2,x" -xf $_src.tar.gz
1421 # Always refresh the whole build!
1422 if [ -d build ]; then
1428 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1429 cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
1430 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1431 cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
1432 cmake_d="$cmake_d -D NAMESPACE_VERSIONING=OFF" # VERY IMPORTANT!!!
1434 if file /bin/cp | grep -q '32-bit'; then
1435 cflags="-fPIC -m32 -march=i686"
1440 cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ..
1442 make -j$THREADS && make install
1446 if [ -d $_inst ]; then
1447 _create_inst_shortcut
1449 ERROR "ILMBase-$ILMBASE_VERSION failed to compile, exiting"
1453 INFO "Done compiling ILMBase-$ILMBASE_VERSION!"
1455 INFO "Own ILMBase-$ILMBASE_VERSION is up to date, nothing to do!"
1456 INFO "If you want to force rebuild of this lib (and openexr), use the --force-openexr option."
1459 magic_compile_set ilmbase-$ILMBASE_VERSION $ilmbase_magic
1462 #### Build OpenEXR ####
1464 _src=$SRC/OpenEXR-$OPENEXR_VERSION
1466 _inst=$_openexr_inst
1467 _inst_shortcut=$INST/openexr
1477 if [ "$NO_BUILD" = true ]; then
1478 WARNING "--no-build enabled, OpenEXR will not be compiled!"
1482 # To be changed each time we make edits that would modify the compiled result!
1485 # Clean install if needed!
1486 magic_compile_check openexr-$OPENEXR_VERSION $openexr_magic
1487 if [ $? -eq 1 -o "$OPENEXR_FORCE_REBUILD" = true ]; then
1491 _openexr_inst=$INST/openexr-$OPENEXR_VERSION
1494 _ilmbase_inst=$_inst_shortcut
1497 if [ ! -d $_inst ]; then
1498 INFO "Building OpenEXR-$OPENEXR_VERSION"
1500 # Rebuild dependecies as well!
1501 OIIO_FORCE_BUILD=true
1502 OIIO_FORCE_REBUILD=true
1506 if [ ! -d $_src ]; then
1507 INFO "Downloading OpenEXR-$OPENEXR_VERSION"
1510 if [ "$OPENEXR_USE_REPO" = true ]; then
1511 git clone ${OPENEXR_SOURCE_REPO[0]} $_src
1513 download OPENEXR_SOURCE[@] $_src.tar.gz
1514 INFO "Unpacking OpenEXR-$OPENEXR_VERSION"
1515 tar -C $SRC --transform "s,(.*/?)openexr[^/]*(.*),\1OpenEXR-$OPENEXR_VERSION\2,x" -xf $_src.tar.gz
1522 if [ "$OPENEXR_USE_REPO" = true ]; then
1523 # XXX For now, always update from latest repo...
1524 git pull origin master
1525 git checkout $OPENEXR_SOURCE_REPO_UID
1527 oiio_src_path="../OpenEXR"
1532 # Always refresh the whole build!
1533 if [ -d build ]; then
1539 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1540 cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
1541 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1542 cmake_d="$cmake_d -D ILMBASE_PACKAGE_PREFIX=$_ilmbase_inst"
1543 cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
1544 cmake_d="$cmake_d -D NAMESPACE_VERSIONING=OFF" # VERY IMPORTANT!!!
1546 if file /bin/cp | grep -q '32-bit'; then
1547 cflags="-fPIC -m32 -march=i686"
1552 cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" $oiio_src_path
1554 make -j$THREADS && make install
1558 if [ -d $_inst ]; then
1559 _create_inst_shortcut
1560 # Copy ilmbase files here (blender expects same dir for ilmbase and openexr :/).
1561 cp -an $_ilmbase_inst/* $_inst_shortcut
1563 ERROR "OpenEXR-$OPENEXR_VERSION failed to compile, exiting"
1567 magic_compile_set openexr-$OPENEXR_VERSION $openexr_magic
1570 INFO "Done compiling OpenEXR-$OPENEXR_VERSION!"
1572 INFO "Own OpenEXR-$OPENEXR_VERSION is up to date, nothing to do!"
1573 INFO "If you want to force rebuild of this lib, use the --force-openexr option."
1576 _with_built_openexr=true
1578 # Just always run it, much simpler this way!
1579 run_ldconfig "openexr"
1582 #### Build OIIO ####
1584 _src=$SRC/OpenImageIO-$OIIO_VERSION
1586 _inst=$INST/oiio-$OIIO_VERSION
1587 _inst_shortcut=$INST/oiio
1596 if [ "$NO_BUILD" = true ]; then
1597 WARNING "--no-build enabled, OpenImageIO will not be compiled!"
1601 # To be changed each time we make edits that would modify the compiled result!
1605 # Clean install if needed!
1606 magic_compile_check oiio-$OIIO_VERSION $oiio_magic
1607 if [ $? -eq 1 -o "$OIIO_FORCE_REBUILD" = true ]; then
1611 if [ ! -d $_inst ]; then
1612 INFO "Building OpenImageIO-$OIIO_VERSION"
1614 # Rebuild dependecies as well!
1615 OSL_FORCE_BUILD=true
1616 OSL_FORCE_REBUILD=true
1620 if [ ! -d $_src ]; then
1623 if [ "$OIIO_USE_REPO" = true ]; then
1624 git clone ${OIIO_SOURCE_REPO[0]} $_src
1626 download OIIO_SOURCE[@] "$_src.tar.gz"
1627 INFO "Unpacking OpenImageIO-$OIIO_VERSION"
1628 tar -C $SRC --transform "s,(.*/?)oiio-Release-[^/]*(.*),\1OpenImageIO-$OIIO_VERSION\2,x" -xf $_src.tar.gz
1634 if [ "$OIIO_USE_REPO" = true ]; then
1635 # XXX For now, always update from latest repo...
1636 git pull origin master
1637 # Stick to same rev as windows' libs...
1638 git checkout $OIIO_SOURCE_REPO_UID
1642 # Always refresh the whole build!
1643 if [ -d build ]; then
1649 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1650 cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
1651 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1652 cmake_d="$cmake_d -D STOP_ON_WARNING=OFF"
1653 cmake_d="$cmake_d -D BUILDSTATIC=OFF"
1654 cmake_d="$cmake_d -D LINKSTATIC=OFF"
1655 cmake_d="$cmake_d -D USE_SIMD=sse2"
1657 cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
1658 cmake_d="$cmake_d -D OPENEXR_VERSION=$OPENEXR_VERSION"
1660 if [ "$_with_built_openexr" = true ]; then
1661 cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr"
1662 cmake_d="$cmake_d -D OPENEXR_HOME=$INST/openexr"
1663 INFO "ILMBASE_HOME=$INST/openexr"
1666 # ptex is only needed when nicholas bishop is ready
1667 cmake_d="$cmake_d -D USE_PTEX=OFF"
1669 # Optional tests and cmd tools
1670 cmake_d="$cmake_d -D USE_QT=OFF"
1671 cmake_d="$cmake_d -D USE_PYTHON=OFF"
1672 cmake_d="$cmake_d -D USE_FFMPEG=OFF"
1673 cmake_d="$cmake_d -D BUILD_TESTING=OFF"
1674 cmake_d="$cmake_d -D OIIO_BUILD_TESTS=OFF"
1675 cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=OFF"
1676 #cmake_d="$cmake_d -D CMAKE_EXPORT_COMPILE_COMMANDS=ON"
1677 #cmake_d="$cmake_d -D CMAKE_VERBOSE_MAKEFILE=ON"
1679 if [ -d $INST/boost ]; then
1680 cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost -D Boost_NO_SYSTEM_PATHS=ON"
1683 # Looks like we do not need ocio in oiio for now...
1684 # if [ -d $INST/ocio ]; then
1685 # cmake_d="$cmake_d -D OCIO_PATH=$INST/ocio"
1687 cmake_d="$cmake_d -D USE_OCIO=OFF"
1689 if [ "$USE_CXX11" = true ]; then
1690 cmake_d="$cmake_d -D OIIO_BUILD_CPP11=ON"
1693 if file /bin/cp | grep -q '32-bit'; then
1694 cflags="-fPIC -m32 -march=i686"
1699 cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ..
1701 make -j$THREADS && make install
1704 if [ -d $_inst ]; then
1705 _create_inst_shortcut
1707 ERROR "OpenImageIO-$OIIO_VERSION failed to compile, exiting"
1711 magic_compile_set oiio-$OIIO_VERSION $oiio_magic
1714 INFO "Done compiling OpenImageIO-$OIIO_VERSION!"
1716 INFO "Own OpenImageIO-$OIIO_VERSION is up to date, nothing to do!"
1717 INFO "If you want to force rebuild of this lib, use the --force-oiio option."
1720 # Just always run it, much simpler this way!
1724 #### Build LLVM ####
1726 _src=$SRC/LLVM-$LLVM_VERSION
1727 _src_clang=$SRC/CLANG-$LLVM_VERSION
1729 _inst=$INST/llvm-$LLVM_VERSION
1730 _inst_shortcut=$INST/llvm
1739 if [ "$NO_BUILD" = true ]; then
1740 WARNING "--no-build enabled, LLVM will not be compiled!"
1744 # To be changed each time we make edits that would modify the compiled result!
1748 # Clean install if needed!
1749 magic_compile_check llvm-$LLVM_VERSION $llvm_magic
1750 if [ $? -eq 1 -o "$LLVM_FORCE_REBUILD" = true ]; then
1754 if [ ! -d $_inst ]; then
1755 INFO "Building LLVM-$LLVM_VERSION (CLANG included!)"
1757 # Rebuild dependecies as well!
1758 OSL_FORCE_BUILD=true
1759 OSL_FORCE_REBUILD=true
1763 if [ ! -d $_src -o true ]; then
1765 download LLVM_SOURCE[@] "$_src.tar.gz"
1766 download LLVM_CLANG_SOURCE[@] "$_src_clang.tar.gz"
1768 INFO "Unpacking LLVM-$LLVM_VERSION"
1769 tar -C $SRC --transform "s,([^/]*/?)llvm-[^/]*(.*),\1LLVM-$LLVM_VERSION\2,x" \
1771 INFO "Unpacking CLANG-$LLVM_VERSION to $_src/tools/clang"
1772 # Stupid clang guys renamed 'clang' to 'cfe' for now handle both cases... :(
1773 tar -C $_src/tools \
1774 --transform "s,([^/]*/?)(clang|cfe)-[^/]*(.*),\1clang\3,x" \
1775 -xf $_src_clang.tar.gz
1779 # XXX Ugly patching hack!
1780 patch -p1 -i "$SCRIPT_DIR/patches/install_deps_llvm.diff"
1788 # Always refresh the whole build!
1789 if [ -d build ]; then
1795 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1796 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1797 cmake_d="$cmake_d -D LLVM_ENABLE_FFI=ON"
1798 cmake_d="$cmake_d -D LLVM_TARGETS_TO_BUILD=X86"
1799 cmake_d="$cmake_d -D LLVM_ENABLE_TERMINFO=OFF"
1801 if [ -d $_FFI_INCLUDE_DIR ]; then
1802 cmake_d="$cmake_d -D FFI_INCLUDE_DIR=$_FFI_INCLUDE_DIR"
1807 make -j$THREADS && make install
1810 if [ -d $_inst ]; then
1811 _create_inst_shortcut
1813 ERROR "LLVM-$LLVM_VERSION failed to compile, exiting"
1817 magic_compile_set llvm-$LLVM_VERSION $llvm_magic
1820 INFO "Done compiling LLVM-$LLVM_VERSION (CLANG included)!"
1822 INFO "Own LLVM-$LLVM_VERSION (CLANG included) is up to date, nothing to do!"
1823 INFO "If you want to force rebuild of this lib, use the --force-llvm option."
1829 _src=$SRC/OpenShadingLanguage-$OSL_VERSION
1831 _inst=$INST/osl-$OSL_VERSION
1832 _inst_shortcut=$INST/osl
1841 if [ "$NO_BUILD" = true ]; then
1842 WARNING "--no-build enabled, OpenShadingLanguage will not be compiled!"
1846 # To be changed each time we make edits that would modify the compiled result!
1850 # Clean install if needed!
1851 magic_compile_check osl-$OSL_VERSION $osl_magic
1852 if [ $? -eq 1 -o "$OSL_FORCE_REBUILD" = true ]; then
1853 #~ rm -Rf $_src # XXX Radical, but not easy to change remote repo fully automatically
1857 if [ ! -d $_inst ]; then
1858 INFO "Building OpenShadingLanguage-$OSL_VERSION"
1862 if [ ! -d $_src ]; then
1865 if [ "$OSL_USE_REPO" = true ]; then
1866 git clone ${OSL_SOURCE_REPO[0]} $_src
1868 download OSL_SOURCE[@] "$_src.tar.gz"
1869 INFO "Unpacking OpenShadingLanguage-$OSL_VERSION"
1870 tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
1877 if [ "$OSL_USE_REPO" = true ]; then
1878 git remote set-url origin ${OSL_SOURCE_REPO[0]}
1879 # XXX For now, always update from latest repo...
1880 git pull --no-edit -X theirs origin $OSL_SOURCE_REPO_BRANCH
1881 # Stick to same rev as windows' libs...
1882 git checkout $OSL_SOURCE_REPO_UID
1885 # XXX Ugly patching hack!
1886 patch -p1 -i "$SCRIPT_DIR/patches/install_deps_osl.diff"
1889 # Always refresh the whole build!
1890 if [ -d build ]; then
1896 cmake_d="-D CMAKE_BUILD_TYPE=Release"
1897 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
1898 cmake_d="$cmake_d -D BUILD_TESTING=OFF"
1899 cmake_d="$cmake_d -D STOP_ON_WARNING=OFF"
1900 cmake_d="$cmake_d -D BUILDSTATIC=OFF"
1901 cmake_d="$cmake_d -D OSL_BUILD_PLUGINS=OFF"
1902 cmake_d="$cmake_d -D OSL_BUILD_TESTS=OFF"
1903 cmake_d="$cmake_d -D USE_SIMD=sse2"
1904 if [ "$USE_CXX11" = true ]; then
1905 cmake_d="$cmake_d -D OSL_BUILD_CPP11=1"
1908 #~ cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
1910 if [ "$_with_built_openexr" = true ]; then
1911 INFO "ILMBASE_HOME=$INST/openexr"
1912 cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr"
1913 # XXX Temp workaround... sigh, ILMBase really messed the things up by defining their custom names ON by default :(
1914 cmake_d="$cmake_d -D ILMBASE_CUSTOM=ON"
1915 cmake_d="$cmake_d -D ILMBASE_CUSTOM_LIBRARIES='Half;Iex;Imath;IlmThread'"
1918 if [ -d $INST/boost ]; then
1919 cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost -D Boost_NO_SYSTEM_PATHS=ON"
1922 if [ -d $INST/oiio ]; then
1923 cmake_d="$cmake_d -D OPENIMAGEIOHOME=$INST/oiio"
1926 if [ ! -z $LLVM_VERSION_FOUND ]; then
1927 cmake_d="$cmake_d -D LLVM_VERSION=$LLVM_VERSION_FOUND"
1928 if [ -d $INST/llvm ]; then
1929 cmake_d="$cmake_d -D LLVM_DIRECTORY=$INST/llvm"
1930 cmake_d="$cmake_d -D LLVM_STATIC=ON"
1934 #~ cmake_d="$cmake_d -D CMAKE_EXPORT_COMPILE_COMMANDS=ON"
1935 #~ cmake_d="$cmake_d -D CMAKE_VERBOSE_MAKEFILE=ON"
1939 make -j$THREADS && make install
1942 if [ -d $_inst ]; then
1943 _create_inst_shortcut
1945 ERROR "OpenShadingLanguage-$OSL_VERSION failed to compile, exiting"
1949 magic_compile_set osl-$OSL_VERSION $osl_magic
1952 INFO "Done compiling OpenShadingLanguage-$OSL_VERSION!"
1954 INFO "Own OpenShadingLanguage-$OSL_VERSION is up to date, nothing to do!"
1955 INFO "If you want to force rebuild of this lib, use the --force-osl option."
1963 _src=$SRC/OpenSubdiv-$OSD_VERSION
1965 _inst=$INST/osd-$OSD_VERSION
1966 _inst_shortcut=$INST/osd
1975 if [ "$NO_BUILD" = true ]; then
1976 WARNING "--no-build enabled, OpenSubdiv will not be compiled!"
1980 # To be changed each time we make edits that would modify the compiled result!
1984 # Clean install if needed!
1985 magic_compile_check osd-$OSD_VERSION $osd_magic
1986 if [ $? -eq 1 -o "$OSD_FORCE_REBUILD" = true ]; then
1990 if [ ! -d $_inst ]; then
1991 INFO "Building OpenSubdiv-$OSD_VERSION"
1995 if [ ! -d $_src ]; then
1998 if [ "$OSD_USE_REPO" = true ]; then
1999 git clone ${OSD_SOURCE_REPO[0]} $_src
2001 download OSD_SOURCE[@] "$_src.tar.gz"
2002 INFO "Unpacking OpenSubdiv-$OSD_VERSION"
2003 tar -C $SRC --transform "s,(.*/?)OpenSubdiv-[^/]*(.*),\1OpenSubdiv-$OSD_VERSION\2,x" \
2010 if [ "$OSD_USE_REPO" = true ]; then
2011 git remote set-url origin ${OSD_SOURCE_REPO[0]}
2012 # XXX For now, always update from latest repo...
2013 git pull --no-edit -X theirs origin $OSD_SOURCE_REPO_BRANCH
2014 # Stick to same rev as windows' libs...
2015 git checkout $OSD_SOURCE_REPO_UID
2019 # Always refresh the whole build!
2020 if [ -d build ]; then
2026 cmake_d="-D CMAKE_BUILD_TYPE=Release"
2027 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
2028 # ptex is only needed when nicholas bishop is ready
2029 cmake_d="$cmake_d -D NO_PTEX=1"
2030 cmake_d="$cmake_d -D NO_CLEW=1 -D NO_CUDA=1 -D NO_OPENCL=1"
2031 # maya plugin, docs, tutorials, regression tests and examples are not needed
2032 cmake_d="$cmake_d -D NO_MAYA=1 -D NO_DOC=1 -D NO_TUTORIALS=1 -D NO_REGRESSION=1 -DNO_EXAMPLES=1"
2036 make -j$THREADS && make install
2039 if [ -d $_inst ]; then
2040 _create_inst_shortcut
2042 ERROR "OpenSubdiv-$OSD_VERSION failed to compile, exiting"
2046 magic_compile_set osd-$OSD_VERSION $osd_magic
2049 INFO "Done compiling OpenSubdiv-$OSD_VERSION!"
2051 INFO "Own OpenSubdiv-$OSD_VERSION is up to date, nothing to do!"
2052 INFO "If you want to force rebuild of this lib, use the --force-osd option."
2058 #### Build Blosc ####
2060 _src=$SRC/c-blosc-$OPENVDB_BLOSC_VERSION
2062 _inst=$INST/blosc-$OPENVDB_BLOSC_VERSION
2063 _inst_shortcut=$INST/blosc
2072 if [ "$NO_BUILD" = true ]; then
2073 WARNING "--no-build enabled, Blosc will not be compiled!"
2077 # To be changed each time we make edits that would modify the compiled result!
2081 # Clean install if needed!
2082 magic_compile_check blosc-$OPENVDB_BLOSC_VERSION $blosc_magic
2083 if [ $? -eq 1 -o "$OPENVDB_FORCE_REBUILD" = true ]; then
2088 if [ ! -d $_inst ]; then
2089 INFO "Building Blosc-$OPENVDB_BLOSC_VERSION"
2091 # Rebuild dependecies as well!
2092 OPENVDB_FORCE_BUILD=true
2093 OPENVDB_FORCE_REBUILD=true
2097 if [ ! -d $_src ]; then
2098 INFO "Downloading Blosc-$OPENVDB_BLOSC_VERSION"
2100 download OPENVDB_BLOSC_SOURCE[@] $_src.tar.gz
2102 INFO "Unpacking Blosc-$OPENVDB_BLOSC_VERSION"
2103 tar -C $SRC -xf $_src.tar.gz
2107 # Always refresh the whole build!
2108 if [ -d build ]; then
2114 cmake_d="-D CMAKE_BUILD_TYPE=Release"
2115 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
2116 cmake_d="$cmake_d -D BUILD_STATIC=OFF"
2117 cmake_d="$cmake_d -D BUILD_TESTS=OFF"
2118 cmake_d="$cmake_d -D BUILD_BENCHMARKS=OFF"
2123 make -j$THREADS && make install
2127 if [ -d $_inst ]; then
2128 _create_inst_shortcut
2130 ERROR "Blosc-$OPENVDB_BLOSC_VERSION failed to compile, exiting"
2134 INFO "Done compiling Blosc-$OPENVDB_BLOSC_VERSION!"
2136 INFO "Own Blosc-$OPENVDB_BLOSC_VERSION is up to date, nothing to do!"
2137 INFO "If you want to force rebuild of this lib (and openvdb), use the --force-openvdb option."
2140 magic_compile_set blosc-$OPENVDB_BLOSC_VERSION $blosc_magic
2142 run_ldconfig "blosc"
2145 #### Build OpenVDB ####
2147 _src=$SRC/openvdb-$OPENVDB_VERSION
2149 _inst=$INST/openvdb-$OPENVDB_VERSION
2150 _inst_shortcut=$INST/openvdb
2159 if [ "$NO_BUILD" = true ]; then
2160 WARNING "--no-build enabled, OpenVDB will not be compiled!"
2167 # To be changed each time we make edits that would modify the compiled result!
2171 # Clean install if needed!
2172 magic_compile_check openvdb-$OPENVDB_VERSION $openvdb_magic
2173 if [ $? -eq 1 -o "$OPENVDB_FORCE_REBUILD" = true ]; then
2177 if [ ! -d $_inst ]; then
2178 INFO "Building OpenVDB-$OPENVDB_VERSION"
2182 if [ ! -d $_src -o true ]; then
2184 download OPENVDB_SOURCE[@] "$_src.tar.gz"
2186 INFO "Unpacking OpenVDB-$OPENVDB_VERSION"
2187 tar -C $SRC -xf $_src.tar.gz
2192 #~ if [ "$OPENVDB_USE_REPO" = true ]; then
2193 #~ git remote set-url origin ${OPENVDB_SOURCE_REPO[0]}
2194 #~ # XXX For now, always update from latest repo...
2195 #~ git pull --no-edit -X theirs origin $OPENVDB_SOURCE_REPO_BRANCH
2196 #~ # Stick to same rev as windows' libs...
2197 #~ git checkout $OPENVDB_SOURCE_REPO_UID
2201 # Source builds here
2204 make_d="DESTDIR=$_inst"
2205 make_d="$make_d HDSO=/usr"
2207 if [ -d $INST/boost ]; then
2208 make_d="$make_d BOOST_INCL_DIR=$INST/boost/include BOOST_LIB_DIR=$INST/boost/lib"
2211 if [ "$_with_built_openexr" = true ]; then
2212 make_d="$make_d ILMBASE_INCL_DIR=$INST/openexr/include ILMBASE_LIB_DIR=$INST/openexr/lib"
2213 make_d="$make_d EXR_INCL_DIR=$INST/openexr/include EXR_LIB_DIR=$INST/openexr/lib"
2214 INFO "ILMBASE_HOME=$INST/openexr"
2217 if [ -d $INST/blosc ]; then
2218 make_d="$make_d BLOSC_INCL_DIR=$INST/blosc/include BLOSC_LIB_DIR=$INST/blosc/lib"
2221 # Build without log4cplus, glfw, python module & docs
2222 make_d="$make_d LOG4CPLUS_INCL_DIR= GLFW_INCL_DIR= PYTHON_VERSION= DOXYGEN="
2224 make -j$THREADS lib $make_d install
2227 if [ -d $_inst ]; then
2228 _create_inst_shortcut
2230 ERROR "OpenVDB-$OPENVDB_VERSION failed to compile, exiting"
2234 magic_compile_set openvdb-$OPENVDB_VERSION $openvdb_magic
2237 INFO "Done compiling OpenVDB-$OPENVDB_VERSION!"
2239 INFO "Own OpenVDB-$OPENVDB_VERSION is up to date, nothing to do!"
2240 INFO "If you want to force rebuild of this lib, use the --force-openvdb option."
2243 run_ldconfig "openvdb"
2246 #### Build Alembic ####
2248 _src=$SRC/alembic-$ALEMBIC_VERSION
2250 _inst=$INST/alembic-$ALEMBIC_VERSION
2251 _inst_shortcut=$INST/alembic
2260 if [ "$NO_BUILD" = true ]; then
2261 WARNING "--no-build enabled, Alembic will not be compiled!"
2265 # To be changed each time we make edits that would modify the compiled result!
2269 # Clean install if needed!
2270 magic_compile_check alembic-$ALEMBIC_VERSION $alembic_magic
2271 if [ $? -eq 1 -o "$ALEMBIC_FORCE_REBUILD" = true ]; then
2275 if [ ! -d $_inst ]; then
2276 INFO "Building Alembic-$ALEMBIC_VERSION"
2280 if [ ! -d $_src -o true ]; then
2282 download ALEMBIC_SOURCE[@] "$_src.tar.gz"
2284 INFO "Unpacking Alembic-$ALEMBIC_VERSION"
2285 tar -C $SRC -xf $_src.tar.gz
2290 cmake_d="-D CMAKE_INSTALL_PREFIX=$_inst"
2292 # Without Boost or TR1, Alembic requires C++11.
2293 if [ "$USE_CXX11" != true ]; then
2294 cmake_d="$cmake_d -D ALEMBIC_LIB_USES_BOOST=ON"
2295 cmake_d="$cmake_d -D ALEMBIC_LIB_USES_TR1=OFF"
2298 if [ -d $INST/boost ]; then
2299 if [ -d $INST/boost ]; then
2300 cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost"
2302 cmake_d="$cmake_d -D USE_STATIC_BOOST=ON"
2304 cmake_d="$cmake_d -D USE_STATIC_BOOST=OFF"
2307 if [ "$_with_built_openexr" = true ]; then
2308 cmake_d="$cmake_d -D ILMBASE_ROOT=$INST/openexr"
2309 cmake_d="$cmake_d -D USE_ARNOLD=OFF"
2310 cmake_d="$cmake_d -D USE_BINARIES=OFF"
2311 cmake_d="$cmake_d -D USE_EXAMPLES=OFF"
2312 cmake_d="$cmake_d -D USE_HDF5=OFF"
2313 cmake_d="$cmake_d -D USE_MAYA=OFF"
2314 cmake_d="$cmake_d -D USE_PRMAN=OFF"
2315 cmake_d="$cmake_d -D USE_PYALEMBIC=OFF"
2316 cmake_d="$cmake_d -D USE_STATIC_HDF5=OFF"
2317 cmake_d="$cmake_d -D ALEMBIC_ILMBASE_LINK_STATIC=OFF"
2318 cmake_d="$cmake_d -D ALEMBIC_SHARED_LIBS=OFF"
2319 INFO "ILMBASE_ROOT=$INST/openexr"
2323 make -j$THREADS install
2326 if [ -d $_inst ]; then
2327 _create_inst_shortcut
2329 ERROR "Alembic-$ALEMBIC_VERSION failed to compile, exiting"
2333 magic_compile_set alembic-$ALEMBIC_VERSION $alembic_magic
2336 INFO "Done compiling Alembic-$ALEMBIC_VERSION!"
2338 INFO "Own Alembic-$ALEMBIC_VERSION is up to date, nothing to do!"
2339 INFO "If you want to force rebuild of this lib, use the --force-alembic option."
2342 run_ldconfig "alembic"
2345 #### Build OpenCOLLADA ####
2346 _init_opencollada() {
2347 _src=$SRC/OpenCOLLADA-$OPENCOLLADA_VERSION
2349 _inst=$INST/opencollada-$OPENCOLLADA_VERSION
2350 _inst_shortcut=$INST/opencollada
2353 clean_OpenCOLLADA() {
2358 compile_OpenCOLLADA() {
2359 if [ "$NO_BUILD" = true ]; then
2360 WARNING "--no-build enabled, OpenCOLLADA will not be compiled!"
2364 # To be changed each time we make edits that would modify the compiled results!
2368 # Clean install if needed!
2369 magic_compile_check opencollada-$OPENCOLLADA_VERSION $opencollada_magic
2370 if [ $? -eq 1 -o "$OPENCOLLADA_FORCE_REBUILD" = true ]; then
2374 if [ ! -d $_inst ]; then
2375 INFO "Building OpenCOLLADA-$OPENCOLLADA_VERSION"
2379 if [ ! -d $_src ]; then
2381 git clone $OPENCOLLADA_SOURCE $_src
2386 # XXX For now, always update from latest repo...
2387 git pull origin $OPENCOLLADA_REPO_BRANCH
2389 # Stick to same rev as windows' libs...
2390 git checkout $OPENCOLLADA_REPO_UID
2393 # Always refresh the whole build!
2394 if [ -d build ]; then
2400 cmake_d="-D CMAKE_BUILD_TYPE=Release"
2401 cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
2402 cmake_d="$cmake_d -D USE_EXPAT=OFF"
2403 cmake_d="$cmake_d -D USE_LIBXML=ON"
2404 # XXX Does not work!
2405 # cmake_d="$cmake_d -D USE_STATIC=OFF"
2406 cmake_d="$cmake_d -D USE_STATIC=ON"
2410 make -j$THREADS && make install
2413 if [ -d $_inst ]; then
2414 _create_inst_shortcut
2416 ERROR "OpenCOLLADA-$OPENCOLLADA_VERSION failed to compile, exiting"
2420 magic_compile_set opencollada-$OPENCOLLADA_VERSION $opencollada_magic
2423 INFO "Done compiling OpenCOLLADA-$OPENCOLLADA_VERSION!"
2425 INFO "Own OpenCOLLADA-$OPENCOLLADA_VERSION is up to date, nothing to do!"
2426 INFO "If you want to force rebuild of this lib, use the --force-opencollada option."
2430 #### Build FFMPEG ####
2432 _src=$SRC/ffmpeg-$FFMPEG_VERSION
2433 _inst=$INST/ffmpeg-$FFMPEG_VERSION
2434 _inst_shortcut=$INST/ffmpeg
2443 if [ "$NO_BUILD" = true ]; then
2444 WARNING "--no-build enabled, ffmpeg will not be compiled!"
2448 # To be changed each time we make edits that would modify the compiled result!
2452 # Clean install if needed!
2453 magic_compile_check ffmpeg-$FFMPEG_VERSION $ffmpeg_magic
2454 if [ $? -eq 1 -o "$FFMPEG_FORCE_REBUILD" = true ]; then
2458 if [ ! -d $_inst ]; then
2459 INFO "Building ffmpeg-$FFMPEG_VERSION"
2463 if [ ! -d $_src ]; then
2464 INFO "Downloading ffmpeg-$FFMPEG_VERSION"
2466 download FFMPEG_SOURCE[@] "$_src.tar.bz2"
2468 INFO "Unpacking ffmpeg-$FFMPEG_VERSION"
2469 tar -C $SRC -xf $_src.tar.bz2
2476 if [ "$VORBIS_USE" = true ]; then
2477 extra="$extra --enable-libvorbis"
2480 if [ "$THEORA_USE" = true ]; then
2481 extra="$extra --enable-libtheora"
2484 if [ "$XVID_USE" = true ]; then
2485 extra="$extra --enable-libxvid"
2488 if [ "$X264_USE" = true ]; then
2489 extra="$extra --enable-libx264"
2492 if [ "$VPX_USE" = true ]; then
2493 extra="$extra --enable-libvpx"
2496 if [ "$MP3LAME_USE" = true ]; then
2497 extra="$extra --enable-libmp3lame"
2500 if [ "$OPENJPEG_USE" = true ]; then
2501 extra="$extra --enable-libopenjpeg"
2504 ./configure --cc="gcc -Wl,--as-needed" \
2505 --extra-ldflags="-pthread -static-libgcc" \
2506 --prefix=$_inst --enable-static \
2507 --disable-ffplay --disable-ffserver --disable-doc \
2509 --enable-avfilter --disable-vdpau \
2510 --disable-bzlib --disable-libgsm --disable-libspeex \
2511 --enable-pthreads --enable-zlib --enable-stripping --enable-runtime-cpudetect \
2512 --disable-vaapi --disable-nonfree --enable-gpl \
2513 --disable-postproc --disable-librtmp --disable-libopencore-amrnb \
2514 --disable-libopencore-amrwb --disable-libdc1394 --disable-version3 --disable-outdev=sdl \
2516 --disable-outdev=xv --disable-indev=sndio --disable-outdev=sndio \
2517 --disable-outdev=alsa --disable-indev=sdl --disable-indev=alsa --disable-indev=jack \
2518 --disable-indev=lavfi $extra
2520 make -j$THREADS && make install
2523 if [ -d $_inst ]; then
2524 _create_inst_shortcut
2526 ERROR "FFmpeg-$FFMPEG_VERSION failed to compile, exiting"
2530 magic_compile_set ffmpeg-$FFMPEG_VERSION $ffmpeg_magic
2533 INFO "Done compiling ffmpeg-$FFMPEG_VERSION!"
2535 INFO "Own ffmpeg-$FFMPEG_VERSION is up to date, nothing to do!"
2536 INFO "If you want to force rebuild of this lib, use the --force-ffmpeg option."
2541 #### Install on DEB-like ####
2542 get_package_version_DEB() {
2543 dpkg-query -W -f '${Version}' $1 | sed -r 's/([0-9]+:)?(([0-9]+\.?)+([0-9]+)).*/\2/'
2546 check_package_DEB() {
2547 r=`apt-cache show $1 | grep -c 'Package:'`
2549 if [ $r -ge 1 ]; then
2556 check_package_installed_DEB() {
2557 r=`dpkg-query -W -f='${Status}' $1 | grep -c "install ok"`
2559 if [ $r -ge 1 ]; then
2566 check_package_version_match_DEB() {
2567 v=`apt-cache policy $1 | grep 'Candidate:' | sed -r 's/.*:\s*([0-9]+:)(([0-9]+\.?)+).*/\2/'`
2569 if [ -z "$v" ]; then
2577 check_package_version_ge_DEB() {
2578 v=`apt-cache policy $1 | grep 'Candidate:' | sed -r 's/.*:\s*([0-9]+:)?(([0-9]+\.?)+).*/\2/'`
2580 if [ -z "$v" ]; then
2588 check_package_version_ge_lt_DEB() {
2589 v=`apt-cache policy $1 | grep 'Candidate:' | sed -r 's/.*:\s*([0-9]+:)?(([0-9]+\.?)+).*/\2/'`
2591 if [ -z "$v" ]; then
2595 version_ge_lt $v $2 $3
2599 install_packages_DEB() {
2600 if [ ! $SUDO ]; then
2601 WARNING "--no-sudo enabled, impossible to run apt-get install for $@, you'll have to do it yourself..."
2603 $SUDO apt-get install -y $@
2604 if [ $? -ge 1 ]; then
2605 ERROR "apt-get failed to install requested packages, exiting."
2613 INFO "Installing dependencies for DEB-based distribution"
2615 PRINT "`eval _echo "$COMMON_INFO"`"
2618 if [ "$NO_CONFIRM" = false ]; then
2619 read -p "Do you want to continue (Y/n)?"
2620 [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" != "y" ] && exit
2623 if [ ! $SUDO ]; then
2624 WARNING "--no-sudo enabled, impossible to run apt-get update, you'll have to do it yourself..."
2626 $SUDO apt-get update
2629 # These libs should always be available in debian/ubuntu official repository...
2630 VORBIS_DEV="libvorbis-dev"
2631 OGG_DEV="libogg-dev"
2632 THEORA_DEV="libtheora-dev"
2634 _packages="gawk cmake cmake-curses-gui build-essential libjpeg-dev libpng-dev libtiff-dev \
2635 git libfreetype6-dev libx11-dev flex bison libtbb-dev libxxf86vm-dev \
2636 libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
2637 libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
2638 libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
2639 libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev"
2640 # libglewmx-dev (broken in deb testing currently...)
2647 # New Ubuntu crap (17.04 and more) have no openjpeg lib!
2648 OPENJPEG_DEV="libopenjpeg-dev"
2649 check_package_DEB $OPENJPEG_DEV
2650 if [ $? -eq 0 ]; then
2651 _packages="$_packages $OPENJPEG_DEV"
2656 # Some not-so-old distro (ubuntu 12.4) do not have it, do not fail in this case, just warn.
2657 YAMLCPP_DEV="libyaml-cpp-dev"
2658 check_package_DEB $YAMLCPP_DEV
2659 if [ $? -eq 0 ]; then
2660 _packages="$_packages $YAMLCPP_DEV"
2663 WARNING "libyaml-cpp-dev not found, you may have to install it by hand to get Blender compiling..."
2667 if [ "$WITH_JACK" = true ]; then
2668 _packages="$_packages libspnav-dev"
2669 # Only install jack if jack2 is not already installed!
2671 JACK2="libjack-jackd2-dev"
2672 check_package_installed_DEB $JACK2
2673 if [ $? -eq 0 ]; then
2674 _packages="$_packages $JACK2"
2676 _packages="$_packages $JACK"
2681 install_packages_DEB $_packages
2684 SNDFILE_DEV="libsndfile1-dev"
2685 check_package_DEB $SNDFILE_DEV
2686 if [ $? -eq 0 ]; then
2687 install_packages_DEB $SNDFILE_DEV
2691 X264_DEV="libx264-dev"
2692 check_package_version_ge_DEB $X264_DEV $X264_VERSION_MIN
2693 if [ $? -eq 0 ]; then
2694 install_packages_DEB $X264_DEV
2698 if [ "$WITH_ALL" = true ]; then
2700 XVID_DEV="libxvidcore-dev"
2701 check_package_DEB $XVID_DEV
2702 if [ $? -eq 0 ]; then
2703 install_packages_DEB $XVID_DEV
2708 MP3LAME_DEV="libmp3lame-dev"
2709 check_package_DEB $MP3LAME_DEV
2710 if [ $? -eq 0 ]; then
2711 install_packages_DEB $MP3LAME_DEV
2716 VPX_DEV="libvpx-dev"
2717 check_package_version_ge_DEB $VPX_DEV $VPX_VERSION_MIN
2718 if [ $? -eq 0 ]; then
2719 install_packages_DEB $VPX_DEV
2724 # Check cmake/glew versions and disable features for older distros.
2725 # This is so Blender can at least compile.
2727 _cmake=`get_package_version_DEB cmake`
2728 version_ge $_cmake "2.8.10"
2729 if [ $? -eq 1 ]; then
2730 version_ge $_cmake "2.8.8"
2731 if [ $? -eq 1 ]; then
2732 WARNING "OpenVDB and OpenCOLLADA disabled because cmake-$_cmake is not enough"
2734 OPENCOLLADA_SKIP=true
2736 WARNING "OpenVDB disabled because cmake-$_cmake is not enough"
2742 _glew=`get_package_version_DEB libglew-dev`
2743 if [ -z $_glew ]; then
2744 # Stupid virtual package in Ubuntu 12.04 doesn't show version number...
2745 _glew=`apt-cache showpkg libglew-dev|tail -n1|awk '{print $2}'|sed 's/-.*//'`
2747 version_ge $_glew "1.9.0"
2748 if [ $? -eq 1 ]; then
2749 version_ge $_glew "1.7.0"
2750 if [ $? -eq 1 ]; then
2751 WARNING "OpenSubdiv disabled because GLEW-$_glew is not enough"
2752 WARNING "Blender will not use system GLEW library"
2756 WARNING "OpenSubdiv will compile with GLEW-$_glew but with limited capability"
2757 WARNING "Blender will not use system GLEW library"
2764 _do_compile_python=false
2765 if [ "$PYTHON_SKIP" = true ]; then
2766 WARNING "Skipping Python/NumPy installation, as requested..."
2767 elif [ "$PYTHON_FORCE_BUILD" = true ]; then
2768 INFO "Forced Python/NumPy building, as requested..."
2769 _do_compile_python=true
2771 check_package_DEB python$PYTHON_VERSION_MIN-dev
2772 if [ $? -eq 0 ]; then
2773 install_packages_DEB python$PYTHON_VERSION_MIN-dev
2776 if [ "$NUMPY_SKIP" = true ]; then
2777 WARNING "Skipping NumPy installation, as requested..."
2779 check_package_DEB python3-numpy
2780 if [ $? -eq 0 ]; then
2781 install_packages_DEB python3-numpy
2783 WARNING "Sorry, using python package but no valid numpy package available!" \
2784 " Use --build-numpy to force building of both Python and NumPy."
2788 _do_compile_python=true
2792 if $_do_compile_python; then
2795 if [ "$NUMPY_SKIP" = true ]; then
2796 WARNING "Skipping NumPy installation, as requested..."
2804 if [ "$BOOST_SKIP" = true ]; then
2805 WARNING "Skipping Boost installation, as requested..."
2806 elif [ "$BOOST_FORCE_BUILD" = true ]; then
2807 INFO "Forced Boost building, as requested..."
2810 check_package_version_ge_DEB libboost-dev $BOOST_VERSION_MIN
2811 if [ $? -eq 0 ]; then
2812 install_packages_DEB libboost-dev
2814 boost_version=$(echo `get_package_version_DEB libboost-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
2816 install_packages_DEB libboost-{filesystem,iostreams,locale,regex,system,thread,wave,program-options}$boost_version-dev
2825 if [ "$OCIO_SKIP" = true ]; then
2826 WARNING "Skipping OpenColorIO installation, as requested..."
2827 elif [ "$OCIO_FORCE_BUILD" = true ]; then
2828 INFO "Forced OpenColorIO building, as requested..."
2831 # XXX Always force build of own OCIO, until linux distro guys update their package to default libyaml-cpp ver (0.5)!
2832 #check_package_version_ge_DEB libopencolorio-dev $OCIO_VERSION_MIN
2833 #if [ $? -eq 0 ]; then
2834 #install_packages_DEB libopencolorio-dev
2843 if [ "$OPENEXR_SKIP" = true ]; then
2844 WARNING "Skipping ILMBase/OpenEXR installation, as requested..."
2845 elif [ "$OPENEXR_FORCE_BUILD" = true ]; then
2846 INFO "Forced ILMBase/OpenEXR building, as requested..."
2849 check_package_version_ge_DEB libopenexr-dev $OPENEXR_VERSION_MIN
2850 if [ $? -eq 0 ]; then
2851 install_packages_DEB libopenexr-dev
2852 OPENEXR_VERSION=`get_package_version_DEB libopenexr-dev`
2853 ILMBASE_VERSION=$OPENEXR_VERSION
2862 if [ "$OIIO_SKIP" = true ]; then
2863 WARNING "Skipping OpenImageIO installation, as requested..."
2864 elif [ "$OIIO_FORCE_BUILD" = true ]; then
2865 INFO "Forced OpenImageIO building, as requested..."
2868 # 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...
2869 #check_package_version_ge_lt_DEB libopenimageio-dev $OIIO_VERSION_MIN $OIIO_VERSION_MAX
2870 #if [ $? -eq 0 -a "$_with_built_openexr" = false ]; then
2871 # install_packages_DEB libopenimageio-dev
2881 _do_compile_llvm=false
2882 if [ "$LLVM_SKIP" = true ]; then
2883 WARNING "Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
2885 elif [ "$LLVM_FORCE_BUILD" = true ]; then
2886 INFO "Forced LLVM building, as requested..."
2887 _do_compile_llvm=true
2889 check_package_DEB clang-$LLVM_VERSION
2890 if [ $? -eq 0 ]; then
2891 install_packages_DEB llvm-$LLVM_VERSION-dev clang-$LLVM_VERSION
2893 LLVM_VERSION_FOUND=$LLVM_VERSION
2896 _do_compile_llvm=true
2900 if [ "$_do_compile_llvm" = true ]; then
2901 install_packages_DEB libffi-dev
2902 # LLVM can't find the debian ffi header dir
2903 _FFI_INCLUDE_DIR=`dpkg -L libffi-dev | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
2907 LLVM_VERSION_FOUND=$LLVM_VERSION
2912 _do_compile_osl=false
2913 if [ "$OSL_SKIP" = true ]; then
2914 WARNING "Skipping OpenShadingLanguage installation, as requested..."
2915 elif [ "$OSL_FORCE_BUILD" = true ]; then
2916 INFO "Forced OpenShadingLanguage building, as requested..."
2917 _do_compile_osl=true
2919 # No package currently!
2920 _do_compile_osl=true
2923 if [ "$_do_compile_osl" = true ]; then
2924 if [ "$have_llvm" = true ]; then
2928 WARNING "No LLVM available, cannot build OSL!"
2934 if [ "$OSD_SKIP" = true ]; then
2935 WARNING "Skipping OpenSubdiv installation, as requested..."
2936 elif [ "$OSD_FORCE_BUILD" = true ]; then
2937 INFO "Forced OpenSubdiv building, as requested..."
2940 # No package currently!
2946 if [ "$OPENVDB_SKIP" = true ]; then
2947 WARNING "Skipping OpenVDB installation, as requested..."
2948 elif [ "$OPENVDB_FORCE_BUILD" = true ]; then
2949 INFO "Forced OpenVDB building, as requested..."
2952 check_package_version_ge_DEB libopenvdb-dev $OPENVDB_VERSION_MIN
2953 if [ $? -eq 0 ]; then
2954 install_packages_DEB libopenvdb-dev libblosc-dev
2962 if [ "$ALEMBIC_SKIP" = true ]; then
2963 WARNING "Skipping Alembic installation, as requested..."
2964 elif [ "$ALEMBIC_FORCE_BUILD" = true ]; then
2965 INFO "Forced Alembic building, as requested..."
2968 # No package currently, only HDF5!
2973 if [ "$WITH_OPENCOLLADA" = true ]; then
2974 _do_compile_collada=false
2976 if [ "$OPENCOLLADA_SKIP" = true ]; then
2977 WARNING "Skipping OpenCOLLADA installation, as requested..."
2978 elif [ "$OPENCOLLADA_FORCE_BUILD" = true ]; then
2979 INFO "Forced OpenCollada building, as requested..."
2980 _do_compile_collada=true
2982 # No package currently!
2983 _do_compile_collada=true
2986 if [ "$_do_compile_collada" = true ]; then
2987 install_packages_DEB libpcre3-dev
2988 # Find path to libxml shared lib...
2989 _XML2_LIB=`dpkg -L libxml2-dev | grep -e ".*/libxml2.so"`
2998 if [ "$FFMPEG_SKIP" = true ]; then
2999 WARNING "Skipping FFMpeg installation, as requested..."
3000 elif [ "$FFMPEG_FORCE_BUILD" = true ]; then
3001 INFO "Forced FFMpeg building, as requested..."
3004 # XXX Debian Testing / Ubuntu 16.04 finally includes FFmpeg, so check as usual
3005 check_package_DEB ffmpeg
3006 if [ $? -eq 0 ]; then
3007 check_package_version_ge_DEB ffmpeg $FFMPEG_VERSION_MIN
3008 if [ $? -eq 0 ]; then
3009 install_packages_DEB libavdevice-dev
3021 #### Install on RPM-like ####
3023 if [ -f /etc/redhat-release ]; then
3024 if [ "`grep '[6-7]\.' /etc/redhat-release`" ]; then
3029 elif [ -f /etc/SuSE-release ]; then
3034 get_package_version_RPM() {
3036 if [ "$RPM" = "RHEL" ]; then
3037 yum info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'
3038 elif [ "$RPM" = "FEDORA" ]; then
3039 dnf info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'
3040 elif [ "$RPM" = "SUSE" ]; then
3041 zypper info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'
3045 check_package_RPM() {
3047 if [ "$RPM" = "RHEL" ]; then
3048 r=`yum info $1 | grep -c 'Summary'`
3049 elif [ "$RPM" = "FEDORA" ]; then
3050 r=`dnf info $1 | grep -c 'Summary'`
3051 elif [ "$RPM" = "SUSE" ]; then
3052 r=`zypper info $1 | grep -c 'Summary'`
3055 if [ $r -ge 1 ]; then
3062 check_package_version_match_RPM() {
3063 v=`get_package_version_RPM $1`
3065 if [ -z "$v" ]; then
3073 check_package_version_ge_RPM() {
3074 v=`get_package_version_RPM $1`
3076 if [ -z "$v" ]; then
3084 check_package_version_ge_lt_RPM() {
3085 v=`get_package_version_RPM $1`
3087 if [ -z "$v" ]; then
3091 version_ge_lt $v $2 $3
3095 install_packages_RPM() {
3097 if [ ! $SUDO ]; then
3098 WARNING "--no-sudo enabled, impossible to install $@, you'll have to do it yourself..."
3100 if [ "$RPM" = "RHEL" ]; then
3101 $SUDO yum install -y $@
3102 if [ $? -ge 1 ]; then
3103 ERROR "yum failed to install requested packages, exiting."
3107 elif [ "$RPM" = "FEDORA" ]; then
3108 $SUDO dnf install -y $@
3109 if [ $? -ge 1 ]; then
3110 ERROR "dnf failed to install requested packages, exiting."
3114 elif [ "$RPM" = "SUSE" ]; then
3115 $SUDO zypper --non-interactive install --auto-agree-with-licenses $@
3116 if [ $? -ge 1 ]; then
3117 ERROR "zypper failed to install requested packages, exiting."
3125 INFO "Installing dependencies for RPM-based distribution"
3127 PRINT "`eval _echo "$COMMON_INFO"`"
3130 if [ "$NO_CONFIRM" = false ]; then
3131 read -p "Do you want to continue (Y/n)?"
3132 [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" != "y" ] && exit
3135 # Enable non-free repositories for all flavours
3136 if [ ! $SUDO ]; then
3137 WARNING "--no-sudo enabled, impossible to install third party repositories, you'll have to do it yourself..."
3140 if [ "$RPM" = "FEDORA" ]; then
3141 _fedora_rel="`egrep "[0-9]{1,}" /etc/fedora-release -o`"
3142 $SUDO dnf -y install --nogpgcheck \
3143 http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$_fedora_rel.noarch.rpm \
3144 http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$_fedora_rel.noarch.rpm
3148 elif [ "$RPM" = "RHEL" ]; then
3149 if [ "`grep '6\.' /etc/redhat-release`" ]; then
3150 ERROR "Building with GCC 4.4 is not supported!"
3153 $SUDO yum -y install --nogpgcheck \
3154 http://download.fedoraproject.org/pub/epel/7/$(uname -i)/e/epel-release-7-6.noarch.rpm \
3155 http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
3160 elif [ "$RPM" = "SUSE" ]; then
3161 # Packman repo now includes name in link...
3162 _suse_rel="`grep -w VERSION /etc/os-release | sed 's/[^0-9.]*//g'`"
3163 _suse_name="`grep -w NAME /etc/os-release | gawk '{print $2}' | sed 's/\"//'`"
3164 if [ $_suse_name ]; then
3165 _suse_rel="${_suse_name}_${_suse_rel}"
3169 INFO "About to add 'packman' repository from http://packman.inode.at/suse/openSUSE_$_suse_rel/"
3170 INFO "This is only needed if you do not already have a packman repository enabled..."
3171 read -p "Do you want to add this repo (Y/n)?"
3172 if [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" == "y" ]; then
3173 INFO " Installing packman..."
3174 $SUDO zypper ar -f -n packman http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_$_suse_rel/ packman
3177 INFO " Skipping packman installation."
3179 $SUDO zypper --non-interactive --gpg-auto-import-keys update --auto-agree-with-licenses
3183 # These libs should always be available in fedora/suse official repository...
3184 OPENJPEG_DEV="openjpeg-devel"
3185 VORBIS_DEV="libvorbis-devel"
3186 OGG_DEV="libogg-devel"
3187 THEORA_DEV="libtheora-devel"
3189 _packages="gcc gcc-c++ git make cmake tar bzip2 xz findutils flex bison \
3190 libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL-devel \
3191 libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
3192 wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
3193 glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
3194 libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel"
3201 if [ "$RPM" = "FEDORA" -o "$RPM" = "RHEL" ]; then
3202 _packages="$_packages freetype-devel tbb-devel"
3204 if [ "$WITH_JACK" = true ]; then
3205 _packages="$_packages jack-audio-connection-kit-devel"
3209 install_packages_RPM $_packages
3212 X264_DEV="x264-devel"
3213 check_package_version_ge_RPM $X264_DEV $X264_VERSION_MIN
3214 if [ $? -eq 0 ]; then
3215 install_packages_RPM $X264_DEV
3219 if [ "$WITH_ALL" = true ]; then
3221 XVID_DEV="xvidcore-devel"
3222 check_package_RPM $XVID_DEV
3223 if [ $? -eq 0 ]; then
3224 install_packages_RPM $XVID_DEV
3229 MP3LAME_DEV="lame-devel"
3230 check_package_RPM $MP3LAME_DEV
3231 if [ $? -eq 0 ]; then
3232 install_packages_RPM $MP3LAME_DEV
3237 elif [ "$RPM" = "SUSE" ]; then
3238 _packages="$_packages freetype2-devel"
3241 install_packages_RPM $_packages
3244 # Install TBB on openSUSE, from temporary repo
3245 check_package_RPM tbb-devel
3246 if [ $? -eq 0 ]; then
3247 install_packages_RPM tbb-devel
3249 $SUDO zypper ar -f http://download.opensuse.org/repositories/devel:/libraries:/c_c++/openSUSE_$_suse_rel/devel:libraries:c_c++.repo
3250 $SUDO zypper -n --gpg-auto-import-keys install tbb-devel
3251 $SUDO zypper rr devel_libraries_c_c++
3255 X264_DEV="libx264-devel"
3256 check_package_version_ge_RPM $X264_DEV $X264_VERSION_MIN
3257 if [ $? -eq 0 ]; then
3258 install_packages_RPM $X264_DEV
3262 if [ "$WITH_ALL" = true ]; then
3264 XVID_DEV="libxvidcore-devel"
3265 check_package_RPM $XVID_DEV
3266 if [ $? -eq 0 ]; then
3267 install_packages_RPM $XVID_DEV
3272 MP3LAME_DEV="libmp3lame-devel"
3273 check_package_RPM $MP3LAME_DEV
3274 if [ $? -eq 0 ]; then
3275 install_packages_RPM $MP3LAME_DEV
3282 SNDFILE_DEV="libsndfile-devel"
3283 check_package_RPM $SNDFILE_DEV
3284 if [ $? -eq 0 ]; then
3285 install_packages_RPM $SNDFILE_DEV
3288 if [ "$WITH_ALL" = true ]; then
3290 VPX_DEV="libvpx-devel"
3291 check_package_version_ge_RPM $VPX_DEV $VPX_VERSION_MIN
3292 if [ $? -eq 0 ]; then
3293 install_packages_RPM $VPX_DEV
3297 install_packages_RPM libspnav-devel
3302 _do_compile_python=false
3303 if [ "$PYTHON_SKIP" = true ]; then
3304 WARNING "Skipping Python installation, as requested..."
3305 elif [ "$PYTHON_FORCE_BUILD" = true ]; then
3306 INFO "Forced Python/NumPy building, as requested..."
3307 _do_compile_python=true
3309 check_package_version_match_RPM python3-devel $PYTHON_VERSION_MIN
3310 if [ $? -eq 0 ]; then
3311 install_packages_RPM python3-devel
3314 if [ "$NUMPY_SKIP" = true ]; then
3315 WARNING "Skipping NumPy installation, as requested..."
3317 check_package_version_ge_RPM python3-numpy $NUMPY_VERSION_MIN
3318 if [ $? -eq 0 ]; then
3319 install_packages_RPM python3-numpy
3321 WARNING "Sorry, using python package but no valid numpy package available!" \
3322 " Use --build-numpy to force building of both Python and NumPy."
3326 _do_compile_python=true
3330 if [ "$_do_compile_python" = true ]; then
3333 if [ "$NUMPY_SKIP" = true ]; then
3334 WARNING "Skipping NumPy installation, as requested..."
3342 _do_compile_boost=false
3343 if [ "$BOOST_SKIP" = true ]; then
3344 WARNING "Skipping Boost installation, as requested..."
3345 elif [ "$BOOST_FORCE_BUILD" = true ]; then
3346 INFO "Forced Boost building, as requested..."
3347 _do_compile_boost=true
3349 check_package_version_ge_RPM boost-devel $BOOST_VERSION_MIN
3350 if [ $? -eq 0 ]; then
3351 install_packages_RPM boost-devel
3354 _do_compile_boost=true
3358 if [ "$_do_compile_boost" = true ]; then
3359 if [ "$RPM" = "SUSE" ]; then
3360 install_packages_RPM gcc-fortran
3362 install_packages_RPM libquadmath-devel bzip2-devel
3370 if [ "$OCIO_SKIP" = true ]; then
3371 WARNING "Skipping OpenColorIO installation, as requested..."
3372 elif [ "$OCIO_FORCE_BUILD" = true ]; then
3373 INFO "Forced OpenColorIO building, as requested..."
3376 if [ "$RPM" = "SUSE" ]; then
3377 check_package_version_ge_RPM OpenColorIO-devel $OCIO_VERSION_MIN
3378 if [ $? -eq 0 ]; then
3379 install_packages_RPM OpenColorIO-devel
3384 # XXX Fedora/RHEL OCIO still depends on libyaml-cpp v0.3 even when system default is v0.5!
3391 if [ "$OPENEXR_SKIP" = true ]; then
3392 WARNING "Skipping ILMBase/OpenEXR installation, as requested..."
3393 elif [ "$OPENEXR_FORCE_BUILD" = true ]; then
3394 INFO "Forced ILMBase/OpenEXR building, as requested..."
3397 check_package_version_ge_RPM openexr-devel $OPENEXR_VERSION_MIN
3398 if [ $? -eq 0 ]; then
3399 install_packages_RPM openexr-devel
3400 OPENEXR_VERSION=`get_package_version_RPM openexr-devel`
3401 ILMBASE_VERSION=$OPENEXR_VERSION
3409 if [ "$OIIO_SKIP" = true ]; then
3410 WARNING "Skipping OpenImageIO installation, as requested..."
3411 elif [ "$OIIO_FORCE_BUILD" = true ]; then
3412 INFO "Forced OpenImageIO building, as requested..."
3415 # XXX RPM distros pulls in too much and depends on old libs, so better to build for now...
3416 #check_package_version_ge_lt_RPM OpenImageIO-devel $OIIO_VERSION_MIN $OIIO_VERSION_MAX
3417 #if [ $? -eq 0 -a $_with_built_openexr == false ]; then
3418 # install_packages_RPM OpenImageIO-devel
3428 _do_compile_llvm=false
3429 if [ "$LLVM_SKIP" = true ]; then
3430 WARNING "Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
3432 elif [ "$LLVM_FORCE_BUILD" = true ]; then
3433 INFO "Forced LLVM building, as requested..."
3434 _do_compile_llvm=true
3436 if [ "$RPM" = "SUSE" ]; then
3437 CLANG_DEV="llvm-clang-devel"
3439 CLANG_DEV="clang-devel"
3441 # XXX RHEL has 3.4 in repo but OSL complains about not finding MCJIT_LIBRARY, so compile for now...
3442 #check_package_version_match_RPM $CLANG_DEV $LLVM_VERSION
3443 #if [ $? -eq 0 ]; then
3444 # install_packages_RPM llvm-devel $CLANG_DEV
3446 # LLVM_VERSION_FOUND=$LLVM_VERSION
3449 _do_compile_llvm=true
3453 if [ "$_do_compile_llvm" = true ]; then
3454 install_packages_RPM libffi-devel
3455 # LLVM can't find the fedora ffi header dir...
3456 _FFI_INCLUDE_DIR=`rpm -ql libffi-devel | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
3460 LLVM_VERSION_FOUND=$LLVM_VERSION
3465 _do_compile_osl=false
3466 if [ "$OSL_SKIP" = true ]; then
3467 WARNING "Skipping OpenShadingLanguage installation, as requested..."
3468 elif [ "$OSL_FORCE_BUILD" = true ]; then
3469 INFO "Forced OpenShadingLanguage building, as requested..."
3470 _do_compile_osl=true
3472 # No package currently!
3473 _do_compile_osl=true
3476 if [ "$_do_compile_osl" = true ]; then
3477 if [ "$have_llvm" = true ]; then
3481 WARNING "No LLVM available, cannot build OSL!"
3487 if [ "$OSD_SKIP" = true ]; then
3488 WARNING "Skipping OpenSubdiv installation, as requested..."
3489 elif [ "$OSD_FORCE_BUILD" = true ]; then
3490 INFO "Forced OpenSubdiv building, as requested..."
3493 # No package currently!
3499 if [ "$OPENVDB_SKIP" = true ]; then
3500 WARNING "Skipping OpenVDB installation, as requested..."
3501 elif [ "$OPENVDB_FORCE_BUILD" = true ]; then
3502 INFO "Forced OpenVDB building, as requested..."
3505 # No package currently!
3510 if [ "$ALEMBIC_SKIP" = true ]; then
3511 WARNING "Skipping Alembic installation, as requested..."
3512 elif [ "$ALEMBIC_FORCE_BUILD" = true ]; then
3513 INFO "Forced Alembic building, as requested..."
3516 # No package currently!
3521 if [ "$WITH_OPENCOLLADA" = true ]; then
3523 _do_compile_collada=false
3524 if [ "$OPENCOLLADA_SKIP" = true ]; then
3525 WARNING "Skipping OpenCOLLADA installation, as requested..."
3526 elif [ "$OPENCOLLADA_FORCE_BUILD" = true ]; then
3527 INFO "Forced OpenCollada building, as requested..."
3528 _do_compile_collada=true
3531 _do_compile_collada=true
3534 if [ "$_do_compile_collada" = true ]; then
3535 install_packages_RPM pcre-devel
3536 # Find path to libxml shared lib...
3537 _XML2_LIB=`rpm -ql libxml2-devel | grep -e ".*/libxml2.so"`
3545 if [ "$FFMPEG_SKIP" = true ]; then
3546 WARNING "Skipping FFMpeg installation, as requested..."
3547 elif [ "$FFMPEG_FORCE_BUILD" = true ]; then
3548 INFO "Forced FFMpeg building, as requested..."
3551 check_package_version_ge_RPM ffmpeg-devel $FFMPEG_VERSION_MIN
3552 if [ $? -eq 0 ]; then
3553 install_packages_RPM ffmpeg ffmpeg-devel
3562 #### Install on ARCH-like ####
3563 get_package_version_ARCH() {
3564 pacman -Si $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+?(([0-9]+\.?)+).*/\1/'
3567 check_package_ARCH() {
3568 r=`pacman -Si $1 | grep -c 'Description'`
3570 if [ $r -ge 1 ]; then
3577 check_package_version_match_ARCH() {
3578 v=`get_package_version_ARCH $1`
3580 if [ -z "$v" ]; then
3588 check_package_version_ge_ARCH() {
3589 v=`get_package_version_ARCH $1`
3591 if [ -z "$v" ]; then
3599 check_package_version_ge_lt_ARCH() {
3600 v=`get_package_version_ARCH $1`
3602 if [ -z "$v" ]; then
3606 version_ge_lt $v $2 $3
3610 install_packages_ARCH() {
3611 if [ ! $SUDO ]; then
3612 WARNING "--no-sudo enabled, impossible to run pacman for $@, you'll have to do it yourself..."
3614 $SUDO pacman -S --needed --noconfirm $@
3615 if [ $? -ge 1 ]; then
3616 ERROR "pacman failed to install requested packages, exiting."
3624 INFO "Installing dependencies for ARCH-based distribution"
3626 PRINT "`eval _echo "$COMMON_INFO"`"
3629 if [ "$NO_CONFIRM" = false ]; then
3630 read -p "Do you want to continue (Y/n)?"
3631 [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" != "y" ] && exit
3636 if [ ! -x "/usr/bin/sudo" ]; then
3638 ERROR "This script requires sudo but it is not installed."
3639 PRINT "Please setup sudo according to:"
3640 PRINT "https://wiki.archlinux.org/index.php/Sudo"
3641 PRINT "and try again."
3647 if [ ! $SUDO ]; then
3648 WARNING "--no-sudo enabled, impossible to run pacman -Sy, you'll have to do it yourself..."
3653 # These libs should always be available in arch official repository...
3654 OPENJPEG_DEV="openjpeg"
3655 VORBIS_DEV="libvorbis"
3657 THEORA_DEV="libtheora"
3659 BASE_DEVEL="base-devel"
3661 # Avoid conflicts when gcc-multilib is installed
3662 pacman -Qi gcc-multilib &>/dev/null
3663 if [ $? -eq 0 ]; then
3664 BASE_DEVEL=`pacman -Sgq base-devel | sed -e 's/^gcc$/gcc-multilib/g' | paste -s -d' '`
3667 _packages="$BASE_DEVEL git cmake \
3668 libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
3669 $OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl fftw intel-tbb \
3670 libxml2 yaml-cpp tinyxml python-requests jemalloc"
3677 if [ "$WITH_ALL" = true ]; then
3678 _packages="$_packages libspnav"
3681 if [ "$WITH_JACK" = true ]; then
3682 _packages="$_packages jack"
3686 install_packages_ARCH $_packages
3689 SNDFILE_DEV="libsndfile"