您当前的位置:首页 > 网站建设 > 网站维护
| php | asp | css | H5 | javascript | Mysql | Dreamweaver | Delphi | 网站维护 | 帝国cms | React | 考试系统 | ajax | jQuery |

Linux系统下SystemC环境配置方法

51自学网 2022-07-04 11:28:46
  网站维护

以下为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

运行如下命令

../configuremakemake 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 nameSC_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++ mainint 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-linux64INCDIR=-I/home/cp/Simulator/systemc/includeLIB=-lsystemcall:	g++ -o test test.cpp $(LIBDIR) $(INCDIR) $(LIB)clean:	rm -rf *.o

下载地址:
linux系统下用户管理相关介绍
Linux配置免密登录单机和全分布详细教程
51自学网,即我要自学网,自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1