Difference between revisions of "Installing Cell Broadband Engine SDK"

From ArchWiki
Jump to: navigation, search
Line 2: Line 2:
 
[[Category:HOWTOs (English)]]
 
[[Category:HOWTOs (English)]]
  
The CBE SDK installation only supports an FC5 linux distribution. I managed to install it on my archlinux system with the help of the original article by Justin Lee for a more general installation on a linux system. The arcticle can be found on the [http://www.cellperformance.com/justin_lee/2006/08/cellbroadbandengine_sdk_11_on_ubuntu.html Cellperformance website].
+
The CBE SDK installation only supports the Fedora 7 or RHEL linux distributions. I managed to install it on my archlinux system with the help of [http://forums.gentoo.org/viewtopic-t-685982.html a post in the gentoo forum], and doing some trial/error.
  
  
Line 9: Line 9:
 
All of the following required packages are provided by the pacman databases and the versions should be recent enough.
 
All of the following required packages are provided by the pacman databases and the versions should be recent enough.
  
Current repository:
+
Core repository:
 
*gcc 4.x
 
*gcc 4.x
 
*glibc 2.4
 
*glibc 2.4
Line 24: Line 24:
  
  
 
+
The simulator requires tk and tcl in pre-8.5 versions, and compiled without thread support.
A little tweak is needed for the following two:
+
 
+
====make-3.80====
+
We need the exact version 3.80 of make for installing the SDK and the current make-version that pacman provides is a later version.
+
In your /var/abs/local directory, make a directory called 'make'. In that directory, create a file 'PKGBUILD'.
+
# cd /var/abs/local
+
# mkdir make
+
# cd make
+
# nano -w PKGBUILD
+
Place the following in this PKGBUILD file:
+
# $Id: PKGBUILD,v 1.13 2006/04/07 04:18:32 judd Exp $
+
# Maintainer: judd <jvinet@zeroflux.org>
+
pkgname=make
+
pkgver=3.80
+
pkgrel=1
+
pkgdesc="GNU make utility to maintain groups of programs"
+
url="http://www.gnu.org/software/make"
+
depends=('glibc' 'bash')
+
source=(ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz)
+
md5sums=('c68540da9302a48068d5cce1f0099477')
+
+
build() {
+
  cd $startdir/src/$pkgname-$pkgver
+
  ./configure --prefix=/usr
+
  make || return 1
+
  make DESTDIR=$startdir/pkg install
+
}
+
 
+
Now run makepkg and install this version (3.80) of make with the following command.
+
# makepkg
+
# pacman -U make-3.80-1.pkg.tar.gz
+
A subsequent update of your arch system, will upgrade make again. That is not a bad thing, since the 3.80 version is only needed for the installation of the SDK. If you however do not want your system to update it anymore, add the line 'IgnorePkg  = make' to your /etc/pacman.conf file.
+
 
+
  
 
====tcl/tk-8.4.x without threads====
 
====tcl/tk-8.4.x without threads====
Line 64: Line 31:
 
  # cd /var/abs/local/tcl
 
  # cd /var/abs/local/tcl
 
  # nano -w PKGBUILD
 
  # nano -w PKGBUILD
 +
 
The PKGBUILD file (just the enable-threads in the ./configure should be eliminated from the original PKGBUILD file you can retrieve from ABS):
 
The PKGBUILD file (just the enable-threads in the ./configure should be eliminated from the original PKGBUILD file you can retrieve from ABS):
  # $Id: PKGBUILD,v 1.26 2006/07/19 17:39:13 jgc Exp $
+
 
 +
  # $Id: PKGBUILD 356 2008-04-18 22:56:27Z aaron $
 
  # Maintainer: dorphell <dorphell@archlinux.org>
 
  # Maintainer: dorphell <dorphell@archlinux.org>
 
  # Committer: Judd Vinet <jvinet@zeroflux.org>
 
  # Committer: Judd Vinet <jvinet@zeroflux.org>
 
  pkgname=tcl
 
  pkgname=tcl
  pkgver=8.4.13
+
  pkgver=8.4.19
  pkgrel=2
+
  pkgrel=1
 
  pkgdesc="The Tcl scripting language"
 
  pkgdesc="The Tcl scripting language"
  arch=(i686)
+
  arch=('i686' 'x86_64')
 +
license=('custom')
 
  depends=(glibc)
 
  depends=(glibc)
  source=(http://heanet.dl.sourceforge.net/sourceforge/tcl/tcl${pkgver}- src.tar.gz)
+
  source=(http://downloads.sourceforge.net/sourceforge/tcl/tcl${pkgver}-src.tar.gz)
 
  url="http://tcl.sourceforge.net/"
 
  url="http://tcl.sourceforge.net/"
  md5sums=('c6b655ad5db095ee73227113220c0523')
+
  md5sums=('ade2c033a7b545ee108f3fdfeb629fcf')
 
   
 
   
 
  build() {
 
  build() {
 
   cd ${startdir}/src/tcl${pkgver}/unix
 
   cd ${startdir}/src/tcl${pkgver}/unix
   sed -i -e "s/relid'/relid/" configure
+
if [ "$CARCH" = "x86_64" ]; then
   ./configure --prefix=/usr --disable-threads --disable-64bit
+
   ./configure --prefix=/usr --disable-threads --enable-64bit
 +
   else  ./configure --prefix=/usr --disable-threads --disable-64bit
 +
fi
 
   make || return 1
 
   make || return 1
 
   make INSTALL_ROOT=${startdir}/pkg install install-private-headers
 
   make INSTALL_ROOT=${startdir}/pkg install install-private-headers
   ln -sf tclsh8.4 ${startdir}/pkg/usr/bin/tclsh
+
   ln -sf tclsh8.5 ${startdir}/pkg/usr/bin/tclsh
 +
  # install license
 +
  install -Dm644 ../license.terms $startdir/pkg/usr/share/licenses/$pkgname/LICENSE
 +
 +
 +
  # remove buildroot traces / fixes #3602
 +
  sed -i \
 +
  -e "s,^TCL_BUILD_LIB_SPEC='-L.*/unix,TCL_BUILD_LIB_SPEC='-L/usr/lib," \
 +
  -e "s,^TCL_SRC_DIR='.*',TCL_SRC_DIR='/usr/include'," \
 +
  -e "s,^TCL_BUILD_STUB_LIB_SPEC='-L.*/unix,TCL_BUILD_STUB_LIB_SPEC='-L/usr/lib," \
 +
  -e "s,^TCL_BUILD_STUB_LIB_PATH='.*/unix,TCL_BUILD_STUB_LIB_PATH='/usr/lib," \
 +
  -e "s,^TCL_LIB_FILE='libtcl8.5..TCL_DBGX..so',TCL_LIB_FILE=\"libtcl8.5\$\{TCL_DBGX\}.so\"," \
 +
  -e "s,^TCL_CC_SEARCH_FLAGS='\(.*\)',TCL_CC_SEARCH_FLAGS='\1:/usr/lib'," \
 +
  -e "s,^TCL_LD_SEARCH_FLAGS='\(.*\)',TCL_LD_SEARCH_FLAGS='\1:/usr/lib'," \
 +
  $startdir/pkg/usr/lib/tclConfig.sh
 
  }
 
  }
  
 
Make the non-threaded package and install it:
 
Make the non-threaded package and install it:
 
  # makepkg
 
  # makepkg
  # pacman -U tcl-8.4.13-2.pkg.tar.gz
+
  # pacman -U tcl-8.4.19-1.pkg.tar.gz
If newer versions of tcl/tk become available, the non-threaded version will be overriden by the default threaded version. The new version and PKGBUILD from ABS can be adapted and installed in the same way or updates could be stopped by adding 'IgnorePkg = tcl tk' to your /etc/pacman.conf file.
+
If newer versions of tcl/tk become available, the non-threaded version will be overriden by the default threaded version. The new version and PKGBUILD from ABS can be adapted and installed in the same way or updates could be stopped by adding
 +
'IgnorePkg = tcl tk'
 +
to your /etc/pacman.conf file.
  
  
 
=Installation=
 
=Installation=
===Mount ISO===
+
===Get ISOs and build the SDK===
Mount the ISO image downloaded from http://www.alphaworks.ibm.com/tech/cellsw (after free registration on the ibm website).
+
You'll have to download the two 3.0 SDK ISOs for Fedora 7 manually from [http://www.ibm.com/developerworks/power/cell/pkgdownloads.html?S_TACT=105AGX16&S_CMP=LP IBMs website, which requires free registration. Place them in a build folder, and get the [http://aur.archlinux.org/packages.php?ID=17060 cellsdk build files from the AUR], and place them in the same folder. Now the SDK is ready to be build, but you will have to do it as root because the PKGBUILD uses mount of loop-devices to extract packages from the ISOs.
mkdir -p /mnt/cellsdk
+
makepkg --asroot
mount -o loop CellSDK11.iso /mnt/cellsdk
+
  
===Copy SDK packages===
+
Now a cellsdk-3.0-1-x86_64.pkg.tar.gz should be ready for installation! Just run
  cp -r /mnt/cellsdk/software ~
+
  pacman -A cellsdk-3.0-1-x86_64.pkg.tar.gz
 +
and now the SDK is installed and ready for use.
  
===Patch Install Script===
+
=Running the Simulator=
RPM can not be allowed to check dependencies, so --nodeps should be added everywhere. A patch file can be [http://triplez.sg.gs/cellsdk-1.1/cellsdk.patch downloaded].
+
cd ~/software
+
patch cellsdk cellsdk.patch
+
 
+
===Installing SDK===
+
sudo ./cellsdk install
+
This should fetch another bunch of rpm files and install the complete SDK succesfully.
+
 
+
===Running the Simulator===
+
 
Go to /opt/IBM/systemsim-cell/run/cell/linux directory and type sudo ../run_gui.
 
Go to /opt/IBM/systemsim-cell/run/cell/linux directory and type sudo ../run_gui.
 
You can run without root by changing the owner and group.
 
You can run without root by changing the owner and group.
  sudo chown -R /opt/IBM/systemsim-cell
+
  sudo chown -R /opt/ibm/systemsim-cell
  sudo chgrp -R /opt/IBM/systemsim-cell  
+
  sudo chgrp -R /opt/ibm/systemsim-cell  
  
  
  cd /opt/IBM/systemsim-cell/run/cell/linux
+
  cd /opt/ibm/systemsim-cell/run/cell/linux
 
  ../run_gui
 
  ../run_gui
  
 
If it gives you some segmentation fault, that means you've forgotten to install the tcl/tk without pthread versions.
 
If it gives you some segmentation fault, that means you've forgotten to install the tcl/tk without pthread versions.
 
=Problems=
 
===sysroot===
 
I dont know why, but my first attempt to installation failed halfway. The /opt/IBM/cellsdk-1.1/sysroot was not a directory but an empty file. Deleting this empty file and reinitiating the install script took care of the problem.
 

Revision as of 15:55, 20 May 2008


The CBE SDK installation only supports the Fedora 7 or RHEL linux distributions. I managed to install it on my archlinux system with the help of a post in the gentoo forum, and doing some trial/error.


Required Packages

All of the following required packages are provided by the pacman databases and the versions should be recent enough.

Core repository:

  • gcc 4.x
  • glibc 2.4
  • perl 5.x
  • freeglut
  • gawk
  • bison
  • flex

Extra repository:

  • rpmextract

To make sure all of these are installed:

# pacman -S gcc glibc perl freeglut gawk bison flex rpmextract


The simulator requires tk and tcl in pre-8.5 versions, and compiled without thread support.

tcl/tk-8.4.x without threads

There are problems running the simulator when pthreads are enabled, so we need to build tcl/tk without threads. To do this, we create another dir in the /var/abs/local and make a new PKGBUILD.

# mkdir /var/abs/local/tcl
# cd /var/abs/local/tcl
# nano -w PKGBUILD

The PKGBUILD file (just the enable-threads in the ./configure should be eliminated from the original PKGBUILD file you can retrieve from ABS):

# $Id: PKGBUILD 356 2008-04-18 22:56:27Z aaron $
# Maintainer: dorphell <dorphell@archlinux.org>
# Committer: Judd Vinet <jvinet@zeroflux.org>
pkgname=tcl
pkgver=8.4.19
pkgrel=1
pkgdesc="The Tcl scripting language"
arch=('i686' 'x86_64')
license=('custom')
depends=(glibc)
source=(http://downloads.sourceforge.net/sourceforge/tcl/tcl${pkgver}-src.tar.gz)
url="http://tcl.sourceforge.net/"
md5sums=('ade2c033a7b545ee108f3fdfeb629fcf')

build() {
  cd ${startdir}/src/tcl${pkgver}/unix
if [ "$CARCH" = "x86_64" ]; then
  ./configure --prefix=/usr --disable-threads --enable-64bit
  else   ./configure --prefix=/usr --disable-threads --disable-64bit
fi
  make || return 1
  make INSTALL_ROOT=${startdir}/pkg install install-private-headers
  ln -sf tclsh8.5 ${startdir}/pkg/usr/bin/tclsh
  # install license
  install -Dm644 ../license.terms $startdir/pkg/usr/share/licenses/$pkgname/LICENSE


 # remove buildroot traces / fixes #3602
 sed -i \
 -e "s,^TCL_BUILD_LIB_SPEC='-L.*/unix,TCL_BUILD_LIB_SPEC='-L/usr/lib," \
 -e "s,^TCL_SRC_DIR='.*',TCL_SRC_DIR='/usr/include'," \
 -e "s,^TCL_BUILD_STUB_LIB_SPEC='-L.*/unix,TCL_BUILD_STUB_LIB_SPEC='-L/usr/lib," \
 -e "s,^TCL_BUILD_STUB_LIB_PATH='.*/unix,TCL_BUILD_STUB_LIB_PATH='/usr/lib," \
 -e "s,^TCL_LIB_FILE='libtcl8.5..TCL_DBGX..so',TCL_LIB_FILE=\"libtcl8.5\$\{TCL_DBGX\}.so\"," \
 -e "s,^TCL_CC_SEARCH_FLAGS='\(.*\)',TCL_CC_SEARCH_FLAGS='\1:/usr/lib'," \
 -e "s,^TCL_LD_SEARCH_FLAGS='\(.*\)',TCL_LD_SEARCH_FLAGS='\1:/usr/lib'," \
 $startdir/pkg/usr/lib/tclConfig.sh
}

Make the non-threaded package and install it:

# makepkg
# pacman -U tcl-8.4.19-1.pkg.tar.gz

If newer versions of tcl/tk become available, the non-threaded version will be overriden by the default threaded version. The new version and PKGBUILD from ABS can be adapted and installed in the same way or updates could be stopped by adding

'IgnorePkg = tcl tk'

to your /etc/pacman.conf file.


Installation

Get ISOs and build the SDK

You'll have to download the two 3.0 SDK ISOs for Fedora 7 manually from IBMs website, which requires free registration. Place them in a build folder, and get the [http://aur.archlinux.org/packages.php?ID=17060 cellsdk build files from the AUR, and place them in the same folder. Now the SDK is ready to be build, but you will have to do it as root because the PKGBUILD uses mount of loop-devices to extract packages from the ISOs.

makepkg --asroot

Now a cellsdk-3.0-1-x86_64.pkg.tar.gz should be ready for installation! Just run

pacman -A cellsdk-3.0-1-x86_64.pkg.tar.gz

and now the SDK is installed and ready for use.

Running the Simulator

Go to /opt/IBM/systemsim-cell/run/cell/linux directory and type sudo ../run_gui. You can run without root by changing the owner and group.

sudo chown -R /opt/ibm/systemsim-cell
sudo chgrp -R /opt/ibm/systemsim-cell 


cd /opt/ibm/systemsim-cell/run/cell/linux
../run_gui

If it gives you some segmentation fault, that means you've forgotten to install the tcl/tk without pthread versions.