Tuesday, June 19, 2007

Installing Cell SDK under Ubuntu

The Cell SDK from IBM, currently at v2.1, is only officially supported under Fedora. It's simply a bunch of RPMs so most RPM-based distros should work (I know that RedHat EL 5 works, for instance). However, if you're using a Debian-based distro you might need to make some preparations. Here are some simple steps to follow to get the SDK running under Ubuntu. I only tested this under Feisty, and I think it should work with Edgy as well, but for older releases you'll need to get a backported glibc. So let's start ($ denotes the console prompt):

1) Ubuntu doesn't use bash! It uses the more lightweight alternative dash, which doesn't like the SDK's installation script. Install bash:

$ apt-get install bash

2) Then make sure that /bin/sh actually points to bash:

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2007-06-17 17:38 /bin/sh -> bash

3) Another tool to replace. Ubuntu uses mawk while Fedora uses gawk. We'll install gawk and make sure that awk points to it:

$ apt-get install gawk
$ update-alternatives --set awk /usr/bin/gawk


4) The installation script checks for RPM dependencies, and this will definitely fail. We'll modify it so that it doesn't make any checks, and we'll install the equivalent debs manually. Simply, replace each "rpm -i" by "rpm -i --nodeps":

$ sed -i 's/rpm -i/rpm -i --nodeps/g' [path_to_sdk]/software/cellsdk

5) Install the required packages:

$ apt-get install rpm freeglut3 freeglut3-dev libxmu-dev libxext-dev gcc make perl rsync flex byacc tk8.4 tcl8.4 libelf1

6) Make symlinks to libtck and libtk:

$ cd /usr/lib
$ ln -s libtcl8.4.so.0 libtcl8.4.so
$ ln -s libtk8.4.so.0 libtk8.4.so

7) Finally, run the installation script as root:

$ cd [path_to_sdk]/software
$ sudo ./cellsdk install


And that should be it!

11 comments:

Guerreiro said...

I got this error when i try to install the SDK...

guerreiro@guerreiro:~/Desktop/CellSDK21.iso_FILES/software$ sudo ./cellsdk install
[: 168: ==: unexpected operator
[: 200: ==: unexpected operator
./cellsdk: 252: CBE: not found
[: 306: ==: unexpected operator
./cellsdk: 382: Syntax error: "(" unexpected
guerreiro@guerreiro:~/Desktop/CellSDK21.iso_FILES/software$

even if i not change the original script i get the same message... what sould I do???

Mahmoud AlGammal said...

From the "unexpected operator" errors, I'm guessing that you might have something else other than bash installed. Are you sure you have followed all steps? What does ls -l `which bash` return on your system?

hammady said...

You are saying Ubuntu is not using bash?
Which Ubuntu you mean? At least Feisty does.

Mahmoud AlGammal said...

Yes, it doesn't. It's using dash. And I just realized a mistake in my earlier comment (sorry Guerreiro, I hope you'll come back to see the correction). I meant one should check by looking at the output of ls -l `which sh`. On Feisty, you should see something like this:
lrwxrwxrwx 1 root root 4 2007-06-17 17:38 /bin/sh -> dash

Protheus said...

Hi all,

if you compiled a newer kernel you might get this Problem:

IBM Cell System Simulator:

Preparing... ########################################### [100%]
package systemsim-cell-2.1-10 is intended for a ppc64 architecture
ERROR: failed to install IBM Cell System Simulator

You can fix it by changing the rpm -i with sed to the following:
sed 's/rpm -i/rpm -i --nodeps --ignorearch/' [cellsdk-file]

Just in case ...

Protheus

Mahmoud AlGammal said...

Thanks a lot. I hope someone will find this useful.

Felipe said...

It works for Ubuntu 7.04 x86_64 too. :-)

Anonymous said...

Does this work on Ubuntu 7.10?

Mahmoud AlGammal said...

I haven't tried yet, but it most probably will. Try following the same procedure and share your findings.

Anonymous said...

Hello, after following all your steps (I'm using glutsy) and executed sudo ./cellsdk install --nosim -f, I get many many errors like these ones:
GNU Compiler Toolchain:

error: Failed dependencies:
binutils >= 2.15.91.0.2-4 is needed by ppu-gcc-4.1.1-10.ppc
glibc-devel >= 2.2.90-12 is needed by ppu-gcc-4.1.1-10.ppc
libc.so.6 is needed by ppu-gdb-6.6-15.ppc
libc.so.6()(64bit) is needed by ppu-gdb-6.6-15.ppc
libc.so.6(GLIBC_2.0) is needed by ppu-gdb-6.6-15.ppc
libc.so.6(GLIBC_2.1.3) is needed by ppu-gdb-6.6-15.ppc
libc.so.6(GLIBC_2.3)(64bit) is needed by ppu-gdb-6.6-15.ppc
libc.so.6(GLIBC_2.3.4) is needed by ppu-gdb-6.6-15.ppc
libc.so.6(GLIBC_2.3.4)(64bit) is needed by ppu-gdb-6.6-15.ppc
libc.so.6(GLIBC_2.4) is needed by ppu-gdb-6.6-15.ppc
libc.so.6(GLIBC_2.4)(64bit) is needed by ppu-gdb-6.6-15.ppc
libdl.so.2()(64bit) is needed by ppu-gdb-6.6-15.ppc
libdl.so.2(GLIBC_2.3)(64bit) is needed by ppu-gdb-6.6-15.ppc

Any clue?
Thanks :)

Mahmoud AlGammal said...

Make sure that you have the packages "binutils" & "libc6-dev" installed in gutsy. I'm not sure if that's the only problem, but it seems so from the errors you got.

If this solves your problem then please let me know, so that I update the list of required packages in the steps.