There are two versions of the libspe:
- 1.x: Distributed as part of the Cell SDK 2.0, is the most widely used nowadays by applications designed to run on the Cell architecture.
- 2.x: A rewrite of the library that provides a better and cleaner interface — e.g. less black boxes —, but which is currently distributed for evaluation and testing purposes. Further development will happen on this version, so I needed to have it available.
Let's see how to build and install libspe2 from sources on a PS3 running YDL5.
The first step is to download the most up-to-date SRPM package for the libspe2, which at the time of this writing was libspe2-2.0.1-1.src.rpm. Once downloaded, install it on the system:
# rpm -i libspe2-2.0.1-1.src.rpm
The above command leaves the original source tarball, any necessary patches and the spec file all properly laid out inside the /usr/src/yellowdog hierarchy.
Now, before we can build the libspe2 package, we need to fulfill two requisites. The first is the installation of quilt (for which no binary package exists in the YDL5 repositories), a required tool in libspe2's build process. The second is the updating of bash to a newer version, as the one distributed in YDL5 has a quoting bug that prevents quilt from being built properly.
The easiest way to solve these problems is to look for the corresponding SRPM packages for quilt and an updated bash. As YDL5 is based on Fedora Core, a safe bet is to fetch the necessary files from the Fedora Core 6 (FC6) repositories; these were: quilt-0.46-1.fc6.src.rpm and bash-3.1-16.1.src.rpm. After that, proceed with their installation as shown above for libspe2 (using rpm -i).
With all the sources in place, it is time to build and install them in the right order. Luckily the FC6 SRPMs we need work fine in YDL5, but this might not be true for other packages. Here is what to do:
# cd /usr/src/yellowdog/SRPMS
# rpmbuild -ba --target=ppc bash.spec
# rpm -U ../RPMS/ppc/bash-3.1-16.1.ppc.rpm
# rpmbuild -ba --target=ppc quilt.spec
# rpm -i ../RPMS/ppc/quilt-0.46-1.ppc.rpm
# rpmbuild -ba libspe2.spec
# rpm -i ../RPMS/ppc64/libspe2-2.0.1-1.ppc64.rpm
# rpm -i ../RPMS/ppc64/libspe2-devel-2.0.1-1.ppc64.rpm
And that's it! libspe2 is now installed and ready to be used. Of course, with the build requisites in place, you compile libspe2 in your home directory for testing purposes by using the tar.gz package instead of the SRPM.
At last, complete the installation by adding the elfspe2-2.0.1-1.ppc.rpm package to the mix.