View previous topic :: View next topic |
Author |
Message |
garlicbread Apprentice
Joined: 06 Mar 2004 Posts: 182
|
Posted: Sat Apr 21, 2007 5:09 pm Post subject: PS3 crossdev build |
|
|
I thought I'd post this here as the other PS3 thread is getting a bit crowded
the PS3 has 2 processor types available
the PPE which is what linux runs on, this is the ppc64 platform
and the SPU co-processors which are not normally used by the linux kernel, but could be used via apps via the spufs filesystem
(the use of the SPU is quite new as it's part of the Cell, most apps such as yafray probably aren't geared up to make use of it as yet)
http://en.wikipedia.org/wiki/Cell_microprocessor
as far as I know the PPE is single core, dual threaded, which makes it look like a dual core processor under linux
with a normal Cell there are also 8 SPU's, but only 7 for the PS3 (one is marked bad at the hardware level to get greater yeilds for the chips which makes it cheaper)
since one of the SPU's is also used for the Game OS / hypervisor stuff
this leaves 2(PPE) + 6(SPU) = 8 little tux's all in a row at startup
for distcc cross compiling we need to use ppc64 (not spu)
instructions taken from http://www.gentoo.org/doc/en/cross-compiling-distcc.xml
On the helper boxes (for me this was one of my amd64 boxes)
Code: | emerge -u crossdev distcc
crossdev -t ppc64 |
wait and wait and wait
make a cup of tea and wait some more for cross-glibc and everything else to finish
make sure that /etc/conf/distccd is setup correctly
if your local subnet is 192.168.0.x then the default should be fine
(for me I had to change the --allow setting for the subnet as all my machines are on 192.168.1.x)
start the service
Code: | /etc/init.d/distccd start |
to add to the default run level (on boot)
Code: | rc-update add distccd default |
on the box running the emerge (the PS3 box)
Code: | emerge -u crossdev distcc
cd /usr/lib/distcc/bin
echo '#!/bin/bash' >powerpc64-unknown-linux-gnu-wrapper
echo 'exec /usr/lib/distcc/bin/powerpc64-unknown-linux-gnu-g${0:$[-2]} "$@"' >>powerpc64-unknown-linux-gnu-wrapper
chmod a+x powerpc64-unknown-linux-gnu-wrapper
rm c++ g++ gcc cc
ln -s powerpc64-unknown-linux-gnu-wrapper cc
ln -s powerpc64-unknown-linux-gnu-wrapper gcc
ln -s powerpc64-unknown-linux-gnu-wrapper g++
ln -s powerpc64-unknown-linux-gnu-wrapper c++ |
inside /etc/make.conf
for FEATURES add distcc in there
for DISTCC_HOSTS add a list of IP addresses of the helper boxes e.g. "localhost 192.168.1.45"
for MAKEOPTS this should be the number of processors in total involved in the build +1, e.g. "-j6"
this seems to work
but I'm still getting a warning of
"powerpc64-unknown-linux-gnu-gcc: -mabi=altivec detected on the command line overrides implicit -m64 added by the wrapper."
considering it's just a warning not an error I'm not sure if this should just be ignored |
|
Back to top |
|
|
robnotts Guru
Joined: 15 Mar 2004 Posts: 405 Location: Nottingham, UK
|
Posted: Sun Apr 22, 2007 8:50 am Post subject: |
|
|
I had already followed these instructions and get exactly the same warning... having recompiled my PS3 via distcc and the system still working, I guess we can ignore the warning for now.
Rob. _________________ ---
Gentoo Phenom][ X4 955 on AMD790 + Geforce 220GT 8GB/1.75TB (Desktop)
+ MythTV (3xFreeview,1xFreesat HD) on 1080p
Gentoo Turion64 X2 Geforce 6150 2GB/120GB (Laptop) |
|
Back to top |
|
|
fatboynotsoslim n00b
Joined: 23 Apr 2007 Posts: 2
|
Posted: Mon Apr 23, 2007 12:55 pm Post subject: |
|
|
garlicbread,
Does Gentoo have a bootcd image similar to Ubuntu, so that I can load it up on my main pc and laptop to get some faster processing done, without first having to install gentoo on my other machines?
They both still run, win xp pro |
|
Back to top |
|
|
garlicbread Apprentice
Joined: 06 Mar 2004 Posts: 182
|
Posted: Mon Apr 23, 2007 4:03 pm Post subject: |
|
|
There's the Gentoo Live CD, I'm not sure if it includes distcc by default
but I suspect it won't include the ppc64 cross compiler which is what you need for the PS3 64bit, or ppc for the PS3 32bit
you could always create a custom Live CD, but that would involve someone with Gentoo using catalyst to create it
From what I've heard catalyst isn't easy to use, and I'm not sure how you'd go about including cross compilers on there at the same time |
|
Back to top |
|
|
tcostigl Tux's lil' helper
Joined: 28 Jul 2004 Posts: 97
|
Posted: Tue Apr 24, 2007 1:12 am Post subject: |
|
|
I am using the toolchain overlay and is blocked by "missing keyword (-*)". Because the crossdev script attempts to set up the keywords for you, modifying package.keywords does not help. So I edited the crossdev script to include "-*". I don't really know if this is a bad idea or not!? Maybe someone else knows better, perhaps lu_zero? I guess i could have just removed '-*' from the ebuild as well...
Anyway, it seems to be working... cross-gcc-stage1 is compiling.
EDIT: Ok, compiling finished early . None of the ebuilds in the overlay build by using crossdev. |
|
Back to top |
|
|
garlicbread Apprentice
Joined: 06 Mar 2004 Posts: 182
|
Posted: Wed Apr 25, 2007 6:35 pm Post subject: |
|
|
the above was more about setting up other machines to help out the PS3 with it's compiling of normal ppc64 code
(it's only got 256Mb of mem )
running crossdev on the helper machines (not the PS3) so that the helper machines have the correct gcc / binutils etc to help out via distcc
If you want to compile code for the SPU's on the PS3 (which is something different altogether)
to make use of the SPU coprocessors
then you need to run crossdev on the PS3 so that it has the correct versions of binutils / gcc for compiling SPU code
(even though the PS3 has both processor types, as Linux is running on a ppc64 platform normally)
the problem is I think SPU code can only be compiled on the cutting edge versions of gcc (4.3) / binutils
which is why you need to use the toolchain overlay
and unmask gcc / binutils (on the PS3)
this way crossdev will be able to use the correct versions of gcc etc for creating a crosscompiler for the spu
(all the details are in one of those other tutorials in the main PS3 thread) |
|
Back to top |
|
|
tcostigl Tux's lil' helper
Joined: 28 Jul 2004 Posts: 97
|
Posted: Thu Apr 26, 2007 12:56 am Post subject: |
|
|
Quote: | (even though the PS3 has both processor types, as Linux is running on a ppc64 platform normally)
the problem is I think SPU code can only be compiled on the cutting edge versions of gcc (4.3) / binutils
which is why you need to use the toolchain overlay
and unmask gcc / binutils (on the PS3) |
I see. But will gcc-4.3 add any features for the ppu? |
|
Back to top |
|
|
garlicbread Apprentice
Joined: 06 Mar 2004 Posts: 182
|
Posted: Thu Apr 26, 2007 9:50 am Post subject: |
|
|
I think the PPU is the same as any other powerpc 64 platform such as the Apple
so the only gains would probably be over how the code compiles / size of code etc
(probably nothing in terms of getting better access to hardware on the PS3)
for the SPU I think a cross compiled gcc-4.3 is needed probably because it's such a new platform
and the code's probably not all there yet in the standard / stable gcc for the SPU (or perhaps just doesn't work as well)
for the PPU / Linux it's probably best to stick to the stable versions of gcc for emerge's etc
as there could be a real risk of breaking your system horribly
usually newer versions of gcc are much more strict in the conventions used in the code, so it can be less forgiving with code that's a bit sloppy, resulting in code that won't comple, or perhaps strange errors at run-time if there's any bugs in unstable gcc
when your whole system relies on one piece of software, it's usually best to make sure it's stable |
|
Back to top |
|
|
|