Installing the PSP toolchain in Ubuntu

(As all the guides I found out there were either outdated or specific to windows/cygwin, I decided to put this here just so that I remember how to do this next time I have to install the toolchain on another computer :-) )

First, check out the toolchain sources from svn://svn.ps2dev.org/psp/trunk/psptoolchain into say ~/tmp/psptoolchain:

mkdir ~/tmp/psptoolchain
cd ~/tmp/psptoolchain
svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain .

Notice the svn:// and not http://, most tutorials are still using http://svn… and it won’t work.

Now read ~/tmp/psptoolchain/readme-ubuntu.txt. It tells you to make sure you have a series of packages installed; a pity they forgot to add a couple of packages (libmpfr-dev and libgmp3-dev). This is the full, updated list of packages to install:

sudo apt-get install build-essential autoconf automake bison flex \
  libncurses5-dev libreadline-dev libusb-dev texinfo libmpfr-dev \
  libgmp3-dev

with that and following the remaining instructions in the readme-ubuntu.txt file you should be able to get the toolchain installed in your computer. It will take some time depending on your processor etc, on my powerpc mac it takes a lot of time (in the order of hours), whereas in my brand new ubuntu machine with quad processor it took ~25 minutes, if I remember correctly.

So once it finishes, everything will be installed at /usr/local/pspdev. You might want to create a shortcut to the samples, which are in /usr/local/pspdev/psp/sdk/samples, but have a look at the other folders anyway, since the .h files are in there too and it’s good to know what you’re dealing with.

And this is entirely optional, but if you want to install SDL and other libraries, the easiest way I found is to use their psplibraries script. It is hosted in the same SVN repository so you just need to check it out:

mkdir ~/tmp/psplibraries
cd ~/tmp/psplibraries
svn co svn://svn.ps2dev.org/psp/trunk/psplibraries .

Again, there’s a readme-ubuntu.txt file; you might need to install libtool as specified there, and after that, simply run the libraries-sudo.sh file and let it work for a while since it needs to grab the sources for the libraries and build them.

Once that is finished too, the libraries will be also ready for your consumption and linkage inside the /usr/local/pspdev folder too, so everything is nice and clean. The guys at pspdev did a good job, kudos to them!

29 Responses to “Installing the PSP toolchain in Ubuntu”

  1. [...] About & Contact « Installing the PSP toolchain in Ubuntu [...]

  2. Manolopm says:

    Thanks for the mini Howto, Sole. It works fine in my Debian for AMD 64. Greetings from Canary Islands :)

  3. sole says:

    Ohh! I didn’t know you also read my blog :-)

    Thanks to you for reading! I’m glad it also works in Debian. Let’s give these psp’s some cool stuff to execute!

  4. gzip says:

    Nice and simple. Libs are the icing on the cake. Thanks.

  5. gedit says:

    Thank you so much for this, i searched around for ages trying to find what was needed to set this up. This guide is awesome. I love you…. so much.

  6. sole says:

    that’s enthusiasm! thanks to you!

  7. hardnrg says:

    you should get a medal or something for this…

    I send you many internets

  8. sole says:

    glad it’s useful :)

    What am I going to do with so many internets? :D

  9. osgeld says:

    thanks, i redid my machine and this was much quicker and less painful than the first time i did it with someone else’s instructions

  10. sole says:

    super! waiting for some psp homebrew apps developed in ubuntu, then ;-)

  11. encryped says:

    nice i really like ubuntu and first i did use windows for my psp homebrew but this works much easier

  12. bubugian says:

    Hi,
    some month ago I’ve installed psptoolchain but something goes wrong (I can compile hello world but it doesn’t works).
    I try your guide but I can’t contact ’svn.ps2dev.org’…
    What I should try ?

    Thanks!

  13. sole says:

    I can’t help you if you don’t post the error message you get. You probably don’t have svn installed and that’s why you can’t contact the server. Other than that I can’t think of anything else…

  14. foebea says:

    Awesome tutorial, thanks! I wrote one for 7.04, but the install route has appearantly changed enough that that’s no longer valid. You saved me a good couple of hours, im sure.

    You should post this at psp-hacks development forum, they have a mega thread for setting up the environment, and the only linux install info there currently is my old thread.

    Thanks again!

  15. foebea says:

    just in case anyone here hits problems running psplibraries before they fix it, it is currently a little ill and bombs out in a few places.

    I posted the resolution here.
    http://forums.ps2dev.org/viewtopic.php?p=77896#77896

    I’m guessing ooPo will have it fixed on svn after the holidays. It’s just a few missing includes, libs, and a config.guess file.

  16. Lui says:

    Great Job! The Best tutorial, I couldn’t compile the toolchain after this tutorial, I did it!! Thanx a lot!!

  17. sole says:

    Lui, I guess you meant you COULD compile it after the tuto :D

  18. Dani says:

    Thanks! It’s good to see a not-so-old tuto about this.

  19. john says:

    Hi Thanks a lot for this you’re right about nearly all the tutorils being for windows with cygwin etc.
    I realise this is a fairly old page, are all the links still correct? and will this work with the latest psp toolchain? I am going to do this as soon as i get latest ubuntu installed.
    Thanks a lot.

  20. sole says:

    If you read the comments, you’ll see it seems to be working for people – at least back in April of 2009, so it seems to be still current. Not sure if you can call the advice fairly old then!

  21. John says:

    Yeah, good point ive just tried this and it was all going well until i ran the toolchain.sh where it said C compiler cannot create executables.
    So i’m a bit stuck, any suggestions?
    thanks very much for this tho, it is very helpful and easy to follow.
    oh, and it also said E: Couldn’t find package libgmp3-d when i tried to get that package.

  22. John says:

    Oh, i said in that post i was running toolchain.sh but i was actually running toolchain-sudo.sh as it says in the readme, should I be using toolchain.sh perhaps?

  23. sole says:

    do you have gcc (the C compiler) installed on your system?

  24. John says:

    yes i have gcc 4.2.2
    I’ve just edited the toolchain-sudo.sh file to include:
    export CC=/usr/bin/gcc-4.2
    I think it may be an error specific to ubuntu 9.04 as this seems to have got past that stage, I’ll reply if it works.

  25. sole says:

    hmm, that’s interesting! hope that works, and please let me know in any case. it’s good to know just in case we re-format :D

  26. John says:

    Yes, i think its worked but i’m not sure. Is there any way to check if it installed everything? i’ve not tried using it yet, will do soon…

  27. sole says:

    What about trying to compile something? :P

  28. Chris says:

    Thanks for the info. I noticed my fresh install of ubuntu had gcc-4.3 so had to edit the toolchain-sudo.sh script for that, but everything else worked fine.

Leave a Reply