Wednesday, July 18, 2007

Using OPNET with ccache (on Linux)

I use the OPNET network simulator for research purposes. Its default compilation process compiles the files using gcc (default on Linux), one by one, with a very poor dependency check, so that many times you prefer to compile with "force model recompilation" to be sure.
To speed-up this compilation process for my simulations I use a series of commonly used tools, such as ccache (a compiler cache), make (to recompile only what needs to recompiled) and icecream (to make use of other machines in order to parallelly compile many files). In this first part I'm writing down the simpler thing, that is, how to use ccache.

This is very straightforward. First of all, install ccache. Then, use one of the methods suggested in the ccache documentation. Supposing you're user dev, I prefer installing ccache like this:
$> which ccache # discover where ccache is, suppose /usr/bin/ccache
$> ln -s /usr/bin/ccache /bin

now, call
$> ccache -s
to view ccache statistics, then try to compile something in OPNET and run ccache -s again. You should see some change in the statistics...
Well, so we saw that using ccache is very simple, but you'll see that's very effective if you're used to use "force model recompilation" to avoid dependency problems. Using icecream and Makefiles will be a little more tricky, but if you're interested you'd better follow this blog!

Tuesday, July 10, 2007

Browsing your phone with KDE

This time I'm going to write down how you can access your phone's folders using KDE. These notes are related to opensuse 10.2 with kde 3.5.7, but I used the same method also on other linux versions and this is quite straightforward. The telephone I used is a nokia 3200, with infrared connectivity (it implements the obex protocol, very common in telephones)

The first method you can use involves a KDE component. On SuSE, you must have kdebluetooth installed, in order to have the component kio_obex in kde's library folder.
You must also configure the IRDA service (/etc/init.d/irda on SuSE), this is a different topic and there are many other useful readings on the internet to do it, so for now I'll skip this step.
Now, in KDE, all you have to do is enable infrared in your phone, put it near the infrared port of your PC, and then open a konqueror window to digit this URL:
obex2://irda

(depending on your packages, it could also be obex://irda)
and you'll get full access to the user folders of your phone! At least on mine, I can access all the folders containing images and tones, depending on your phone maybe you can also access games folders and so on...

The second method is by using obexfs. This requires also installing fuse, both these packages are very easy to install on opensuse.
With this method, all you have to do is create a directory to mount your phone, e.g. /mnt/phone, and then type
obexfs -i /mnt/phone
(-i is for IRDA, with -b you'll easily access also bluetooth phones) and then browse the folder. Remember to unmount the phone when finished! To do this, type:
fusermount -u /mnt/phone

and that's it, I hope this little article can be useful!

Thursday, July 5, 2007

GNU Octave Compilation

I tried to compile GNU Octave by myself, in order to take advantage of the improved performance that can be obtained by using the optimized ATLAS libraries (see the links if you want to know what I'm speaking about).
I personally found it uneasy to understand what the correct procedure is, so I'm writing here the steps that I followed in order to get the whole thing done.
First, download the latest versions of both octave and ATLAS, and uncompress them as usual.
Then, compile ATLAS (this is straightforward as from the instructions provided with it).
Last, the thing that I found a little tricky to understand. Provided you compiled ATLAS for an architecture named Linux_SOMEARCH, and you're doing everything in a folder /root/octave, you should call configure like this:

./configure --enable-shared --enable-dl --disable-static LDFLAGS="-L/root/octave/ATLAS/lib/Linux_SOMEARCH"

It is very important that the library location specified with LDFLAGS be absolute rather then relative
, as I tried with a relative path and the compilation was broken by this. Add to configure any other option you should use, and then compile everything so that you can enjoy the improved performance!
Finally, notice that this refers to GNU Octave version 2.1.73 (the latest stable version at the time of this post)

My first post

Hi to all my readers!
I opened this blog to collect and publish everything I find during my work, so that everyone can possibly be helped by me sharing my experience! Enjoy!