Open coolvision opened 2 years ago
This is my bad: I forgot that Apple's notarization requirement is such that the MuJoCo.app bundle needs to be "sealed". This prevents us from having the symlink in the copy of mujoco.framework that lives inside MuJoCo.app in a way that would make it usable as a framework for building other applications. (In other words, we had to explicitly delete the crucial symlink when we submit MuJoCo.app for notarization, which is a requirement for macOS to allow the app to be run when downloaded over the Internet)
The copy of mujoco.framework that's shipped in the same DMG but separate from MuJoCo.app should have the necessary symlink. I guess we need to update the instructions to ask people to copy mujoco.framework somewhere and point the Makefile to it.
I'm mistaken yet again. Turns out the failure to sign and notarize was my fault, not Apple's restriction. I believe I have now successfully restructured the bundles in such a way as to allow it to be signed, notarized, and have the embedded framework be usable. Stay tuned.
This is now fully resolved in the 2.2.1 release.
Hmm, I still had to add the same symlink to get this to work. Not sure if this is maybe an issue with my setup? I'm just running clang++
from the command line using the MacOS Makefile:
$ clang++ -O2 -F/Applications/MuJoCo.app/Contents/Frameworks -I/usr/local/include -pthread -std=c++17 -stdlib=libc++ -L/usr/local/lib -Wl,-rpath,/Applications/MuJoCo.app/Contents/Frameworks basic.cc -framework mujoco -lglfw -o basic
> ld: framework not found mujoco
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make: *** [all] Error 1
$ cd /Applications/MuJoCo.app/Contents/Frameworks/mujoco.framework
$ ls -l
> total 0
> lrwxr-xr-x 1 alexandercai admin 24 Jun 20 13:41 Headers -> Versions/Current/Headers
> lrwxr-xr-x 1 alexandercai admin 24 Jun 20 13:41 Modules -> Versions/Current/Modules
> lrwxr-xr-x 1 alexandercai admin 26 Jun 20 13:41 Resources -> Versions/Current/Resources
> drwxr-xr-x@ 4 alexandercai admin 128 Jun 20 13:21 Versions
$ ln -s Versions/Current/libmujoco.2.3.6.dylib mujoco
$ cd -
$ clang++ -O2 -F/Applications/MuJoCo.app/Contents/Frameworks -I/usr/local/include -pthread -std=c++17 -stdlib=libc++ -L/usr/local/lib -Wl,-rpath,/Applications/MuJoCo.app/Contents/Frameworks basic.cc -framework mujoco -lglfw -o basic
Everything works fine after that. Just thought I'd leave this here.
+1, I had the same error as @adzcai and I had to add the missing symlink to get this to compile, using that same MacOS Makefile. All I did was download the .dmg and drag MuJoCo.app
to the Applications/
directory beforehand.
@saran-t is it maybe worth taking another look at whether the bundle should be fixed? or is this an issue with our setups somehow?
@saran-t Can confirm this is still an issue in 3.1.6.
Can we just remove the Makefile altogether?
For anyone having issues with symlink on MacOS, when adding symlink make sure that libmujoco.x.x.x is the version of Mujoco you are using
ln -s Versions/Current/libmujoco.x.x.x.dylib /Applications/MuJoCo.app/Contents/Frameworks/mu
Can we just remove the Makefile altogether?
@saran-t I agree we should remove the makefiles, but this issue is unrelated right? This is about our macOS packaging script, no?
Using:
First, tried to build with the makefile:
checked that framework is installed in correct location required by the makefile:
Clang version:
Next, tried to run first makefile command:
Finally was able to fix this by adding a symlink:
After this, build works correctly, so I would guess that this symlink is missing from the dmg.