Using OpenSubdiv

Using OpenSubdiv


Compiling & Linking

Here are example commands for building an OpenSubdiv application on several architectures:

Linux

g++ -I$OPENSUBDIV/include -c myapp.cpp
g++ myapp.o -L$OPENSUBDIV/lib -losdCPU -losdGPU -o myapp

Mac OS-X

g++ -I$OPENSUBDIV/include -c myapp.cpp
g++ myapp.o -L$OPENSUBDIV/lib -losdCPU -losdGPU -o myapp
install_name_tool -add_rpath $OPENSUBDIV/lib myapp

(On 64-bit OS-X: add -m64 after each g++.)

Windows

cl /nologo /MT /TP /DWIN32 /I"%OPENSUBDIV%\include" -c myapp.cpp
link /nologo /out:myapp.exe /LIBPATH:"%OPENSUBDIV%\lib" libosdCPU.lib libosdGPU.lib myapp.obj

Note:

HBR uses the offsetof macro on a templated struct, which appears to spurriously set off a warning in both gccc and Clang. It is recommended to turn the warning off with the -Wno-invalid-offsetof flag.