Skip to content
Hyesoon Kim edited this page Aug 8, 2020 · 9 revisions

Table of Contents generated with DocToc

How to build macsim (stand alone)

Currently, MacSim support only SCons build process. Note that we will keep automake process only for the macsim-sst build, which is described in this page.

Requirement

  1. Compiler * c++0x support * We tested g++ and icc compilers. However, icc compiler may not work with external libraries.
  2. scons * ubuntu
apt-get install scons

internal only

   cd internal
   git submodule update --init

Build Steps

./build.py
  • build options

    • -j (--thread) : specify number of threads for parallel build
    • -d : debug build (-g)
    • -p : gprof build (-pg)
    • -c : clean
    • -t : build test
    • --dramsim : using DRAMSim2
    • --power : power model (with EnergyIntrospector)
    • --iris : Iris interconnection model
  • Note that you can choose either opt (default), dbg, or gpf build, not multiple.

  • However, you can choose any combination of libraries you want (DRAMSim2, EI, Iris).

Configuration file

MacSim provides a top-level configuration file called macsim.config. The sample content of the configuration file is as following:

## MacSim Configuration File

[Build]
debug: 0
gprof: 0

[Library]
dram:  0
power: 0
iris:  0

Although you can specify these options in the command lines with build.py, specifying in this file would make your build process easier.


SST

The Structural Simulation Toolkit (SST) is a simulation framework designed by Sandia National Lab. It was developed to explore innovations in highly concurrent systems where the ISA, microarchitecture, and memory interact with the programming model and communications system. More information about SST can be found at SST-Website

Requirement

  • Compiler
  • GCC with C++0x support
  • autotools
  • Library
  • OpenMPI 1.8
  • Boost 1.56
  • Python devel

Compile Configuration

SST and Macsim provides several environment variables that can configure the framework compiling.

  • CC: C compiler command
  • CFLAGS: C compiler flags
  • LDFLAGS: linker flags, e.g. -L if you have libraries in a nonstandard directory
  • LIBS: libraries to pass to the linker, e.g. -l
  • CPPFLAGS: (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory
  • CXX: C++ compiler command
  • CXXFLAGS: C++ compiler flags
  • MPICC: MPI C compiler command
  • MPICPP: MPI C preprocessor command
  • MPICXX: MPI C++ compiler command
  • MPICXXCPP: MPI C++ preprocessor command
  • CPP: C preprocessor
  • CXXCPP: C++ preprocessor

How to download and work on SST

First, all SST related codes can be found in the SST organization at github. The codes of SST are managed via submodules. The top level repository is sst. We need BOOST library, OpenMPI (please see SST Build instruction, gthparch DRAMSim2 repo, and SST DRAMSim2 Guide for detailed build info.

Download and Compile

  1. fetch sst code
$ git clone --recursive https://github.com/gthparch/sst

(Note). (if you are not part of gthparch) Above clone, will fail to get macsim, since we use a private version. So, prepare macsim code from our public repo

cd elements
git clone https://github.com/gthparch/macsim macsimComponent
  1. disable unused sst-elements

By default, sst will compile with several elements that won't be used by typical macsim simulation. The only required elements are: memHierarchy, VaultSimC, and macsimComponent. You can disable all other elements by generating an empty .ignore file in their directories.

  for i in *; do  if [ -d $i ] ; then  cp .ignore $i; fi; done

and remove .ignore from components you want

  1. Build SST

    1. Use build_sst.sh if you are part of gthparch.

    2. Or do the following steps set up environment configurations.

    cd sst/
    ./autogen.sh
    ./configure --prefix=<sst_install_path> --with-dramsim=$DRAMSIM2_HOME
    make all -j4
    make install

Note: To use DRAMSim2, follow the instructions here: SST DRAMSim2 Guide

Note: SST and Macsim are using multiple environment variables to configure its compiling. More info can be found by checking sst configure help as follows.

$ sst/configure --help