Open Colocasia opened 2 years ago
What Mono version do you have installed? Is it recent enough to support M1 Macs?
ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/Current/lib/libmonosgen-2.0.dylib, missing required architecture arm64
Seems like you have x86_64 only mono runtime installed. https://www.mono-project.com/download/stable/ should have universal version of mono available.
ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/Current/lib/libmonosgen-2.0.dylib, missing required architecture arm64
Seems like you have x86_64 only mono runtime installed. https://www.mono-project.com/download/stable/ should have universal version of mono available.
Oh! Seems this problem! I have a try! Thanks!
Seems like mono not support M1 Macs! Is there any other way to make the compilation success?
Seems like mono not support M1 Macs!
Unfortunately, seems like Mono still provide i386
+ x86_64
universal installer only, but it should be possible to compile Mono for the M1 from source.
For the reference, to build mono and install it to path/to/install/mono
(replace with any suitable location):
git clone https://github.com/mono/mono.git
cd mono
./autogen.sh --host=aarch64-apple-darwin20.0.0 --target=aarch64-apple-darwin20.0.0 --prefix=path/to/install/mono --disable-nls
make
make install
And then add mono_prefix=path/to/install/mono
to the Godot build command.
Note that official builds use the stable/preview 2020-02
branch, I suggest compiling the same.
It's also recommended to use https://github.com/godotengine/godot-mono-builds to build Mono with some needed patch and configuration applied, especially if you intend to build Android or HTML5 templates.
For the reference, to build mono and install it to
path/to/install/mono
(replace with any suitable location):git clone https://github.com/mono/mono.git cd mono ./autogen.sh --host=aarch64-apple-darwin20.0.0 --target=aarch64-apple-darwin20.0.0 --prefix=path/to/install/mono --disable-nls make make install
And then add
mono_prefix=path/to/install/mono
to the Godot build command.
but mono compile with error on mac m1
Note that official builds use the stable/preview
2020-02
branch, I suggest compiling the same.It's also recommended to use https://github.com/godotengine/godot-mono-builds to build Mono with some needed patch and configuration applied, especially if you intend to build Android or HTML5 templates.
i use it to compile mono-6.12.0.122 but compile arm64 error:
[ 0%] Building C object boringssl/ssl/pqueue/CMakeFiles/pqueue.dir/pqueue.c.o
error: unknown target CPU 'armv8-a+crypto'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4
make[6]: *** [boringssl/ssl/pqueue/CMakeFiles/pqueue.dir/pqueue.c.o] Error 1
make[5]: *** [boringssl/ssl/pqueue/CMakeFiles/pqueue.dir/all] Error 2
make[4]: *** [all] Error 2
make[3]: *** [build-shared/libmono-btls-shared.dylib] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
compile x86_64 ok
i use it to compile mono-6.12.0.122 but compile arm64 error:
Stable won't build on M1, but master
should work (I have compiled commit 4b5e2591eb299eb34d60b5217b14c1ad9f11e238
few hours ago, it was fine).
4b5e2591eb299eb34d60b5217b14c1ad9f11e238
Oh! Thanks! I have try! Hope it works! ^_^
Official builds use mono-6.12.0.158
, this works fine. That's also from the 2020-02
branch which is the Preview branch.
I have no idea what the master
branch of Mono is since they stopped making releases since merging into dotnet-runtime. The 2020-02
(i.e. 6.12) is the latest "Mono" release branch which they still maintain and where they backported arm64 support, but only from 6.12.0.147
or so.
Official builds use
mono-6.12.0.158
, this works fine. That's also from the2020-02
branch which is the Preview branch. I have no idea what themaster
branch of Mono is since they stopped making releases since merging into dotnet-runtime. The2020-02
(i.e. 6.12) is the latest "Mono" release branch which they still maintain and where they backported arm64 support, but only from6.12.0.147
or so.
CMake Error at CMakeLists.txt:74 (add_subdirectory):
The source directory
/Users/gaoxiang/Projects/Engines/mono/external/boringssl
does not contain a CMakeLists.txt file.
It seems script not check this boringssl
I use build script complie 2020-02 branch
got error:
/Users/gaoxiang/mono-configs/desktop-osx-arm64-release/mono/btls/build-shared/boringssl/crypto/sha/sha1-armv8.S:7:1: error: unknown directive
.hidden sha1_block_data_order
then i use this command compile ok!
./autogen.sh --host=aarch64-apple-darwin20.0.0 --target=aarch64-apple-darwin20.0.0 --prefix=path/to/install/mono --disable-nls
make
It seems some error in build scripts
Make sure that you run ./patch_mono.py
before building. It's mentioned in the README but could be made more prominent, it's easy to miss now.
I made a build yesterday with these scripts and the 2020-02
branch (mono-6.12.0.174
tag) and it worked fine: https://github.com/godotengine/godot-mono-builds/releases/tag/release-4e93604
You can see how it does the build e.g. for macOS here: https://github.com/godotengine/godot-mono-builds/blob/4e93604bc4d4004e0ca17de4178bd80bde3d04d1/.github/workflows/build.yml#L227-L235
Make sure that you run
./patch_mono.py
before building. It's mentioned in the README but could be made more prominent, it's easy to miss now.I made a build yesterday with these scripts and the
2020-02
branch (mono-6.12.0.174
tag) and it worked fine: https://github.com/godotengine/godot-mono-builds/releases/tag/release-4e93604You can see how it does the build e.g. for macOS here: https://github.com/godotengine/godot-mono-builds/blob/4e93604bc4d4004e0ca17de4178bd80bde3d04d1/.github/workflows/build.yml#L227-L235
I use these commands:
python3 patch_mono.py --mono-sources=$HOME/Projects/Engines/mono
python3 osx.py configure --target=arm64 --mono-sources=$HOME/Projects/Engines/mono
python3 osx.py make --target=arm64 --mono-sources=$HOME/Projects/Engines/mono
It seems right, but compile error
Scanning dependencies of target sha
[ 6%] Building C object boringssl/crypto/sha/CMakeFiles/sha.dir/sha1.c.o
[ 6%] Building C object boringssl/crypto/sha/CMakeFiles/sha.dir/sha256.c.o
[ 6%] Building C object boringssl/crypto/sha/CMakeFiles/sha.dir/sha512.c.o
[ 6%] Building ASM object boringssl/crypto/sha/CMakeFiles/sha.dir/sha1-armv8.S.o
/Users/gaoxiang/mono-configs/desktop-osx-arm64-release/mono/btls/build-shared/boringssl/crypto/sha/sha1-armv8.S:7:1: error: unknown directive
.hidden sha1_block_data_order
^
make[6]: *** [boringssl/crypto/sha/CMakeFiles/sha.dir/sha1-armv8.S.o] Error 1
make[5]: *** [boringssl/crypto/sha/CMakeFiles/sha.dir/all] Error 2
make[4]: *** [all] Error 2
make[3]: *** [build-shared/libmono-btls-shared.dylib] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
I use these commands work fine:
cd $HOME/Projects/Engines/mono
./autogen.sh --host=aarch64-apple-darwin20.0.0 --target=aarch64-apple-darwin20.0.0 --
prefix=$HOME/Projects/Engines/mono_arm64 --disable-nls
make
make install
I build with 2020-02 branch (mono-6.12.0.174) on mac m1
I run godot with mono on mac m1 crash:
Thread 0 Crashed:: tid_103 Dispatch queue: com.apple.main-thread
0 org.godotengine.godot 0x0000000104bf8928 GDMono::_load_api_assemblies() (.cold.4) + 52 (gd_mono.cpp:932)
1 org.godotengine.godot 0x000000010132cb8c GDMono::_load_api_assemblies() + 248 (gd_mono.cpp:932)
2 org.godotengine.godot 0x000000010132c9d8 GDMono::initialize_load_assemblies() + 24 (gd_mono.cpp:418)
3 org.godotengine.godot 0x0000000101259740 CSharpLanguage::init() + 324 (csharp_script.cpp:137)
4 org.godotengine.godot 0x0000000104967908 ScriptServer::init_languages() + 1040 (script_language.cpp:176)
5 org.godotengine.godot 0x0000000100c14e80 Main::setup2(unsigned long long) + 11528 (main.cpp:1977)
6 org.godotengine.godot 0x0000000100c0d72c Main::setup(char const*, int, char**, bool) + 24308 (main.cpp:1518)
7 org.godotengine.godot 0x0000000100c00a14 main + 456 (godot_main_osx.mm:83)
8 libdyld.dylib 0x0000000195ae9450 start + 4
What's the cause of the problem?
Hi! I compiled mono as follows,It crashes when I run it:
scons p=osx arch=arm64 tools=yes module_mono_enabled=yes mono_glue=no mono_prefix=$HOME/Projects/Engines/mono_arm64 -j$(sysctl -n hw.logicalcpu)
bin/godot.osx.tools.arm64.mono --generate-mono-glue modules/mono/glue
scons p=osx arch=arm64 target=release_debug tools=yes module_mono_enabled=yes mono_glue=yes mono_prefix=$HOME/Projects/Engines/mono_arm64 -j$(sysctl -n hw.logicalcpu)
cp -r misc/dist/osx_tools.app ./Godot.app
mkdir -p Godot.app/Contents/MacOS
cp bin/godot.osx.opt.tools.arm64.mono Godot.app/Contents/MacOS/Godot
chmod +x Godot.app/Contents/MacOS/Godot
mkdir -p Godot.app/Contents/Frameworks
cp -R bin/GodotSharp Godot.app/Contents/Frameworks/
I do something wrong? And where is crash log? I need help
Oh! When I run this:
bin/godot.osx.tools.arm64.mono --generate-mono-glue modules/mono/glue
it has error:
ERROR: Cannot resolve type reference in documentation: 'RootMotionView'.
at: bbcode_to_xml (modules/mono/editor/bindings_generator.cpp:391)
ERROR: Cannot resolve type reference in documentation: 'RootMotionView'.
at: bbcode_to_xml (modules/mono/editor/bindings_generator.cpp:391)
Is this cause crash?
Godot version
3.4.4-stable 4.0-dev
System information
Mac M1
Issue description
I got error:
Steps to reproduce
See above
Minimal reproduction project
No response