28
--long source:,install:,tmp:,threads:,help,with-all,with-osl,with-opencollada,all-static,force-all,\
28
--long source:,install:,tmp:,threads:,help,with-all,with-opencollada,all-static,force-all,\
29
29
force-python,force-numpy,force-boost,force-ocio,force-oiio,force-llvm,force-osl,force-opencollada,\
30
30
force-ffmpeg,skip-python,skip-numpy,skip-boost,skip-ocio,skip-oiio,skip-llvm,skip-osl,skip-ffmpeg,\
31
skip-opencollada,required-numpy \
42
42
# Do not install some optional, potentially conflicting libs by default...
45
# Do not yet enable osl, use --with-osl (or --with-all) option to try it.
48
45
# Do not yet enable opencollada, use --with-opencollada (or --with-all) option to try it.
49
46
WITH_OPENCOLLADA=false
51
48
# Try to link everything statically. Use this to produce portable versions of blender.
54
THREADS=`cat /proc/cpuinfo | grep cores | uniq | sed -e "s/.*: *\(.*\)/\\1/"`
51
THREADS=`cat /proc/cpuinfo | grep processor | wc -l`
55
52
if [ -z "$THREADS" ]; then
64
61
Number of threads for building: \$THREADS (automatically detected, use --threads=<nbr> to override it).
65
62
Full install: \$WITH_ALL (use --with-all option to enable it).
66
Building OSL: \$WITH_OSL (use --with-osl option to enable it).
67
63
Building OpenCOLLADA: \$WITH_OPENCOLLADA (use --with-opencollada option to enable it).
68
64
All static linking: \$ALL_STATIC (use --all-static option to enable it).
96
92
how your package system is set…).
97
93
Note this option also implies all other (more specific) --with-foo options below.
100
Try to install or build the OpenShadingLanguage libraries (and their dependencies).
103
95
--with-opencollada
104
96
Build and install the OpenCOLLADA libraries.
174
166
Unconditionally skip OpenCOLLADA installation/building.
177
Unconditionally skip FFMpeg installation/building.\""
169
Unconditionally skip FFMpeg installation/building.
172
Use this in case your distro features a valid python package, but no matching Numpy one.
173
It will force compilation of both python 3.3 and numpy 1.7.\""
179
175
##### Main Vars #####
181
PYTHON_VERSION="3.3.0"
177
PYTHON_VERSION="3.3.2"
182
178
PYTHON_VERSION_MIN="3.3"
183
179
PYTHON_SOURCE="http://python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.bz2"
184
180
PYTHON_FORCE_REBUILD=false
551
549
ln -s $_inst $_inst_shortcut
554
_lib_path="$INST/$1/lib"
555
_ldconf_path="/etc/ld.so.conf.d/$1.conf"
557
INFO "Running ldconfig for $1..."
558
sudo sh -c "echo \"$_lib_path\" > $_ldconf_path"
559
sudo /sbin/ldconfig # XXX OpenSuse does not include sbin in command path with sudo!!!
554
563
#### Build Python ####
556
565
_src=$SRC/Python-$PYTHON_VERSION
593
./configure --prefix=$_inst --enable-ipv6 \
602
./configure --prefix=$_inst --libdir=$_inst/lib --enable-ipv6 \
594
603
--enable-loadable-sqlite-extensions --with-dbmliborder=bdb \
595
604
--with-computed-gotos --with-pymalloc
631
640
compile_Numpy() {
632
641
# To be changed each time we make edits that would modify the compiled result!
636
645
# Clean install if needed!
637
magic_compile_check numpy-$NUMPY_VERSION $py_magic
646
magic_compile_check numpy-$NUMPY_VERSION $numpy_magic
638
647
if [ $? -eq 1 -o $NUMPY_FORCE_REBUILD == true ]; then
924
933
ERROR "ILMBase-$ILMBASE_VERSION failed to compile, exiting"
937
INFO "Done compiling ILMBase-$ILMBASE_VERSION!"
928
939
INFO "Own ILMBase-$ILMBASE_VERSION is up to date, nothing to do!"
929
940
INFO "If you want to force rebuild of this lib (and openexr), use the --force-openexr option."
932
943
magic_compile_set ilmbase-$ILMBASE_VERSION $ilmbase_magic
935
INFO "Done compiling ILMBase-$ILMBASE_VERSION!"
938
946
#### Build OpenEXR ####
1588
1596
cmake_d="$cmake_d -D OPENIMAGEIOHOME=$INST/oiio"
1599
INFO "$LLVM_VERSION_FOUND"
1591
1600
if [ ! -z $LLVM_VERSION_FOUND ]; then
1592
1601
cmake_d="$cmake_d -D LLVM_VERSION=$LLVM_VERSION_FOUND"
1593
1602
if [ -d $INST/llvm ]; then
1883
1892
# These libs should always be available in debian/ubuntu official repository...
1884
1893
OPENJPEG_DEV="libopenjpeg-dev"
1885
1894
VORBIS_DEV="libvorbis-dev"
1895
OGG_DEV="libogg-dev"
1886
1896
THEORA_DEV="libtheora-dev"
1888
1898
_packages="gawk cmake cmake-curses-gui scons build-essential libjpeg-dev libpng-dev \
1889
1899
libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev \
1890
1900
libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \
1891
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV \
1901
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
1892
1902
libsdl1.2-dev libfftw3-dev patch bzip2"
1894
1904
OPENJPEG_USE=true
1895
1905
VORBIS_USE=true
1896
1907
THEORA_USE=true
1898
1909
# Install newest libtiff-dev in debian/ubuntu.
1992
2004
check_package_DEB python$PYTHON_VERSION_MIN-numpy
1993
2005
if [ $? -eq 0 ]; then
1994
2006
install_packages_DEB python$PYTHON_VERSION_MIN-numpy
2007
elif $NUMPY_REQUIRED; then
2008
INFO "WARNING! Valid python package but no valid numpy package!"
2009
INFO " Building both Python and Numpy from sources!"
1996
INFO "WARNING! Sorry, using python package but no numpy package available!"
2012
INFO "WARNING! Sorry, using python package but no valid numpy package available!"
2013
INFO " Use --required-numpy to force building of both Python and numpy."
2020
if $_do_compile; then
2003
2023
if $NUMPY_SKIP; then
2078
INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
2099
INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
2102
check_package_version_ge_DEB llvm-dev $LLVM_VERSION_MIN
2103
if [ $? -eq 0 ]; then
2104
install_packages_DEB llvm-dev clang
2106
LLVM_VERSION_FOUND="" # Using default one, no need to specify it!
2109
install_packages_DEB libffi-dev
2110
# LLVM can't find the debian ffi header dir
2111
_FFI_INCLUDE_DIR=`dpkg -L libffi-dev | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
2081
check_package_DEB llvm-$LLVM_VERSION-dev
2082
if [ $? -eq 0 ]; then
2083
install_packages_DEB llvm-$LLVM_VERSION-dev clang
2085
LLVM_VERSION_FOUND=$LLVM_VERSION
2088
check_package_DEB llvm-$LLVM_VERSION_MIN-dev
2089
if [ $? -eq 0 ]; then
2090
install_packages_DEB llvm-$LLVM_VERSION_MIN-dev clang
2092
LLVM_VERSION_FOUND=$LLVM_VERSION_MIN
2095
install_packages_DEB libffi-dev
2096
# LLVM can't find the debian ffi header dir
2097
_FFI_INCLUDE_DIR=`dpkg -L libffi-dev | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
2101
LLVM_VERSION_FOUND=$LLVM_VERSION
2115
LLVM_VERSION_FOUND=$LLVM_VERSION
2107
INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
2111
install_packages_DEB flex bison libtbb-dev
2112
# No package currently!
2120
INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
2124
install_packages_DEB flex bison libtbb-dev
2125
# No package currently!
2299
2311
# These libs should always be available in fedora/suse official repository...
2300
2312
OPENJPEG_DEV="openjpeg-devel"
2301
2313
VORBIS_DEV="libvorbis-devel"
2314
OGG_DEV="libogg-devel"
2302
2315
THEORA_DEV="libtheora-devel"
2304
2317
_packages="gcc gcc-c++ make scons libtiff-devel freetype-devel libjpeg-devel\
2305
2318
libpng-devel libX11-devel libXi-devel wget ncurses-devel \
2306
2319
readline-devel $OPENJPEG_DEV openal-soft-devel \
2307
glew-devel yasm $THEORA_DEV $VORBIS_DEV patch"
2320
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch"
2309
2322
OPENJPEG_USE=true
2310
2323
VORBIS_USE=true
2311
2325
THEORA_USE=true
2313
2327
if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then
2409
2424
check_package_version_match_RPM python3-numpy $NUMPY_VERSION_MIN
2410
2425
if [ $? -eq 0 ]; then
2411
2426
install_packages_RPM python3-numpy
2427
elif $NUMPY_REQUIRED; then
2428
INFO "WARNING! Valid python package but no valid numpy package!"
2429
INFO " Building both Python and Numpy from sources!"
2413
INFO "WARNING! Sorry, using python package but no numpy package available!"
2432
INFO "WARNING! Sorry, using python package but no valid numpy package available!"
2433
INFO " Use --required-numpy to force building of both Python and numpy."
2440
if $_do_compile; then
2420
2443
if $NUMPY_SKIP; then
2509
INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
2511
# Problem compiling with LLVM 3.2 so match version 3.1 ...
2512
check_package_version_match_RPM llvm $LLVM_VERSION
2513
if [ $? -eq 0 ]; then
2514
if [ $RPM = "SUSE" ]; then
2515
install_packages_RPM llvm-devel llvm-clang-devel
2517
install_packages_RPM llvm-devel clang-devel
2520
LLVM_VERSION_FOUND=$LLVM_VERSION
2524
# Better to compile it than use minimum version from repo...
2526
install_packages_RPM libffi-devel
2527
# LLVM can't find the fedora ffi header dir...
2528
_FFI_INCLUDE_DIR=`rpm -ql libffi-devel | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
2532
LLVM_VERSION_FOUND=$LLVM_VERSION
2485
INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
2487
# Problem compiling with LLVM 3.2 so match version 3.1 ...
2488
check_package_version_match_RPM llvm $LLVM_VERSION
2489
if [ $? -eq 0 ]; then
2490
if [ $RPM = "SUSE" ]; then
2491
install_packages_RPM llvm-devel llvm-clang-devel
2493
install_packages_RPM llvm-devel clang-devel
2496
LLVM_VERSION_FOUND=$LLVM_VERSION
2500
# Better to compile it than use minimum version from repo...
2502
install_packages_RPM libffi-devel
2503
# LLVM can't find the fedora ffi header dir...
2504
_FFI_INCLUDE_DIR=`rpm -ql libffi-devel | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
2508
LLVM_VERSION_FOUND=$LLVM_VERSION
2514
INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
2517
# No package currently!
2519
install_packages_RPM flex bison git
2520
if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then
2521
install_packages_RPM tbb-devel
2538
INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
2541
# No package currently!
2543
install_packages_RPM flex bison git
2544
if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then
2545
install_packages_RPM tbb-devel
2626
2649
# These libs should always be available in arch official repository...
2627
2650
OPENJPEG_DEV="openjpeg"
2628
2651
VORBIS_DEV="libvorbis"
2629
2653
THEORA_DEV="libtheora"
2631
2655
_packages="base-devel scons cmake libxi glew libpng libtiff wget openal \
2632
$OPENJPEG_DEV $VORBIS_DEV $THEORA_DEV yasm sdl fftw"
2656
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl fftw"
2634
2658
OPENJPEG_USE=true
2635
2659
VORBIS_USE=true
2636
2661
THEORA_USE=true
2638
2663
if $WITH_ALL; then
2692
2718
check_package_version_ge_ARCH python-numpy $NUMPY_VERSION_MIN
2693
2719
if [ $? -eq 0 ]; then
2694
2720
install_packages_ARCH python-numpy
2696
INFO "WARNING! Sorry, using python package but no numpy package available!"
2721
elif $NUMPY_REQUIRED; then
2722
INFO "WARNING! Valid python package but no valid numpy package!"
2723
INFO " Building both Python and Numpy from sources!"
2726
INFO "WARNING! Sorry, using python package but no valid numpy package available!"
2727
INFO " Use --required-numpy to force building of both Python and numpy."
2735
if $_do_compile; then
2704
if $WITH_NUMPY; then
2705
if $NUMPY_SKIP; then
2706
INFO "WARNING! Skipping NumPy installation, as requested..."
2738
if $NUMPY_SKIP; then
2739
INFO "WARNING! Skipping NumPy installation, as requested..."
2805
INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
2807
check_package_version_ge_ARCH llvm $LLVM_VERSION_MIN
2808
if [ $? -eq 0 ]; then
2809
install_packages_ARCH llvm clang
2811
LLVM_VERSION=`check_package_version_ge_ARCH llvm $LLVM_VERSION_MIN`
2812
LLVM_VERSION_FOUND=$LLVM_VERSION
2815
install_packages_ARCH libffi
2816
# LLVM can't find the arch ffi header dir...
2817
_FFI_INCLUDE_DIR=`pacman -Ql libffi | grep -e ".*/ffi.h" | awk '{print $2}' | sed -r 's/(.*)\/ffi.h/\1/'`
2818
# LLVM 3.1 needs python2 to build and arch defaults to python3
2819
_PYTHON2_BIN="/usr/bin/python2"
2823
LLVM_VERSION_FOUND=$LLVM_VERSION
2772
INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
2774
check_package_version_ge_ARCH llvm $LLVM_VERSION_MIN
2829
INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
2832
check_package_version_ge_ARCH openshadinglanguage $OSL_VERSION_MIN
2775
2833
if [ $? -eq 0 ]; then
2776
install_packages_ARCH llvm clang
2778
LLVM_VERSION=`check_package_version_ge_ARCH llvm`
2779
LLVM_VERSION_FOUND=$LLVM_VERSION
2834
install_packages_ARCH openshadinglanguage
2782
install_packages_ARCH libffi
2783
# LLVM can't find the arch ffi header dir...
2784
_FFI_INCLUDE_DIR=`pacman -Ql libffi | grep -e ".*/ffi.h" | awk '{print $2}' | sed -r 's/(.*)\/ffi.h/\1/'`
2785
# LLVM 3.1 needs python2 to build and arch defaults to python3
2786
_PYTHON2_BIN="/usr/bin/python2"
2790
LLVM_VERSION_FOUND=$LLVM_VERSION
2796
INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
2799
check_package_version_ge_ARCH openshadinglanguage $OSL_VERSION_MIN
2800
if [ $? -eq 0 ]; then
2801
install_packages_ARCH openshadinglanguage
2804
#XXX Note: will fail to build with LLVM 3.2!
2806
install_packages_ARCH git intel-tbb
2837
#XXX Note: will fail to build with LLVM 3.2!
2839
install_packages_ARCH git intel-tbb
2987
if [ -d $INST/python-$PYTHON_VERSION_MIN ]; then
2988
_1="-D PYTHON_ROOT_DIR=$INST/python-$PYTHON_VERSION_MIN"
2990
_buildargs="$_buildargs $_1"
2951
2993
if [ -d $INST/boost ]; then
2952
2994
_1="-D BOOST_ROOT=$INST/boost"
2953
2995
_2="-D Boost_NO_SYSTEM_PATHS=ON"
2984
3026
_buildargs="$_buildargs $_1"
2988
_1="-D WITH_CYCLES_OSL=ON"
2989
_2="-D WITH_LLVM=ON"
2990
_3="-D LLVM_VERSION=$LLVM_VERSION_FOUND"
3029
_1="-D WITH_CYCLES_OSL=ON"
3030
_2="-D WITH_LLVM=ON"
3031
_3="-D LLVM_VERSION=$LLVM_VERSION_FOUND"
3035
_buildargs="$_buildargs $_1 $_2 $_3"
3036
if [ -d $INST/osl ]; then
3037
_1="-D CYCLES_OSL=$INST/osl"
3039
_buildargs="$_buildargs $_1"
3041
if [ -d $INST/llvm ]; then
3042
_1="-D LLVM_DIRECTORY=$INST/llvm"
3043
_2="-D LLVM_STATIC=ON"
2994
_buildargs="$_buildargs $_1 $_2 $_3"
2995
if [ -d $INST/osl ]; then
2996
_1="-D CYCLES_OSL=$INST/osl"
2998
_buildargs="$_buildargs $_1"
3000
if [ -d $INST/llvm ]; then
3001
_1="-D LLVM_DIRECTORY=$INST/llvm"
3002
_2="-D LLVM_STATIC=ON"
3005
_buildargs="$_buildargs $_1 $_2"
3046
_buildargs="$_buildargs $_1 $_2"
3009
3049
if $WITH_OPENCOLLADA; then
3134
INFO "Running ldconfig..."
3135
if [ $_need_boost_ldconfig == true ]; then
3136
sudo sh -c "echo \"$INST/boost/lib\" > /etc/ld.so.conf.d/boost.conf"
3138
if [ $_need_oiio_ldconfig == true ]; then
3139
sudo sh -c "echo \"$INST/oiio/lib\" > /etc/ld.so.conf.d/oiio.conf"
3141
if [ $_need_openexr_ldconfig == true ]; then
3142
sudo sh -c "echo \"$INST/openexr/lib\" > /etc/ld.so.conf.d/openexr.conf"
3144
sudo /sbin/ldconfig # XXX OpenSuse does not include sbin in command path with sudo!!!
3147
3173
print_info | tee BUILD_NOTES.txt
3149
3175
INFO "This information has been written to BUILD_NOTES.txt"