Building Libspe Programming Environment

出典: PS3 Linux Information Site / Cell/B.E.のパワーを体験しよう

English / Japanese

To develop programs with SPE on PS3, some items such as compile tool for SPE and libspe must be installed in advance. This site describes how to build “Self-Compiling Environment” for developing programs for PS3 Linux on PS3.

As of February 2007, the following information has been confirmed:

  • Simply installing Fedora Core does not install a development environment for programming with SPE and an execution environment by default.
  • In Yellow Dog Linux v5.0 for PS3 released in November 2006, only an execution environment for ibspe 1.1 has been installed by default.
  • In Yellow Dog Linux v5.0 for PS3 released as a version downloadable from mirror sites at the end of December 2006, a development environment and an execution environment for libspe 1.1 have been installed by default.

Regardless of types of Linux installed, the following development tools and packages for developing libspe must be installed in order to build the latest development environment for programming with SPE. Refer to Overview of Libspe for differences between libspe1 and libspe2 and overviews.

目次

Installing Cell SDK 2.1 Development Tools

  • As of April 2007, a set of the latest development tools such as compilers or debuggers can be obtained from GNU Toolchain 4.1.1 and GDB for the Cell BE's SPU page at Barcelona Supercomputing Center (BSC). To build Self-Compiling Environment on PS3 Linux, acquiring a set of rpm (e.g. Binutils, GCC Compiler, GDB) for Power PC from above page is required.

Development Tools for SPE

  • To develop programs with SPE, at least binutils (spu-binutils), gcc (spu-gcc), and gcc-c++ (spu-gcc-g++) for SPU are required. Installation of spu-gdb or spu-toolchain-debuginfo is also recommended for debugging.
  • All compilers and tools for SPE (SPU) are installed with command names beginning with “spu-”. In the case of gcc for SPE, the command name is “spu-gcc”.

Development Tools for PPE

  • Basically, gcc originally contained in PPC Linux distributions can be used to compile programs for PPE. However compilers for PPC which is contained in existing distributions are not optimized for PPE in Cell. Therefore, for a better performance, it is recommended to install development tools for PPE downloadable from BSC web site.


  • All compilers and tools for PPE (PPU) are installed with command names beginning with “ppu-”. In the case of gcc for PPE, the command name is “ppu-gcc”.
  • Followings are the summarized other points to consider of PPE development tools:
    • gcc or g++ which is installed from PPC Linux distributions will generate binaries in 32-bit mode by default. In the case of gcc or g++ (ppu-gcc or ppu-g++) for PPU which can be installed as a part of Cell SDK of BSC, 64-bit binaries are generated by default.
    • Both of the above compilers can explicitly specify the mode of compilation (32-bit mode or 64-bit mode) by adding “-m32” or “-m64”.
    • When compiling a program by adding the option “-pg” for gprof, if the program is compiled in 32-bit mode (specifying “-m32” or compiling the program without any options using gcc), the generated binaries will not work properly on PS3.
    • Performance differences between gcc and ppu-gcc vary depending on the characteristics of programs. In some benchmarks, a large difference (approx. 20% difference) is reported.

Installing libspe and newlib which are libraries for developing SPE

As of April 2007, libspe 1.2 and libspe 2.1 are the latest versions of libraries for developing SPE. Although programs or materials using libspe1 are currently still popular, APIs using libspe2 may become more popular in future. Therefore, installation of libspe2 is recommended for the people who would like to start programming on PS3. (Installing both libraries is also preferable.)

Installing newlib which is libc for SPE

As of April 2007, the latest version of newlib, which is libc for SPU, can be obtained from GNU Toolchain 4.1.1 and GDB for the Cell BE's SPUpage at BSC.

Installing packages required for building libspe 2.1 environment

lTo build a programming environment using libspe2.1, downloaded and installed all of the following rpm files.

Note: There was a bug in libspe 2.0.1 which had been released in Cell SDK 2.0 provided by IBM Alphaworks and BSC. When a set of development environments and a library for developing SPE (libspe) are installed from iso image of Cell SDK 2.0, an overwrite installation of libspe 2.1 should be performed. To force overwrite installations, rpm command should be executed with “--force” option (e.g. “rpm --force -ivh *.rpm”). Refer to Known Bugs for Libspe for bugs of libspe 2.0.1 contained in iso image of Cell SDK 2.0.

Installing packages required for building libspe 1.2 (deprecated) environment

The rpm required for libspe 1.2 can be obtained from SPE Management Library for Cell BE v1.2 (deprecated). To build a programming environment using libspe1.2, download and install all of the following rpm files.


In Yellow Dog Linux v5.0, libspe 1.1 which is the previous version of libspe 1.2 is installed by default. To update the development environment, perform an overwrite installation, rpm command with “--force” option, or “yum remove libspe” command must be executed to remove pre-installed packages and then install new packages.

Installing elfspe

By installing the tool “elfspe”, SPE program can be directly executed from a shell prompt (without calling it from PPE program using libspe or others). Installation of elfspe is recommended because it is useful for testing or debugging.

Formerly there were two types of elfspe for libspe1 and libspe2, though the Cell SDK 2.1 only contains elfspe for libspe2.

Elfspe is realized by the “binfmt_misc” feature provided in Linux. See this page for more details about binfmt_misc.


Back To Libspe: PS3 Programming Environment


© 2007 Fixstars Corporation. © 2007 Sony Computer Entertainment Inc.


Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

DISCLAIMER

THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.

表示
個人用ツール
Open Source Projects