[SOLVED] Building with USD fails

Hi,

it seems that blender is not configured to build with USD by default:

-- Could NOT find USD (missing: USD_LIBRARY USD_INCLUDE_DIR) 
-- USD not found, disabling WITH_USD

so I edited the build configuration in /build_linux/CMakeCache.txt using CMake:
set USD_INCLUDE_DIR to /home/mick/blender-git/lib/linux_centos7_x86_64/usd/include
and USD_LIBRARY to /home/mick/blender-git/lib/linux_centos7_x86_64/usd/lib/libusd_usd_m.a
but it still fails to build:


[ 43%] Building C object source/blender/draw/CMakeFiles/bf_draw_shaders.dir/intern/shaders/common_subdiv_vbo_sculpt_data_comp.glsl.c.o
In file included from /home/mick/blender-git/lib/linux_centos7_x86_64/usd/include/pxr/usd/sdf/path.h:1396,
                 from /home/mick/blender-git/lib/linux_centos7_x86_64/usd/include/pxr/usd/pcp/mapFunction.h:29,
                 from /home/mick/blender-git/lib/linux_centos7_x86_64/usd/include/pxr/usd/usd/editTarget.h:30,
                 from /home/mick/blender-git/lib/linux_centos7_x86_64/usd/include/pxr/usd/usd/stage.h:32,
                 from /home/mick/blender-git/blender/source/blender/io/usd/intern/usd_asset_utils.h:7,
                 from /home/mick/blender-git/blender/source/blender/io/usd/intern/usd_asset_utils.cc:4:
/home/mick/blender-git/lib/linux_centos7_x86_64/usd/include/pxr/usd/sdf/pathNode.h:36:10: fatal error: tbb/atomic.h: No such file or directory
   36 | #include <tbb/atomic.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [source/blender/io/usd/CMakeFiles/bf_usd.dir/build.make:76: source/blender/io/usd/CMakeFiles/bf_usd.dir/intern/usd_asset_utils.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....



...



[ 43%] Building C object source/blender/draw/CMakeFiles/bf_draw_shaders.dir/intern/shaders/draw_debug_print_display_frag.glsl.c.o
In file included from /home/mick/blender-git/lib/linux_centos7_x86_64/usd/include/pxr/usd/sdf/path.h:1396,
                 from /home/mick/blender-git/blender/source/blender/io/usd/intern/usd_exporter_context.h:7,
                 from /home/mick/blender-git/blender/source/blender/io/usd/intern/usd_hierarchy_iterator.h:7,
                 from /home/mick/blender-git/blender/source/blender/io/usd/intern/usd_capi_export.cc:6:
/home/mick/blender-git/lib/linux_centos7_x86_64/usd/include/pxr/usd/sdf/pathNode.h:36:10: fatal error: tbb/atomic.h: No such file or directory
   36 | #include <tbb/atomic.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [source/blender/io/usd/CMakeFiles/bf_usd.dir/build.make:90: source/blender/io/usd/CMakeFiles/bf_usd.dir/intern/usd_capi_export.cc.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:6802: source/blender/io/usd/CMakeFiles/bf_usd.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....



...



[ 53%] Built target extern_mantaflow
make[1]: *** [Makefile:166: all] Error 2
make: *** [GNUmakefile:368: all] Error 2

Does it work for you out of the box? How can I fix it?

What is the output of svn info when run in /home/mick/blender-git/lib/linux_centos7_x86_64/ and git rev-parse HEAD when run in /home/mick/blender-git/blender/

svn info
Path: .
Working Copy Root Path: /home/mick/blender-git/lib/linux_centos7_x86_64
URL: https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64
Relative URL: ^/trunk/lib/linux_centos7_x86_64
Repository Root: https://svn.blender.org/svnroot/bf-blender
Repository UUID: 954f8c5b-7b00-dc11-b283-0030488c597c
Revision: 63251
Node Kind: directory
Schedule: normal
Last Changed Author: campbellbarton
Last Changed Rev: 63083
Last Changed Date: 2022-11-02 10:14:13 +0100 (Mi, 02 Nov 2022)

and

git rev-parse HEAD
e61566137b2f4c68ccb7d88e782ef55bd91bb5cc

You’re using an old library folder, early December we switched to a different one, see this post on bf-committers for details how to update your local environment.

1 Like

That’s it, thank you!