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$