Sunday, February 3, 2013

Take the First Step

To take the first step we have to download, compile and launch GEM5.

  1. So, we need to download some tools:
    1. GCC, the most common C compiler on linux.
    2. Python, at least 2.4. Available at http://www.python.org/
    3. Scons, "SCons is an Open Source software construction tool". It is similar to Make utility. You can download it from www.scons.org
    4. Swig, a connector between C/C++ and some high-level programming languages. http://swig.org/
  2. After install the dependencies we have to download the GEM5 source code:
    1. You need mercurial (hg) to download the source code. It is time to install it if you haven't it yet.
    2. If you already installed mercurial you are ready to clone the repository: hg clone http://repo.gem5.org/gem5
    3. That is the development repository, so you may want to update it in the future. You can do it with hg pull and hg update.
  3. If everything worked until now it is time to compile GEM5:
    1. You only have to run scons buid/ARM/gem5.opt in the gem5 directory. That will compile a default version of GEM5. Of course some options can be provided to the compiler to change the CPU type, cache coherence,.. You may want to use the option -j value where value indicates how many processors should the compiler uses while compiling (be careful if you don't have more than 4GB of RAM).
  4. If it compiled without any errors we can run a test in order to check that everything is fine. The command is ./build/ARM/gem5.opt ./configs/example/se.py - c queens -o 8. You can download the queens binary from https://mega.co.nz/#!z5I0AKAa!PkzayRAPWnJszt_qSZOmJxxh0_EixGZ1Gsux2GnChJw (448 KB). It should find 92 solutions if it worked.
That's all, if you had any problems you can find more information in the web. Although I highly recommend you to check the links at the end of the post.

Further info can be found at:

6 comments:

  1. Hi there,

    I am also trying to learn gem5. I have installed and ran the test to check if its proper. How would you recommend to go forward from here? I am going to use it for interconnection networks.

    Thanks,
    Vineeth

    ReplyDelete
  2. hi there ,

    i'm getting this error on my Linux mint 15 64 bit. I think i'm doing something wrong.


    $ scons build/ARM/gem5.opt
    scons: Reading SConscript files ...
    Error Don't know what compiler options to use for your compiler.
    compiler: None
    version: COMMAND NOT FOUND!
    If you're trying to use a compiler other than GCC
    or clang, there appears to be something wrong with your
    environment.

    If you are trying to use a compiler other than those listed
    above you will need to ease fix SConstruct and
    src/SConscript to support that compiler.

    Can you provide me step by step info for a fresh installed system (Linux mint 15 or ubuntu) .

    ReplyDelete
  3. You should check if you have installed gcc and g++. You can check it by running gcc and g++ in the terminal. If they aren't installed then you have to install them (sudo apt-get install gcc g++)

    If gcc and g++ are installed then the problem is that scons isn't able to find the binaries, you should try this command: scons build/ARM/gem5.opt CC= CXX=

    ReplyDelete
  4. @Sunny13: Use this command to install everything you need to run gem5 properly: sudo apt-get install mercurial scons swig gcc m4 python python-dev libgoogle-perftools-dev g++

    Try this video for reference: http://www.youtube.com/watch?v=SW63HJ0nW90

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete