Compilation error on Apple Silicon

5 views
Skip to first unread message

Karl Schmid

unread,
Jun 25, 2024, 5:47:05 AM (8 days ago) Jun 25
to mu-discuss
I tried to compile the most recent version mu-1.12.5 on my new MacBookPro M3, but got the following error message:

schmid@FlowerPowerProM3:~/Downloads/mu-1.12.5$ ninja -C build
ninja: Entering directory `build'
[15/194] Linking target lib/utils/mu-html2text
FAILED: lib/utils/mu-html2text
c++  -o lib/utils/mu-html2text lib/utils/mu-html2text.p/mu-html-to-text.cc.o -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names lib/utils/libmu-utils.a -L/opt/homebrew/Cellar/glib/2.80.3/lib -L/opt/homebrew/opt/gettext/lib -lglib-2.0 -lintl -L/opt/homebrew/Cellar/glib/2.80.3/lib -L/opt/homebrew/opt/gettext/lib -lglib-2.0 -lintl -L/opt/homebrew/Cellar/glib/2.80.3/lib -L/opt/homebrew/opt/gettext/lib -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -L/opt/homebrew/Cellar/glib/2.80.3/lib -L/opt/homebrew/opt/gettext/lib -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
ld: warning: ignoring duplicate libraries: '-lgio-2.0', '-lglib-2.0', '-lgobject-2.0', '-lintl'
ld: warning: ignoring file '/opt/homebrew/Cellar/glib/2.80.3/lib/libglib-2.0.0.dylib': found architecture 'arm64', required architecture 'x86_64'
ld: warning: ignoring file '/opt/homebrew/Cellar/glib/2.80.3/lib/libgobject-2.0.0.dylib': found architecture 'arm64', required architecture 'x86_64'
ld: warning: ignoring file '/opt/homebrew/Cellar/gettext/0.22.5/lib/libintl.8.dylib': found architecture 'arm64', required architecture 'x86_64'
ld: warning: ignoring file '/opt/homebrew/Cellar/glib/2.80.3/lib/libgio-2.0.0.dylib': found architecture 'arm64', required architecture 'x86_64'
Undefined symbols for architecture x86_64:

It seems that it expects some libraries for the x86 architecture that are available only for the native arm64 architecture.

Is it possible to compile somehow via Rosetta or directly for the arm64 architecture?

Best regards,

Karl

Norm Tovey-Walsh

unread,
Jun 25, 2024, 6:38:16 AM (8 days ago) Jun 25
to Karl Schmid, mu-discuss
> '/opt/homebrew/Cellar/glib/2.80.3/lib/libgio-2.0.0.dylib': found
> architecture 'arm64', required architecture 'x86_64'
> Undefined symbols for architecture x86_64:

I’ve had no trouble building mu on an M2 silicon Mac. But these error messages look familiar.

A while back, one of my colleagues had *real* trouble with an Apple Silicon Mac and Homebrew (at least, I think it was homebrew related, I could be wrong). Migration from the previous Intel Mac to the new Mac with “migration assistant” or whatever Apple calls it, had apparently copied some x86 libraries over.

I tried everything I could think of, deleting Homebrew entirely, deleting /usr/local, etc. To no avail. In the end, we just had to burn the whole thing to the ground and reinstall MacOS.

I hope you’re not in a similar situation!

Be seeing you,
norm

--
Norm Tovey-Walsh <n...@nwalsh.com>
https://norm.tovey-walsh.com/

> The DMCA criminalizes curiosity. It would put Susie in jail for taking
> her stereo apart to see how it works.
signature.asc

Dirk-Jan C. Binnema

unread,
Jun 26, 2024, 1:57:13 PM (6 days ago) Jun 26
to mu-di...@googlegroups.com
I don't have such HW, so just some general advice; at the beginning of
the build, you should see something like this (with some details different):

From your output it seems as if your M3 (arm64) tries to cross-compile
to x86_64... and then tries to link against arm64 libraries. What does
meson tell you with its setup? E.g. I see something like:

The Meson build system
,----
|
| Version: 1.4.1
| Source dir: /home/djcb/Sources/mu
| Build dir: /home/djcb/Sources/mu/build
| Build type: native build
| Project name: mu
| Project version: 1.12.5
| C compiler for the host machine: ccache cc (gcc 14.1.1 "cc (GCC) 14.1.1 20240522 (Red Hat 14.1.1-4)")
| C linker for the host machine: cc ld.bfd 2.41-37
| C++ compiler for the host machine: ccache c++ (gcc 14.1.1 "c++ (GCC) 14.1.1 20240522 (Red Hat 14.1.1-4)")
| C++ linker for the host machine: c++ ld.bfd 2.41-37
| Host machine cpu family: x86_64
| Host machine cpu: x86_64
`----

Kind regards,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
gpg: 6987 9CED 1745 9375 0F14 DA98 11DD FEA9 DCC4 A036
Reply all
Reply to author
Forward
0 new messages