Context
I'm on gentoo and as the official ebuild is super outdated, i did build it using gentoo official guide.
I'm not found of using prebuild lib, both for security and performance reason, and because i got the chance to have a modern enough cpu so building from sources is not too long for me.
Here is my actual gentoo configuration:
Some useful extract from them:
gcc-9.3.0, glibc-2.30-r8, 5.4.38-gentoo
I realize that this is much more modern than what is expected on https://vfxplatform.com/ but:
- it would be nice to have that the install_deps script works also on new system
- it may help in the future
So It did invest some time and did fix the build on my side so it works.
Draft Diff
D7673: Improve install_deps script to make it works on gentoo
I'm completely open to split the diff into several pieces if you want to review each fixe one by one.
Stuff that I fixed
Boost
On gentoo I needed
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index 6a247e81148..6f58dc01b46 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -1459,7 +1459,7 @@ compile_Boost() { if [ ! -f $_src/b2 ]; then ./bootstrap.sh fi - ./b2 -j$THREADS -a $BOOST_BUILD_MODULES \ + ./b2 --ignore-site-config -j$THREADS -a $BOOST_BUILD_MODULES \ --prefix=$_inst --disable-icu boost.locale.icu=off install ./b2 --clean
That was done as per https://stackoverflow.com/questions/23013433/how-to-install-modular-boost
LLVM and LibFFI
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index 6a247e81148..6f58dc01b46 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -1972,13 +1972,13 @@ compile_LLVM() { cmake_d="-D CMAKE_BUILD_TYPE=Release" cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst" - cmake_d="$cmake_d -D LLVM_ENABLE_FFI=ON" + cmake_d="$cmake_d -D LLVM_ENABLE_FFI=ON -D FFI_INCLUDE_DIR=/usr/lib64/libffi/include" cmake_d="$cmake_d -D LLVM_TARGETS_TO_BUILD=X86" cmake_d="$cmake_d -D LLVM_ENABLE_TERMINFO=OFF" - if [ -d $_FFI_INCLUDE_DIR ]; then - cmake_d="$cmake_d -D FFI_INCLUDE_DIR=$_FFI_INCLUDE_DIR" - fi + #if [ -d $_FFI_INCLUDE_DIR ]; then + # cmake_d="$cmake_d -D FFI_INCLUDE_DIR=$_FFI_INCLUDE_DIR" + #fi
for some reason the _FFI_INCLUDE_DIR in place was not working. I did comment out the part modifying this and hardcoded the FFI_INCLUD_DIR path.
To find the path I used
$ pkg-config libffi --cflags-only-I -I/usr/lib64/libffi/include
I think relying on pkg-config could help bringing cross system compatibility.
OpenVDB
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index 6a247e81148..6f58dc01b46 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -2431,8 +2431,9 @@ compile_OPENVDB() { fi if [ "$_with_built_openexr" = true ]; then - make_d="$make_d ILMBASE_INCL_DIR=$INST/openexr/include ILMBASE_LIB_DIR=$INST/openexr/lib" - make_d="$make_d EXR_INCL_DIR=$INST/openexr/include EXR_LIB_DIR=$INST/openexr/lib" + make_d="$make_d ILMBASE_INCL_DIR=$INST/openexr/include ILMBASE_LIB_DIR=$INST/openexr/lib64" + make_d="$make_d EXR_INCL_DIR=$INST/openexr/include EXR_LIB_DIR=$INST/openexr/lib64" + make_d="$make_d HALF_INCL_DIR=$INST/openexr/include HALF_LIB_DIR=$INST/openexr/lib64" INFO "ILMBASE_HOME=$INST/openexr" fi
for some reason openexr lib was compiled in lib64 directory
OpenCollada
OpenCollada is not compatible with modern PRCE: see https://github.com/KhronosGroup/OpenCOLLADA/issues/547
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index 6a247e81148..6f58dc01b46 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -2728,6 +2729,9 @@ compile_OpenCOLLADA() { git reset --hard fi + sed -i "s/typedef struct real_pcre pcre;//g" COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h + sed -i "s/struct real_pcre;/#include \"pcre.h\"/g" COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h + # Always refresh the whole build! if [ -d build ]; then rm -rf build
I have stolen the fix from https://github.com/lasalvavida/OpenCOLLADA/pull/1
Next steps
Do you see value in fixing this ? If so I can split my fixes and work on getting it merged here.