Drake has begun incorporating portions of OpenUSD, via building from source code. One Drake-specific requirement (that other downstream library developers may have) is to minimize the symbols that are visible from its shared libraries.
Happily, OpenUSD has a very nice system to let downstream builders rewrite its namespaces. However, the Drake integration experience so far has uncovered a few holes in the namespace scheme. I hope to help address this by offering a few small PRs, with reference back to this issue.
Steps to Reproduce
It's easiest to give an example from OpenUSD's own shared library output. These instructions are for Ubuntu Jammy.
Description of Issue
Drake has begun incorporating portions of OpenUSD, via building from source code. One Drake-specific requirement (that other downstream library developers may have) is to minimize the symbols that are visible from its shared libraries.
Drake uses two techniques to control symbols:
Technique 1 has the limitation that it sometimes interferes with c++ in surprising ways (e.g https://github.com/PixarAnimationStudios/OpenUSD/issues/1475). It can work well for plain C code.
Happily, OpenUSD has a very nice system to let downstream builders rewrite its namespaces. However, the Drake integration experience so far has uncovered a few holes in the namespace scheme. I hope to help address this by offering a few small PRs, with reference back to this issue.
Steps to Reproduce
It's easiest to give an example from OpenUSD's own shared library output. These instructions are for Ubuntu Jammy.
$cd path-to/OpenUSD
$ git checkout dev
$ python3 ./build_scripts/build_usd.py --no-python ~/tmp/usd/dist
$ cd ~/tmp/usd/dist
$ readelf --wide --symbols --demangle ./lib/libusd_work.so | grep 'GLOBAL *DEFAULT' |egrep -v 'pxrInternal|GLIBC|GCC|CXXABI|tbb::'
PXR_WORK_THREAD_LIMIT
is GLOBAL and not namespaced.System Information (OS, Hardware)
Ubuntu LTS versions for x84_64, macOS recent versions for arm64. See the Supported Configurations table at https://drake.mit.edu/installation.html .
Package Versions
The problems vary over time, but several were seen as of v24.08. Current dev has fewer problems already.
Build Flags