Linux系统下SystemC环境如何配置

发布时间:2021-12-02 11:45:07 作者:小新
来源:亿速云 阅读:238

这篇文章将为大家详细讲解有关Linux系统下SystemC环境如何配置,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

以下为centos7下配置方法

Linux系统下SystemC环境如何配置

将压缩包放置到用户目录下,并解压

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

屏幕上将会显示

Linux系统下SystemC环境如何配置

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环境如何配置”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

推荐阅读:
  1. mac下go环境配置
  2. Windows环境下配置Nginx

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

linux

上一篇:Spring Security核心过滤器链是什么

下一篇:tk.Mybatis插入数据获取Id怎么实现

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》