How can I install gem5?

Ask Ubuntu Asked by DeepSidhu1313 on December 1, 2020

I was helping my friend installing gem5 simulator on Linux for thesis work. I know Linux a little bit. Somehow I managed to install that simulator on my laptop with Ubuntu 12.04, but when I tried to install that simulator on her laptop it didn’t go well. I gave the same commands on her laptop but it gave this error.

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

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.

I tried same commands to install gem5 simulator by re installing ubuntu on her laptop. But same error. Then I tried on Linux Mint 15 and Fedora but got the same error. What am I doing wrong? Can somebody provide step by step guide to perform installation of gem5 simulator or can anybody can provide me a .deb file of it?

If not please at-least guide me how to create deb file of that sim, but please consider my skills are of beginner’s level.

4 Answers

This worked for me !! Thanks !!!

 sudo apt-get install swig gcc m4 python python-dev libgoogle-perftools-dev mercurial scons g++ build-essential
 hg clone
 cd gem5/
 scons build/ARM/gem5.opt -j2
 build/ARM/gem5.opt configs/example/ -c tests/test-progs/hello/bin/arm/linux/hel­lo

Correct answer by DeepSidhu1313 on December 1, 2020

Have a look at the gem5 in-tree Docker files used in the CI tests

gem5 currently runs precommits with Docker and an in-tree Dockerfile, so I don't think anything can be more reliable than looking at those.

E.g.: the logs of this precommit run say:

latest: Pulling from gem5-test/ubuntu-20.04_all-dependencies

and in-tree we see the corresponding Dockerfile which contains the packages it depends on:

RUN apt -y install build-essential git m4 scons zlib1g zlib1g-dev 
    libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev 
    python3-dev python3-six python-is-python3 doxygen libboost-all-dev 
    libhdf5-serial-dev python3-pydot libpng-dev libelf-dev

Then the usual build command such as:

scons -j`nproc` build/ARM/gem5.opt

Of course, building gem5 itself is the easy part. Much harder potentially will be to setup your test content of interest. Here are some pointers:

Answered by Ciro Santilli on December 1, 2020

1-sudo apt-get update
2-sudo apt-get install swig gcc m4 python python-dev libgoogle-perftools-dev  g++  scons  mercurial  zlib1g-dev protobuf-compiler libprotobuf-dev
3-hg clone
4-cd gem5/
5-scons build/ARM/gem5.opt

in 5 instruction You can type(SPARC,Alpha,...) or other
if 5's step was OK that's means is your installation is complete. good Lucks

Answered by marziye esmslampanah on December 1, 2020

Well I checked out the dev tree and ran scons and it just worked™. I would guess from the error you're seeing that means you don't have a compiler (scons is only a replacement for make, not gcc). This is where reading the README file or the dependencies page comes in handy.

sudo apt-get install build-essential scons swig zlib1g-dev m4 protobuf{-c,}-compiler

I compile other stuff, so apart from scons I was already good to go.

Answered by Oli on December 1, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP