Installing Ruby’s linalg in Ubuntu

Ruby has a project for download called linalg that exposes the LAPACK functions in Ruby. LAPACK is a set of routines written in Fortran to do Linear Algebra operations. Now, before you cry foul about Fortran, LAPACK is used in a lot of places, and it’s pretty damn old and has held up over the years.

The linalg package just updated about two weeks ago, first since 2004, so it has some updates. Unfortunately, there’s no easy gem to install. You’ll have to download the tar, and then run


sudo ruby install.rb

Of course, you’ll run into some problems, unless you have other packages installed:


sudo apt-get install lapack3 lapack3-dev libg2c0-dev

Don’t worry, if you don’t like it, you can run uninstall. Read INSTALL file for more directions.
I use to wonder how people knew which packages to look for. Apparently, you look at the output and see what files the configure is crapping out on. Then use apt-file to search for which package the file is in. It’s one of those basic things that seems not mentioning in hindsight. Like calling “source ~/.bashrc” after you’ve edited your bash files. No one ever mentions that.


sudo apt-get install apt-file
sudo apt-file update
apt-file list g2c.h

Knowing that, you’ll know how to fish, and I’ll not post how to install stuff in the future.

tip!

Advertisements

5 thoughts on “Installing Ruby’s linalg in Ubuntu

  1. I am running in to troubles installing the dependencies: lapack3, libg2c0-dev, lapack3-dev. I cannot find them on the ubuntu 10.04 repositories. I tried installing the .deb packages from ubuntu. When I got the package libg2c0, it said gcc3.4 not found. I have the latter version gcc4.4, so why am I not able to install stuff? Do I have to get the older version? I am not sure what other programs will be affected then.

  2. Hrm, I don't know. Ubuntu regularly retires packages from the repos. You'll want to check ubuntu's community forums as they're pretty active and helpful over there. I don't know enough about the state of LAPACK itself to be able to help you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s