HowTo
How to build GreenBus example/project in GreenSocsEclipse?
Please follow these instructions for building the GreenBus example/program in GreenSocsEclipse IDE:
1) If you want to use GreenBus then loading the needful greenbus packages is necessary, so type the command:
- gs-use gsc systemc gstlm dust scv eclipse jre
This will load all systemc,gstlm, dust as well as scv libraries and loads the eclipse also.We upload jre to avoid some random java run time error given while loading eclipse.
2) Now, if you check $LD_LIBRARY_PATH variable then it will give the include directories path of all needful the packages we are using.
- echo $LD_LIBRARY_PATH
3) Now in Eclipse, you can create a new project by selecting: File->New->Managed Make C++ project. The advantage of the managed make C++ project is that we don't need to bother about the makefile.More information on this, you can get from help of Eclipse.
4) Then right-click the project and check out its properties. In properties go to C/C++ Build-> Tool settings->GCC C++ Compiler.
Now add the include directories for it, by browsing in your system. Mainly it should have:
- /gspm/OSCI/scv/1.0p2/gCC4.0.3-systemc2.2/include/
- /gspm/OSCI/systemc/2.2/gCC4.0.3/include/
- /gspm/OSCI/FZI/dust/1.0/gCC4.0.3-systemc2.2/include/
- /gspm/GreenSocs/gstlm/1.1/include/
Then in the debugging options it should have,
- -Wno-deprecated-c //for supressing some warnings in C++
- -c -WI,zmuldefs // for multiple symbol definitons.This is also for suppressing some of the errors.
Do the same setting for GCC C complier also.
5) Now do some linker settings. You we need to do some of the linker settings like: Project->Properties->C/C++ Build-> Tool settings->GCC C++ linker->libraries. Add following in libraries
- z
- m
- scv
- dust
- systemc
- gspm/OSCI/systemc/2.2/gCC4.0.3/lib
- gspm/OSCI/scv/1.0p2/gCC4.0.3-systemc2.2/lib
- gspm/OSCI/FZI/dust/1.0/gCC4.0.3-systemc2.2/lib
6) This completes the settings for building any project for Green bus.For building any SystemC or any other project we need to add or remove the libraries accordingly.Remember one thing that setting the environment is all depends on the type of project we do.We should know what headers/libraries are going to be used and add them accordingly.If it still gives error while build then know the error and add the required missing resource for successful build.
Posted January 8th, 2008 by MarkBurton