My operating system is Ubuntu 12.04.

0. Checking Your Compilers

First thing first, you will need the tools beforing making stuffs.

  • Type "g++ --version" to check if you have g++, if not use "sudo apt-get install g++" to install it first. (Fedora users can use command "yum")
  • Type "make --version" to check if you have GNU make, otherwise you know what to do...

1. Downloading SystemC

The first step is to download the source package of SystemC. The official download page is http://www.accellera.org/downloads/standards/systemc. You need to register with your email for accepting the licenses. Currently the newest and stable version of SystemC is 2.3.0.

2. Making SystemC Library Step-by-step

The downloaded tar file are for example located here: ~/Downloads/

cd ~/Downloads/
tar zxvf systemc-2.3..tar
cd systemc-2.3.
mkdir objdir
cd objdir
sudo mkdir /usr/local/systemc/
sudo ../configure --prefix=/usr/local/systemc/
sudo make
sudo make install

Here "sudo" is kind of important if you are not root.

3. Compling SystemC Files

Suppose you have already have your SystemC example files here: ~/hello_word/, with file hello.h, and main.cpp.

To compile your SystemC files, use

g++ main.cpp -I$SYSTEMC_HOME/include -L$SYSTEMC_HOME/lib-linux64 -o hello -lsystemc

Of coursee you need to set the environment variable SYSTEMC_HOME first:

export SYSTEMC_HOME=/usr/local/systemc/

or anywhere you actually built it.

In this way your code will be compiled successfully.

4. Running the Executable

The title looks stupid but I still think it is necessary to address it here. Your compilation will be successful but you might face an error when you are trying to run the executable, for example:

./hello: error while loading shared libraries: libsystemc-2.3..so: cannot open shared object file: No such file or directory

In this case, you need to set LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/usr/local/systemc/lib-linux

For 64-bit system users, you may set the variable value to:

export LD_LIBRARY_PATH=/usr/local/systemc/lib-linux64

In my case I need to set it to the latter one (To be frank I didn't set it right at the first time). If you are not sure which one you need to set, simply go to that folder, to see you have "lib-linux" or "lib-linux64".

At this stage, you may run your executables without errors.

[SystemC] Setting Up the Environment的更多相关文章

  1. Building and setting up QT environment for BeagleBone

    There are too few information available on how to easily setup QT environment for building Beaglebon ...

  2. Storm(1) - Setting Up Development Environment

    Setting up your development environment 1. download j2se 6 SDK from http://www.oracle.com/technetwor ...

  3. 使用SystemC进行硬件仿真

    使用SystemC进行硬件仿真 环境 linux-x86-64 bash g++ 下载解压SystemC SystemC下载地址 解压下载的包 tar zxvf systemc-2.3.3.tar.g ...

  4. Setting the Java Class Path

    The class path is the path taht Java Runtime Environment(JRE) searches for classes and other resourc ...

  5. svn: None of the environment variables SVN_EDITOR...问题解决

    转:http://blog.163.com/lgh_2002/blog/static/44017526201046111856208/ 问题1: svn: Could not use external ...

  6. Setting an appropriate geodatabase spatial domain

    原文地址:http://webhelp.esri.com/arcgisdesktop/9.1/body.cfm?tocVisable=1&ID=1470&TopicName=Setti ...

  7. pt-heartbeat

    pt-heartbeat是用来监测主从延迟的情况的,众所周知,传统的通过show slave status\G命令中的Seconds_Behind_Master值来判断主从延迟并不靠谱. pt-hea ...

  8. 『.NET Core CLI工具文档』(二).NET Core 工具遥测(应用信息收集)

    说明:本文是个人翻译文章,由于个人水平有限,有不对的地方请大家帮忙更正. 原文:.NET Core Tools Telemetry 翻译:.NET Core 工具遥测(应用信息收集) .NET Cor ...

  9. 安装jhipster

    基础软件安装 安装JDK,需要配置环境变量.暂时使用1.8版本 安装maven,需要配置环境变量.  http://maven.apache.org/ 安装Node.js ,https://nodej ...

随机推荐

  1. Eclipse 的常用快捷方式

    快捷方式<!--[if !supportLists]-->0. Ctrl + 1 (快速修复)<!--[if !supportLists]-->1. Ctrl + D (删除当 ...

  2. UML类图画法及其之间的几种关系(转)

    UML类图画法及其之间的几种关系 最近做重构项目,需要画一下类图,发现类图的画法及其之间的几种关系已经淡忘了很多,所以整理总结一下,有问题的地方大家可以一起讨论下. 文章目录如下: 类图画法 类之间的 ...

  3. 【补充版】HashMap(根据value筛选查找)

    HashMap查找之根据Value查找 一般大家都知道对于HashMap而言都是通过key来进行查找.找到了key自然对应的value也就一并找到了.但是有些情况下就需要通过value来进行判断查找. ...

  4. 在Android中使用Java 8的lambda表达式

    作为一名Java开发者,或许你时常因为缺乏闭包而产生许多的困扰.幸运的是:Java's 8th version introduced lambda functions给我们带来了好消息;然而,这咩有什 ...

  5. 【BZOJ2874】训练士兵(主席树)

    题意:有一个N*M的矩阵,给出一些形如(x1,y1,x2,y2,s)的操作,代表(x1,y1)到(x2,y2)都被加上了s这个数 现在有一些强制在线的询问,询问(x1,y1)到(x2,y2)的和 对于 ...

  6. 冷门JS技巧

    前端已经被玩儿坏了!像console.log()可以向控制台输出图片等炫酷的玩意已经不是什么新闻了,像用||操作符给变量赋默认值也是人尽皆知的旧闻了,今天看到Quora上一个帖子,瞬间又GET了好多前 ...

  7. 学习笔记-----Android的View绘制过程

    边看源码边参考别人的博客等,做一下学习笔记. 要了解View的绘制,首先得知道View树的结构:(可以参考http://blog.csdn.net/qinjuning/article/details/ ...

  8. 使用javascript实现贪吃蛇游戏

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  9. SQL三大范式三个例子搞定

    第一范式(1NF) (必须有主键,列不可分) 数据库表中的任何字段都是单一属性的,不可再分 create table aa(id int,NameAge varchar(100)) insert aa ...

  10. FluentValidation验证

    参考:http://www.c-sharpcorner.com/UploadFile/3d39b4/Asp-Net-mvc-validation-using-fluent-validation/ 创建 ...