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. linux在home目录下使用ls命令卡死

    linux在home目录下使用ls命令卡死,原因可能是mount的某个服务器挂掉或出啥问题了,这个时候umount掉就正常了,如果umount提示device is busy,这时可以使用强制卸载   ...

  2. 初学c# -- 学习笔记(四)

    想想,数据库先用mysql了,这玩意小且安装方便.前面web学了些,现在学winform的.数据库先看看便捷的mysql. 下载了一个mysql5.7版的,装上居然找不到密码,重装3.4回,找不到,说 ...

  3. Android加载SD卡目录,文件夹遍历,图片设置,设置文件对应打开方式等

    此案例主要说的是Android使用GridView加载SD卡下所有目录,文件夹多层遍历,文件图标修改,设置文件对应打开方式等功能. 如图: 代码: public class GridViewFile ...

  4. iOS开发笔记之Runtime实用总结

    前言 runtime的资料网上有很多了,部分有些晦涩难懂,我通过自己的学习方法总结一遍,主要讲一些常用的方法功能,以实用为主,我觉得用到印象才是最深刻的.另外runtime的知识还有很多,想要了解更多 ...

  5. [原创]迈出NIOS的第一步,HelloNIOS

    Altera官方推出NIOS已经很久了,个人感觉C+V代码配合会是后面FPGA使用的一个主流,由C来完成一些对时序要求不高,对功能要求偏高的部分,比如运动控制等:由V来配合时序完成高时序要求的需求以及 ...

  6. php学习笔记-基础篇

    1."var_dump"函数可以将变量的数据类型显示出来. 2."memory_get_usage"获取当前PHP消耗的内存. 3.php中的字符串型分单引号, ...

  7. Chrome 自动填充的表单是淡黄色的背景,有方法自定义吗

    input:-webkit-autofill { -webkit-box-shadow: 0 0 0px 1000px white inset; }

  8. Ueditor 编译发布后无法使用上传图片、附件等功能

    Ueditor 发布后上传到服务器会出现无法使用上传功能,在本地源代码模式下上传功能正常,这是因为在网站发布期间把 net/Uploader.cs 给编译了,发布后的代码不包含Uploader.cs故 ...

  9. .net学习笔记--序列化与反序列化

    序列化其实就是将一个对象的所有相关的数据保存为一个二进制文件(注意:是一个对象) 而且与这个对象相关的所有类型都必须是可序列化的所以要在相关类中加上 [Serializable]特性 对象类型包括:对 ...

  10. Object.create()方法的低版本兼容问题

    Object.prototype.create=(function(){ if(Object.prototype.create){return Object.prototype.create}else ...