Skip to content

Compiling on MacOS (Intel)

Motoo Chhotoo Chintoo edited this page Jun 1, 2023 · 24 revisions

Set up Homebrew.

Follow the Homebrew installation instructions here, pasting the given line in Terminal.

Install dependencies.

After installing homebrew, enter this command in the terminal to install packages necessary to build sm64ex:

brew install make mingw-w64 gcc gcc@9 sdl2 pkg-config glew glfw3 libusb audiofile coreutils

You may encounter errors if you use an outdated MacOS (e.g. High Sierra, Mojave, Catalina and so forth).

To compile on these versions, follow the steps here.

Obtain the source code.

git clone https://github.com/djoslin0/sm64ex-coop.git
cd sm64ex-coop

Assembling libjuice (optional for 10.15 and above).

Run the following script to compile the libjuice library:

sh tools/mac-intel-essential.sh

Copy baserom(s) for asset extraction.

For each version (jp/us/eu) that you want to build an executable for, put an existing ROM at ./baserom.<version>.z64 for asset extraction.

For example, if you want to build the US version, there should be a ROM file called baserom.us.z64 in the sm64ex directory (meaning next to the Makefile).

NOTE: Only the us version is currently supported on coop.

If during the build process you get messages saying that the ROM has an incorrect hash, there is a possibility that it's a V64 ROM that needs to be byteswapped. To do that, use this web tool.

Compile the game

To turn certain features on and off, append any needed build flags to your gmake invocation:

gmake OSX_BUILD=1

OSX_BUILD must be specified to be 1.

Run the game

./build/us_pc/sm64.us.f3dex2e

Compiling on an outdated MacOS

While compiling on an outdated MacOS version, you are likely to encounter errors like these:

  • gmake: cpp-9: No such file or directory

  • build/us_pc/level_rules.mk: No such file or directory

To solve these problems, enter the following commands in the terminal to install the missing packages:

brew install make sdl2 pkg-config glew glfw3 libusb audiofile coreutils [email protected] gmp libmpc lz4 mpfr xz zstd
brew install mingw-w64 gcc@9 gcc --ignore-dependencies

Now you may continue to compile the game.