Setting up development env on Mac OS X

I am planning to begin working on posted issues for Panda3D, but first need to set up a development and testing environment. I have been making steady progress on this. I decided to do this on a Big Sur system and have installed Xcode 12. I have forked the panda3d code from github and downloaded the 3rd party tools. After a bit of noodling, I was able to get the compiler going, but hit a snag. Here is the command I used:

python3 makepanda/makepanda.py --everything --verbose --no-python

This successfully went through a significant amount of the process, but then I hit this error:

Writing built/etc/Confauto.prc
install_name_tool -id @loader_path/…/lib/libfmodexL.dylib built/lib/libfmodexL.dylib
otool -L built/lib/libfmodexL.dylib | grep .dylib > built/tmp/otool-libs.txt
install_name_tool -id @loader_path/…/lib/libfmodex.dylib built/lib/libfmodex.dylib
otool -L built/lib/libfmodex.dylib | grep .dylib > built/tmp/otool-libs.txt
install_name_tool -id @loader_path/…/lib/libopencv_highgui.2.4.3.dylib built/lib/libopencv_highgui.2.4.3.dylib
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: in swap_object_headers(): malformed load command 0 (cmdsize not a multiple of 4)
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: internal error: swap_object_headers() failed
Thoughts?

Hi, this is a recent issue on Big Sur, please see this bug report for a workaround:

Thanks rdb. Looks like it’s off and running.

The build finished with just one issue. Mac security didn’t want to give permission to /Cg.framework. This is easily solved by going to System Preferences:Security and Privacy. There should be a notification there that Cg.framework was trying to launch with an option to always allow. You will also get a separate dialog notifying you that MacOS blocked the execution of Cg.framework. Select cancel in this dialog. Restart the build by reissuing the command:
python3 makepanda/makepanda.py --everything --verbose --no-python --no-opencv --no-fmod --installer
That worked for me. I took pretty careful notes and can write up directions for anyone else interested in using MacOS as their dev environment.
Thanks rdb for all your help

Glad that you managed to produce a build. Please note you can add something like --threads 4 (or however many CPU cores you want to devote to this) to make the build go faster.