dreamworksanimation / openmoonray

MoonRay is DreamWorks’ open-source, award-winning, state-of-the-art production MCRT renderer.
https://openmoonray.org/
Apache License 2.0
4.32k stars 254 forks source link

Houdini missing library linked from /Applications/MoonRay/installs/lib/python/pxr/Tf/_tf.so for MacOS #167

Open justptkthings opened 3 months ago

justptkthings commented 3 months ago

I must be missing something, but my Houdini is having issues loading MoonRay as a plugin on Apple Silicon because the Python3.9 framework is missing in the install.

Error from Houdini:

ImportError: dlopen(/Applications/MoonRay/installs/lib/python/pxr/Tf/_tf.so, 0x0002): Library not loaded: @rpath/Python3.framework/Versions/3.9/Python3
  Referenced from: <B018F789-E1DA-32B3-8E79-0F748D30ED37> /Applications/MoonRay/installs/lib/python/pxr/Tf/_tf.so

Full Error: houdini_errors.txt

otool output:

otool -L /Applications/MoonRay/installs/lib/python/pxr/Tf/_tf.so
/Applications/MoonRay/installs/lib/python/pxr/Tf/_tf.so:
    @rpath/_tf.so (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libusd_tf.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libusd_arch.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.120.2)
    @rpath/Python3.framework/Versions/3.9/Python3 (compatibility version 3.9.0, current version 3.9.0)
    @rpath/libboost_python39.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libtbb.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1700.255.5)

ls output of /Applications/MoonRay/installs/lib aka @rpath ls_output.txt

Reproduction:

MacOS Version: Sonoma 14.6.1 OpenMoonRay Version: 1.6.0 Houdini Version: 19.5.805

OpenMoonRay Installation (Pretty much taken from the guide, but included for sanity check):

sudo mkdir -p /Applications/MoonRay/{installs,build,build-deps,source}
sudo mkdir -p /Applications/MoonRay/installs/{bin,lib,include}
sudo chown -R ${USER}: /Applications/MoonRay
cd /Applications/MoonRay/source
git clone https://github.com/dreamworksanimation/openmoonray.git
cd /Applications/MoonRay
ln -s source/openmoonray/building .
ln -s source/openmoonray .
cd /Applications/MoonRay/build-deps
cmake ../building/macOS
cmake --build .
cd /Applications/MoonRay/openmoonray
cmake --preset container-macOS
cmake --build --preset container-macOS
rm -rf /Applications/MoonRay/{build,build-deps,openmoonray/release}

Using Houdini Terminal 19.5.805:

sed -i 's/19.5.640/19.5.805/g' /Applications/MoonRay/openmoonray/scripts/macOS/setupHoudini.sh
source /Applications/MoonRay/openmoonray/scripts/macOS/setupHoudini.sh
houdinicore