OSX maya2egg2012: dyld: Symbol not found: __Py_NoneStruct

Building on Snow Leopard, 64-bits, with current CVS source. Almost everything compiled fine (don’t have 64-bit builds for some of the thirdparty libraries, but enough to work with for now). maya2egg2012 gave me this error:

dyld: Symbol not found: __Py_NoneStruct
  Referenced from: /Developer/Panda3D/lib/libp3dtool.1.9.dylib
  Expected in: flat namespace
 in /Developer/Panda3D/lib/libp3dtool.1.9.dylib

Trace/BPT trap

as if it should be linking to python, but isn’t, maybe?

[/code]

I’m not sure whether this is related or not, but Maya has always given us problems due to the fact that Maya itself links with a different version of Python than the one we use for Panda. So there do tend to be linking errors.

We did finally solve this on Windows through some sneaky hacks, which allow Panda to be linked in with Maya as long as it promises never to call into any of its own Python functions.

I’m not sure whether this should also work OSX–I’ve never personally tried to build Maya support on OSX (I don’t have that license), and I do know the OSX linker is pretty fussy about some stupid things. rdb might have some more insights.

In the meantime, you could try researching this by simply adding -framework Python to the link line by hand to see what happens.

David

Yeah, it’s always been persnickety. I had to do something similar on Linux with the current maya and panda versions.

If I try that linker flag on the command line and it works, where would I add it into makepanda?

I think you only need to add ‘PYTHON’ to the opts list for maya2egg.exe etc. You’ll find that makepanda.py is actually fairly straightforward to read. :slight_smile:

David

I have not tried Maya on 64-bit OSX. Let me know your findings!

Linking to the wrong version of Python will probably make the Maya exporter crash. You should try and link to Maya’s version of Python instead of Panda’s. Panda checks for the PANDA_INCOMPATIBLE_PYTHON environment variable, if it is set, then Panda will try not to make calls into Python. I believe it is set automatically by mayapath.cxx (which compiles to the maya2egg program) before invoking maya2egg_bin.

Definitely some progress.

  TargetAdd('maya2egg'+VNUM+'.exe', opts=['PYTHON'])

solved that error, but I have another one:

maya2egg2012
MAYA_LOCATION: /Applications/Autodesk/maya2012/Maya.app/Contents
dyld: Library not loaded: /Developer/Panda3D/lib/libOpenMaya.dylib
  Referenced from: /Developer/Tools/Panda3D/maya2egg2012_bin
  Reason: image not found

strange that it would be looking in Panda3D/lib, not in /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS. Must be some linker flag I guess?

btw here’s my build line, showing which third party libraries are included (not related to the error, here, but just for general interest)

makepanda/makepanda.py --everything  --installer --verbose --no-artoolkit --no-opencv --no-ffmpeg --no-rocket --no-ode --no-tiff --no-swscale --no-vrpn --no-fcollada --no-squish --no-fftw --threads 4

I don’t have 64-bit versions of those libs, but I do get a generally fully functioning 64-bit OSX panda with this.

[/code]

This means that makepanda has mistaken it for a Panda library and changed the library reference to an absolute one. That’s a bug, but for now, try this:
Call “otool -L” on the maya2egg_bin binary to see the libraries it pulls in.
Then, use the following command to change the the library reference to the correct path: (this is one long command, the forum software breaks it up)

install_name_tool -change /Developer/Panda3D/lib/libOpenMaya.dylib /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libOpenMaya.dylib path/to/maya2egg_bin

By the way, I have recently recompiled many of the thirdparty packages for 64-bits OSX, if you want a copy, let me know.

That got through those linking errors, but now I have this one:

MAYA_LOCATION: /Applications/Autodesk/maya2012/Maya.app/Contents
dyld: Library not loaded: @executable_path/libIMFbase.dylib
  Referenced from: /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libOpenMaya.dylib
  Reason: image not found
Trace/BPT trap

Yes, I’d love a copy of the OSX 64-bit thirdparty libs, that’d be great - thanks!

[/quote]

Here you go:
rdb.name/thirdparty_mac_x86_64.bz2
Missing are still OpenCV, tiff, VRPN, ffmpeg, and librocket. The ones that are there should be universal (ppc, i386, x86_64, some even ppc64)

Could you tell me the location of libIMFbase.dylib on your system?

thanks!

yes, it’s

/Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libIMFbase.dylib

it’s one of the libs I did the install_name_tool command with:

install_name_tool -change /Developer/Panda3D/lib/libOpenMaya.dylib /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libOpenMaya.dylib maya2egg2012_bin 
install_name_tool -change /Developer/Panda3D/lib/libOpenMayaAnim.dylib /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libOpenMayaAnim.dylib maya2egg2012_bin 
install_name_tool -change /Developer/Panda3D/lib/libAnimSlice.dylib /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libAnimSlice.dylib maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libDeformSlice.dylib  /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libDeformSlice.dylib  maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libModifiers.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libModifiers.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libDynSlice.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libDynSlice.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libKinSlice.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libKinSlice.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libModelSlice.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libModelSlice.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libNurbsSlice.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libNurbsSlice.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libPolySlice.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libPolySlice.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libProjectSlice.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libProjectSlice.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libImage.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libImage.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libShared.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libShared.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libTranslators.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libTranslators.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libDataModel.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libDataModel.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libRenderModel.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libRenderModel.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libNurbsEngine.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libNurbsEngine.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libDependEngine.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libDependEngine.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libCommandEngine.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libCommandEngine.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libFoundation.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libFoundation.dylib    maya2egg2012_bin
install_name_tool -change /Developer/Panda3D/lib/libIMFbase.dylib       /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libIMFbase.dylib    maya2egg2012_bin

Hmm. I’m not all that familiar with the workings of dyld and @executable_path, but from what I can gather here, a workaround could be setting DYLD_FALLBACK_LIBRARY_PATH to “/Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/” before running.

Progress! :slight_smile:

I have a working OSX 64-bit Panda with maya2egg2012, built on Snow Leopard. I had to do a lot of manual steps including copying files out of Maya.app, which is probably bad, but here are the steps I took.

  1. Using current CVS source for 64-bit / Cocoa support, for handy things like opening a window and rendering graphics

  2. in makepanda.py, added Python as a dependency for maya2egg

5321:

    TargetAdd('maya2egg'+VNUM+'.exe', opts=['PYTHON'])
  1. Changed the rpath flag when linking maya2egg2012_bin from
-rpath,/Applications/Autodesk/maya2012/lib

to

-rpath,/Applications/Autodesk/maya2012/Maya.app/Contents/MacOS

I didn’t know exactly where to change that in makepanda so did it manually:

g++ -o built/bin/maya2egg2012_bin -Lbuilt/lib -Lbuilt/tmp -L/usr/X11R6/lib built/tmp/maya2egg2012_mayaToEgg.o -lmayaegg2012 -lmaya2012 -lp3eggbase -lp3progbase -lp3converter -lp3pandatoolbase built/lib/libpandaegg.dylib built/lib/libpanda.dylib built/lib/libpandaexpress.dylib built/lib/libp3dtool.dylib built/lib/libp3dtoolconfig.dylib -headerpad_max_install_names -L/Applications/Autodesk/maya2012/Maya.app/Contents/MacOS -framework AppKit -Wl,-rpath,/Applications/Autodesk/maya2012/Maya.app/Contents/MacOS -lOpenMaya -lOpenMayaAnim -lAnimSlice -lDeformSlice -lModifiers -lDynSlice -lKinSlice -lModelSlice -lNurbsSlice -lPolySlice -lProjectSlice -lImage -lShared -lTranslators -lDataModel -lRenderModel -lNurbsEngine -lDependEngine -lCommandEngine -lFoundation -lIMFbase -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -pthread -ldl
  1. Did a bunch of install_tool commands to change where it’s looking for all the Maya libs

  2. Still this error:

MAYA_LOCATION: /Applications/Autodesk/maya2012/Maya.app/Contents
dyld: Library not loaded: @executable_path/../Frameworks/MC3Framework.framework/Versions/A/MC3Framework
  Referenced from: /Applications/Autodesk/maya2012/Maya.app/Contents/MacOS/libFoundation.dylib

Which I could only solve by copying /Applications/Autodesk/maay2012/Maya.app/Contents/Frameworks/MC3Framework into /Developer/Tools/Frameworks

which seems like a very ugly hack, but at least it’s getting somewhere …

Great work! I wouldn’t have guessed that setting an rpath would work, I’ll keep that in mind. I wonder why it’s not working for the framework, though…