Surprisingly on the forum or the wiki I have not found a lot of information about it. Most is from Yorik in the github readme (see link) and also there are a frew posts on the developer section, so people seem to have done this.
- https://github.com/FreeCAD/FreeCAD-render, Wiki link
The Blender wiki might have contained detailed info once, but 2020 it only says the following on the topicTo use the Cycles renderer, Cycles must be compiled as standalone. The Blender wiki has a section on how to compile Cycles as standalone
I thought I put together a small script to download and compile Cycles on a Ubuntu 18.04, so I could pull updates in the future easily. However, it turned out to be a lot more difficut than expected . Maybe the problem is that I wanted to install the dependencies as libraries from the repository instread of downloading all the code and their recursive dependencies. Right now I am not sure any more if that works at all. Below is the script so far. I have been though quite a few iterations yet and it still does not compile. Currently I am stuck at resolving "could not find OSL" and "could not find LLVM". OSL is the OpenShadingLanguare and needs to be compiles from source - but according to the wiki it is only optional when WITH_CYCLES_OSL option is set which it is not. So its not clear why it still asks for this.No precompiled binaries are available at the moment. Instead you can get the source code (see below) and compile your own
The "could not find LLVM" is more tricky: I tried the following without success: "libllvm-10-ocaml-dev", "libllvm-9-ocaml-dev","libllvm6.0","libllvm9.0". None solved the error.
Is there somone who has gone through this already and can give me a hint on how to compile Cycles on a Ubuntu box? Did I miss something? For my feeling this is already a lot more fuss than it should be.
Code: Select all
#/!bin/bash
# This script will download and compily cycles from source
# Usage
# ./compile_cycles.sh
# it will ask for the sudo password for installation.
# download current master from the web
cd ~/temp
sudo rm -r ~/temp/cycles
mkdir -p ~/temp/cycles
git clone https://git.blender.org/cycles.git
# install dependencies
sudo apt install -y libopengl0
sudo apt install -y libglew-dev
sudo apt install -y libboost-all-dev
sudo apt install -y libopenimageio-dev
sudo apt install -y libpugixml-dev
sudo apt install -y libglu1-mesa-dev
sudo apt install -y libilmbase-dev
sudo apt install -y libopenexr-dev
sudo apt install -y libopencolorio
# compile
# added no Cycles option. If add with -D WITH_CYCLES_XXX the '...'
# The other options found on a post for compiler blender...
# Note: this fails with missing stuff:
# OSL (not clear which. libosl is sth different)
# LLVM (there are no libllvmX-dev, but libllvm4.0..libllvm19 and libllvm-X-ocaml-dev ?). Installing "libllvm-10-ocaml-dev" did not solve the error
make BUILD_CMAKE_ARGS="-DBOOST_ROOT=/usr/lib/boost -DBoost_NO_BOOST_CMAKE=ON -DBoost_NO_SYSTEM_PATHS=ON" CMAKE_EXE_LINKER_FLAGS='-lGLU' release
Code: Select all
-- GLUT_FOUND=TRUE
-- Could NOT find OSL (missing: _osl_LIBRARIES OSL_INCLUDE_DIR OSL_COMPILER)
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find LLVM (missing: LLVM_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
src/cmake/Modules/FindLLVM.cmake:96 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/cmake/external_libs.cmake:101 (find_package)
src/CMakeLists.txt:18 (include)
-- Configuring incomplete, errors occurred!
Edit: minor script correction