tutorial:toolchain_setup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorial:toolchain_setup [2020/10/15 13:02]
iridescence created
tutorial:toolchain_setup [2022/09/26 23:12] (current)
iridescence
Line 1: Line 1:
 ====== Choosing A Toolchain ====== ====== 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.+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!
  
 ===== C/C++ ===== ===== C/C++ =====
Line 16: Line 16:
 You'll want to make sure you've installed developer tools including git.  You'll want to make sure you've installed developer tools including git. 
  
-To get the toolchain, you will need to run <code>git clone https://github.com/pspdev/psptoolchain.git</code>+To get the toolchain, you will need to run <code>git clone https://github.com/pspdev/pspdev.git</code>
  
-If you're on Ubuntu / Debianyou can use the ./prepare-debian-ubuntu.sh to get all dependenciesAlso make sure to set your terminal to avoid using dash, as it will create issues.+If you use Linux, use the prepare script according to your distro. For example, 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 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.
Line 27: Line 27:
  python3, readline, subversion, tar, tcl, texinfo, unzip, wget, xz-utils</code>  python3, readline, subversion, tar, tcl, texinfo, unzip, wget, xz-utils</code>
  
-Once that's done you'll need to initiate compilation with: <code>sudo ./toolchain-sudo.sh</code>+To setup your working directory 
 +<code> 
 +export PSPDEV=/usr/local/pspdev 
 +sudo mkdir -p $PSPDEV 
 +sudo chown -R $USER: $PSPDEV 
 +</code>
  
-After installation, you need to add your toolchain to path with <code>export PATH=$PATH:/usr/local/pspdev/bin</code>+And in your login script: 
 +<code> 
 +export PSPDEV=/usr/local/pspdev 
 +export PATH=$PATH:$PSPDEV/bin 
 +</code> 
 + 
 +Once that's done you'll need to initiate compilation with: <code>sudo ./build-all.sh</code> 
 + 
 +After installation, you need to add your toolchain to path with <code>export PATH=$PATH:/usr/local/pspdev/bin</code> or use the login script as described earlier.
  
 Congratulations! You now have a working installation! Congratulations! You now have a working installation!
Line 35: Line 48:
 ===== Rust ===== ===== Rust =====
  
-To install Rust on your computer, you'll need to head to the official Rust installer, [[https://rustup.rs/|Rustup]].+To install Rust on your computer, you'll need to head to the official Rust installer, ''[[https://rustup.rs/|rustup]]''.
 Follow the instructions and install Rust. If you're on Windows, you'll need [[https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16|Visual Studio C++ Build Tools]]. Follow the instructions and install Rust. If you're on Windows, you'll need [[https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16|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.+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''.
 <code> <code>
 rustup default nightly rustup default nightly
Line 44: Line 57:
 cargo install cargo-psp cargo install cargo-psp
 </code> </code>
 +This will set your default Rust toolchain to be ''nightly''. You can also do a per-project override with the following commands:
 +<code>
 +cargo new my-psp-app
 +cd my-psp-app
 +rustup override set nightly
 +</code>
 +
 +Finally, add the ''[[https://lib.rs/crates/psp|psp]]'' crate to your ''Cargo.toml''.
  
 Now you've got a working PSP Toolchain in Rust! Now you've got a working PSP Toolchain in Rust!
Line 49: Line 70:
 ===== Zig ===== ===== Zig =====
  
-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 [[https://ziglang.org/download/|here]].+For working with Zig-PSP, all you need is the v0.8.1 of the Zig compiler installed. You can find the downloads here [[https://ziglang.org/download/|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: 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:
  • tutorial/toolchain_setup.1602766948.txt.gz
  • Last modified: 2020/10/15 13:02
  • by iridescence