最近更换了研究方向,需要安装SST模拟器,SST模拟器的安装过程比较复杂,这里记录一下安装过程。

1. 前言

由于课题工作需要,因此仅安装了sst-element中部分组件,本文主要参考SST模拟器详细安装教程SST模拟器附加组件安装教程,并在此基础上针对个人需求进行了一定的修改。

软件名称 软件版本
Ubuntu 20.04/22.04
SST 13.0.0/13.1.0

2. 安装SST模拟器

2.1 安装前的准备

首先我们需要安装一些必要的软件,这样才能使得SST能够正常的编译。

1
sudo apt install gcc g++ build essential make cmake autoconf automake git libtool doxygen patch

SST推荐的源码下载目录为$HOME/scratch/src,安装目录为$HOME/local/packages,因此我们需要创建这些目录。

1
2
mkdir -p $HOME/scratch/src
mkdir -p $HOME/local/packages

SST推荐安装MPI库,这样就可以通过MPI进行并行计算,官方推荐使用OpenMPI版本的对应关系详见Release Matrix,由于我在学习SST模拟器的同时还想熟悉MPI编程,因此我选择将OpenMPI安装在系统中。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
cd $HOME/scratch/src
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.4.tar.gz
tar -zxvf openmpi-4.1.4.tar.gz
cd openmpi-4.1.4
# 设置环境变量
echo -e '# MPI \n
MPI_HOME=/usr/local/openmpi \n
export PATH=$MPI_HOME/bin:$PATH \n
export LD_LIBRARY_PATH=$MPI_HOME/lib:$LD_LIBRARY_PATH \n
export MANPATH=$MPI_HOME/share/man:$MANPATH \n
export PATH=$MPIHOME/bin:$PATH' | sudo tee -a /etc/profile
source /etc/profile
./configure --prefix=$MPIHOME
sudo make all install

SST-Core官方提供了HDF5支持,但是根据由于链接问题,在linux上无法安装,github上也有人提出了Issue,因此本次就不安装HDF5。

2.2 安装SST-Core

SST Core安装到官方推荐的目录就好

1
2
3
4
5
6
7
8
9
10
11
12
cd $HOME/scratch/src
wget https://github.com/sstsimulator/sst-core/releases/download/v13.1.0_Final/sstcore-13.1.0.tar.gz
tar -zxvf sstcore-13.1.0.tar.gz
cd $HOME/scratch/src/sstcore-13.1.0
echo -e '# SST Core \n
export SST_CORE_HOME=$HOME/local/sstcore-13.1.0\n
export SST_CORE_ROOT=$HOME/scratch/src/sstcore-13.1.0\n
export PATH=$SST_CORE_HOME/bin:$PATH
' | tee -a ~/.bashrc
source ~/.bashrc
make all -j$(nproc)
make install

对SST-Core的安装进行测试

1
2
3
4
which sst
sst --version
sst-info
sst-test-core

2.3 安装SST-Elements

SST-Elements的源码同样要下载到官方推荐的目录,并解压

1
2
3
4
5
6
7
8
9
10
cd $HOME/scratch/src
wget https://github.com/sstsimulator/sst-elements/releases/download/v13.1.0_Final/sstelements-13.1.0.tar.gz
tar -zxvf sstelements-13.1.0.tar.gz
cd $HOME/scratch/src/sstelements-13.1.0/sst-elements-library-13.1.0
echo -e '# SST Elements \n
export SST_ELEMENTS_HOME=$HOME/local/sstelements-13.1.0\n
export SST_ELEMENTS_ROOT=$HOME/scratch/src/sstelements-13.1.0/sst-elements-library-13.1.0\n
export PATH=$SST_ELEMENTS_HOME/bin:$PATH
' | tee -a ~/.bashrc
source ~/.bashrc

2.4 安装SST-Elements附加组件

2.4.1 安装DRAMSim2 2.2.2

1
2
3
4
5
6
7
8
9
cd $HOME/scratch/src
wget https://codeload.github.com/dramninjasUMD/DRAMSim2/tar.gz/refs/tags/v2.2.2
tar xfz v2.2.2.tar.gz
mv DRAMSim2-2.2.2 DRAMSim2
cd DRAMSim2
echo -e '#DRAMSim \n
export DRAMSIM2_HOME=$HOME/local/packages/DRAMSim2' | tee -a ~/.bashrc
make libdramsim.so
cp -r . $DRAMSIM2_HOME

2.4.2 安装NVDIMMSim 2.0.0

1
2
3
4
5
6
7
8
9
cd $HOME/scratch/src
tar xfz NVDIMMSim-2.0.0.tar.gz
wget https://github.com/jimstevens2001/NVDIMMSim/archive/v2.0.0.tar.gz
mv NVDIMMSim-2.0.0 NVDIMMSim
cd NVDIMMSim/src
echo -e '#NVDIMMSim \n
export NVDIMMSIM_HOME=$HOME/local/packages/NVDIMMSim' | tee -a ~/.bashrc
make libnvdsim.so
cp -r . $NVDIMMSIM_HOME

2.4.3 安装HybridSim 2.0.1

1
2
3
4
5
6
7
8
9
cd $HOME/scratch/src
wget https://github.com/jimstevens2001/HybridSim/archive/v2.0.1.tar.gz
tar xfz HybridSim-2.0.1.tar.gz
mv HybridSim-2.0.1 HybridSim
cd HybridSim
echo -e '#NVDIMMSim \n
export HYBRIDSIM_HOME=$HOME/local/packages/HybridSim' | tee -a ~/.bashrc
make libhybridsim.so
cp -r . $HYBRIDSIM_HOME

2.4.4 安装DRAMsim3

1
2
3
4
5
6
7
8
9
10
11
12
cd $HOME/scratch/src
wget https://github.com/umd-memsys/DRAMsim3/archive/refs/tags/1.0.0.tar.gz
tar xfz dramsim3-1.0.0.tar.gz
cd dramsim3-1.0.0
echo -e '#NVDIMMSim \n
export DRAMSIM3_HOME=$HOME/local/packages/dramsim3' | tee -a ~/.bashrc
mkdir build
cd build
cmake ..
make -j$(nproc)
cd ..
cp -r . $DRAMSIM3_HOME

2.4.5 安装Intel Pin Tool 3.26-98690

1
2
3
4
5
6
cd $HOME/scratch/src
wget https://software.intel.com/sites/landingpage/pintool/downloads/pin-3.26-98690-g1fc9d60e6-gcc-linux.tar.gz
tar -zxvf pin-3.26-98690-g1fc9d60e6-gcc-linux.tar.gz
echo -e '#Intel Pin Tool \n
export PIN_HOME=$HOME/local/packages/pin-3.26-98690-g1fc9d60e6-gcc-linux \n
export INTEL_PIN_DIRECTORY=$PIN_HOME' | tee -a ~/.bashrc

2.4.6 安装Goblin HMCSim

1
2
3
4
5
6
7
8
cd $HOME/scratch/src
https://github.com/tactcomplabs/gc64-hmcsim/archive/refs/tags/sst-8.0.0-release.zip
unzip gc64-hmcsim-sst-8.0.0-release.zip
cd gc64-hmcsim-sst-8.0.0-release
echo -e '#Goblin HMCSim \n
export GOBLINHMCSIM_HOME=$HOME/local/packages/GoblinHMCSim \n' | tee -a ~/.bashrc
make -j$(nproc)
ln -s `pwd` $GOBLINHMCSIM_HOME

2.4.7 安装HBM Dramsim2

1
2
3
4
5
6
7
8
cd $HOME/scratch/src
git clone https://github.com/tactcomplabs/HBM.git
cd HBM
git checkout hbm-1.0.0-release
echo -e '#HBM Dramsim2 \n
export HBMDRAMSIM2_HOME=$HOME/local/packages/HBMDramsim2 \n' | tee -a ~/.bashrc
make -j$(nproc)
ln -s `pwd` $HBMDRAMSIM2_HOME

2.4.8 安装Ramulator

1
2
3
4
5
6
7
8
9
cd $HOME/scratch/src
git clone https://github.com/CMU-SAFARI/ramulator.git
cd ramulator
git checkout 7d2e72306c6079768e11a1867eb67b60cee34a1c
patch -p1 -i ramulator_sha_7d2e723_gcc48Patch.patch
patch -p1 -i ramulator_sha_7d2e723_libPatch.patch
echo -e '#Ramulator \n
export RAMULATOR_HOME=$HOME/local/packages/ramulator \n' | tee -a ~/.bashrc
make CXX=g++ libramulator.so -j$(nproc)

2.5 编译安装SST-Elements

1
2
3
4
# 官网给的教程部分有笔误,hbm dramsim2 应该是一个等号
./configure --prefix=$SST_ELEMENTS_HOME --with-dramsim=$DRAMSIM2_HOME --with-nvdimmsim=$NVDIMMSIM_HOME --with-hybridsim=$HYBRIDSIM_HOME --with-dramsim3=$DRAMSIM3_HOME --with-pin=$PIN_HOME --with-goblinhmcsim=$GOBLINHMCSIM_HOME --with-hbmdramsim=$HBMDRAMSIM2_HOME --with-ramulator=$RAMULATOR_HOME
make all -j$(nproc)
make install

测试SST Elements

1
2
3
4
which sst
sst --version
sst-info
sst-test-elements -w "*simple*"