Changeset View
Changeset View
Standalone View
Standalone View
build_files/build_environment/install_deps.sh
| Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | --force-oiio | ||||
| Force the rebuild of OpenImageIO. | Force the rebuild of OpenImageIO. | ||||
| --force-llvm | --force-llvm | ||||
| Force the rebuild of LLVM. | Force the rebuild of LLVM. | ||||
| --force-osl | --force-osl | ||||
| Force the rebuild of OpenShadingLanguage. | Force the rebuild of OpenShadingLanguage. | ||||
| --force-osd | |||||
| Force the rebuild of OpenSubdiv. | |||||
| --force-opencollada | --force-opencollada | ||||
| Force the rebuild of OpenCOLLADA. | Force the rebuild of OpenCOLLADA. | ||||
| --force-ffmpeg | --force-ffmpeg | ||||
| Force the rebuild of FFMpeg. | Force the rebuild of FFMpeg. | ||||
| Note about the --force-foo options: | Note about the --force-foo options: | ||||
| * They obviously only have an effect if those libraries are built by this script | * They obviously only have an effect if those libraries are built by this script | ||||
| Show All 20 Lines | --skip-oiio | ||||
| Unconditionally skip OpenImageIO installation/building. | Unconditionally skip OpenImageIO installation/building. | ||||
| --skip-llvm | --skip-llvm | ||||
| Unconditionally skip LLVM installation/building. | Unconditionally skip LLVM installation/building. | ||||
| --skip-osl | --skip-osl | ||||
| Unconditionally skip OpenShadingLanguage installation/building. | Unconditionally skip OpenShadingLanguage installation/building. | ||||
| --skip-osd | |||||
| Unconditionally skip OpenSubdiv installation/building. | |||||
| --skip-opencollada | --skip-opencollada | ||||
| Unconditionally skip OpenCOLLADA installation/building. | Unconditionally skip OpenCOLLADA installation/building. | ||||
| --skip-ffmpeg | --skip-ffmpeg | ||||
| Unconditionally skip FFMpeg installation/building. | Unconditionally skip FFMpeg installation/building. | ||||
| --required-numpy | --required-numpy | ||||
| Use this in case your distro features a valid python package, but no matching Numpy one. | Use this in case your distro features a valid python package, but no matching Numpy one. | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
| LLVM_SKIP=false | LLVM_SKIP=false | ||||
| # OSL needs to be compiled for now! | # OSL needs to be compiled for now! | ||||
| OSL_VERSION="1.5.11" | OSL_VERSION="1.5.11" | ||||
| OSL_VERSION_MIN=$OSL_VERSION | OSL_VERSION_MIN=$OSL_VERSION | ||||
| OSL_FORCE_REBUILD=false | OSL_FORCE_REBUILD=false | ||||
| OSL_SKIP=false | OSL_SKIP=false | ||||
| # OpenSubdiv needs to be compiled for now | |||||
| OSD_VERSION="3.0.2" | |||||
| OSD_VERSION_MIN=$OSD_VERSION | |||||
| OSD_FORCE_REBUILD=false | |||||
| OSD_SKIP=false | |||||
| # Version?? | # Version?? | ||||
| OPENCOLLADA_VERSION="1.3" | OPENCOLLADA_VERSION="1.3" | ||||
| OPENCOLLADA_FORCE_REBUILD=false | OPENCOLLADA_FORCE_REBUILD=false | ||||
| OPENCOLLADA_SKIP=false | OPENCOLLADA_SKIP=false | ||||
| FFMPEG_VERSION="2.1.5" | FFMPEG_VERSION="2.1.5" | ||||
| FFMPEG_VERSION_MIN="2.1.5" | FFMPEG_VERSION_MIN="2.1.5" | ||||
| FFMPEG_FORCE_REBUILD=false | FFMPEG_FORCE_REBUILD=false | ||||
| ▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | --force-all) | ||||
| PYTHON_FORCE_REBUILD=true | PYTHON_FORCE_REBUILD=true | ||||
| NUMPY_FORCE_REBUILD=true | NUMPY_FORCE_REBUILD=true | ||||
| BOOST_FORCE_REBUILD=true | BOOST_FORCE_REBUILD=true | ||||
| OCIO_FORCE_REBUILD=true | OCIO_FORCE_REBUILD=true | ||||
| OPENEXR_FORCE_REBUILD=true | OPENEXR_FORCE_REBUILD=true | ||||
| OIIO_FORCE_REBUILD=true | OIIO_FORCE_REBUILD=true | ||||
| LLVM_FORCE_REBUILD=true | LLVM_FORCE_REBUILD=true | ||||
| OSL_FORCE_REBUILD=true | OSL_FORCE_REBUILD=true | ||||
| OSD_FORCE_REBUILD=true | |||||
| OPENCOLLADA_FORCE_REBUILD=true | OPENCOLLADA_FORCE_REBUILD=true | ||||
| FFMPEG_FORCE_REBUILD=true | FFMPEG_FORCE_REBUILD=true | ||||
| shift; continue | shift; continue | ||||
| ;; | ;; | ||||
| --force-python) | --force-python) | ||||
| PYTHON_FORCE_REBUILD=true | PYTHON_FORCE_REBUILD=true | ||||
| NUMPY_FORCE_REBUILD=true | NUMPY_FORCE_REBUILD=true | ||||
| shift; continue | shift; continue | ||||
| Show All 17 Lines | case $1 in | ||||
| --force-llvm) | --force-llvm) | ||||
| LLVM_FORCE_REBUILD=true | LLVM_FORCE_REBUILD=true | ||||
| OSL_FORCE_REBUILD=true | OSL_FORCE_REBUILD=true | ||||
| shift; continue | shift; continue | ||||
| ;; | ;; | ||||
| --force-osl) | --force-osl) | ||||
| OSL_FORCE_REBUILD=true; shift; continue | OSL_FORCE_REBUILD=true; shift; continue | ||||
| ;; | ;; | ||||
| --force-osd) | |||||
| OSD_FORCE_REBUILD=true; shift; continue | |||||
| ;; | |||||
| --force-opencollada) | --force-opencollada) | ||||
| OPENCOLLADA_FORCE_REBUILD=true; shift; continue | OPENCOLLADA_FORCE_REBUILD=true; shift; continue | ||||
| ;; | ;; | ||||
| --force-ffmpeg) | --force-ffmpeg) | ||||
| FFMPEG_FORCE_REBUILD=true; shift; continue | FFMPEG_FORCE_REBUILD=true; shift; continue | ||||
| ;; | ;; | ||||
| --skip-python) | --skip-python) | ||||
| PYTHON_SKIP=true; shift; continue | PYTHON_SKIP=true; shift; continue | ||||
| Show All 14 Lines | --skip-oiio) | ||||
| OIIO_SKIP=true; shift; continue | OIIO_SKIP=true; shift; continue | ||||
| ;; | ;; | ||||
| --skip-llvm) | --skip-llvm) | ||||
| LLVM_SKIP=true; shift; continue | LLVM_SKIP=true; shift; continue | ||||
| ;; | ;; | ||||
| --skip-osl) | --skip-osl) | ||||
| OSL_SKIP=true; shift; continue | OSL_SKIP=true; shift; continue | ||||
| ;; | ;; | ||||
| --skip-osd) | |||||
| OSD_SKIP=true; shift; continue | |||||
| ;; | |||||
| --skip-opencollada) | --skip-opencollada) | ||||
| OPENCOLLADA_SKIP=true; shift; continue | OPENCOLLADA_SKIP=true; shift; continue | ||||
| ;; | ;; | ||||
| --skip-ffmpeg) | --skip-ffmpeg) | ||||
| FFMPEG_SKIP=true; shift; continue | FFMPEG_SKIP=true; shift; continue | ||||
| ;; | ;; | ||||
| --required-numpy) | --required-numpy) | ||||
| NUMPY_REQUIRED=true; shift; continue | NUMPY_REQUIRED=true; shift; continue | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
| #~ OSL_SOURCE_REPO=( "https://github.com/imageworks/OpenShadingLanguage.git" ) | #~ OSL_SOURCE_REPO=( "https://github.com/imageworks/OpenShadingLanguage.git" ) | ||||
| #~ OSL_SOURCE_REPO=( "https://github.com/mont29/OpenShadingLanguage.git" ) | #~ OSL_SOURCE_REPO=( "https://github.com/mont29/OpenShadingLanguage.git" ) | ||||
| #~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395" | #~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395" | ||||
| #~ OSL_SOURCE_REPO_BRANCH="master" | #~ OSL_SOURCE_REPO_BRANCH="master" | ||||
| OSL_SOURCE_REPO=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" ) | OSL_SOURCE_REPO=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" ) | ||||
| OSL_SOURCE_REPO_UID="22ee5ea298fd215430dfbd160b5aefd507f06db0" | OSL_SOURCE_REPO_UID="22ee5ea298fd215430dfbd160b5aefd507f06db0" | ||||
| OSL_SOURCE_REPO_BRANCH="blender-fixes" | OSL_SOURCE_REPO_BRANCH="blender-fixes" | ||||
| OSD_USE_REPO=true | |||||
| OSD_SOURCE=( "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v3_0_2.tar.gz" ) | |||||
sergey: v3_0_2 is to be replaced with `OSD_VERSION`? | |||||
Done Inline Actions100% ack .. will change that! plasmasolutions: 100% ack .. will change that! | |||||
| OSD_SOURCE_REPO=( "https://github.com/PixarAnimationStudios/OpenSubdiv.git" ) | |||||
| OSD_SOURCE_REPO_UID="404659fffa659da075d1c9416e4fc939139a84ee" | |||||
| OSD_SOURCE_REPO_BRANCH="dev" | |||||
| OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" ) | OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" ) | ||||
| OPENCOLLADA_REPO_UID="3335ac164e68b2512a40914b14c74db260e6ff7d" | OPENCOLLADA_REPO_UID="3335ac164e68b2512a40914b14c74db260e6ff7d" | ||||
| FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" ) | FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" ) | ||||
| ##### Generic Helpers ##### | ##### Generic Helpers ##### | ||||
| # Check return code of wget for success... | # Check return code of wget for success... | ||||
| ▲ Show 20 Lines • Show All 997 Lines • ▼ Show 20 Lines | compile_OSL() { | ||||
| else | else | ||||
| INFO "Own OpenShadingLanguage-$OSL_VERSION is up to date, nothing to do!" | INFO "Own OpenShadingLanguage-$OSL_VERSION is up to date, nothing to do!" | ||||
| INFO "If you want to force rebuild of this lib, use the --force-osl option." | INFO "If you want to force rebuild of this lib, use the --force-osl option." | ||||
| fi | fi | ||||
| run_ldconfig "osl" | run_ldconfig "osl" | ||||
| } | } | ||||
| #### Build OSD #### | |||||
| _init_osd() { | |||||
| _src=$SRC/OpenSubdiv-$OSD_VERSION | |||||
| _git=true | |||||
| _inst=$INST/osd-$OSD_VERSION | |||||
| _inst_shortcut=$INST/osd | |||||
| } | |||||
| clean_OSD() { | |||||
| _init_osd | |||||
| _clean | |||||
| } | |||||
| compile_OSD() { | |||||
| # To be changed each time we make edits that would modify the compiled result! | |||||
| osd_magic=0 | |||||
| _init_osd | |||||
| # Clean install if needed! | |||||
| magic_compile_check osd-$OSD_VERSION $osd_magic | |||||
| if [ $? -eq 1 -o $OSD_FORCE_REBUILD == true ]; then | |||||
| clean_OSD | |||||
| fi | |||||
| if [ ! -d $_inst ]; then | |||||
| INFO "Building OpenSubdiv-$OSD_VERSION" | |||||
| prepare_opt | |||||
| if [ ! -d $_src ]; then | |||||
| mkdir -p $SRC | |||||
| if [ $OSD_USE_REPO == true ]; then | |||||
| git clone ${OSD_SOURCE_REPO[0]} $_src | |||||
| else | |||||
| download OSD_SOURCE[@] "$_src.tar.gz" | |||||
| INFO "Unpacking OpenSubdiv-$OSD_VERSION" | |||||
| tar -C $SRC --transform "s,(.*/?)OpenSubdiv-[^/]*(.*),\1OpenSubdiv-$OSD_VERSION\2,x" \ | |||||
| -xf $_src.tar.gz | |||||
| fi | |||||
| fi | |||||
| cd $_src | |||||
| if [ $OSD_USE_REPO == true ]; then | |||||
| git remote set-url origin ${OSD_SOURCE_REPO[0]} | |||||
| # XXX For now, always update from latest repo... | |||||
| git pull --no-edit -X theirs origin $OSD_SOURCE_REPO_BRANCH | |||||
| # Stick to same rev as windows' libs... | |||||
| git checkout $OSD_SOURCE_REPO_UID | |||||
| git reset --hard | |||||
| fi | |||||
| # Always refresh the whole build! | |||||
| if [ -d build ]; then | |||||
| rm -rf build | |||||
| fi | |||||
| mkdir build | |||||
| cd build | |||||
| cmake_d="-D CMAKE_BUILD_TYPE=Release" | |||||
| cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst" | |||||
| # ptex is only needed when nicholas bishop is ready | |||||
| cmake_d="$cmake_d -D NO_PTEX=1" | |||||
| cmake_d="$cmake_d -D NO_CLEW=1" | |||||
| # maya plugin, docs, tutorials, regression tests and examples are not needed | |||||
| cmake_d="$cmake_d -D NO_MAYA=1 -D NO_DOC=1 -D NO_TUTORIALS=1 -D NO_REGRESSION=1 -DNO_EXAMPLES=1" | |||||
| cmake $cmake_d .. | |||||
| make -j$THREADS && make install | |||||
| make clean | |||||
| if [ -d $_inst ]; then | |||||
| _create_inst_shortcut | |||||
| else | |||||
| ERROR "OpenSubdiv-$OSD_VERSION failed to compile, exiting" | |||||
| exit 1 | |||||
| fi | |||||
| magic_compile_set osd-$OSD_VERSION $osd_magic | |||||
| cd $CWD | |||||
| INFO "Done compiling OpenSubdiv-$OSD_VERSION!" | |||||
| else | |||||
| INFO "Own OpenSubdiv-$OSD_VERSION is up to date, nothing to do!" | |||||
| INFO "If you want to force rebuild of this lib, use the --force-osd option." | |||||
| fi | |||||
| run_ldconfig "osd" | |||||
| } | |||||
| #### Build OpenCOLLADA #### | #### Build OpenCOLLADA #### | ||||
| _init_opencollada() { | _init_opencollada() { | ||||
| _src=$SRC/OpenCOLLADA-$OPENCOLLADA_VERSION | _src=$SRC/OpenCOLLADA-$OPENCOLLADA_VERSION | ||||
| _git=true | _git=true | ||||
| _inst=$INST/opencollada-$OPENCOLLADA_VERSION | _inst=$INST/opencollada-$OPENCOLLADA_VERSION | ||||
| _inst_shortcut=$INST/opencollada | _inst_shortcut=$INST/opencollada | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | install_DEB() { | ||||
| VORBIS_DEV="libvorbis-dev" | VORBIS_DEV="libvorbis-dev" | ||||
| OGG_DEV="libogg-dev" | OGG_DEV="libogg-dev" | ||||
| THEORA_DEV="libtheora-dev" | THEORA_DEV="libtheora-dev" | ||||
| _packages="gawk cmake cmake-curses-gui scons build-essential libjpeg-dev libpng-dev \ | _packages="gawk cmake cmake-curses-gui scons build-essential libjpeg-dev libpng-dev \ | ||||
| libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev \ | libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev \ | ||||
| libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \ | libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \ | ||||
| libopenal-dev libglew-dev libglewmx-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \ | libopenal-dev libglew-dev libglewmx-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \ | ||||
| libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev" | libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libxrandr-dev \ | ||||
| libxinerama-dev" | |||||
| OPENJPEG_USE=true | OPENJPEG_USE=true | ||||
| VORBIS_USE=true | VORBIS_USE=true | ||||
| OGG_USE=true | OGG_USE=true | ||||
| THEORA_USE=true | THEORA_USE=true | ||||
| PRINT "$LIBYAML_CPP_VER" | PRINT "$LIBYAML_CPP_VER" | ||||
| # Some not-so-old distro (ubuntu 12.4) do not have it, do not fail in this case, just warn. | # Some not-so-old distro (ubuntu 12.4) do not have it, do not fail in this case, just warn. | ||||
| ▲ Show 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | if $have_llvm; then | ||||
| # No package currently! | # No package currently! | ||||
| PRINT "" | PRINT "" | ||||
| compile_OSL | compile_OSL | ||||
| else | else | ||||
| WARNING "No LLVM available, cannot build OSL!" | WARNING "No LLVM available, cannot build OSL!" | ||||
| fi | fi | ||||
| fi | fi | ||||
| PRINT "" | |||||
| if $OSD_SKIP; then | |||||
| WARNING "Skipping OpenSubdiv installation, as requested..." | |||||
| else | |||||
| if $have_llvm; then | |||||
| install_packages_DEB flex bison libtbb-dev | |||||
| # No package currently! | |||||
| PRINT "" | |||||
| compile_OSD | |||||
| else | |||||
| WARNING "No LLVM available, cannot build OSD!" | |||||
| fi | |||||
| fi | |||||
| if $WITH_OPENCOLLADA; then | if $WITH_OPENCOLLADA; then | ||||
| PRINT "" | PRINT "" | ||||
| if $OPENCOLLADA_SKIP; then | if $OPENCOLLADA_SKIP; then | ||||
| WARNING "Skipping OpenCOLLADA installation, as requested..." | WARNING "Skipping OpenCOLLADA installation, as requested..." | ||||
| else | else | ||||
| install_packages_DEB libpcre3-dev | install_packages_DEB libpcre3-dev | ||||
| # Find path to libxml shared lib... | # Find path to libxml shared lib... | ||||
| _XML2_LIB=`dpkg -L libxml2-dev | grep -e ".*/libxml2.so"` | _XML2_LIB=`dpkg -L libxml2-dev | grep -e ".*/libxml2.so"` | ||||
| ▲ Show 20 Lines • Show All 887 Lines • ▼ Show 20 Lines | if [ "$OSL_SKIP" = false ]; then | ||||
| _1="-D WITH_CYCLES_OSL=ON" | _1="-D WITH_CYCLES_OSL=ON" | ||||
| _2="-D WITH_LLVM=ON" | _2="-D WITH_LLVM=ON" | ||||
| _3="-D LLVM_VERSION=$LLVM_VERSION_FOUND" | _3="-D LLVM_VERSION=$LLVM_VERSION_FOUND" | ||||
| PRINT " $_1" | PRINT " $_1" | ||||
| PRINT " $_2" | PRINT " $_2" | ||||
| PRINT " $_3" | PRINT " $_3" | ||||
| _buildargs="$_buildargs $_1 $_2 $_3" | _buildargs="$_buildargs $_1 $_2 $_3" | ||||
| if [ -d $INST/osl ]; then | if [ -d $INST/osl ]; then | ||||
| _1="-D CYCLES_OSL=$INST/osl" | _1="-D CYCLES_OSL=$INST/osl/include" | ||||
| PRINT " $_1" | PRINT " $_1" | ||||
| _buildargs="$_buildargs $_1" | _buildargs="$_buildargs $_1" | ||||
| fi | fi | ||||
| if [ -d $INST/llvm ]; then | if [ -d $INST/llvm ]; then | ||||
| _1="-D LLVM_ROOT_DIR=$INST/llvm" | _1="-D LLVM_ROOT_DIR=$INST/llvm" | ||||
| _2="-D LLVM_STATIC=ON" | _2="-D LLVM_STATIC=ON" | ||||
| PRINT " $_1" | PRINT " $_1" | ||||
| PRINT " $_2" | PRINT " $_2" | ||||
| _buildargs="$_buildargs $_1 $_2" | _buildargs="$_buildargs $_1 $_2" | ||||
| fi | fi | ||||
| else | else | ||||
| _1="-D WITH_CYCLES_OSL=OFF" | _1="-D WITH_CYCLES_OSL=OFF" | ||||
| _2="-D WITH_LLVM=OFF" | _2="-D WITH_LLVM=OFF" | ||||
| PRINT " $_1" | PRINT " $_1" | ||||
| PRINT " $_2" | PRINT " $_2" | ||||
| _buildargs="$_buildargs $_1 $_2" | _buildargs="$_buildargs $_1 $_2" | ||||
| fi | fi | ||||
| if [ -d $INST/osd ]; then | |||||
| _1="-D WITH_OPENSUBDIV=ON" | |||||
| _2="-D OPENSUBDIV_INCLUDE_DIR=$INST/osd/include" | |||||
| _3="-D OPENSUBDIV_OSDCPU_LIBRARY=$INST/osd/lib/libosdCPU.so" | |||||
| _4="-D OPENSUBDIV_OSDGPU_LIBRARY=$INST/osd/lib/libosdGPU.so" | |||||
Not Done Inline ActionsReplace those three by single: _2="-D OPENSUBDIV_ROOT_DIR=$INST/osd" Also, below we lack the scons options, something like: if [ "$OSD_SKIP" = false ]; then
PRINT "WITH_BF_OPENSUBDIV = True"
if [ -d $INST/osd ]; then
PRINT "BF_OPENSUBDIV = '$INST/osd'"
fi
fimont29: Replace those three by single:
_2="-D OPENSUBDIV_ROOT_DIR=$INST/osd"
Also, below we lack… | |||||
| PRINT " $_1" | |||||
| PRINT " $_2" | |||||
| PRINT " $_3" | |||||
| PRINT " $_4" | |||||
| _buildargs="$_buildargs $_1 $_2 $_3 $_4" | |||||
| fi | |||||
| if $WITH_OPENCOLLADA; then | if $WITH_OPENCOLLADA; then | ||||
| _1="-D WITH_OPENCOLLADA=ON" | _1="-D WITH_OPENCOLLADA=ON" | ||||
| PRINT " $_1" | PRINT " $_1" | ||||
| _buildargs="$_buildargs $_1" | _buildargs="$_buildargs $_1" | ||||
| fi | fi | ||||
| if [ "$FFMPEG_SKIP" = false ]; then | if [ "$FFMPEG_SKIP" = false ]; then | ||||
| _1="-D WITH_CODEC_FFMPEG=ON" | _1="-D WITH_CODEC_FFMPEG=ON" | ||||
| ▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines | |||||
v3_0_2 is to be replaced with OSD_VERSION?