Building 4coder for Mac


This is going to be a pretty utilitarian post on how to build 4coder for Mac.


4coder is incredible - and more importantly, it’s what I want to be using whenever I’m typing code. I had to move to an M2 Mac recently and the pre-built versions of 4coder don’t work on an M2 chip.

Allen recently open sourced 4coder putting the code on github. But, as the README notes, support of Mac hasn’t been updated in some time. I suspect, in fact, that there never was support for M2 Macs at all.

So I started trying to get it to work on Mac again, specifically on an M2 chip. It’s surprisingly easy, even though it took me a while to figure out how to do it.

What follows below is how I accomplished this. While I haven’t tested it on Intel macs, I believe many of the steps below will need to be done if you want to build 4coder for a non-M2 chips computer as well.

Building 4coder


Follow the steps in the README of the git repo up until step 7 (where you run the various build scripts) The git repo is here:


The build scripts make use of a tool called realpath. This is standard on linux it seems but is not included on Macs. You can get realpath by doing one of the following:


The 4coder-non-source repo has prebuild libraries for freetype. Those libraries are built for Macs running on Intel chips.


Compiling on an M2 chip, I got a bunch of errors relating to intrinsics/assembly code in the 4coder_audio.h/c files. I personally don’t rely on 4coder for audio so I chose to just omit this code from compilation.

  1. cd into 4ed/code
  2. run bin/

And you should be good to go! Let me know if this doesn’t work for you, and I’ll update instructions here.