Monday, October 10, 2011

What ever you occupy, occupy it with passion.



Everyone must do their part.

Thursday, May 05, 2011

How to setup addons for Fedora 14 when running inside VirtualBox

Well, follow the straightforward instructions on this site:

http://www.sysprobs.com/install-fedora-14-virtualbox-working-guest-additions

Wednesday, December 22, 2010

Compiling LAPACK as a shared library in linux

So I've finally gotten MDAnalysis (a python module which relies on LAPACK) to work with custom LAPACK shared library. It makes me wonder what other functions are missing from the lapack libs that numpy/scipy compile against by default. But I think numpy/scipy compile lapack functions statically; so they should be optimized if you compile them from source.

In any case, I worked on LAPACK version 3.3.0 and had to modify the following make related files:
(1) {root}/make.inc
(2) {root}/SRC/Makefile
(3) {root}/BLAS/SRC/Makefile
(4) {root}/Makefile

Where {root} is your extraction path.


(1) For {root}/make.inc:
At minimum, add "-fPIC" to the configuration variables listed below.

FORTRAN
OPTS
LOADER

I also appended "-02 -pipe" for optimization and speedier compilation on to FORTRAN and LOADER

For ease of installation, I added a new varaible, PREFIX, which designates the installation path:

#INSTALLATION PATH
PREFIX=/home/group/shared_libraries/centos64/pkgs/lapack/3.3.0/


(2) For {root}/SRC/Makefile:
Update the main target:

all: ../$(LAPACKLIB) liblapack.so

Add the following build target and rule

liblapack.so: $(ALLOBJ)
gfortran -shared -Wl,-soname,$@ -o $@ $(ALLOBJ)

And you'll need to remove some redundancy from the object files list:

#DSLASRC = spotrs.o sgetrs.o spotrf.o sgetrf.o
DSLASRC = spotrs.o sgetrs.o sgetrf.o

#ZCLASRC = cpotrs.o cgetrs.o cpotrf.o cgetrf.o
ZCLASRC =



(3) For {root}/BLAS/SRC/Makefile:
Update the main target to read as follows

all: $(BLASLIB) libblas.so

Of course, you can create an alias in the {root}/make.inc for BLASLIBSO = libblas.so

Now add the new target:

libblas.so: $(ALLOBJ)
gfortran -shared -Wl,-soname,$@ -o $@ $(ALLOBJ)


(4) For {root}/Makefile
Added an install rule which depends on the PREFIX setting from make.inc:

install: all
cp BLAS/SRC/libblas.so $(PREFIX)/lib
cp SRC/liblapack.so $(PREFIX)/lib
cp *.a $(PREFIX)/lib


That's it!

Friday, December 17, 2010

Installing topicmodels R package

It has been quite annoying trying to install the "topicmodels" package for R. But here's a run down, in case others out there encounter the following error message when installing the package into a non-standard location.


ctm.c:29:25: error: gsl/gsl_rng.h: No such file or directory
ctm.c:30:28: error: gsl/gsl_vector.h: No such file or directory
ctm.c:31:28: error: gsl/gsl_matrix.h: No such file or directory


First, you will need to install the GNU GSL library. Pick it up from here: ftp://ftp.gnu.org/gnu/gsl/. The typical yum or manual compilation should work just fine. If you're installing this library into a non-standard location, take note of the installation path because you will need that below.

Second, even when passing the "--configure-vars" option to point to the location of the GSL include and shared library folder, R CMD INSTALL will fail. The solution?

Here:
1) Download the topicmodel source from here: http://cran.r-project.org/web/packages/topicmodels/index.html
2) Unpack into a working folder.
3) Modify the src/Makevars file to read as follows:

LIB_GSL=/path/to/gsl/installation/
PKG_LIBS=-lgsl -lgslcblas -L${LIB_GSL}/lib
PKG_CPPFLAGS=-I$(LIB_GSL)/include

Of course, modify the value for LIB_GSL according to your installation path. Now re-compress the folder structure like so:
"tar zcvf topicmodels.tar.gz /path/to/working/folder"

Now run "R CMD INSTALL topicmodels.tar.gz ".

Note that you will also encounter an issue with the vignette generation, so you'll need to install the OAIHarvester package in an R session:

install.packages("OAIHarvester")

Goodluck!
Paul

Thursday, September 17, 2009

Southern California Volvo dealerships

So the past few days have been a bit of a commuter's nightmare. Well, at least, for someone who's lost his car keys in the city of angels.

I drive a Volvo. I love 'em. I've owned two and I've been happy with their safety and reliability. The downside of owning one of these is the cost of maintenance and repair.

I was calling around local dealerships for a replacement set of keys. One word of advice, the downtown Los Angeles Volvo dealership rips people off! The guy on the phone sounded brash and unprofessional too. I saved almost $200 dollars towing my car to the Rusnak dealership in Pasadena.

I have no particular ties (advertising, cronyism, etc) to either of these dealerships. In fact, the best car service I've received has been from the Santa Monica and the Power Volvo Irvine dealerships.

Saturday, July 11, 2009

Custom PyCUDA installation on Fedora 10


Below is an email response I posted in the pycuda mailing list.  I was running into conflicting versions of the boost library.  I had to remove the default version of boost (1.33?) which is part of the fedora 10 distribution.  

====
For anyone else running into this issue (and if you're using Fedora/redhat distribution), here's the fix.  This assumes that you've compiled and installed CUDA 2.2 and that you've set CUDA_ROOT to your cuda installation path (including updating your LD_LIBRARY_PATH, etc).

i) make sure you have 'chrpath' installed along with rpm tools:
yum install chrpath
yum install rpm-build

1) download the latest (at this time, 1.39) src rpm and spec file
wget http://people.redhat.com/bkoz/boost/boost-1.39.0-0.3.fc11.src.rpm
wget http://people.redhat.com/bkoz/boost/boost.spec-1.39.0-0.2

2) rebuild the rpm
rpmbuild --rebuild boost-1.39.0-0.3.fc11.src.rpm

3) install the rpms
go into rpmbuild/RPMS/{your platform}
rpm -Uvh boost-*

4) obtain pycuda, unpack and run configure
python configure.py

5) edit siteconf.py and remove the compiler version, eg, gcc43, from the following variables

BOOST_PYTHON_LIBNAME = ['boost_python-mt']
BOOST_THREAD_LIBNAME = ['boost_thread-mt']

6) issue make and make install and ensure that the examples run 
Goodluck,
Paul

Friday, July 10, 2009

Exploring Stockholm, Sweden virtually



A colleague recommended this very nice site to explore Sweden virtually using a google-esque street view interface. I highly recommend visiting Stockholm!

A great page to discover and reminisce about Stockholm
http://www.hitta.se/gatubild/