[QUESTION] How to compile mu on M1 macOS Monterey?

305 views
Skip to first unread message

stardiviner

unread,
May 24, 2022, 1:18:23 AM5/24/22
to mu-discuss
Parden me at first because my Emacs mu4e seems can't sent out email (It failed recently on "sendmail" on macOS system, don't know why, even I tried 3 times). So I post on Google Groups in web browser again.

Problem: meson and ninja can't find the Homebrew installed glib.h header file.

How to solve this error?

The homebrew provided "mu" formula is not updated with GitHub repo latest release. So I try to compile by myself.

Environments:
- Emacs version: GNU Emacs 28.1 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2022-05-12
- System: M1 macOS Monterey
- glib: I installed glib with Homebrew =$ brew install glib=

Compile commands:

#+begin_src shell
export CPATH=/opt/homebrew/include
export LIBRARY_PATH=/opt/homebrew/lib

./autogen.sh # && make
meson build && ninja -C build
#+end_src



Here is the output of compile commands:

#+begin_example
*** meson build setup
/opt/homebrew/bin/meson
The Meson build system
Version: 0.62.1
Source dir: /Users/stardiviner/Code/Emacs/mu
Build dir: /Users/stardiviner/Code/Emacs/mu/build
Build type: native build
Project name: mu
Project version: 1.7.23
C compiler for the host machine: cc (clang 13.1.6 "Apple clang version 13.1.6 (clang-1316.0.21.2.3)")
C linker for the host machine: cc ld64 762
C++ compiler for the host machine: c++ (clang 13.1.6 "Apple clang version 13.1.6 (clang-1316.0.21.2.3)")
C++ linker for the host machine: c++ ld64 762
Host machine cpu family: aarch64
Host machine cpu: arm64
Compiler for C supports arguments -Wno-unused-parameter: YES (cached)
Compiler for C++ supports arguments -Wno-unused-parameter: YES (cached)
Compiler for C supports arguments -Wno-cast-function-type: YES (cached)
Compiler for C++ supports arguments -Wno-cast-function-type: YES (cached)
Compiler for C supports arguments -Wformat-security: YES (cached)
Compiler for C++ supports arguments -Wformat-security: YES (cached)
Compiler for C supports arguments -Wformat=2: YES (cached)
Compiler for C++ supports arguments -Wformat=2: YES (cached)
Compiler for C supports arguments -Wstack-protector: YES (cached)
Compiler for C++ supports arguments -Wstack-protector: YES (cached)
Compiler for C supports arguments -Wno-keyword-macro: YES
Compiler for C++ supports arguments -Wno-keyword-macro: YES
Compiler for C supports arguments -Wno-switch-enum: YES (cached)
Compiler for C++ supports arguments -Wno-switch-enum: YES (cached)
Compiler for C supports arguments -Wno-#warnings: YES (cached)
Compiler for C++ supports arguments -Wno-#warnings: YES (cached)
Checking for function "setsid" : YES (cached)
Checking for function "wordexp" : YES (cached)
Dependency glib-2.0 found: YES 2.72.0 (cached)
Dependency gobject-2.0 found: YES 2.72.0 (cached)
Dependency gio-2.0 found: YES 2.72.0 (cached)
Dependency gmime-3.0 found: YES 3.2.7 (cached)
Dependency xapian-core found: YES 1.4.19 (cached)
Dependency threads found: YES unknown (cached)
Dependency guile-3.0 found: YES 3.0.8 (cached)
Program gawk found: YES (/opt/homebrew/bin/gawk)
Program emacs found: YES 29.0.50 (/opt/homebrew/bin/emacs)
Program makeinfo found: YES (/usr/local/bin/makeinfo)
Configuring version.texi using configuration
Configuring mu4e-meta.el using configuration
mu4e/meson.build:92: WARNING: Source item '/Users/stardiviner/Code/Emacs/mu/build/mu4e/mu4e-meta.el' cannot be converted to File object, because it is a generated file. This will become a hard error in the future.
Configuring compile-scm using configuration
Program guile-snarf found: YES (/opt/homebrew/bin/guile-snarf)
Configuring config.h using configuration
Build targets in project: 59
NOTICE: Future-deprecated features used:
 * 0.56.0: {'dependency.get_pkgconfig_variable', 'meson.source_root'}

Found ninja-1.11.0 at /opt/homebrew/Caskroom/miniforge/base/bin/ninja
*** Now run 'ninja -C build' to build mu
*** Or check the Makefile for some useful targets
Directory already configured.

Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
If ninja fails, run "ninja reconfigure" or "meson --reconfigure"
to force Meson to regenerate.

If build failures persist, run "meson setup --wipe" to rebuild from scratch
using the same options as passed when configuring the build.
To change option values, run "meson configure" instead.
ninja: Entering directory `build'
[1/127] Compiling C object lib/utils/tests/test-mu-util.p/test-mu-util.c.o
FAILED: lib/utils/tests/test-mu-util.p/test-mu-util.c.o
cc -Ilib/utils/tests/test-mu-util.p -Ilib/utils/tests -I../lib/utils/tests -I. -I.. -Ilib/utils -I../lib/utils -Ilib -I../lib -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -std=c11 -O2 -g -Wno-unused-parameter -Wno-cast-function-type -Wformat-security -Wformat=2 -Wstack-protector -Wno-keyword-macro -Wno-switch-enum '-Wno-#warnings' -DHAVE_CONFIG_H -MD -MQ lib/utils/tests/test-mu-util.p/test-mu-util.c.o -MF lib/utils/tests/test-mu-util.p/test-mu-util.c.o.d -o lib/utils/tests/test-mu-util.p/test-mu-util.c.o -c ../lib/utils/tests/test-mu-util.c
../lib/utils/tests/test-mu-util.c:24:10: fatal error: 'glib.h' file not found
#include <glib.h>
         ^~~~~~~~
1 error generated.
[2/127] Compiling C object lib/utils/libmu-utils.a.p/mu-util.c.o
FAILED: lib/utils/libmu-utils.a.p/mu-util.c.o
cc -Ilib/utils/libmu-utils.a.p -Ilib/utils -I../lib/utils -Ilib -I../lib -I. -I.. -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -std=c11 -O2 -g -Wno-unused-parameter -Wno-cast-function-type -Wformat-security -Wformat=2 -Wstack-protector -Wno-keyword-macro -Wno-switch-enum '-Wno-#warnings' -DHAVE_CONFIG_H -MD -MQ lib/utils/libmu-utils.a.p/mu-util.c.o -MF lib/utils/libmu-utils.a.p/mu-util.c.o.d -o lib/utils/libmu-utils.a.p/mu-util.c.o -c ../lib/utils/mu-util.c
In file included from ../lib/utils/mu-util.c:26:
../lib/utils/mu-util.h:23:10: fatal error: 'glib.h' file not found
#include <glib.h>
         ^~~~~~~~
1 error generated.
[3/127] Compiling C++ object lib/utils/libmu-utils.a.p/mu-option.cc.o
FAILED: lib/utils/libmu-utils.a.p/mu-option.cc.o
c++ -Ilib/utils/libmu-utils.a.p -Ilib/utils -I../lib/utils -Ilib -I../lib -I. -I.. -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O2 -g -Wno-unused-parameter -Wno-cast-function-type -Wformat-security -Wformat=2 -Wstack-protector -Wno-keyword-macro -Wno-switch-enum '-Wno-#warnings' -DHAVE_CONFIG_H -MD -MQ lib/utils/libmu-utils.a.p/mu-option.cc.o -MF lib/utils/libmu-utils.a.p/mu-option.cc.o.d -o lib/utils/libmu-utils.a.p/mu-option.cc.o -c ../lib/utils/mu-option.cc
../lib/utils/mu-option.cc:21:10: fatal error: 'glib.h' file not found
#include <glib.h>
         ^~~~~~~~
1 error generated.
[4/127] Compiling C++ object lib/utils/libmu-utils.a.p/mu-logger.cc.o
FAILED: lib/utils/libmu-utils.a.p/mu-logger.cc.o
c++ -Ilib/utils/libmu-utils.a.p -Ilib/utils -I../lib/utils -Ilib -I../lib -I. -I.. -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O2 -g -Wno-unused-parameter -Wno-cast-function-type -Wformat-security -Wformat=2 -Wstack-protector -Wno-keyword-macro -Wno-switch-enum '-Wno-#warnings' -DHAVE_CONFIG_H -MD -MQ lib/utils/libmu-utils.a.p/mu-logger.cc.o -MF lib/utils/libmu-utils.a.p/mu-logger.cc.o.d -o lib/utils/libmu-utils.a.p/mu-logger.cc.o -c ../lib/utils/mu-logger.cc
../lib/utils/mu-logger.cc:21:10: fatal error: 'glib.h' file not found
#include <glib.h>
         ^~~~~~~~
1 error generated.
[5/127] Compiling C++ object lib/utils/libmu-utils.a.p/mu-readline.cc.o
FAILED: lib/utils/libmu-utils.a.p/mu-readline.cc.o
c++ -Ilib/utils/libmu-utils.a.p -Ilib/utils -I../lib/utils -Ilib -I../lib -I. -I.. -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O2 -g -Wno-unused-parameter -Wno-cast-function-type -Wformat-security -Wformat=2 -Wstack-protector -Wno-keyword-macro -Wno-switch-enum '-Wno-#warnings' -DHAVE_CONFIG_H -MD -MQ lib/utils/libmu-utils.a.p/mu-readline.cc.o -MF lib/utils/libmu-utils.a.p/mu-readline.cc.o.d -o lib/utils/libmu-utils.a.p/mu-readline.cc.o -c ../lib/utils/mu-readline.cc
../lib/utils/mu-readline.cc:26:10: fatal error: 'glib.h' file not found
#include <glib.h>
         ^~~~~~~~
1 error generated.
[6/127] Compiling C++ object lib/utils/tests/test-command-parser.p/test-command-parser.cc.o
FAILED: lib/utils/tests/test-command-parser.p/test-command-parser.cc.o
c++ -Ilib/utils/tests/test-command-parser.p -Ilib/utils/tests -I../lib/utils/tests -Ilib/utils -I../lib/utils -Ilib -I../lib -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O2 -g -Wno-unused-parameter -Wno-cast-function-type -Wformat-security -Wformat=2 -Wstack-protector -Wno-keyword-macro -Wno-switch-enum '-Wno-#warnings' -DHAVE_CONFIG_H -MD -MQ lib/utils/tests/test-command-parser.p/test-command-parser.cc.o -MF lib/utils/tests/test-command-parser.p/test-command-parser.cc.o.d -o lib/utils/tests/test-command-parser.p/test-command-parser.cc.o -c ../lib/utils/tests/test-command-parser.cc
../lib/utils/tests/test-command-parser.cc:21:10: fatal error: 'glib.h' file not found
#include <glib.h>
         ^~~~~~~~
1 error generated.
[7/127] Compiling C++ object lib/utils/libmu-utils.a.p/mu-command-parser.cc.o
FAILED: lib/utils/libmu-utils.a.p/mu-command-parser.cc.o
c++ -Ilib/utils/libmu-utils.a.p -Ilib/utils -I../lib/utils -Ilib -I../lib -I. -I.. -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O2 -g -Wno-unused-parameter -Wno-cast-function-type -Wformat-security -Wformat=2 -Wstack-protector -Wno-keyword-macro -Wno-switch-enum '-Wno-#warnings' -DHAVE_CONFIG_H -MD -MQ lib/utils/libmu-utils.a.p/mu-command-parser.cc.o -MF lib/utils/libmu-utils.a.p/mu-command-parser.cc.o.d -o lib/utils/libmu-utils.a.p/mu-command-parser.cc.o -c ../lib/utils/mu-command-parser.cc
In file included from ../lib/utils/mu-command-parser.cc:20:
In file included from ../lib/utils/mu-command-parser.hh:30:
In file included from ../lib/utils/mu-error.hh:25:
../lib/utils/mu-util.h:23:10: fatal error: 'glib.h' file not found
#include <glib.h>
         ^~~~~~~~
1 error generated.
[8/127] Compiling C++ object lib/utils/libmu-utils.a.p/mu-sexp.cc.o
FAILED: lib/utils/libmu-utils.a.p/mu-sexp.cc.o
c++ -Ilib/utils/libmu-utils.a.p -Ilib/utils -I../lib/utils -Ilib -I../lib -I. -I.. -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O2 -g -Wno-unused-parameter -Wno-cast-function-type -Wformat-security -Wformat=2 -Wstack-protector -Wno-keyword-macro -Wno-switch-enum '-Wno-#warnings' -DHAVE_CONFIG_H -MD -MQ lib/utils/libmu-utils.a.p/mu-sexp.cc.o -MF lib/utils/libmu-utils.a.p/mu-sexp.cc.o.d -o lib/utils/libmu-utils.a.p/mu-sexp.cc.o -c ../lib/utils/mu-sexp.cc
In file included from ../lib/utils/mu-sexp.cc:21:
In file included from ../lib/utils/mu-sexp.hh:27:
../lib/utils/mu-utils.hh:30:10: fatal error: 'glib.h' file not found
#include <glib.h>
         ^~~~~~~~
1 error generated.
[9/127] Compiling C++ object lib/utils/libmu-utils.a.p/mu-utils.cc.o
FAILED: lib/utils/libmu-utils.a.p/mu-utils.cc.o
c++ -Ilib/utils/libmu-utils.a.p -Ilib/utils -I../lib/utils -Ilib -I../lib -I. -I.. -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O2 -g -Wno-unused-parameter -Wno-cast-function-type -Wformat-security -Wformat=2 -Wstack-protector -Wno-keyword-macro -Wno-switch-enum '-Wno-#warnings' -DHAVE_CONFIG_H -MD -MQ lib/utils/libmu-utils.a.p/mu-utils.cc.o -MF lib/utils/libmu-utils.a.p/mu-utils.cc.o.d -o lib/utils/libmu-utils.a.p/mu-utils.cc.o -c ../lib/utils/mu-utils.cc
../lib/utils/mu-utils.cc:43:10: fatal error: 'glib.h' file not found
#include <glib.h>
         ^~~~~~~~
1 error generated.
[10/127] Compiling C++ object lib/utils/tests/test-option.p/test-option.cc.o
FAILED: lib/utils/tests/test-option.p/test-option.cc.o
c++ -Ilib/utils/tests/test-option.p -Ilib/utils/tests -I../lib/utils/tests -Ilib/utils -I../lib/utils -Ilib -I../lib -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O2 -g -Wno-unused-parameter -Wno-cast-function-type -Wformat-security -Wformat=2 -Wstack-protector -Wno-keyword-macro -Wno-switch-enum '-Wno-#warnings' -DHAVE_CONFIG_H -MD -MQ lib/utils/tests/test-option.p/test-option.cc.o -MF lib/utils/tests/test-option.p/test-option.cc.o.d -o lib/utils/tests/test-option.p/test-option.cc.o -c ../lib/utils/tests/test-option.cc
In file included from ../lib/utils/tests/test-option.cc:20:
../lib/utils/mu-utils.hh:30:10: fatal error: 'glib.h' file not found
#include <glib.h>
         ^~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
#+end_example

Ray Kinsella

unread,
May 24, 2022, 10:10:42 AM5/24/22
to mu-di...@googlegroups.com, stardiviner
Hi Stardivner,

stardiviner <numb...@gmail.com> writes:

> Parden me at first because my Emacs mu4e seems can't sent out email (It
> failed recently on "sendmail" on macOS system, don't know why, even I tried
> 3 times). So I post on Google Groups in web browser again.
>
> Problem: meson and ninja can't find the Homebrew installed glib.h header
> file.
>
> How to solve this error?
>
> The homebrew provided "mu" formula is not updated with GitHub repo latest
> release. So I try to compile by myself.
>
> Environments:
> - Emacs version: GNU Emacs 28.1 (build 1, aarch64-apple-darwin21.1.0, NS
> appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2022-05-12
> - System: M1 macOS Monterey
> - glib: I installed glib with Homebrew =$ brew install glib=
>
> Compile commands:
>
> #+begin_src shell
> export CPATH=/opt/homebrew/include
> export LIBRARY_PATH=/opt/homebrew/lib

Where is glib.h on your system?
--
Regards, Ray K

Dirk-Jan C. Binnema

unread,
May 24, 2022, 11:56:02 AM5/24/22
to mu-di...@googlegroups.com

>> ./autogen.sh # && make
>> meson build && ninja -C build
>> #+end_src
>>
>>
>>
>> Here is the output of compile commands:
>>
>> #+begin_example
>> *** meson build setup
>> /opt/homebrew/bin/meson
>> The Meson build system
>> Version: 0.62.1
>> Source dir: /Users/stardiviner/Code/Emacs/mu
>> Build dir: /Users/stardiviner/Code/Emacs/mu/build
>> Build type: native build
>> Project name: mu
>> Project version: 1.7.23

<snip>

>> Dependency glib-2.0 found: YES 2.72.0 (cached)

^^^ so meson can find glib (likely, through its pkgconfig file).
Locate the glib-2.0.pc file on your system.

<snip>

>> [1/127] Compiling C object lib/utils/tests/test-mu-util.p/test-mu-util.c.o
>> FAILED: lib/utils/tests/test-mu-util.p/test-mu-util.c.o
>> cc -Ilib/utils/tests/test-mu-util.p -Ilib/utils/tests -I../lib/utils/tests
>> -I. -I.. -Ilib/utils -I../lib/utils -Ilib -I../lib
>> -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0
>> -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include
>> -I/opt/homebrew/opt/gettext/include
>> -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall
>> -Winvalid-pch -Wextra -std=c11 -O2 -g -Wno-unused-parameter
>> -Wno-cast-function-type -Wformat-security -Wformat=2 -Wstack-protector
>> -Wno-keyword-macro -Wno-switch-enum '-Wno-#warnings' -DHAVE_CONFIG_H -MD
>> -MQ lib/utils/tests/test-mu-util.p/test-mu-util.c.o -MF
>> lib/utils/tests/test-mu-util.p/test-mu-util.c.o.d -o
>> lib/utils/tests/test-mu-util.p/test-mu-util.c.o -c
>> ../lib/utils/tests/test-mu-util.c
>> ../lib/utils/tests/test-mu-util.c:24:10: fatal error: 'glib.h' file not
>> found
>> #include <glib.h>

So it passes the include paths; the directory
/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0
should contain glib.h. Does it?

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

stardiviner

unread,
May 25, 2022, 3:20:12 AM5/25/22
to mu-discuss
Thanks Drik, and Ray K.

I searched Homebrew path "/opt/homebrew/" with command `find`. And got two path of "glib.h":
- /opt/homebrew/Cellar/glib/2.72.1/include/glib-2.0/glib.h
- /opt/homebrew/include/glib-2.0/glib.h

Should I setting environment variable like this?
```
export CPATH=/opt/homebrew/Cellar/glib/2.72.1/include/glib-2.0/
export LIBRARY_PATH=/opt/homebrew/Cellar/glib/2.72.1/lib/glib-2.0/
```

This solved the `glib.h not found problem`. but got another problem:

```
[9/110] Compiling C++ object lib/utils/test-command-parser.p/test-command-parser.cc.o
FAILED: lib/utils/test-command-parser.p/test-command-parser.cc.o
c++ -Ilib/utils/test-command-parser.p -Ilib/utils -I../lib/utils -Ilib -I../lib -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O2 -g -Wundef -Wwrite-strings -Wformat -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Wpointer-arith -Wswitch-default -DHAVE_CONFIG_H -MD -MQ lib/utils/test-command-parser.p/test-command-parser.cc.o -MF lib/utils/test-command-parser.p/test-command-parser.cc.o.d -o lib/utils/test-command-parser.p/test-command-parser.cc.o -c ../lib/utils/test-command-parser.cc
In file included from ../lib/utils/test-command-parser.cc:21:
In file included from /opt/homebrew/Cellar/glib/2.72.1/include/glib-2.0/glib.h:30:
In file included from /opt/homebrew/Cellar/glib/2.72.1/include/glib-2.0/glib/galloca.h:32:
/opt/homebrew/Cellar/glib/2.72.1/include/glib-2.0/glib/gtypes.h:32:10: fatal error: 'glibconfig.h' file not found
#include <glibconfig.h>
         ^~~~~~~~~~~~~~
1 error generated.
[10/110] Compiling C++ object lib/utils/libmu-utils.a.p/mu-command-parser.cc.o
FAILED: lib/utils/libmu-utils.a.p/mu-command-parser.cc.o
c++ -Ilib/utils/libmu-utils.a.p -Ilib/utils -I../lib/utils -Ilib -I../lib -I. -I.. -I/opt/homebrew/Cellar/glib/2.72.0/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.0/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre/8.45/include -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O2 -g -Wundef -Wwrite-strings -Wformat -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Wpointer-arith -Wswitch-default -DHAVE_CONFIG_H -MD -MQ lib/utils/libmu-utils.a.p/mu-command-parser.cc.o -MF lib/utils/libmu-utils.a.p/mu-command-parser.cc.o.d -o lib/utils/libmu-utils.a.p/mu-command-parser.cc.o -c ../lib/utils/mu-command-parser.cc

In file included from ../lib/utils/mu-command-parser.cc:20:
In file included from ../lib/utils/mu-command-parser.hh:30:
In file included from ../lib/utils/mu-error.hh:25:
In file included from ../lib/utils/mu-utils.hh:28:
In file included from /opt/homebrew/Cellar/glib/2.72.1/include/glib-2.0/glib.h:30:
In file included from /opt/homebrew/Cellar/glib/2.72.1/include/glib-2.0/glib/galloca.h:32:
/opt/homebrew/Cellar/glib/2.72.1/include/glib-2.0/glib/gtypes.h:32:10: fatal error: 'glibconfig.h' file not found
#include <glibconfig.h>
         ^~~~~~~~~~~~~~

1 error generated.
ninja: build stopped: subcommand failed.
```

Is there anyone use M1 macOS and compiled mu from source code correctly? Teach me how to setting this environment.
I don't know about those C/C++ environments. Thanks in advance.

stardiviner

unread,
May 30, 2022, 11:32:01 PM5/30/22
to mu-discuss
Will mu add support adding extra compilation steps (like setting environment path and installing glib etc) for M1 macOS on README?

Ray Kinsella

unread,
May 31, 2022, 4:41:07 AM5/31/22
to mu-di...@googlegroups.com, stardiviner

stardiviner <numb...@gmail.com> writes:

> Will mu add support adding extra compilation steps (like setting environment path and installing glib etc) for M1 macOS on README?
>
> On Wednesday, May 25, 2022 at 3:20:12 PM UTC+8 stardiviner wrote:
>
> Thanks Drik, and Ray K.
>
> I searched Homebrew path "/opt/homebrew/" with command `find`. And got two path of "glib.h":
> - /opt/homebrew/Cellar/glib/2.72.1/include/glib-2.0/glib.h
> - /opt/homebrew/include/glib-2.0/glib.h
>
> Should I setting environment variable like this?
> ```
> export CPATH=/opt/homebrew/Cellar/glib/2.72.1/include/glib-2.0/
> export LIBRARY_PATH=/opt/homebrew/Cellar/glib/2.72.1/lib/glib-2.0/
> ```
>
> This solved the `glib.h not found problem`. but got another problem:
>

glibconfig.h is the kind of the configuration header generally created
during the build process by autotools or similar, and installed as part
of the devel package. On my system it is in

/usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h

What happens when you do ... can you send the output?

* pkg-config --cflags glib-2.0
* pkg-config --libs glib-2.0

(BTW - I have now idea what /opt/homebrew/Cellar is)

Can you 'find /opt/homebrew/ -name glibconfig.h -print'

> ```
--
Regards, Ray K

Dirk-Jan C. Binnema

unread,
May 31, 2022, 5:57:45 AM5/31/22
to mu-di...@googlegroups.com

On Monday May 30 2022, stardiviner wrote:

> Will mu add support adding extra compilation steps (like setting
> environment path and installing glib etc) for M1 macOS on README?

Don't think there's anything specific for M1 here, or mu/mu4e for that
matter. mu (through meson) finds its dependencies through pkg-config. If
you have installed things in a non-standard place (like homebrew), you
need to set the PKG_CONFIG_PATH accordingly (see the pkg-config
manpage).

If you still have trouble, I'd recommend just sticking with the 1.6
releases for now.

stardiviner

unread,
Jun 1, 2022, 1:35:04 AM6/1/22
to mu4e
I finally found the problem. Because my compile commands error:

My original wrong compile commands:

#+begin_src shell
./autogen.sh
make
meson build
ninja -C build
#+end_src


I I found the correct compile commands are:

#+begin_src shell
./autogen.sh
ninja -C build
#+end_src

Now the previous headers not found problem is gone. Even thought got other error. But I will post in
another thread.

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


--
You received this message because you are subscribed to the Google Groups "mu-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mu-discuss+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mu-discuss/871qwavxbi.fsf%40djcbsoftware.nl.

Tim Cross

unread,
Jun 1, 2022, 1:53:38 AM6/1/22
to mu-di...@googlegroups.com

I find

meson build && ninja -C build

works fine and is what is documented in the NEWS.org file. The
autogen.sh is legacy and not what you want for current master branch.

If you prefer a more 'traditional' approach, have a looke at
Makefile.meson

stardiviner

unread,
Jun 1, 2022, 2:02:14 AM6/1/22
to mu4e
Thanks, I have not followed the latest NEWS.org file. My fault. Add note on my notebook soon.

I got same error with command `meson build && ninja -C build`. As I posted in another new thread.

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

Dirk-Jan C. Binnema

unread,
Jun 1, 2022, 2:33:15 AM6/1/22
to mu-di...@googlegroups.com

On Wednesday Jun 01 2022, Tim Cross wrote:

> I find
>
> meson build && ninja -C build
>
> works fine and is what is documented in the NEWS.org file. The
> autogen.sh is legacy and not what you want for current master branch.
>
> If you prefer a more 'traditional' approach, have a looke at
> Makefile.meson

Ah, but ./autogen.sh (in mu 1.7.x) is just a small wrapper over the
meson commands. It also copies Makefile.meson to Makefile, which gives
you a few useful extra targets for tests etc.

Dinosaurs like myself with "make" in their muscle-memory use it all the
time.

Tim Cross

unread,
Jun 1, 2022, 3:02:34 AM6/1/22
to mu-di...@googlegroups.com

After doing git pull, try doing git clean -xdf

That should clean out any old files you might have hanging around
causing problems - basically, it will remove everything not managed by
git.

Note also that as your building on a mac and using homebrew, you might
need to tweak a little to ensure meson finds everything. In particular,
pkg_config (I think, from memory as not using a mac anymore).
Reply all
Reply to author
Forward
0 new messages