SystemC Install

Firstof all, I think this blog is great but still not so complete. Youmight end up figuring out how to set up the Environment Variable Pathby yourself, which might be a little difficult for new Linux users.


http://vinaydvd.wordpress.com/2012/05/30/installing-systemc-in-ubuntu/


Iinstalled SystemC in the following way. Works for me.



STEP1:

Downloadand unzip. I will skip that.


STEP2:

gointo the unzipped direction.


cdsystemc-2.3.1


STEP3:

Createa temp folder for configure, make and install.


mkdirtmp
cd tmp


STEP4:

SinceSystemC-2.3.1 has already put header files


#include<cstring>

#include<cstdlib>


indirection : ../src/sysc/utils/sc_utils_ids.cpp. We can simply makethe program.

../configure
make

makeinstall


STEP5:

Goback to upper level direction.
Cd..


Ifthese folder : inclue andlib-linuxare generated, them the installation is done.

STEP6:

Deletethe tmp folder.


 rm-rf tmp


STEP7:

Let'splay with it. By the way, if you failed to run this hello program,don't panic.


//All systemc modules should include systemc.h header file

#include"systemc.h"

//Hello_world is module name


SC_MODULE(hello_world) {

SC_CTOR(hello_world) {

//Nothing in constructor

}

voidsay_hello() {

//Print"Hello World" to the console.

cout<< "Hello World.\n";

}

};


//sc_main in top level function like in C++ main

intsc_main(int argc, char* argv[]) {

hello_worldhello("HELLO");

//Print the hello world

hello.say_hello();

return(0);

}


Comiple:

g++hello.cpp -I/home/user/systemc/include -L/home/user/systemc/lib-linux-o hello -lsystemc

Useyour own user name and installing direction.


Specifically,
-I/home/user/systemc/includetellsg++ to go to the right directory to find systemc.h


-L/home/user/systemc/lib-linuxtellsld linker to go to the right directory to find the declarations ofthe library.


-ohello : ........
-lsystemctellsld linker that the ultimate library file in use is libsystemc.a


STEp8:

Runit!

./hello


Thenyou may see this:

errorwhile loading shared libraries: libsystemc-2.3.1.so: cannot openshared object file: No such file or directory


Ihave tried this but it doesn't work for me.

http://stackoverflow.com/questions/24590712/systemc-linker-error-in-eclipseubuntu-14-4-64-bit


Thisone DOES!!

http://stackoverflow.com/questions/2172621/cannot-open-shared-object-file-no-such-file-or-directory




:~$cd Ryerson/ECE/EE8205/



:~/Ryerson/ECE/EE8205$g++ SystemC_helloworld.cpp-I/home/boris/Softwares/systemc-2.3.1/include-L/home/boris/Softwares/systemc-2.3.1/lib-linux -o hello -lsystemc



:~/Ryerson/ECE/EE8205$./hello



./hello:error while loading shared libraries: libsystemc-2.3.1.so: cannotopen shared object file: No such file or directory



:~/Ryerson/ECE/EE8205$exportLD_LIBRARY_PATH=/home/boris/Softwares/systemc-2.3.1/lib:$LD_LIBRARY_PATHDisplayall 129 possibilities? (y or n)



:~/Ryerson/ECE/EE8205$exportLD_LIBRARY_PATH=/home/boris/Softwares/systemc-2.3.1/lib-linux:$LD_LIBRARY_PATH


:~/Ryerson/ECE/EE8205$./hello


SystemC2.3.1-Accellera --- Sep 24 2014 08:38:01


Copyright(c) 1996-2014 by all Contributors,


ALLRIGHTS RESERVED


HelloWorld.



boris@boris-D630:~/Ryerson/ECE/EE8205$


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序猿Boris

我们都是技术人,我们相互支持

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值