Readme updated w.r.t CMAKE

This commit is contained in:
Matthias Jung
2020-02-26 15:51:37 +01:00
parent 372f383664
commit b21574c70d

216
README.md
View File

@@ -1,4 +1,4 @@
DRAMSys 3.0
DRAMSys 4.0
===========
**DRAMSys** [1] is a flexible DRAM subsystem design space exploration
@@ -9,40 +9,21 @@ Pipeline Status: [![pipeline status](https://git.eit.uni-kl.de/ems/astdm/dram.sy
[![Coverage report](https://git.eit.uni-kl.de/ems/astdm/dram.sys/badges/master/coverage.svg?job=coverage)](https://git.eit.uni-kl.de/ems/astdm/dram.sys/commits/master)
## Basic Setup
Open a terminal window, go to your home directory, create a directory for your
projects and change to it.
```bash
$ cd
$ mkdir projects
$ cd projects
```
Configure git on your machine. Some basic configurations follow.
```bash
$ git config --global user.name "FirstName OtherNames LastName"
$ git config --global user.email user@email
$ git config --global credential.helper 'cache --timeout=3600'
$ git config --global color.ui auto
```
Now clone the repository into a local folder on your computer.
Start using DRAMSys by cloning the current stable master branch:
```bash
$ git clone --recursive https://git.eit.uni-kl.de/ems/astdm/dram.sys.git
```
The *--recursive* flag tells git to initialize all submodules within the
repository. **DRAMPower** [2] and **tinyxml** are examples third party
repositories that were embedded within the source tree as submodules.
repository, namely **DRAMPower** [2], **SystemC** and **tinyxml**.
Now you can implement, test, commit and push features into a **branch**.
When you consider your work stable enough to be merged into the master branch
it is time to open a **merge request** using the web interface.
Your changes will be reviewed and finally integrated into the master branch.
Your changes will be reviewed and might be integrated into the master branch.
After cloning go to the project directory.
@@ -66,87 +47,12 @@ $ ls
```
You can use [utils/install_deb.sh](./utils/install_deb.sh) in order to install
dependencies. First read and understand the script, then execute it. Type your
password if required.
dependencies. Type your password if required.
```bash
$ ./install_deb.sh
```
- **SystemC 2.3.1a and TLM-2.0**
You can use [utils/getsysc.sh](./utils/getsysc.sh) to download and install SystemC 2.3.1a
and TLM-2.0. First read and understand the script then execute it.
```bash
$ ./getsysc.sh
```
Alternatively, the sources can be downloaded from
[here](http://accellera.org/downloads/standards/systemc). For installation
instructions see the installation notes file contained in the release package.
- **qwt-6.1**
You can use [utils/getqwt.sh](./utils/getqwt.sh) in order to install qwt-6.1. First read
and understand the script then execute it.
```bash
$ ./getqwt.sh
$ cd ~/qwt-6.1
```
After that add environment variables to your ~/.bashrc. Open the file with a
text editor (e.g., nano, gedit, kate, notepad++, subl, atom, ultraedit, emacs,
vim, etc.).
```bash
$ nano ~/.bashrc
```
```bash
export LIBQWT_HOME=${HOME}/qwt-6.1/lib
export LIBQWT_HEADERS=${HOME}/qwt-6.1/src
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${LIBQWT_HOME}
```
Remember to verify that the library was created and the header files are
located in the paths you specify. You can use the **ls** command to accomplish
that.
```bash
$ ls ${HOME}/qwt-6.1/lib
$ ls ${HOME}/qwt-6.1/src
```
Further information about Qwt can be found [here](http://qwt.sourceforge.net/).
To grant flexibility to the user the paths where to find some essential
libraries and headers can be specified with environment variables. Make sure
you have the environment variables below defined in your ~/.bashrc file.
**Note that some of the variables are automatically generated by the scripts. If
you install the libraries in custom paths in your system you have to adapt the
environment variables accordingly**.
```bash
# SystemC home and target architecture
export SYSTEMC_HOME=$HOME/systemc-2.3.1a
export SYSTEMC_TARGET_ARCH=linux64
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${SYSTEMC_HOME}/lib-$SYSTEMC_TARGET_ARCH
# DRAMSys libraries and headers
export LIBPYTHON_VERSION="3.5m"
export PYTHON_HOME=/usr/lib/python3.5
export PYTHON_HEADERS=/usr/include/python3.5m
export LIBQWT_HOME=${HOME}/qwt-6.1/lib
export LIBQWT_HEADERS=${HOME}/qwt-6.1/src
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${LIBQWT_HOME}
```
### Coding Style
Please read the [coding-style document](coding-style.md) before starting to
@@ -167,15 +73,15 @@ $ qtcreator &
Use the menu bar and open the DRAMSys project.
**File -> Open Project -> dram.sys/DRAMSys/DRAMSys.pro**
**File -> Open Project -> dram.sys/DRAMSys/CMakeLists.txt**
When you open the project for the first time a configuration window pops-up.
Then click in **Configure Project** and after that **Build** the project.
To speedup the building process one can use the additional **make** option
**-j[jobs]**. The command line below returns a good number to be passed to
make as the number of jobs that can run simultaneously to improve the building
time.
**-j[jobs]**. The command line below returns the number of CPUs on a Debian
Linux to be passed to make as the number of jobs that can run simultaneously to
improve the building time.
```bash
$ cat /proc/cpuinfo | grep processor | wc -l
@@ -193,17 +99,18 @@ version** configuration shown in the image below.
### Building without QTCreator
In case you prefer a command line interface to the QTCreator GUI you can also
use **qmake** to generate a Makefile and then compile the project.
use **cmake** to generate a Makefile and then compile the project.
```bash
$ cd dram.sys
$ mkdir build
$ cd build
$ qmake ../DRAMSys/DRAMSys.pro
$ cmake ../DRAMSys/
$ make -j4
```
The compilation generates executable binary files **DRAMSys** and
**traceAnalyzer** that can be found inside sub-directories.
**TraceAnalyzer** that can be found inside sub-directories.
From the build directory use the commands below to execute DRAMSys.
@@ -231,50 +138,13 @@ $ ./traceAnalyzer
```
### Building on MacOS (Formerly OSX)
- Install XCode
- Install SystemC manually in /opt:
```bash
$ ./configure --prefix=/opt/systemc
$ make
$ sudo make install
```
Or you can install via homebrew:
```bash
$ brew install systemc
```
in this case, systemc will be installed, e.g. in:
```
/usr/local/Cellar/systemc/2.3.1
```
and make a simlink of the lib directory:
```
ln -s lib/ lib-macosx64
```
- Install the required python 3 over homebrew:
- Install XCode as a Compiler (or any other via Homebrew)
- Install the required python3 over homebrew:
```bash
$ brew install python3
```
Python3 (via homebrew) will be installed in
```
/usr/local/Cellar/python3/3.5.2_2/Frameworks/Python.framework
```
or you can install manually using official package provided in [link](https://www.python.org/downloads/)
**Note:** Official Python Package will be installed in
```
/Library/Frameworks/Python.framework
```
- Install the QtCreator using offical setup file from [link](https://www.qt.io/download-open-source/#section-2)
**Note:** You have later setup PATH for Qt5 and its tool if you install QtCreator manually, e.g:
@@ -291,61 +161,17 @@ export PATH
$ cd /Library/Frameworks
$ sudo ln -s /opt/qwt-6.1.2/lib/qwt.framework/ .
```
- Export correct Environment Variables in your terminal's profile, e.g:
```bash
# Setting for DRAMSys
# SystemC via official source
export SYSTEMC_HOME=/opt/systemc
export SYSTEMC_TARGET_ARCH=macosx64
# SystemC via Homebrew
#export SYSTEMC_HOME=/usr/local/Cellar/systemc/2.3.1
#export SYSTEMC_TARGET_ARCH=macosx64
# Python via official pkg
export PYTHON_HOME=/Library/Frameworks/Python.framework/Versions/3.5/lib
export PYTHON_HEADERS=/Library/Frameworks/Python.framework/Versions/3.5/Headers
# Python3 via Homebrew
#export PYTHON_HOME=/usr/local/Cellar/python3/3.5.2_2/Frameworks/Python.framework/Versions/3.5/lib
#export PYTHON_HEADERS=/usr/local/Cellar/python3/3.5.2_2/Frameworks/Python.framework/Versions/3.5/Headers
export LIBQWT_HOME=/opt/qwt-6.1.4/lib
export LIBQWT_HEADERS=/opt/qwt-6.1.4/lib/qwt.framework/Headers
```
- For the trace analyzer the file:
```
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/include/python3.4m/pyport.h
```
has to be changed like [this](https://trac.macports.org/attachment/ticket/44288/issue10910-workaround.txt)
- Install package [xerces](http://xerces.apache.org/mirrors.cgi) if your system does not have.
- Type following command inside your dram.sys folder:
```bash
$ mkdir build
$ qmake ../DRAMSys/DRAMSys.pro
$ make -j<number_jobs>
```
Now you can try to run DRAMSys and traceAnalyzer App inside folder simulator and traceAnalyzer, respectively
You compile DRAMSys also with QtCreator or CMAKE as described in the Linux
section.
### Building on Windows 10
DRAMSys can also run on Windows 10 with the *Windows Subsystem for Linux* (WSL) feature. You can install a linux distribution like Debian over the windows app store.
We refer to the following example [website](https://docs.microsoft.com/en-us/windows/wsl/install-win10).
- DRAMSys can also run on Windows 10 with the *Windows Subsystem for Linux* (WSL) feature. You can install a linux distribution like Debian over the windows app store.
We refer to the following example [website](https://docs.microsoft.com/en-us/windows/wsl/install-win10).
Then DRAMSys can be installed as described above for Linux.
Then DRAMSys can be installed as described above for Linux. However it might be advisable to install Qt, SystemC and qwt by hand. Qt should be downloaded from the Qt website.
The install systemc.sh script can be used to install SystemC and for QWT the version 6.1.3 should be used.
Also the build configuration for SystemC should be configured as static with pthreads in the ```simulator.pro``` file:
```qmake
#LIBS += -L$${systemc_home}/lib-$${systemc_target_arch} -lsystemc
LIBS += -L$${systemc_home}/lib-$${systemc_target_arch} -Wl,-Bstatic -lsystemc -Wl,-Bdynamic -pthread
```
- Native Windows 10 Implementation is currently under investigation
### DRAMSys Configuration