Showing posts with label inspiron. Show all posts
Showing posts with label inspiron. Show all posts

Saturday, October 15, 2011

Installing Matplotlib Basemap 1.0.1 on Ubuntu 11.04 64bit


Recently I've spent much of my time trying to plot a map and visualizing data resulted from my simulation program. After reading here and there I found basemap and matplotlib to be the most suitable choice in my opinion. This short tutorial is posted as a personal note which might be useful in the future, in case I need to reinstall basemap on my PC.

1. Using Synaptic Package Manager, do install python 2.7.1, numpy 1.5.1, python-matplotlib 0.99.3, libgeos-dev 3.2.0-1, shapelib 1.2.10-5, python-imaging 1.1.7-2build2 and all of their respective dependencies.

2. Download the basemap-1.0.1.tar.gz from here:
http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.1/

3. Using Archive Manager, extract the file: basemap-1.0.1.tar.gz

4. Run the following commands:
username@my-ubuntu:~Downloads$ cd basemap-1.0.1/

username@my-ubuntu:~Downloads$ python setup.py install


5. Check the installation:
username@my-ubuntu:~Downloads$ cd examples/

username@my-ubuntu:~Downloads$ python simpletest.py


If it displays a map on the screen, then all is set. This works for me, so I hope this will also work for you!

Cheers!



Added on Oct. 17:

I just got my Ubuntu 11.10 upgrade and suddenly basemap error occurs. It could not find libgeos-3.2.0.so which was understandable because Ubuntu upgrade remove this "old package" of libgeos-3.2.0.so and install the new libgeos-3.2.2.so.

ImportError: libgeos-3.2.0.so could not be found by this line: import _geoslib

However, when I tried reinstalling basemap, libgeos-3.2.2.so could be found when running
my-ubuntu$ sudo python setup.py install

So problem was _geoslib.so which somehow was still looking for libgeos-3.2.0.so. I needed to build a new _geoslib.so with the new libgeos-3.2.2.so

The following steps are to cure this:
1. Remove _geoslib.so in /usr/local/lib/python2.7/dist-packages/
2. Change directory to /basemap-1.0.1/build/
3. Remove this folder --> lib.linux-x86_64-2.7/
4. Reinstall basemap-1.0.1 by running sudo python setup.py install

Friday, October 7, 2011

Installing Oracle Solaris Studio 12.2 on Ubuntu 11.04 64bit

Since my first encounter with Sun Studio in 2007, it is always of my intention to have Sun Studio installed on my PC. Now, I have my Dell Inspiron N4030 with its "good look" and I think it's good to spend much of my work hours with it. As Linux is the only supported operating system by Oracle Solaris Studio (Sun Studio's present name) apart from Solaris, so I decided to install the latest Ubuntu 11.04 64 bit on it. And here is what I did to get my N4030 with Ubuntu 11.04 works hand in hand with the "new Sun Studio" called Oracle Solaris Studio 12.2.

1. Download the latest JRE from here
http://www.java.com/en/download/linux_manual.jsp?locale=en
In my case I downloaded Linux x64 with size of about 20.2 MB
It's a free download! --> filename: jre-6u27-linux-x64.bin

2. Download Oracle Solaris Studio 12.2 from here
http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.html
You need to have an account (free registration --> used to be Sun Developer Network)
It's also a free download! --> filename: SolarisStudio12.2-linux-x86-tar-ML.tar.bz2

3. Run the following command and it will extract to a directory:
username@my-ubuntu:~/Downloads$ ./jre-6u27-linux-x64.bin
username@my-ubuntu:~/Downloads$ sudo mkdir /usr/java
username@my-ubuntu:~/Downloads$ sudo cp -R jre1.6.0_27/ /usr/java/
username@my-ubuntu:~/Downloads$ gedit ~username/.bashrc &

--> add the following line at the end of .bashrc:
export PATH=$PATH:/usr/java/jre1.6.0_27/bin/:/usr/java/jre1.6.0_27/lib/:/usr/java/jre1.6.0_27/man/

--> save .bashrc, exit gedit and load the new PATH environment:
username@my-ubuntu:~/Downloads$ source ~username/.bashrc

--> check your installation:
username@my-ubuntu:~/Downloads$ java

4. Extract SolarisStudio12.2-linux-x86-tar-ML.tar.bz2 using ArchiveManager

5. Change directory to the folder created by extracting the file and run the following commands:
username@my-ubuntu:~/SolarisStudio12.2-linux-x86-tar-ML$ sudo mkdir /opt/oracle
username@my-ubuntu:~/SolarisStudio12.2-linux-x86-tar-ML$ sudo cp -R solstudio12.2/ /opt/oracle/
username@my-ubuntu:~/Downloads$ gedit ~username/.bashrc &

--> add the following line at the end of this file (.bashrc):
export PATH=$PATH:/usr/java/jre1.6.0_27/bin/:/usr/java/jre1.6.0_27/lib/:/usr/java/jre1.6.0_27/man/:/opt/oracle/solstudio12.2/bin/:/opt/oracle/solstudio12.2/lib/:/opt/oracle/solstudio12.2/man/:/opt/oracle/solstudio12.2/include/

--> save .bashrc , exit gedit and load the new PATH environment:
username@my-ubuntu:~/Downloads$ source ~username/.bashrc

--> check your installation:
username@my-ubuntu:~/Downloads$ solstudio &

I guess you're all done! In case you have problem with running the program, please check file permission. If it's a file permission problem, then run the following command:
username@my-ubuntu:~/SolarisStudio12.2-linux-x86-tar-ML$ sudo chmod 755 -R /opt/oracle/solstudio12.2/

Thank you. This works for me and my Ubuntu 11.04 64 bit and I hope it will work for you too.

Cheers!