Skip to content

Houdini libraries that must be recompiled to use Houdini with a custom build of the USD library.

License

Notifications You must be signed in to change notification settings

suesauer/HoudiniUsdBridge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HoudiniUsdBridge

Houdini libraries that must be recompiled to use Houdini with a custom build of the USD library.

Building USD on Linux

In order for this to work, there are a few requirements for how the USD library is built:

  1. You must define "_GLIBCXX_USE_CXX11_ABI=0"
  2. You must set the compile flag "-std=c++14"

These conditions can be met by editing USD/cmake/defaults/gccclangshareddefaults.cmake to set these options. Specifically, the following line:

set(_PXR_GCC_CLANG_SHARED_CXX_FLAGS "${_PXR_GCC_CLANG_SHARED_CXX_FLAGS} -std=c++11")

Should be replaced by:

set(_PXR_GCC_CLANG_SHARED_CXX_FLAGS "${_PXR_GCC_CLANG_SHARED_CXX_FLAGS} -std=c++14")
set(_PXR_GCC_CLANG_SHARED_CXX_FLAGS "${_PXR_GCC_CLANG_SHARED_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")

In addition, the boost build used by USD must also set these options, which can be done by editing the USD/build_scripts/build_usd.py file. Specifically, the following lines must be added to the b2_settings variable:

'cflags="-fPIC -std=c++14 -D_GLIBCXX_USE_CXX11_ABI=0"'
'cxxflags="-fPIC -std=c++14 -D_GLIBCXX_USE_CXX11_ABI=0"'

Building Pixar Operators for Houdini

Because the gusd library gets built into Houdini, you should not build the Houdini operators when doing your build of USD. Instead, you should build the Pixar operators from the $HT/samples/USD directory that comes with Houdini. You can of course update the source files in there from your USD repository if you have newer code than what ships with Houdini.

Building Houdini libraries

Once you have built USD, it is time to build the replacement libHoudiniUSD.so (libHUSD.dll and libgusd.dll on Windows), USD_Plugins.so, and other libraries. You must use CMake to build these libraries. CMake version 3.12 is required (due to the use of add_compile_definitions).

The following variables are used to configure the CMake build:

  • HOUDINI_PATH: The path to the root of the Houdini install. If this is omitted, the $HFS environment variable will be checked as well.
  • USD_ROOT: The path to the USD install.
  • BOOST_NAMESPACE: The namespace of the Boost build used by the external USD build. This defaults to "boost".
  • COPY_HOUDINI_USD_PLUGINS: Whether to copy the $HH/dso/usd_plugins directory from the Houdini install into the HoudiniUsdBridge install tree. This defaults to ON.

Once the libraries are built, copy libHoudiniUSD.so to the $HDSO ($HB on Windows) directory (where most Houdini shared libraries are installed). You will probably want to move aside the existing libraries first in case there is a problem with the new libraries. The USD_Plugins.so library should be copied to $HH/dso/usd. And the USD_Ops.so library should be copied to $HH/dso.

The libpxr_usd_ms.so library is an empty library with no actual functionality in it. It's purpose is simply to allow Houdini's other libraries to satisfy their link dependencies on that library name. The symbols that used to be exported from this library will instead come from your USD build which can be installed elsewhere. All the libpxr libraries in $HDSO or $HB should be replaced with this empty dummy library to avoid duplicate symbols.

Other Considerations

The Houdini USD build has a number of directories automatically added to the USD plugin path ($HDSO/usd_plugins and $HH/dso/usd_plugins). You may need to add these explicitly to your USD plugin path environment variable to ensure that the Houdini USD plugins are loaded by your USD build.

Acknowledgements

The USD library on which these libraries are built is created by Pixar: https://github.com/PixarAnimationStudios/USD SideFX also maintains a fork of this repository: https://github.com/sideeffects/USD

The code in the 'src/houdini/lib/H_USD/gusd' directory of this repository began as a direct copy of the 'third_party/houdini/lib/gusd' directory from this USD repository, and so still contains the original Pixar copyright notices.

About

Houdini libraries that must be recompiled to use Houdini with a custom build of the USD library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 49.6%
  • C++ 47.9%
  • Python 2.0%
  • CMake 0.5%