You will need a host/native GCC install and a full working Dreamcast/KallistiOS compiler toolchain install. You will also need to install the latest kos-ports.
See [ https://dreamcast.wiki/Getting_Started_with_Dreamcast_development ] for instructions.
Mario Kart 64 DC has only been tested to build and run using sh-elf-gcc versions 14 and 15. Use any other major version at your own risk. No support will be provided.
NOTE: WHEN BUILDING KOS, USE THE environ.sh FILE PROVIDED IN THE mario-kart-64-dc REPO.
Mario Kart 64 can be built using an unmodified copy of KOS cloned directly from the official repo. I have tested it with master as of 2025/05/30 (commit 680d1862). I suggest using that specific commit id. I will not guarantee that it even builds against any other KOS commit, nevermind that it runs.
If you are going to file a Github issue, make sure you are using that version to test your problem.
Please follow the instructions for building KOS found in the wiki: [ https://dreamcast.wiki/Getting_Started_with_Dreamcast_development#Configuring_and_compiling_KOS_and_kos-ports ].
And be sure to not skip Building kos-ports.
AGAIN: BE SURE TO USE THE environ.sh FILE PROVIDED IN THE mario-kart-64-dc FOR YOUR KOS BUILD.
Compiling Mario Kart 64 for Dreamcast
Somehow acquire a Mario Kart 64 ROM in Z64 format and name it all lowercase baserom.us.z64 .
Copy baserom.us.z64 into ~/mario-kart-64-dc.
Check that your Mario Kart 64 ROM is a supported version.
The below is the expected md5sum output:
md5sum baserom.us.z64
3a67d9986f54eb282924fca4cd5f6dff baserom.us.z64
Go to the repo directory and compile it like any other KallistiOS project. Make sure you source your KOS environment first (third reminder, use the environ.sh provided with in mario-kart-64-dc repo).
To build the source into an ELF file, run the following commands (exactly as written, except for the path to the mario-kart-64-dc repo, do not change, if it doesn't build, it is your fault not mine):
source /opt/toolchains/dc/kos/environ.sh
cd ~/mario-kart-64-dc
git submodule update --init
cd tools/torch
Under ~/mario-kart-64-dc/tools/torch you will find a README.md with instructions on installing dependencies for torch. See: [ https://github.com/HarbourMasters/Torch/blob/6a2eb921482f2eb3b3cb5b675152d6d21d1a20ff/README.md ]
For Linux and other Linux-like environments, follow those instructions or nothing else will work. Then continue with the following commands (we will start from the beginning so there is no confusion):
source /opt/toolchains/dc/kos/environ.sh
cd ~/mario-kart-64-dc
cd tools/torch
make
cd ..
make
cd ..
make assets
make
For macOS, make sure you have gmake installed (you may need to install it with brew) and try the following (this is how I build it):
source /opt/toolchains/dc/kos/environ.sh
cd ~/mario-kart-64-dc
cd tools/torch
CMAKE_POLICY_VERSION_MINIMUM=3.5 gmake
cd ..
CMAKE_POLICY_VERSION_MINIMUM=3.5 gmake
cd ..
CMAKE_POLICY_VERSION_MINIMUM=3.5 gmake assets
CMAKE_POLICY_VERSION_MINIMUM=3.5 gmake
How to generate Mario Kart 64 disc image
Make sure that you have mkdcdisc built and the executable available on your path. See: [ https://gitlab.com/simulant/mkdcdisc ] for that.
Once that is taken care of, run the following commands
cd ~/mario-kart-64-dc
make cdi
Moments later, you will have a mariokart64.cdi ready to burn to disc.
If you are trying to use the disc image on anything OTHER than a CDR, I cannot help you and will not even pretend to try to help. You're on your own.