Linux系统下SystemC环境配置方法
以下为centos7下配置方法
下载systemc源码包:SystemC (accellera.org)
将压缩包放置到用户目录下,并解压
tar -zxvf systemc-2.3.3.tar.gz
进入到systemc-2.3.3文件夹
cd systemc-2.3.3
新建临时文件夹tmp,并进入其中
mkdir tmpcd tmp
运行如下命令
../configure make make install
至此,文件夹中生成include与lib-linux64两个文件夹
设置环境变量
export LD_LIBRARY_PATH=home/centos7/systemc-2.3.3/lib-linux64 //其中/home/cnetos7/为文件解压路径,根据自身情况确定
执行该命令只在当前可用,重启后即失效,若需要长期可用,建议在用户目录下的.bashrc下添加该条命令,并需要执行以下命令,重启终端生效。
source .bashrc
运行一个systemc程序进行测试。
test.cpp
//all systemc modules should include systemc.h header file #inlcude"systemc.h" //hello_world is module name SC_MODULE(hello_world){ SC_CTOR(hello_world){ //nothing in constructor } void say_hello(){ //Print "Hello world!!!" to the console. cout<<"Hello World!!!"<<endl; } }; //此处分号不要忘了 //sc_main in top level function like in C++ main int sc_main(int argc, char* argv[]){ hello_world hello("HELLO"); return 0; }
编译并运行
g++ test.cpp -I/home/cp/Simulator/systemc/include -L/home/cp/Simulator/systemc/lib-linux64 -o test -lsystemc ./test
屏幕上将会显示
makefile
LIBDIR=-L/home/cp/Simulator/systemc/lib-linux64 INCDIR=-I/home/cp/Simulator/systemc/include LIB=-lsystemc all: g++ -o test test.cpp $(LIBDIR) $(INCDIR) $(LIB) clean: rm -rf *.o
到此这篇关于Linux系统下SystemC环境配置方法的文章就介绍到这了,更多相关Linux系统SystemC环境内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
Centos 6.4 安装Python 2.7 python-pip的详细步骤
这篇文章主要介绍了Centos 6.4 安装Python 2.7 python-pip的详细步骤,需要的朋友可以参考下2017-03-03CentOS下使用LibreOffice实现文档格式的转换方式
项目需求,对上传的文档进行一些预处理,如果用户上传了doc格式的文档,需要将其处理为docx或者pdf格式,以便后续的流程对文档内容进行提取。接下来通过本文给大家分享CentOS下使用LibreOffice实现文档格式的转换,感兴趣的朋友一起看看吧2019-07-07Centos7安装ElasticSearch 6.4.1入门教程详解
这篇文章主要介绍了Centos 7安装ElasticSearch 6.4.1入门教程详解,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2019-05-05
最新评论