Computer Architecture 2012/2013

Tooling prerequisites

Date: August 2012
Author: Raphael 'kena' Poss

Abstract

This note explains how to install the cross-utilities, cross compilers and MGSim simulator. For questions, requests for help, etc., please post on the course's mailing list.

Installing the cross-utilities (as, ld, nm ...)

  1. Get the latest binutils source from https://www.gnu.org/software/binutils/

  2. Configure the binutils for the Alpha ISA:

    tar -xzf ....
    cd ...
    mkdir build-alpha
    cd build-alpha
    ../configure --target=alpha-linux-gnu --disable-werror --prefix=/your/install/dir
    

    (Choose a target prefix where you have disk space available. The total tooling may weigh up to 100MB.)

  3. Build & install:

    make
    make install
    
  4. Repeat #2 and #3 with the MIPS target:

    cd ..
    mkdir build-mips
    cd build-mips
    ../configure --target=mipsel-linux-gnu --disable-werror --prefix=/your/install/dir
    make
    make install
    

    (you can use the same target directory as in #2)

  5. Check the installation was successful:

    export PATH=/your/install/dir/bin:$PATH
    alpha-linux-gnu-as --version
    mipsel-linux-gnu-as --version
    

    This should report the correct version numbers.

Installing the cross-compiler

  1. Ensure you have libgmp ( http://gmplib.org/ ), libmpc ( http://www.multiprecision.org/ ) and libmpfr ( http://www.mpfr.org/ ) installed, with development files.

  2. Get the latest GNU C compiler (core package) from http://gcc.gnu.org/

  3. Configure the GNU C compiler for the Alpha ISA:

    tar -xzf ....
    cd ...
    mkdir build-alpha
    cd build-alpha
    ../configure --target=alpha-linux-gnu \
         --disable-bootstrap --disable-libmudflap --disable-libssp \
         --disable-coverage --disable-gdb --disable-lto --disable-threads \
         --disable-nls --disable-multilib --disable-libquadmath \
         --enable-languages=c --prefix=/your/install/dir
    

    (You might need to add the following at the end of the configure command line: CPPFLAGS=-I/path/to/include and LDFLAGS=-L/path/to/lib to indicate where the extra libs from step #1 can be found)

  4. You then need to disable some components manually to simplify the install:

    grep -v 'maybe-[a-z]*-target-\(libgcc\|libiberty\|libgomp\|zlib\)' <Makefile >Makefile.tmp
    mv Makefile.tmp Makefile
    
  5. Build & install:

    make
    make install
    
  6. Repeat #3-#5 with the MIPS target:

    cd ..
    mkdir build-mips
    cd build-mips
    ../configure --target=mipsel-linux-gnu \
         --disable-bootstrap --disable-libmudflap --disable-libssp \
         --disable-coverage --disable-gdb --disable-lto --disable-threads \
         --disable-nls --disable-multilib --disable-libquadmath \
         --enable-languages=c --prefix=/your/install/dir
    grep -v 'maybe-[a-z]*-target-\(libgcc\|libiberty\|libgomp\|zlib\)' <Makefile >Makefile.tmp
    mv Makefile.tmp Makefile
    
    make
    make install
    

    (you can use the same target directory as in #3)

  7. Check the installation was successful:

    export PATH=/your/install/dir/bin:$PATH
    alpha-linux-gnu-gcc --version
    mipsel-linux-gnu-gcc --version
    

    This should report the correct version numbers.

Installing MGSim

  1. Ensure you have libev ( http://software.schmorp.de/pkg/libev.html ), argp ( standard in GNU C Library, otherwise argp-standalone http://www.lysator.liu.se/~nisse/misc/ ), GNU Make, and Python 2.x ( http://www.python.org/ ) installed, with development files. If possible ensure that SDL is also installed: http://www.libsdl.org/

  2. Get the latest MGSim sources from http://dist.svp-home.org/deploy/

  3. Configure MGSim for the Alpha ISA:

    tar -xzf ....
    cd ...
    mkdir build-mtalpha
    cd build-mtalpha
    ../configure --target=mtalpha \
         --disable-abort-on-trace-failure --disable-verbose-trace-checks \
         --prefix=/your/install/dir
    

    (You might need to add the following at the end of the configure command line: CPPFLAGS=-I/path/to/include and LDFLAGS=-L/path/to/lib to indicate where the extra libs from step #1 can be found)

  4. Build & install:

    make
    make install
    
  5. Check the installation was successful:

    export PATH=/your/install/dir/bin:$PATH
    mgsim --version
    

    This should report the correct version numbers.