Skip to content

Instantly share code, notes, and snippets.

@jedypod
Last active September 2, 2019 02:51
Show Gist options
  • Save jedypod/4e1ffb32962d50aaab190aefaf5f55ad to your computer and use it in GitHub Desktop.
Save jedypod/4e1ffb32962d50aaab190aefaf5f55ad to your computer and use it in GitHub Desktop.
Compile Blender 2.8 on Centos 7.6 using Docker

Compile Blender 2.8 on Centos 7.6

Fedora compilation: https://wiki.blender.org/wiki/Building_Blender/Linux/Fedora

Using Docker. https://hub.docker.com/r/mattiasohlsson/centos-blender-2.8-builder/

Change docker image path:

https://linuxconfig.org/how-to-move-docker-s-default-var-lib-docker-to-another-directory-on-ubuntu-debian-linux /lib/systemd/system/docker.service ExecStart=/usr/bin/docker daemon -g /pod/docker -H fd://

https://devtalk.blender.org/t/unable-to-run-blender-2-80-in-rhel-centos-7/2138/41

docker create --name blender-builder --storage-opt size=20G mattiasohlsson/centos-blender-2.8-builder docker start blender-builder docker logs --follow blender-builder

nevermind it doesn't work

https://wiki.blender.org/wiki/Building_Blender/Linux/Generic_Distro

git clone https://git.blender.org/blender.git cd blender git submodule update --init --recursive git submodule foreach git checkout master git submodule foreach git pull --rebase origin master make update

https://devtalk.blender.org/t/unable-to-run-blender-2-80-in-rhel-centos-7/2138/5 #sudo yum install yum-utils #sudo yum-config-manager --add-repo http://www.nasm.us/nasm.repo sudo vi /etc/yum.repos.d/nasm.repo - PASTE

sudo yum install cmake3 tcl mesa-libGLU-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel nasm yasm python36 #sudo ln -s /bin/cmake3 /bin/cmake #sudo ln -s /bin/python36 /bin/python3 cd /bin sudo rm python3 sudo ln -s python3.6 python3 make deps make full


Using Docker Again https://github.com/mattias-ohlsson/docker-centos-blender-builder https://hub.docker.com/r/mattiasohlsson/centos-blender-2.8-builder

docker run --storage-opt size=20G mattiasohlsson/centos-blender-builder

wait for 20 minutes

docker cp d3f6ed011f77:/blender-2.81.0-git20190807.85c843b115e7-x86_64.tar.gz ./

./blender ./blender: error while loading shared libraries: libjack.so.0: cannot open shared object file: No such file or directory

docker run -it --storage-opt size=20G mattiasohlsson/centos-blender-builder bash

tar up the libjack .so files

tar cvf / docker cp 7293b8fee286:/root/libjack.tar ./

It compiled successfully but and it opens on centos but there appear to be issues with python and there are errors when trying to select things in the interface....

Modifying Dockerfile.

docker build -t blenderbuilder:v1 . docker tag 28924cfbd4be blenderbuilder:latest docker run -it --mount type=bind,source=/pod/compile/blender,target=/root --entrypoint /bin/bash blenderbuilder

Now we have a bash shell in a centos container

wget https://download.blender.org/source/blender-2.80.tar.gz tar xvf blender-2.80.tar.gz

https://darryldias.me/12/compile-blender-2-8-linux/

cd blender-2.8 ./build_files/build_environment/install_deps.sh --help

./build_files/build_environment/install_deps.sh -s /root/src/blender-deps -i /root/build/lib --tmp /root/tmp -t 4 --no-confirm --force-python

ERROR! Building with GCC 4.4 is not supported!

https://devtalk.blender.org/t/error-building-with-gcc-4-4-is-not-supported-on-centos-7-6/4141

line 3303: if [ "grep '6\.' /etc/redhat-release" ]; -> if [ "grep '66\.' /etc/redhat-release" ];

yum install -y sudo

works now... - compiling forever!

-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "2.7") CMake Warning at CMakeLists.txt:124 (message): Make Python 2.7 available to CMake's search path, and re-run configuration

CMake Error at CMakeLists.txt:125 (message): Python is a required dependency when OPENEXR_BUILD_PYTHON_LIBS is set

Unpacking OpenEXR-2.3.0 ./build_files/build_environment/install_deps.sh: line 1584: file: command not found

Trying again with ./build_files/build_environment/install_deps.sh -s /root/src/blender-deps -i /root/build/lib --tmp /root/tmp -t 4 --no-confirm

Tried adding on line 1584 - probably going to cause issues. We'll see. cmake_d="$cmake_d -D OPENEXR_BUILD_PYTHON_LIBS=OFF"

yeah...

-- WebP plugin will not be built
CMake Error at /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
  (Required is at least version "2.7")
Call Stack (most recent call first):
  /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake3/Modules/FindPythonLibs.cmake:309 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/python/CMakeLists.txt:14 (find_package)


-- Configuring incomplete, errors occurred!
See also "/root/src/blender-deps/OpenImageIO-1.8.13/build/CMakeFiles/CMakeOutput.log".
See also "/root/src/blender-deps/OpenImageIO-1.8.13/build/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `clean'.  Stop.
ERROR! OpenImageIO-1.8.13 failed to compile, exiting

I guess python-devel just wasn't installed...

yum install python-devel

scl enable devtoolset-7

Error with OpenShadingLanguage - Boost is too old

-- CMake version is 3.13.5
CMake Deprecation Warning at CMakeLists.txt:20 (cmake_policy):
  The OLD behavior for policy CMP0046 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Project build dir   = /root/src/blender-deps/OpenShadingLanguage-1.9.9/build
-- Project install dir = /root/build/lib/osl-1.9.9
-- platform = linux64
-- CMAKE_CXX_COMPILER is /usr/bin/c++
-- CMAKE_CXX_COMPILER_ID is GNU
-- Building for C++11
-- Compiling with SIMD level sse2
-- Setting Namespace to: OSL_v1_9
-- Using OpenImageIO 1.8.13
-- LLVM version  = 6.0.1
-- Using clang internals for preprocessing
CMake Error at /usr/share/cmake3/Modules/FindBoost.cmake:2100 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.53.0

  Boost include path: /usr/include

  Detected version of Boost is too old.  Requested version was 1.55 (or
  newer).
Call Stack (most recent call first):
  src/cmake/externalpackages.cmake:139 (find_package)
  CMakeLists.txt:123 (include)


-- No Partio found
-- Create oslversion.h from oslversion.h.in
-- Configuring incomplete, errors occurred!
See also "/root/src/blender-deps/OpenShadingLanguage-1.9.9/build/CMakeFiles/CMakeOutput.log".
See also "/root/src/blender-deps/OpenShadingLanguage-1.9.9/build/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `clean'.  Stop.
ERROR! OpenShadingLanguage-1.9.9 failed to compile, exiting

compile boost 1.61 and add to file -> line 1940 - add

cmake_d="$cmake_d -D BOOST_ROOT=/root/deps/boost_1_61_0"
cmake_d="$cmake_d -D BOOST_INCLUDEDIR=/root/deps/boost_1_61_0"
cmake_d="$cmake_d -D BOOST_LIBRARYDIR=/root/deps/boost_1_61_0/stage/lib"

Works

Error

Building libopenvdb.so.5.1.0 because of Grid.o and others
g++  -std=c++11 -std=c++11 -pthread -O3 -DNDEBUG -I . -I .. -isystem /include -isystem /root/build/lib/openexr/include -isystem /include -isystem /root/build/lib/blosc/include -DOPENVDB_USE_BLOSC -DOPENVDB_USE_GLFW_3 -shared -o libopenvdb.so.5.1.0 Grid.o io/Archive.o io/Compression.o io/File.o io/GridDescriptor.o io/Queue.o io/Stream.o io/TempFile.o math/Maps.o math/Proximity.o math/QuantizedUnitVec.o math/Transform.o Metadata.o MetaMap.o openvdb.o Platform.o points/AttributeArray.o points/AttributeArrayString.o points/AttributeGroup.o points/AttributeSet.o points/points.o points/StreamCompression.o util/Formats.o util/Util.o -ldl -lm -lz -Wl,-rpath,/root/build/lib/openexr/lib -L/root/build/lib/openexr/lib -lHalf -Wl,-rpath,/usr -L/usr -ltbb -Wl,-rpath,/usr -L/usr -lboost_iostreams -lboost_system  -Wl,-rpath,/root/build/lib/blosc/lib -L/root/build/lib/blosc/lib -lblosc -Wl,-rpath,/usr -L/usr -lrt -Wl,-soname,libopenvdb.so.5.1
/usr/bin/ld: cannot find -lHalf
collect2: error: ld returned 1 exit status
make: *** [libopenvdb.so.5.1.0] Error 1

ERROR! OpenVDB-5.1.0 failed to compile, exiting

-> line 2247 : add boost include directory - the referenced one doesn't exist... # make_d="$make_d BOOST_INCL_DIR=$INST/boost/include BOOST_LIB_DIR=$INST/boost/lib" make_d="$make_d BOOST_INCL_DIR=/root/deps/boost_1_61_0 BOOST_LIB_DIR=/root/deps/boost_1_61_0/stage/lib -> line 820 : replace url to openvdb. looks like it's no longer hosted on dreamworksanimation github OPENVDB_SOURCE=( "https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz" )

Error with OpenVDB compilation

Building libopenvdb.so.5.1.0 because of Grid.o and others
g++  -std=c++11 -std=c++11 -pthread -O3 -DNDEBUG -I . -I .. -isystem /include -isystem /root/build/lib/openexr/include -isystem /include -isystem /root/build/lib/blosc/include -DOPENVDB_USE_BLOSC -DOPENVDB_USE_GLFW_3 -shared -o libopenvdb.so.5.1.0 Grid.o io/Archive.o io/Compression.o io/File.o io/GridDescriptor.o io/Queue.o io/Stream.o io/TempFile.o math/Maps.o math/Proximity.o math/QuantizedUnitVec.o math/Transform.o Metadata.o MetaMap.o openvdb.o Platform.o points/AttributeArray.o points/AttributeArrayString.o points/AttributeGroup.o points/AttributeSet.o points/points.o points/StreamCompression.o util/Formats.o util/Util.o \
-ldl -lm -lz -Wl,-rpath,/root/build/lib/openexr/lib -L/root/build/lib/openexr/lib -lHalf -Wl,-rpath,/usr -L/usr -ltbb -Wl,-rpath,/usr -L/usr -lboost_iostreams -lboost_system  -Wl,-rpath,/root/build/lib/blosc/lib -L/root/build/lib/blosc/lib -lblosc -Wl,-rpath,/usr -L/usr -lrt -Wl,-soname,libopenvdb.so.5.1
/usr/bin/ld: cannot find -lHalf
collect2: error: ld returned 1 exit status
make: *** [libopenvdb.so.5.1.0] Error 1

-> line 2251: paths to ilmbase and exr include dirs was wrong... didn't exist?!

make_d="$make_d ILMBASE_INCL_DIR=/root/build/lib/openexr/include ILMBASE_LIB_DIR=/root/build/lib/openexr/lib"
make_d="$make_d EXR_INCL_DIR=/root/build/lib/openexr/include EXR_LIB_DIR=/root/build/lib/openexr/lib"
INFO "ILMBASE_HOME=$INST/build/lib/openexr"

Restart - Build with Docker

docker build -t blend_b:v1 .

start

docker run -it --mount type=bind,source=/pod/sw/compile/blender/context,target=/root --entrypoint /bin/bash blend_b:v1

run another shell

docker ps

find pid

docker exec -it /bin/bash

# https://developer.blender.org/diffusion/B/

cd /pod/sw/compile/blender/context/
git clone git://git.blender.org/blender.git
cd blender
git submodule update --init --recursive
git submodule foreach git checkout master
git submodule foreach git pull --rebase origin master

Build Instructions

https://wiki.blender.org/wiki/Building_Blender
https://wiki.blender.org/wiki/Building_Blender/Dependencies

source scl_source enable devtoolset-7
cd /root/blender-git/blender/build_files/build_environment
./install_deps.sh --show-deps
./install_deps.sh --source ~/deps/src --install ~/deps/lib --with-all


-- Using Boost Wave for preprocessing
CMake Error at /usr/share/cmake3/Modules/FindBoost.cmake:2100 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.53.0

  Boost include path: /usr/include

  Detected version of Boost is too old.  Requested version was 1.55 (or
  newer).
Call Stack (most recent call first):
  src/cmake/externalpackages.cmake:139 (find_package)
  CMakeLists.txt:123 (include)


-- Create oslversion.h from oslversion.h.in
-- Configuring incomplete, errors occurred!
See also "/root/deps/src/OpenShadingLanguage-1.9.9/build/CMakeFiles/CMakeOutput.log".
See also "/root/deps/src/OpenShadingLanguage-1.9.9/build/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `clean'.  Stop.
ERROR! OpenShadingLanguage-1.9.9 failed to compile, exiting


# Compile Boost 1.61
cd ~/deps/src
tar xvf boost_1_61_0.tar.bz2
./bootstrap.sh --prefix=$HOME/deps/lib/boost-1.61
./b2 install --prefix=$HOME/deps/lib/boost-1.61

Looks like boost is included in install_deps.sh - just need to force it?

./install_deps.sh --source ~/deps/src --install ~/deps/lib --with-all --build-all --build-boost --build-python --build-numpy 

  Cannot write to '/root/deps/src/openvdb-5.1.0.tar.gz' (Success).
  ERROR! wget could not find https://github.com/dreamworksanimation/openvdb/archive/v5.1.0.tar.gz, or could not write it to /root/deps/src/openvdb-5.1.0.tar.gz, exiting

  
  wget https://github.com/AcademySoftwareFoundation/openvdb/archive/v5.1.0.tar.gz -o /root/deps/src/openvdb-5.1.0.tar.gz

  # Change build_environment/cmake/version.cmake #157 to
  set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
  # Change build_environment/build_deps.sh #856 to
  OPENVDB_SOURCE=( "https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz" )

Try again

  ./install_deps.sh --source ~/deps/src --install ~/deps/lib --with-all --build-all --build-boost --build-python --build-numpy 

Error with OpenVDB

Building libopenvdb.so.5.1.0 because of Grid.o and others
g++  -std=c++11 -std=c++11 -pthread -O3 -DNDEBUG -I . -I .. -isystem /root/deps/lib/boost/include -isystem /root/deps/lib/openexr/include -isystem /include -isystem /root/deps/lib/blosc/include -DOPENVDB_USE_BLOSC -DOPENVDB_USE_GLFW_3 -shared -o libopenvdb.so.5.1.0 Grid.o io/Archive.o io/Compression.o io/File.o io/GridDescriptor.o io/Queue.o io/Stream.o io/TempFile.o math/Maps.o math/Proximity.o math/QuantizedUnitVec.o math/Transform.o Metadata.o MetaMap.o openvdb.o Platform.o points/AttributeArray.o points/AttributeArrayString.o points/AttributeGroup.o points/AttributeSet.o points/points.o points/StreamCompression.o util/Formats.o util/Util.o \
-ldl -lm -lz -Wl,-rpath,/root/deps/lib/openexr/lib -L/root/deps/lib/openexr/lib -lHalf -Wl,-rpath,/usr -L/usr -ltbb -Wl,-rpath,/root/deps/lib/boost/lib -L/root/deps/lib/boost/lib -lboost_iostreams -lboost_system  -Wl,-rpath,/root/deps/lib/blosc/lib -L/root/deps/lib/blosc/lib -lblosc -Wl,-rpath,/usr -L/usr -lrt -Wl,-soname,libopenvdb.so.5.1
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -lHalf
collect2: error: ld returned 1 exit status
make: *** [libopenvdb.so.5.1.0] Error 1
ERROR! OpenVDB-5.1.0 failed to compile, exiting

Looks like these paths are not respecting $INST $SRC

# Set this in install_deps.sh
SRC="$HOME/src/blender-deps"
INST="$HOME/lib"
TMP="$HOME/tmp"
# Try again
./install_deps.sh --with-all --build-all --build-boost --build-python --build-numpy 

Same error! Ahhhh!

Building libopenvdb.so.5.1.0 because of Grid.o and others
g++  -std=c++11 -std=c++11 -pthread -O3 -DNDEBUG -I . -I .. -isystem /root/lib/boost/include -isystem /root/lib/openexr/include -isystem /include -isystem /root/lib/blosc/include -DOPENVDB_USE_BLOSC -DOPENVDB_USE_GLFW_3 -shared -o libopenvdb.so.5.1.0 Grid.o io/Archive.o io/Compression.o io/File.o io/GridDescriptor.o io/Queue.o io/Stream.o io/TempFile.o math/Maps.o math/Proximity.o math/QuantizedUnitVec.o math/Transform.o Metadata.o MetaMap.o openvdb.o Platform.o points/AttributeArray.o points/AttributeArrayString.o points/AttributeGroup.o points/AttributeSet.o points/points.o points/StreamCompression.o util/Formats.o util/Util.o -ldl -lm -lz -Wl,-rpath,/root/lib/openexr/lib -L/root/lib/openexr/lib -lHalf -Wl,-rpath,/usr -L/usr -ltbb -Wl,-rpath,/root/lib/boost/lib -L/root/lib/boost/lib -lboost_iostreams -lboost_system  -Wl,-rpath,/root/lib/blosc/lib -L/root/lib/blosc/lib -lblosc -Wl,-rpath,/usr -L/usr -lrt -Wl,-soname,libopenvdb.so.5.1
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -lHalf
collect2: error: ld returned 1 exit status
make: *** [libopenvdb.so.5.1.0] Error 1
ERROR! OpenVDB-5.1.0 failed to compile, exiting


# Why is -lHalf -Wl,-rpath,/usr -L/usr
should libHalf be compiled?

# Looks like openvdb.cmake is pointing to $LIBDIR/ilmbase instead of $LIBDIR/openexr

Change /root/blender-git/blender/build_files/build_environment/cmake/openvdb.cmake #42-45

  -DILMBASE_LOCATION=${LIBDIR}/openexr
  -DIlmbase_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${ILMBASE_VERSION_POSTFIX}${LIBEXT}
  -DIlmbase_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${ILMBASE_VERSION_POSTFIX}${LIBEXT}
  -DIlmbase_ILMTHREAD_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${ILMBASE_VERSION_POSTFIX}${LIBEXT}

Error

Building libopenvdb.so.5.1.0 because of Grid.o and others
g++  -std=c++11 -std=c++11 -pthread -O3 -DNDEBUG -I . -I .. -isystem /root/lib/boost/include -isystem /root/lib/openexr/include -isystem /include -isystem /root/lib/blosc/include -DOPENVDB_USE_BLOSC -DOPENVDB_USE_GLFW_3 -shared -o libopenvdb.so.5.1.0 Grid.o io/Archive.o io/Compression.o io/File.o io/GridDescriptor.o io/Queue.o io/Stream.o io/TempFile.o math/Maps.o math/Proximity.o math/QuantizedUnitVec.o math/Transform.o Metadata.o MetaMap.o openvdb.o Platform.o points/AttributeArray.o points/AttributeArrayString.o points/AttributeGroup.o points/AttributeSet.o points/points.o points/StreamCompression.o util/Formats.o util/Util.o -ldl -lm -lz -Wl,-rpath,/root/lib/openexr/lib -L/root/lib/openexr/lib -lHalf -Wl,-rpath,/usr -L/usr -ltbb -Wl,-rpath,/root/lib/boost/lib -L/root/lib/boost/lib -lboost_iostreams -lboost_system  -Wl,-rpath,/root/lib/blosc/lib -L/root/lib/blosc/lib -lblosc -Wl,-rpath,/usr -L/usr -lrt -Wl,-soname,libopenvdb.so.5.1
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -lHalf
collect2: error: ld returned 1 exit status
make: *** [libopenvdb.so.5.1.0] Error 1
rm -f Grid.o io/Archive.o io/Compression.o io/File.o io/GridDescriptor.o io/Queue.o io/Stream.o io/TempFile.o math/Maps.o math/Proximity.o math/QuantizedUnitVec.o math/Transform.o Metadata.o MetaMap.o openvdb.o Platform.o points/AttributeArray.o points/AttributeArrayString.o points/AttributeGroup.o points/AttributeSet.o points/points.o points/StreamCompression.o util/Formats.o util/Util.o libopenvdb.so.5.1.0 vdb_test vdb_lod vdb_print vdb_render vdb_view dependencies libopenvdb.so libopenvdb.so.5.1 pyopenvdb.so  dependencies
rm -f libopenvdb.a
rm -f libopenvdb.so.5.1.0
rm -f viewer/Camera.o viewer/ClipBox.o viewer/Font.o viewer/RenderModules.o viewer/Viewer.o
rm -f python/pyFloatGrid.o python/pyIntGrid.o python/pyMetadata.o python/pyOpenVDBModule.o python/pyTransform.o python/pyVec3Grid.o
rm -f unittest/main.o unittest/TestAttributeArray.o unittest/TestAttributeArrayString.o unittest/TestAttributeSet.o unittest/TestAttributeGroup.o unittest/TestBBox.o unittest/TestConjGradient.o unittest/TestCoord.o unittest/TestCpt.o unittest/TestCurl.o unittest/TestDense.o unittest/TestDenseSparseTools.o unittest/TestDiagnostics.o unittest/TestDivergence.o unittest/TestDoubleMetadata.o unittest/TestExceptions.o unittest/TestFile.o unittest/TestFloatMetadata.o unittest/TestGradient.o unittest/TestGrid.o unittest/TestGridBbox.o unittest/TestGridDescriptor.o unittest/TestGridIO.o unittest/TestGridTransformer.o unittest/TestIndexFilter.o unittest/TestIndexIterator.o unittest/TestInit.o unittest/TestInt32Metadata.o unittest/TestInt64Metadata.o unittest/TestInternalOrigin.o unittest/TestLaplacian.o unittest/TestLeaf.o unittest/TestLeafBool.o unittest/TestLeafManager.o unittest/TestLeafMask.o unittest/TestLeafIO.o unittest/TestLeafOrigin.o unittest/TestLevelSetRayIntersector.o unittest/TestLevelSetUtil.o unittest/TestLinearInterp.o unittest/TestMaps.o unittest/TestMat4Metadata.o unittest/TestMath.o unittest/TestMeanCurvature.o unittest/TestMeshToVolume.o unittest/TestMetadata.o unittest/TestMetadataIO.o unittest/TestMetaMap.o unittest/TestMultiResGrid.o unittest/TestName.o unittest/TestNodeIterator.o unittest/TestNodeManager.o unittest/TestNodeMask.o unittest/TestParticleAtlas.o unittest/TestParticlesToLevelSet.o unittest/TestPointAttribute.o unittest/TestPointConversion.o unittest/TestPointCount.o unittest/TestPointDataLeaf.o unittest/TestPointDelete.o unittest/TestPointGroup.o unittest/TestPointIndexGrid.o unittest/TestPointMask.o unittest/TestPointPartitioner.o unittest/TestPointScatter.o unittest/TestPointsToMask.o unittest/TestPoissonSolver.o unittest/TestPotentialFlow.o unittest/TestPrePostAPI.o unittest/TestQuadraticInterp.o unittest/TestQuantizedUnitVec.o unittest/TestQuat.o unittest/TestRay.o unittest/TestStats.o unittest/TestStream.o unittest/TestStreamCompression.o unittest/TestStringMetadata.o unittest/TestTools.o unittest/TestTopologyToLevelSet.o unittest/TestTransform.o unittest/TestTree.o unittest/TestTreeCombine.o unittest/TestTreeGetSetValues.o unittest/TestTreeIterators.o unittest/TestTreeVisitor.o unittest/TestUtil.o unittest/TestValueAccessor.o unittest/TestVec2Metadata.o unittest/TestVec3Metadata.o unittest/TestVolumeRayIntersector.o unittest/TestVolumeToMesh.o unittest/TestVolumeToSpheres.o
rm -f -r ./doc/html ./doc/latex
ERROR! OpenVDB-5.1.0 failed to compile, exiting

#Try compiling OpenVDB Manually

Instructions

https://github.com/AcademySoftwareFoundation/openvdb


rm -f CMakeCache.txt
export ILMBASE_ROOT=$HOME/lib/openexr
export OPENEXR_ROOT=$HOME/lib/openexr
export BOOST_ROOT=$HOME/lib/boost
export BOOST_LIBRARYDIR=$HOME/lib/boost/lib
export BLOSC_ROOT=$HOME/lib/blosc-1.5.0
export TBB_ROOT=$HOME/src/blender-deps/tbb2018_20180618oss
#export GLFW3_ROOT=$RHOME/Systems/glfw/v3.2.1
export CPPUNIT_LOCATION=$HOME/lib/cppunit
mkdir build
cd build

export ILMBASE_ROOT=$HOME/lib/openexr export OPENEXR_ROOT=$HOME/lib/openexr export BOOST_ROOT=$HOME/lib/boost-1.66 export BOOST_LIBRARYDIR=$HOME/lib/boost-1.66/lib export BLOSC_ROOT=$HOME/lib/blosc export TBB_ROOT=$HOME/src/blender-deps/tbb2018_20180618oss export GLFW3_ROOT= export CPPUNIT_LOCATION=$HOME/lib/cppunit mkdir build cd build

-D PYTHON_LIBRARY=$HOME/lib/python-3.7/lib/libpython3.7m.a \

-D PYTHON_INCLUDE_DIR=$HOME/lib/python-3.7/include/python3.7m \

cmake
-D BOOST_ROOT=$HOME/lib/boost-1.66
-D BOOST_LIBRARYDIR=$HOME/lib/boost-1.66/lib
-D BOOST_LIB_DIR=$HOME/lib/boost-1.66/lib
-D BOOST_INCL_DIR=$HOME/lib/boost-1.66/include
-D BLOSC_blosc_LIBRARY=$HOME/lib/blosc/lib/libblosc.so
-D ILMBASE_INCL_DIR=$HOME/lib/openexr/ilmbase-2.3.0/include
-D IlmBase_INCLUDE_DIR=$HOME/lib/openexr/include
-D Ilmbase_HALF_LIBRARY=$HOME/lib/openexr/lib/libHalf-2_3.so
-D Ilmbase_IEX_LIBRARY=$HOME/lib/openexr/lib/libIex-2_3.so
-D Ilmbase_ILMTHREAD_LIBRARY=$HOME/lib/openexr/lib/libIlmThread-2_3.so
-D IlmBase_LIB_COMPONENTS=$HOME/lib/openexr/lib
-D ILMBASE_LIB_DIR=$HOME/lib/openexr/lib
-D Openexr_ILMIMF_LIBRARY=$HOME/lib/openexr/lib
-D EXR_INCL_DIR=$HOME/lib/openexr/include
-D EXR_LIB_DIR=$HOME/lib/openexr/lib
-D CMAKE_CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++
-D CMAKE_C_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/gcc
-D CMAKE_CXX_FLAGS=-std=c++11
-D CPPUNIT_LOCATION=$HOME/lib/cppunit
-D MINIMUM_BOOST_VERSION=1.52
-D ILMBASE_NAMESPACE_VERSIONING=OFF
-D OPENEXR_NAMESPACE_VERSIONING=OFF
-D USE_GLFW3=OFF
-D Blosc_USE_STATIC_LIBS=ON
-D CMAKE_INSTALL_PREFIX=$HOME/lib/openvdb-5.1.0
-D LOG4CPLUS_INCL_DIR=
-D GLFW_INCL_DIR=
-D GLFW_LIBRARY_PATH=
-D PYTHON_VERSION=
-D DOXYGEN=
..

# Get TBB
wget https://github.com/intel/tbb/releases/download/2018_U5/tbb2018_20180618oss_lin.tgz
tar xvf tbb2018_20180618oss_lin.tgz
# Get CPPUnit
git clone git://anongit.freedesktop.org/git/libreoffice/cppunit/
cd cppunit
./autogen.sh
./configure --prefix $HOME/lib/cppunit
make -j8
make install

export CPPUNIT_LOCATION=$HOME/lib/cppunit

# Install blosc 1.5.0
git clone https://github.com/Blosc/c-blosc.git
git checkout tags/v1.5.0
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/lib/blosc-1.5.0 ..
make -j8
make install

# Install boost-1.61
wget https://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.gz
./bootstrap.sh --prefix=$HOME/lib/boost-1.61
./b2 install --prefix=$HOME/lib/boost-1.61

# Install boost-1.66
wget https://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.tar.gz
./bootstrap.sh --prefix=$HOME/lib/boost-1.66
./b2 install --prefix=$HOME/lib/boost-1.66

# Install GLFW
https://github.com/glfw/glfw

Try again... fuck it for openvdb

  ./install_deps.sh --source ~/deps/src --install ~/deps/lib --with-all --build-all --build-boost --build-python --build-numpy --skip-openvdb

Install libvpx - dep of ffmpeg-4.0.2

wget https://github.com/webmproject/libvpx/archive/v1.4.0.tar.gz
mkdir build
cd build
../configure
make -j8
make install

It completed successfully

Ran with:
    install_deps.sh --source /root/deps/src --install /root/deps/lib --with-all --build-all --build-boost --build-python --build-numpy --skip-openvdb


If you're using CMake add this to your configuration flags:
  cmake \
  -D WITH_CODEC_SNDFILE=ON \
  -D PYTHON_VERSION=3.7 \
  -D PYTHON_ROOT_DIR=/root/deps/lib/python-3.7 \
  -D BOOST_ROOT=/root/deps/lib/boost \
  -D Boost_NO_SYSTEM_PATHS=ON \
  -D WITH_OPENCOLORIO=ON \
  -D OPENCOLORIO_ROOT_DIR=/root/deps/lib/ocio \
  -D OPENEXR_ROOT_DIR=/root/deps/lib/openexr \
  -D WITH_OPENIMAGEIO=ON \
  -D OPENIMAGEIO_ROOT_DIR=/root/deps/lib/oiio \
  -D WITH_CYCLES_OSL=ON \
  -D WITH_LLVM=ON \
  -D LLVM_VERSION=6.0.1 \
  -D OSL_ROOT_DIR=/root/deps/lib/osl \
  -D LLVM_ROOT_DIR=/root/deps/lib/llvm \
  -D LLVM_STATIC=ON \
  -D WITH_OPENSUBDIV=ON \
  -D OPENSUBDIV_ROOT_DIR=/root/deps/lib/osd \
  -D WITH_OPENCOLLADA=ON \
  -D OPENCOLLADA_ROOT_DIR=/root/deps/lib/opencollada \
  -D WITH_CYCLES_EMBREE=ON \
  -D EMBREE_ROOT_DIR=/root/deps/lib/embree \
  -D WITH_OPENIMAGEDENOISE=ON \
  -D OPENIMAGEDENOISE_ROOT_DIR=/root/deps/lib/oidn \
  -D WITH_JACK=ON \
  -D WITH_JACK_DYNLOAD=ON \
  -D WITH_ALEMBIC=ON \
  -D ALEMBIC_ROOT_DIR=/root/deps/lib/alembic \
  -D WITH_CODEC_FFMPEG=ON \
  -D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;theora;theoradec;theoraenc;vorbis;vorbisenc;vorbisfile;ogg;xvidcore;vpx;mp3lame;x264;x26410b;openjp2' \
  -D FFMPEG=/root/deps/lib/ffmpeg \
  ..
  make -j8  
Or even simpler, just run (in your blender-source dir):
  make -j8 BUILD_CMAKE_ARGS="-U *SNDFILE* -U *PYTHON* -U *BOOST* -U *Boost* -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES* -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -D WITH_CODEC_SNDFILE=ON -D PYTHON_VERSION=3.7 -D PYTHON_ROOT_DIR=/root/deps/lib/python-3.7 -D BOOST_ROOT=/root/deps/lib/boost -D Boost_NO_SYSTEM_PATHS=ON -D WITH_OPENCOLORIO=ON -D OPENCOLORIO_ROOT_DIR=/root/deps/lib/ocio -D OPENEXR_ROOT_DIR=/root/deps/lib/openexr -D WITH_OPENIMAGEIO=ON -D OPENIMAGEIO_ROOT_DIR=/root/deps/lib/oiio -D WITH_CYCLES_OSL=ON -D WITH_LLVM=ON -D LLVM_VERSION=6.0.1 -D OSL_ROOT_DIR=/root/deps/lib/osl -D LLVM_ROOT_DIR=/root/deps/lib/llvm -D LLVM_STATIC=ON -D WITH_OPENSUBDIV=ON -D OPENSUBDIV_ROOT_DIR=/root/deps/lib/osd -D WITH_OPENCOLLADA=ON -D OPENCOLLADA_ROOT_DIR=/root/deps/lib/opencollada -D WITH_CYCLES_EMBREE=ON -D EMBREE_ROOT_DIR=/root/deps/lib/embree -D WITH_OPENIMAGEDENOISE=ON -D OPENIMAGEDENOISE_ROOT_DIR=/root/deps/lib/oidn -D WITH_JACK=ON -D WITH_JACK_DYNLOAD=ON -D WITH_ALEMBIC=ON -D ALEMBIC_ROOT_DIR=/root/deps/lib/alembic -D WITH_CODEC_FFMPEG=ON -D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;theora;theoradec;theoraenc;vorbis;vorbisenc;vorbisfile;ogg;xvidcore;vpx;mp3lame;x264;x26410b;openjp2' -D FFMPEG=/root/deps/lib/ffmpeg"

Or in all your build directories:
  cmake -U *SNDFILE* -U *PYTHON* -U *BOOST* -U *Boost* -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES* -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -D WITH_CODEC_SNDFILE=ON -D PYTHON_VERSION=3.7 -D PYTHON_ROOT_DIR=/root/deps/lib/python-3.7 -D BOOST_ROOT=/root/deps/lib/boost -D Boost_NO_SYSTEM_PATHS=ON -D WITH_OPENCOLORIO=ON -D OPENCOLORIO_ROOT_DIR=/root/deps/lib/ocio -D OPENEXR_ROOT_DIR=/root/deps/lib/openexr -D WITH_OPENIMAGEIO=ON -D OPENIMAGEIO_ROOT_DIR=/root/deps/lib/oiio -D WITH_CYCLES_OSL=ON -D WITH_LLVM=ON -D LLVM_VERSION=6.0.1 -D OSL_ROOT_DIR=/root/deps/lib/osl -D LLVM_ROOT_DIR=/root/deps/lib/llvm -D LLVM_STATIC=ON -D WITH_OPENSUBDIV=ON -D OPENSUBDIV_ROOT_DIR=/root/deps/lib/osd -D WITH_OPENCOLLADA=ON -D OPENCOLLADA_ROOT_DIR=/root/deps/lib/opencollada -D WITH_CYCLES_EMBREE=ON -D EMBREE_ROOT_DIR=/root/deps/lib/embree -D WITH_OPENIMAGEDENOISE=ON -D OPENIMAGEDENOISE_ROOT_DIR=/root/deps/lib/oidn -D WITH_JACK=ON -D WITH_JACK_DYNLOAD=ON -D WITH_ALEMBIC=ON -D ALEMBIC_ROOT_DIR=/root/deps/lib/alembic -D WITH_CODEC_FFMPEG=ON -D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;theora;theoradec;theoraenc;vorbis;vorbisenc;vorbisfile;ogg;xvidcore;vpx;mp3lame;x264;x26410b;openjp2' -D FFMPEG=/root/deps/lib/ffmpeg .

This information has been written to /root/blender-git/blender/build_files/build_environment/BUILD_NOTES.txt

Error: OIDN TBB linker error

/root/deps/lib/oidn/lib64/libOpenImageDenoise.a(device.cpp.o):device.cpp:function oidn::Device::print(): error: undefined reference to 'TBB_runtime_interface_version'                                                                                         
/root/deps/lib/oidn/lib64/libOpenImageDenoise.a(device.cpp.o):device.cpp:function oidn::Device::commit(): error: undefined reference to 'tbb::interface7::internal::task_arena_base::internal_max_concurrency(tbb::interface7::task_arena const*)'             
/root/deps/lib/oidn/lib64/libOpenImageDenoise.a(device.cpp.o):device.cpp:function std::_Sp_counted_ptr_inplace<tbb::interface7::task_arena, std::allocator<tbb::interface7::task_arena>, (__gnu_cxx::_Lock_policy)2>::_M_dispose(): error: undefined reference 
to 'tbb::interface7::internal::task_arena_base::internal_terminate()'  

# Yeah... gotta love centos it comes with tbb-2013
[Intel® Threading Building
Blocks](https://www.threadingbuildingblocks.org/) (TBB) 2017 or
later.
wget https://github.com/intel/tbb/archive/2019_U8.tar.gz -o tbb-2019_U8.tar.gz
tar xvf tbb-2019_U8.tar.gz
cd tbb-2019_U8
make -j8
make install
# hmmmm

Try not compiling it

https://software.intel.com/en-us/articles/installing-intel-free-libs-and-python-yum-repo
sudo yum-config-manager --add-repo https://yum.repos.intel.com/tbb/setup/intel-tbb.repo
sudo rpm --import https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
yum install intel-tbb-devel-2018.6-274 intel-tbb-2018.6-057

# Recompile oidn with updated tbb
cd oidn/build
cmake -DCMAKE_INSTALL_PREFIX=~/deps/lib/oidn-1.0.0 -DTBB_LIBRARY=/root/deps/src/tbb2018_20180822oss -DTBB_INCLUDE_DIR=/root/deps/src/tbb2018_20180822oss/include -DTBB_LIBRARY_MALLOC=/root/deps/src/tbb2018_20180822oss/include ..
cmake -DCMAKE_INSTALL_PREFIX=~/deps/lib/oidn-1.0.0 -DTBB_LIBRARY=/opt/intel/tbb -DTBB_INCLUDE_DIR=/opt/intel/tbb/include -DTBB_LIBRARY_MALLOC=/opt/intel/tbb/lib/intel64_lin/gcc4.7/libtbbmalloc.so ..
make -j8

Giving up... Probably need to hack the build_deps.sh and add tbb 2018r6 and openvdb and openimagedenoise to get everything to connect together. may need to change boost to 1.66 from 1.68 and see if blender still compiles also.

FROM centos
LABEL maintainer="[email protected]"
ENV HOME /root
WORKDIR $HOME
RUN yum update -y && yum clean all
# Install packages
RUN yum -y install centos-release-scl epel-release \
&& yum -y install autoconf automake bison cmake3 flex gcc git \
jack-audio-connection-kit-devel make patch pcre-devel python36 \
python-setuptools subversion tcl yasm devtoolset-7-gcc-c++ libtool \
libX11-devel libXcursor-devel libXi-devel libXinerama-devel \
libXrandr-devel libXt-devel mesa-libGLU-devel zlib-devel \
python-devel which sudo wget vi tmux sudo \
&& yum clean all
# Use cmake3
RUN alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
--family cmake
# Use python36
RUN alternatives --install /usr/bin/python3 python3 /bin/python36 20 \
--family python3
# Install NASM
RUN curl -O https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.gz \
&& tar xf nasm-*.tar.gz && cd nasm-*/ \
&& ./configure && make && make install \
&& cd && rm -rf $HOME/nasm-*
# Get the source
#RUN mkdir $HOME/blender-git \
# && cd $HOME/blender-git \
# && git clone https://git.blender.org/blender.git \
# && cd $HOME/blender-git/blender \
# && git submodule update --init --recursive \
# && git submodule foreach git checkout master \
# && git submodule foreach git pull --rebase origin master
# COPY start /usr/bin/
# CMD ["scl", "enable", "devtoolset-7", "/usr/bin/start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment