[Solved] Failed to build blender 2.83 (Embree)

Please help me to build blender 2.83:

Building Blender without skipping embree fails (no matter if I pass no parameter regarding embree or if I use --with-embree)

install_deps.sh --with-all --with-oidn --skip-osl

Building Embree: true (use --with-embree option to enable it).

warning: embree-3.8.0-1 is up to date – skipping
there is nothing to do

-D WITH_CYCLES_EMBREE=ON


Or even simpler, just run (in your blender-source dir):
make -j16 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 -U USD -D WITH_CODEC_SNDFILE=ON -D PYTHON_VERSION=3.7 -D WITH_OPENCOLORIO=ON -D WITH_CYCLES_OSL=OFF -D WITH_LLVM=OFF -D WITH_OPENSUBDIV=ON -D WITH_OPENVDB=ON -D WITH_OPENVDB_BLOSC=ON -D WITH_OPENCOLLADA=ON -D WITH_CYCLES_EMBREE=ON -D WITH_OPENIMAGEDENOISE=ON -D OPENIMAGEDENOISE_ROOT_DIR=/home/mick/blender-git/deps/oidn -D WITH_JACK=ON -D WITH_JACK_DYNLOAD=ON -D WITH_ALEMBIC=ON -D ALEMBIC_ROOT_DIR=/home/mick/blender-git/deps/alembic -D WITH_USD=ON -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;opus;mp3lame;x264;openjp2’ -D WITH_XR_OPENXR=ON -D XR_OPENXR_SDK_ROOT_DIR=/home/mick/blender-git/deps/xr-openxr-sdk"


– Could NOT find EMBREE (missing: _embree_LIBRARIES)

This is the error when building:

[100%] Linking CXX executable …/…/bin/blender
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::rtc_filter_occluded_func(RTCFilterFunctionNArguments const*): error: undefined reference to ‘rtcGetGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::rtc_filter_occluded_func(RTCFilterFunctionNArguments const*): error: undefined reference to ‘rtcGetGeometryUserData’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::rtc_filter_occluded_func(RTCFilterFunctionNArguments const*): error: undefined reference to ‘rtcGetGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::rtc_filter_occluded_func(RTCFilterFunctionNArguments const*): error: undefined reference to ‘rtcGetGeometryUserData’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::rtc_filter_occluded_func(RTCFilterFunctionNArguments const*): error: undefined reference to ‘rtcGetGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::rtc_filter_occluded_func(RTCFilterFunctionNArguments const*): error: undefined reference to ‘rtcGetGeometryUserData’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::rtc_filter_occluded_func(RTCFilterFunctionNArguments const*): error: undefined reference to ‘rtcGetGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::rtc_filter_occluded_func(RTCFilterFunctionNArguments const*): error: undefined reference to ‘rtcGetGeometryUserData’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::BVHEmbree(ccl::BVHParams const&, ccl::vector<ccl::Geometry*, ccl::GuardedAllocatorccl::Geometry* > const&, ccl::vector<ccl::Object*, ccl::GuardedAllocatorccl::Object* > const&): error: undefined reference to ‘rtcNewDevice’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::BVHEmbree(ccl::BVHParams const&, ccl::vector<ccl::Geometry*, ccl::GuardedAllocatorccl::Geometry* > const&, ccl::vector<ccl::Object*, ccl::GuardedAllocatorccl::Object* > const&): error: undefined reference to ‘rtcGetDeviceProperty’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::BVHEmbree(ccl::BVHParams const&, ccl::vector<ccl::Geometry*, ccl::GuardedAllocatorccl::Geometry* > const&, ccl::vector<ccl::Object*, ccl::GuardedAllocatorccl::Object* > const&): error: undefined reference to ‘rtcGetDeviceProperty’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::BVHEmbree(ccl::BVHParams const&, ccl::vector<ccl::Geometry*, ccl::GuardedAllocatorccl::Geometry* > const&, ccl::vector<ccl::Object*, ccl::GuardedAllocatorccl::Object* > const&): error: undefined reference to ‘rtcGetDeviceProperty’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::BVHEmbree(ccl::BVHParams const&, ccl::vector<ccl::Geometry*, ccl::GuardedAllocatorccl::Geometry* > const&, ccl::vector<ccl::Object*, ccl::GuardedAllocatorccl::Object* > const&): error: undefined reference to ‘rtcGetDeviceProperty’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::BVHEmbree(ccl::BVHParams const&, ccl::vector<ccl::Geometry*, ccl::GuardedAllocatorccl::Geometry* > const&, ccl::vector<ccl::Object*, ccl::GuardedAllocatorccl::Object* > const&): error: undefined reference to ‘rtcSetDeviceErrorFunction’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::destroy(RTCSceneTy*): error: undefined reference to ‘rtcReleaseScene’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::destroy(RTCSceneTy*): error: undefined reference to ‘rtcReleaseDevice’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_instance(ccl::Object*, int): error: undefined reference to ‘rtcNewGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_instance(ccl::Object*, int): error: undefined reference to ‘rtcSetGeometryInstancedScene’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_instance(ccl::Object*, int): error: undefined reference to ‘rtcSetGeometryTimeStepCount’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_instance(ccl::Object*, int): error: undefined reference to ‘rtcSetGeometryTransformQuaternion’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_instance(ccl::Object*, int): error: undefined reference to ‘rtcSetGeometryUserData’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_instance(ccl::Object*, int): error: undefined reference to ‘rtcSetGeometryMask’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_instance(ccl::Object*, int): error: undefined reference to ‘rtcCommitGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_instance(ccl::Object*, int): error: undefined reference to ‘rtcAttachGeometryByID’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_instance(ccl::Object*, int): error: undefined reference to ‘rtcReleaseGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_instance(ccl::Object*, int): error: undefined reference to ‘rtcSetGeometryTransform’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::update_tri_vertex_buffer(RTCGeometryTy*, ccl::Mesh const*): error: undefined reference to ‘rtcSetNewGeometryBuffer’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_triangles(ccl::Object const*, ccl::Mesh const*, int): error: undefined reference to ‘rtcNewGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_triangles(ccl::Object const*, ccl::Mesh const*, int): error: undefined reference to ‘rtcSetGeometryBuildQuality’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_triangles(ccl::Object const*, ccl::Mesh const*, int): error: undefined reference to ‘rtcSetGeometryTimeStepCount’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_triangles(ccl::Object const*, ccl::Mesh const*, int): error: undefined reference to ‘rtcSetNewGeometryBuffer’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_triangles(ccl::Object const*, ccl::Mesh const*, int): error: undefined reference to ‘rtcSetGeometryUserData’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_triangles(ccl::Object const*, ccl::Mesh const*, int): error: undefined reference to ‘rtcSetGeometryIntersectFilterFunction’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_triangles(ccl::Object const*, ccl::Mesh const*, int): error: undefined reference to ‘rtcSetGeometryOccludedFilterFunction’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_triangles(ccl::Object const*, ccl::Mesh const*, int): error: undefined reference to ‘rtcSetGeometryMask’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_triangles(ccl::Object const*, ccl::Mesh const*, int): error: undefined reference to ‘rtcCommitGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_triangles(ccl::Object const*, ccl::Mesh const*, int): error: undefined reference to ‘rtcAttachGeometryByID’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_triangles(ccl::Object const*, ccl::Mesh const*, int): error: undefined reference to ‘rtcReleaseGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::update_curve_vertex_buffer(RTCGeometryTy*, ccl::Hair const*): error: undefined reference to ‘rtcSetNewGeometryBuffer’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::refit_nodes(): error: undefined reference to ‘rtcCommitGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::refit_nodes(): error: undefined reference to ‘rtcCommitGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_curves(ccl::Object const*, ccl::Hair const*, int): error: undefined reference to ‘rtcNewGeometry’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_curves(ccl::Object const*, ccl::Hair const*, int): error: undefined reference to ‘rtcSetGeometryTessellationRate’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_curves(ccl::Object const*, ccl::Hair const*, int): error: undefined reference to ‘rtcSetNewGeometryBuffer’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_curves(ccl::Object const*, ccl::Hair const*, int): error: undefined reference to ‘rtcSetGeometryBuildQuality’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_curves(ccl::Object const*, ccl::Hair const*, int): error: undefined reference to ‘rtcSetGeometryTimeStepCount’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_curves(ccl::Object const*, ccl::Hair const*, int): error: undefined reference to ‘rtcSetGeometryUserData’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_curves(ccl::Object const*, ccl::Hair const*, int): error: undefined reference to ‘rtcSetGeometryIntersectFilterFunction’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_curves(ccl::Object const*, ccl::Hair const*, int): error: undefined reference to ‘rtcSetGeometryOccludedFilterFunction’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_curves(ccl::Object const*, ccl::Hair const*, int): error: undefined reference to ‘rtcSetGeometryMask’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_curves(ccl::Object const*, ccl::Hair const*, int): error: undefined reference to ‘rtcAttachGeometryByID’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::delete_rtcScene(): error: undefined reference to ‘rtcReleaseScene’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::delete_rtcScene(): error: undefined reference to ‘rtcReleaseScene’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::build(ccl::Progress&, ccl::Stats*): error: undefined reference to ‘rtcSetDeviceMemoryMonitorFunction’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::build(ccl::Progress&, ccl::Stats*): error: undefined reference to ‘rtcReleaseScene’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::build(ccl::Progress&, ccl::Stats*): error: undefined reference to ‘rtcNewScene’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::build(ccl::Progress&, ccl::Stats*): error: undefined reference to ‘rtcSetSceneFlags’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::build(ccl::Progress&, ccl::Stats*): error: undefined reference to ‘rtcSetSceneBuildQuality’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::build(ccl::Progress&, ccl::Stats*): error: undefined reference to ‘rtcSetSceneFlags’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::build(ccl::Progress&, ccl::Stats*): error: undefined reference to ‘rtcSetSceneProgressMonitorFunction’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::build(ccl::Progress&, ccl::Stats*): error: undefined reference to ‘rtcCommitScene’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::refit_nodes(): error: undefined reference to ‘rtcCommitScene’
…/…/lib/libcycles_bvh.a(bvh_embree.cpp.o):bvh_embree.cpp:function ccl::BVHEmbree::add_curves(ccl::Object const*, ccl::Hair const*, int): error: undefined reference to ‘rtcReleaseGeometry’
…/…/lib/libcycles_kernel.a(kernel.cpp.o):kernel.cpp:function ccl::subsurface_random_walk(ccl::KernelGlobals*, ccl::LocalIntersection*, ccl::ShaderData*, ccl::PathState*, ccl::ShaderClosure const*, float, float): error: undefined reference to ‘rtcOccluded1’
…/…/lib/libcycles_kernel.a(kernel.cpp.o):kernel.cpp:function ccl::subsurface_random_walk(ccl::KernelGlobals*, ccl::LocalIntersection*, ccl::ShaderData*, ccl::PathState*, ccl::ShaderClosure const*, float, float): error: undefined reference to ‘rtcOccluded1’
…/…/lib/libcycles_kernel.a(kernel.cpp.o):kernel.cpp:function ccl::svm_ao(ccl::KernelGlobals*, ccl::ShaderData*, ccl::float3, ccl::PathState*, float, int, int) [clone .isra.0]: error: undefined reference to ‘rtcOccluded1’
…/…/lib/libcycles_kernel.a(kernel.cpp.o):kernel.cpp:function ccl::svm_ao(ccl::KernelGlobals*, ccl::ShaderData*, ccl::float3, ccl::PathState*, float, int, int) [clone .isra.0]: error: undefined reference to ‘rtcIntersect1’
…/…/lib/libcycles_kernel.a(kernel.cpp.o):kernel.cpp:function ccl::kernel_volume_stack_init(ccl::KernelGlobals*, ccl::ShaderData*, ccl::PathState const*, ccl::Ray const*, ccl::VolumeStack*) [clone .isra.0]: error: undefined reference to ‘rtcOccluded1’
…/…/lib/libcycles_kernel.a(kernel.cpp.o):kernel.cpp:function ccl::shadow_blocked_opaque(ccl::KernelGlobals*, ccl::ShaderData*, ccl::PathState*, unsigned int, ccl::Ray*, ccl::Intersection*, ccl::float3*): error: undefined reference to ‘rtcIntersect1’
…/…/lib/libcycles_kernel.a(kernel.cpp.o):kernel.cpp:function ccl::kernel_path_indirect(ccl::KernelGlobals*, ccl::ShaderData*, ccl::ShaderData*, ccl::Ray*, ccl::float3, ccl::PathState*, ccl::PathRadiance*): error: undefined reference to ‘rtcIntersect1’
…/…/lib/libcycles_kernel.a(kernel.cpp.o):kernel.cpp:function ccl::kernel_path_trace(ccl::KernelGlobals*, float*, int, int, int, int, int): error: undefined reference to ‘rtcIntersect1’
collect2: error: ld returned 1 exit status
make[3]: *** [source/creator/CMakeFiles/blender.dir/build.make:354: bin/blender] Error 1
make[2]: *** [CMakeFiles/Makefile2:6798: source/creator/CMakeFiles/blender.dir/all] Error 2
make[1]: *** [Makefile:163: all] Error 2
make: *** [GNUmakefile:315: all] Error 2

adding

–with-embree --build-embree

to the parameters when calling install_deps.sh solves this

Forced Embree building, as requested…
Building Embree-3.8.0

On re-running install_deps in contrast to “warning: embree-3.8.0-1 is up to date – skipping” before you get

Own Embree-3.8.0 is up to date, nothing to do!
If you want to force rebuild of this lib, use the --force-embree option.

Apart from Unable to build Blender with Embree I could not find that I have to use these parameters and it seems illogical having to add them when building with embree is the default.