Sunday, October 16, 2011

Installing GPSIM

Hi there., nowadays I'm playing around with micro controllers. Before to get involve with MCUs physically I wanted to try it virtually. As a Linux user I Googled for a linux software to simulate my MCU programs. I found out a software GPSIM (GNU PIC Simulator). But while I'm building the GPSIM I met with a problem and googled for the solution. Unfortunately there wasn't. So I get on to work and got a solution my self.  

Basically it's required to install following dependencies before.

gputils (GNU PIC Utils)
sdcc (Small Device C Compiler)

Then it's time to build and install the GPSIM

while I'm executing the ./configure I met with a problem. first there popt.h file missing. so I have to install package included that header file. and then the biggest problem was occurred

To install gpsim, it's required to be installed gtkextra-2.0 package.
I couldn't find out the gtkextra-2.0. Instead of that I have installed gtkextra-3.0

But while I configuring, terminal prompts an Error.


checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find gtkextra-2.0 package

Although there's  no problem with gtkextra package I examined the source code of the configure file. I saw that there's a code in the configure file which is shown below

$PKGCONFIG --exists gtkextra-2.0
  if test $? != 0; then
    as_fn_error $? "Cannot find gtkextra-2.0 package" "$LINENO" 5
  fi

  X_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0 gthread-2.0`
  X_CFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
  Y_LDFLAGS=`$PKGCONFIG --libs gtkextra-2.0`
  Y_CFLAGS=`$PKGCONFIG --cflags gtkextra-2.0`
  GTK_VERSION_T=`$PKGCONFIG --modversion gtk+-2.0`


this code always search for the older version of the gtkextra package even computer has it's latest version. So I replaced 'gtkextra-2.0' with 'gtkextra-3.0'

Note: Keep a copy of the Configure file before you edit it.
Note: You cannot edit it without root privileges. So use


                     $ sudo gedit configure

Note: Always replace your currently running gtkextra package version. It's  gtkextra-3.0 in my case. To find out version of yours

               $ pkg-config --list-all | grep gtk

Note: install any other dependencies. In my case I had missing packages libpopt-dev (for popt.h)

Then I was able to get through the configuration process painlessly. Then executed

           $ sudo make

           $ sudo make install

I thought that it's almost done. But it wasn't, an error was prompted.

~/gpsim-0.26.1$ gpsim
gpsim: error while loading shared libraries: libgtkextra-x11-3.0.so.1: cannot open shared object file: No such file or directory


Searched for the missing package 'libgtkextra-x11-3.0' library and downloaded the built packages

libgtkextra-x11-3.0-0   and libgtkextra-x11-3.0-dev


installed sequently

$ sudo dpkg -i libgtkextra-x11-3.0-0_3.0-0ubuntu3_i386.deb

$ sudo dpkg -i libgtkextra-x11-3.0-dev_3.0-0ubuntu3_i386.deb

then it works without any trouble ...  :D





   

Tuesday, July 5, 2011

මගේ ගමන...

වෙල් යායෙන්  එහා  ගමේ පන්සලට පයින් පෙර පාසල්  ගිය මම....,
මාවතගම ප්‍රාථමිකයට අප්පච්චී සමඟ බයිසිකලයෙන් ගිය මම....,
මාවතගම සෙන්ට්‍රලයට සහ කුරුණෑගල මලියදේව ආදර්ශයට බසයෙන් ගියද...,
කුරුඳුවත්තේ කොළඹ විශ්වවිද්‍යාලයට මම යන්නේ දුම්රියෙනි.....