Hello fellow blenderists, I hope your day is progressing smoothly.
I am trying to acquire a truly headless version of Blender 3.6 (one that has no dependencies on an installed XServer). Sadly I haven’t been able to find any compiled headless versions, so I’ve embarked on the ambitious and possibly foolhardy journey of trying to build it myself. I’ve encountered numerous obstacles along the way, some of which I’ve been able to solve and some which I have not, for which I would be very glad of any assistance.
My target system is CentOS 7, which natively does not support a modern enough version of make/cmake to compile, so I have the required build tools installed to a conda environment (which is probably where a lot of the problems are originating)
I update the headers location to include the conda env
export C_INCLUDE_PATH=/home/insico/anaconda3/envs/blender-build/include/:/usr/include
export CPLUS_INCLUDE_PATH=/home/insico/anaconda3/envs/blender-build/include/:/usr/include
I comment out the following line in /intern/cycles/kernel/CMakeLists.txt
:
add_custom_command(
OUTPUT ${cycles_kernel_oneapi_lib}
COMMAND ${CMAKE_COMMAND} -E env
- "LD_LIBRARY_PATH=${sycl_compiler_root}/../lib:${OCLOC_INSTALL_DIR}/lib:${IGC_INSTALL_DIR}/lib"
+# "LD_LIBRARY_PATH=${sycl_compiler_root}/../lib:${OCLOC_INSTALL_DIR}/lib:${IGC_INSTALL_DIR}/lib"
# `$ENV{PATH}` is for compiler to find `ld`.
"PATH=${OCLOC_INSTALL_DIR}/bin:${sycl_compiler_root}:$ENV{PATH}"
${SYCL_COMPILER}
To avoid a problem where some compiler warnings about float to double promotions stop compilation.
I am then able to proceed with the compilation up to Generating node_add_closure.oso
, where I get stuck with the following message:
/home/insico/blender-git/lib/linux_x86_64_glibc_228/osl/bin/oslc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
make[3]: *** [intern/cycles/kernel/osl/shaders/CMakeFiles/cycles_osl_shaders.dir/build.make:225: intern/cycles/kernel/osl/shaders/node_add_closure.oso] Error 127
make[2]: *** [CMakeFiles/Makefile2:3617: intern/cycles/kernel/osl/shaders/CMakeFiles/cycles_osl_shaders.dir/all] Error 2
make[1]: *** [Makefile:166: all] Error 2
make: *** [GNUmakefile:365: all] Error 2
Here I am stuck, for I cannot for the life of me get the build tools to recognise a non-standard library location. From googling I’ve tried the following to no avail:
- Setting the
LD_LIBRARY_PATH
env variable (does nothing) - Setting the
LIBRARY_PATH
env variable (does nothing) - Setting the
CMAKE_LIBRARY_PATH
env variable (does nothing) - In CMakeLists.txt writing
set(CMAKE_LIBRARY_PATH /home/insico/anaconda3/envs/blender-build/lib ${CMAKE_LIBRARY_PATH})
(does nothing) - In CMakeLists.txt writing
link_directories(/home/insico/anaconda3/envs/blender-build/lib)
(does nothing)
I am baffled that this is so hard to accomplish, so I can only assume I’m doing something drastically wrong and/or my knowledge of make/cmake is too poor to carry it out. Any help would be greatly appreciated.
Specs:
CentOS version = 7.9
Blender version = 3.6
make version = GNU Make 4.3
cmake version = 3.26.4
gcc version = (conda-forge gcc 13.1.0-0) 13.1.0
g++ version = (conda-forge gcc 13.1.0-0) 13.1.0