SystemC在ubuntu上的安装

来源:互联网 发布:js调用麦克风录音 编辑:程序博客网 时间:2024/05/17 04:54

 最近在弄SocLib时,要用到SystemC,所以就查阅了一下SystemC的安装,这里做个备注,以免后面忘了。。。

我的环境是ubuntu 14.04LTS


1. 把下载下来的SystemC源程序压缩包在用户主目录里使用tar命令解压缩:

       tar xvf systemc-2.2.0.tgz

2. 然后进入解压缩后生成的systemc-2.2.0文件夹,建立一个临时文件夹objdir(名字可以随便起,如tmp什么的也可以):

       cd systemc-2.2.0

       mkdir objdir

3. 然后进入这个临时文件夹,运行SystemC的配置程序来生成安装文件:

    ( Note: "mkdir /usr/local/systemc-2.3.0" and using "echo $CXX" to check whether envirnment variable 'CXX' has been set to g++ before run command "../configure --prefix=/usr/local/systemc-2.3.0".     >export CXX=g++)

       cd objdir

       ../configure -prefix=/home/user/systemc

prefix参数后面这个路径是你希望安装SystemC的目标路径,你也可以改为其他路径的。但是注意不要使用VMwareWindows共享的虚拟分区,我一开始就是安装在虚拟分区里面了,结果总是报错,说属性错误。

4.  等安装文件生成完毕后,回到上层目录,运行make程序就行安装就可以了:

       cd ..这一句不要

       make

       make install

   如果一切顺利,在/home/user/systemc下,SystemC的一切文件就都安装好了。从理论上说,你编译链接SystemC源程序的环境已然就绪了。

   Note: If "error adding symbols: Bad value collect2: error: ld returned 1 exit status" occurs, pleasetry to run command "sudo make clean" and back to the configure step before recompiling.

 

运行一个实例后,发现出错:./hello:error while loading shared libraries: libsystemc-2.3.1.so: cannot open shared object file: No such file or directory

 

解决方法参照http://blog.csdn.net/qiek/article/details/537636

libXXX.so.1.2.3所在的目录加入到 /etc/ld.so.conf中,或者在 /etc/ld.so.conf.d/下新建一文件,如XXX.conf,其内容是libXXX.so.1.2.3所在的目录。

 

在我的例子中,就是:

sudo touch/etc/ld.so.conf.d/systemc.conf

vi/etc/ld.so.conf.d/systemc.conf

(systemc.cof文件中加入一行/systemc安装的绝对路径/lib-linux64)

保存退出

sudo ldconfig

 

大功告成!!

Run "sudo apt-get install build-essential"  if g++ has not been installed.

 

综合参考:

http://blog.csdn.net/funeryoung/article/details/1874515

http://blog.csdn.net/zm_li_share/article/details/9047219

 

0 0
原创粉丝点击