tutorial:toolchain_setup

Choosing A Toolchain

There are currently 3 toolchains for PSP development in C/C++, Rust, and Zig. Each one is slightly different, and has a different process to set up. Below are instructions for each, and on popular platforms. Nothing prevents you from having all 3 at once, so feel free to experiment!

Windows

To install the toolchain on Windows XP and higher, you can go download the installer here.

Once you have installed the PSPSDK, which should be located at C:/pspsdk. We need to add this to our path by going to Windows Icon → Search → Set Environmental Variables → System Environmental Variables → Set Path to include C:/pspsdk/bin. For modern Windows, this is rather simple - you just need to add a new entry in the list. On older versions, you need to add a semi-colon to the end of the path, then add the direct location.

Congratulations! You now have a working installation!

Unix-Based OS

You'll want to make sure you've installed developer tools including git.

To get the toolchain, you will need to run

git clone https://github.com/pspdev/psptoolchain.git

If you're on Ubuntu / Debian, you can use the ./prepare-debian-ubuntu.sh to get all dependencies. Also make sure to set your terminal to avoid using dash, as it will create issues.

If you're on Mac OS, you'll need Ports or Homebrew to develop. After that, you can use the ./prepare-mac-os.sh in order to get all of your dependencies.

If you're not on either, you will need the following packages:

autoconf, automake, bison, bzip2, cmake, doxygen, diffutils, flex,
 g++/gcc-c++, gcc, git, gzip, libarchive, libcurl, libelf, libgpgme,
 libssl, libtool, libusb-dev, m4, make, ncurses, patch, pkg-config,
 python3, readline, subversion, tar, tcl, texinfo, unzip, wget, xz-utils

Once that's done you'll need to initiate compilation with:

sudo ./toolchain-sudo.sh

After installation, you need to add your toolchain to path with

export PATH=$PATH:/usr/local/pspdev/bin

Congratulations! You now have a working installation!

To install Rust on your computer, you'll need to head to the official Rust installer, Rustup. Follow the instructions and install Rust. If you're on Windows, you'll need Visual Studio C++ Build Tools.

After you've finished that, you'll need to hop into your favorite terminal (or refresh your terminal instance) and set your toolchain to nightly and add the Rust-SRC component. Then, we'll install Cargo-PSP.

rustup default nightly
rustup component add rust-src
cargo install cargo-psp

Now you've got a working PSP Toolchain in Rust!

For working with Zig-PSP, all you need is the latest version of the Zig compiler installed. Generally master branch is the best choice, and is required until at least v0.7.0 at the end of October, 2020. You can find the nightly downloads here.

Once you've installed Zig, and it is in your path (see above), make sure you also have git installed for general repository work. You'll need to make a copy of the GitHub template with the following command:

git clone https://github.com/zPSP-Dev/Zig-PSP-Template.git --recursive

And there you have it! You should have everything required to get started with Zig.

  • tutorial/toolchain_setup.txt
  • Last modified: 2020/10/15 13:03
  • by iridescence