# OpenUSD Build Error at 65%

**URL:** <https://forum.aousd.org/t/openusd-build-error-at-65/2187>\
**Category:** Build and Deployment\
**Created:** [January 29, 2025, 11:27pm UTC](https://forum.aousd.org/t/openusd-build-error-at-65/2187 "2025-01-29T23:27:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RolePlayingStudio](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@RolePlayingStudio](https://forum.aousd.org/u/RolePlayingStudio)\
**Post date:** [January 29, 2025, 11:27pm UTC](https://forum.aousd.org/t/openusd-build-error-at-65/2187/1 "2025-01-29T23:27:54Z")

</div>

Hello all! I am trying to build OpenUSD inside a docker container on a linux machine, and I have been getting many errors. I’m pretty sure I shouldn’t have had to fix anything so I probably did something wrong in setup, but I managed to fix most errors up until this one.

```auto
collect2: error: ld returned 1 exit status
gmake[2]: *** [pxr/usd/bin/sdffilter/CMakeFiles/sdffilter.dir/build.make:115: pxr/usd/bin/sdffilter/sdffilter] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:8444: pxr/usd/bin/sdffilter/CMakeFiles/sdffilter.dir/all] Error 2
[64%] Built target _ndr
[64%] Linking CXX shared library libusd_pcp.so
[65%] Built target pcp
[65%] Linking CXX shared library _sdf.so
[65%] Built target _sdf
gmake: *** [Makefile:136: all] Error 2

ERROR: Failed to run 'cmake --build . --config Release --target install -- -j32' in /usr/local/OpenUSD/build/build/OpenUSD.

```

I honestly have no idea what to do here. Regarding those gmake errors, in pxr/usd/bin/sdffilter/, there is no CMakeFiles directory. There are only CmakeLists.txt and sdfilter.cpp.

I’m pretty sure the build should work without my intervention, right? Any ideas why it’s giving me so many problems?

---

<div class="post-metadata">

**Author:** ![nporcino](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@nporcino](https://forum.aousd.org/u/nporcino)\
**Post date:** [January 30, 2025, 12:44am UTC](https://forum.aousd.org/t/openusd-build-error-at-65/2187/2 "2025-01-30T00:44:24Z")

</div>

Yes, the build is intended to work without intervention. It’s hard to say what the problem is without seeing the error the linker encountered.

It might be worthwhile comparing your docker configuration to this one which is known to work:

> **[aswf-docker/ci-usd at main · AcademySoftwareFoundation/aswf-docker](https://github.com/AcademySoftwareFoundation/aswf-docker/tree/main/ci-usd)**
>
> Common container configuration. Contribute to AcademySoftwareFoundation/aswf-docker development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![RolePlayingStudio](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@RolePlayingStudio](https://forum.aousd.org/u/RolePlayingStudio)\
**Post date:** [January 30, 2025, 1:14am UTC](https://forum.aousd.org/t/openusd-build-error-at-65/2187/3 "2025-01-30T01:14:32Z")

</div>

Okay. I’ll try using that container and comparing.

Help me understand though, I thought the build\_script first installs MaterialX and OpenSubdiv and any other dependencies OpenUSD has. Did I need to preinstall them, as I’m seeing in this repo, or is it supposed to work even without it all preinstalled.

And how do I use ci-usd to build usd? Do I need to clone the OpenUSD repo inside the running container from that image, and will that automatically make OpenUSD detect the preinstalled packages?

---

<div class="post-metadata">

**Author:** ![nporcino](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@nporcino](https://forum.aousd.org/u/nporcino)\
**Post date:** [January 30, 2025, 1:45am UTC](https://forum.aousd.org/t/openusd-build-error-at-65/2187/4 "2025-01-30T01:45:14Z")

</div>

Yes, the build script installs any dependencies required, however, I’m not aware that people have tried to use it within a docker container, so it’s possible that additional configuration or corrections might be needed to allow build\_usd.py to function in a docker container.

The container script I pointed to is the equivalent of build\_usd.py but instead of using that build script, it explictly maps out the requirements. If you want to use that script directly, I suggest asking the authors of it on the ASWF slack, in the wg-ci channel, there’s a lot of expertise there. This invite link will get you in, if you are not already a member: [Slack](https://join.slack.com/t/academysoftwarefdn/shared_invite/zt-2yskmuxph-7M8b4Nl1WIzSxmaBaLsBRQ)

---

<div class="post-metadata">

**Author:** ![dhruvgovil](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/dhruvgovil/32/3_2.png) [@dhruvgovil](https://forum.aousd.org/u/dhruvgovil)\
**Post date:** [January 30, 2025, 3:01pm UTC](https://forum.aousd.org/t/openusd-build-error-at-65/2187/5 "2025-01-30T15:01:01Z")

</div>

Do you have more to your error higher up in the log? When you build, with the Python script, add the `-vvv` flag to be more verbose.

There’ll be a line higher up that will likely say “error” and an actual code line that is failing.

Do you know what compiler version is being used in your docker?

---

<div class="post-metadata">

**Author:** ![RolePlayingStudio](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@RolePlayingStudio](https://forum.aousd.org/u/RolePlayingStudio)\
**Post date:** [January 31, 2025, 8:50pm UTC](https://forum.aousd.org/t/openusd-build-error-at-65/2187/6 "2025-01-31T20:50:43Z")

</div>

I have

gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0  
g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0  
cmake version 3.31.5  
Python 3.9.21

log is attached.

[log.txt](https://forum.aousd.org/uploads/short-url/eyb9zpBfU6SwmBPsfAOMzrcTehQ.txt) (270.8 KB)

The log refers to line 115 in pxr/usd/bin/sdffilter/CMakeFiles/sdffilter.dir/build.make.

These are lines 113-115 in that file:

```auto
pxr/usd/bin/sdffilter/sdffilter: pxr/usd/bin/sdffilter/CMakeFiles/sdffilter.dir/link.txt
	@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=/usr/local/OpenUSD/build/build/OpenUSD/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable sdffilter"
	cd /usr/local/OpenUSD/build/build/OpenUSD/pxr/usd/bin/sdffilter && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/sdffilter.dir/link.txt --verbose=$(VERBOSE)

```

The link.txt file it refers to only contains this one line:

```auto
/usr/bin/c++ -Wall -Wformat-security -pthread -Wno-deprecated -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-maybe-uninitialized -O3 -DNDEBUG CMakeFiles/sdffilter.dir/sdffilter.cpp.o -o sdffilter -L/usr/local/OpenUSD/build/lib -Wl,-rpath,/usr/local/OpenUSD/build/build/OpenUSD/pxr/usd/sdf:/usr/local/OpenUSD/build/build/OpenUSD/pxr/base/pegtl:/usr/local/OpenUSD/build/build/OpenUSD/pxr/base/ts:/usr/local/OpenUSD/build/build/OpenUSD/pxr/usd/ar:/usr/local/OpenUSD/build/build/OpenUSD/pxr/base/vt:/usr/local/OpenUSD/build/build/OpenUSD/pxr/base/gf:/usr/local/OpenUSD/build/build/OpenUSD/pxr/base/plug:/usr/local/OpenUSD/build/build/OpenUSD/pxr/base/work:/usr/local/OpenUSD/build/build/OpenUSD/pxr/base/trace:/usr/local/OpenUSD/build/build/OpenUSD/pxr/base/js:/usr/local/OpenUSD/build/build/OpenUSD/pxr/base/tf:/usr/local/OpenUSD/build/build/OpenUSD/pxr/base/arch:/usr/local/OpenUSD/build/build/OpenUSD/pxr/external/boost/python:/usr/local/OpenUSD/build/build/OpenUSD/pxr/external/boost:/usr/local/OpenUSD/build/lib: ../../sdf/libusd_sdf.so ../../../base/pegtl/libusd_pegtl.so ../../../base/ts/libusd_ts.so ../../ar/libusd_ar.so ../../../base/vt/libusd_vt.so ../../../base/gf/libusd_gf.so ../../../base/plug/libusd_plug.so ../../../base/work/libusd_work.so ../../../base/trace/libusd_trace.so ../../../base/js/libusd_js.so ../../../base/tf/libusd_tf.so ../../../base/arch/libusd_arch.so -ldl -lm ../../../external/boost/python/libusd_python.so ../../../external/boost/libusd_boost.so -ltbb

```

I’m not an expert on linking, but it seems that the sdf package is not getting linked to the libusd library?

A search for any libusd files in my repo returns no results.

---

<div class="post-metadata">

**Author:** ![dhruvgovil](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/dhruvgovil/32/3_2.png) [@dhruvgovil](https://forum.aousd.org/u/dhruvgovil)\
**Post date:** [January 31, 2025, 9:08pm UTC](https://forum.aousd.org/t/openusd-build-error-at-65/2187/7 "2025-01-31T21:08:46Z")

</div>

Thanks for that extra info.  
I wonder if its because its compiling as PIE?  
`warning: creating DT_TEXTREL in a PIE`

I’m not super familiar with GCC these days on Linux to comment. @asluk I wonder if anyone on your end has more familiarity here?

Looking at this SO [assembly - Understanding a DT\_TEXTREL warning - Stack Overflow](https://stackoverflow.com/questions/76651605/understanding-a-dt-textrel-warning) it seems like one suggestion is adding `--no-pie` to the compiler flags, but I can’t imagine that would be required either since your Ubuntu version is ~3years old, so would have been caught by now as well.
