reddit / emacs

Installing emacs-29 on Mac M1?

WaitingForEmacs · 2022-12-20 22:04
I am really excited to try emacs-29 but my principal work machine is a 2020 MBP with an Apple Silicon M1 chip. My everyday emacs is 27.1 which I installed through homebrew, and that seems to be the updated version. The usual sites that have pre-built binaries for the Mac (e.g. emacsformacosx.com) are still on 28.2. After some searching I found a few recommendations for emacs-plus: brew tap d12frosted/emacs-plus brew install emacs-plus@29 --with-native-comp --with-modern-doom3-icon Unfortunately that did not build on my machine and I have run out of options to try and trying to figure out the different issues. It does apparently work on some machines, but the explanations and workarounds have not really revealed themselves as far as I can tell. I may just need to be patient, but I thought I would ask in case anyone has a tip or trick that they could share. I'm just very interested in experimenting with the new SQLite functionality. Thanks and regards.
gf3 · 2022-12-20 22:27
I was eventually able to get it compiled and working by clearing out the build cache, updating dependencies, and manually symlinking libgccjit. See [my comment here](https://github.com/d12frosted/homebrew-emacs-plus/issues/485#issuecomment-1308164501).
WaitingForEmacs · 2022-12-20 22:28
Thanks! I will read that over and give it a try. Much appreciated.
gf3 · 2022-12-20 22:29
Good luck!
seaborgiumaggghhh · 2022-12-20 22:56
Always a good time to learn how to compile emacs from source! Or use nix, which makes using latest emacs really easy.
harizvi · 2022-12-20 23:14
It worked for me with this: brew install libgccjit export CC=gcc brew install emacs-plus@29 --with-native-comp --with-xwidgets --with-no-frame-refocus --with-modern-pen-icon
[deleted] · 2022-12-20 23:19
[deleted]
redblobgames · 2022-12-20 23:48
I run the same on m1 mac. I am pretty sure native-comp requires `brew install libgccjit` first.
WaitingForEmacs · 2022-12-21 00:09
I am making progress! Still and issue with libgccjit, but I got everything built without native-comp -- so a step in the right direction!
WaitingForEmacs · 2022-12-21 00:13
Thanks for the vote of confidence! Fortunately I started running Linux back in 1995 when I could first order Slackware CDs from Walnut Creek. I had been using Solaris for a few years before that, and then PRIMOS (Prime Computer), VMS, MVS, and Apple DOS since the early 80s.
[deleted] · 2022-12-21 00:27
[deleted]
WaitingForEmacs · 2022-12-21 00:42
All friends here on /r/emacs!!
[deleted] · 2022-12-21 00:55
[deleted]
ieoa · 2022-12-21 01:00
I use https://github.com/jimeh/emacs-builds on nightly. It looks like they've added nightly 29 builds but haven't setup a corresponding brew cask.
gf3 · 2022-12-21 01:01
Excellent! I also had a lot of issues when building with native comp. Most of the problems stemmed from the build script being unable to find various libgccjit files.
WaitingForEmacs · 2022-12-21 01:17
Yes, I think that is my issue. ON THE OTHER HAND! Oh my goodness, `xwidget-webkit` Wow! How cool is that. With `eww` and `vterm` I was already able to spend 90% of my life in emacs, but this closes the loop. This is *very* exciting stuff.
WaitingForEmacs · 2022-12-21 01:18
Ah, good to know. I knew it would come around if I was patient enough... but as my username my indicate, that is not exactly my forté. Thanks!
ieoa · 2022-12-21 01:36
Oh, no worries at all. Godspeed. ;)
moreVCAs · 2022-12-21 03:33
As others have said, compiling emacs from source is not at all challenging. Would be happy to work through it here if you get stuck 😊
La_Croix_Table · 2022-12-21 04:00
Which is our true operating system after all.
shaunsingh0207 · 2022-12-21 07:57
Nix is wonderful! I have an overlay all setup that build me a fresh build of emacs HEAD with widgets/webkit support and applies all my patches. And the rollbacks are nice for when the latest emacs starts to act up
chmouelb · 2022-12-21 12:44
I could not figure out compiling it previously, same issue with libgccjit, but my macbook had a motherboard issue and had it replaced/resetted. Since installing from scratch i can now compile and install emacs-plus@29 with no issues... Something to do with old install and/or caching i guess
WaitingForEmacs · 2022-12-21 13:04
Thanks. I have seen a few reports where folks completely re-installed homebrew and things magically worked. Fortunately the native comp is not a deal breaker for me, so I am delighted that I have it up and running.
4goodapp · 2022-12-21 14:50
Did you check emacsformacosx.com nightlies build (currently on Emacs v30) [here](https://emacsformacosx.com/builds)?
[deleted] · 2022-12-21 15:11
[deleted]
wakatara · 2022-12-21 15:13
Out of curiosity, did native comp make a big difference in terms of speed (or could you even tell). and can you jsut try the following without all the extras? ``` brew install libgccjit export CC=gcc brew install emacs-plus@29 --with-native-comp ```
harizvi · 2022-12-21 16:26
wakatara writes: > Someone wrote: > > Out of curiosity, did native comp make a big difference in terms of speed (or could you even > tell). When it first came out I did comparison on Intel based Macs, and native comp had a pretty clear positive impact. I haven't done any dependable experiments on M1s to know the impact. > and can you jsut try the following without all the extras? > > brew install libgccjit > export CC=gcc > brew install emacs-plus@29 --with-native-comp For what purpose? --
wakatara · 2022-12-21 16:54
Oh, didn't need all the extra bits, I felt. =\] I think for me it was the xport CC=gcc part that had tripped me up previously. Compiled like a charm with what I wrote down and the oly thing I had to do was set wanrning to nil to stop the annoying native-comp warnings messages. thanks!
harizvi · 2022-12-21 17:25
Glad it worked out for you. xwidgets and frame-refocus are both optional.
Aoterra · 2022-12-24 07:41
See my comment here: https://github.com/d12frosted/homebrew-emacs-plus/issues/485#issuecomment-1364479978
WaitingForEmacs · 2022-12-24 12:29
Thanks. I did try these steps, but unfortunately no luck on either my M1 or older Intel Mac. I keep getting an error saying that homebrew could not compile a libgccjit example program. No worries though! Loving the rest of the new features.
orgtre · 2022-12-26 16:22
I used to get that same error, and [this](https://github.com/d12frosted/homebrew-emacs-plus/issues/536) is what made it work for me.
WaitingForEmacs · 2022-12-30 20:04
Sorry for the delay in getting back to you… but eureka! Re-installing gcc was the missing ingredient that got everything working. Thanks!