My OS is Ubuntu 11.04, and the installed systemc is 2.2.0.
Here are the command lines to install the package:
1. Goto the OSCI website, and download the latest package.
2. Create a separate folder named /usr/local/systemc-2.2
3. Go seeking the cpp file with the directory like systemc-2.2.0/src/sysc/utils/sc_utils_ids.cpp, and then add two statements into the file:
#include "string.h"4. Go to the systemc-2.2 folder, and type
#include "cstdlib"
using namespace std;
xx/systemc-2.2.0/configureThe separate installation folder can also avoid the name collision if installation conducted in the same folder.
sudo make
sudo make install
Verification of the installation
The example file is adopted here(ref), while the command line doesn't work, even the echo $SYSTEMC_HOME didn't show the directory for systemc.
So, I change the command to the absolute address as shown below:
reference for running the systemc program
http://linuxhao.com/Linux/doc/Linux_doc.asp?id=2938
If we change all the addresses to the absolute ones, then we can make it. The final command lines are below:
export SYSTEMC=/home/chenrui/Desktop/llvm/systemc-2.2.0 # chenrui is my computer name, I have checked that the systemc.h is in the systemc-2.2.0 folder.Besides, I have also changed the line 2 of example.cpp so that I can find the systemc library.
g++ -I $SYSTEMC/include -L $SYSTEMC/lib-linux -o example.o example.cpp -lsystemc -lm
And then, it is pretty sure that you can "Hello World." output.
What a wonderful day.
No comments:
Post a Comment