Recently I was learning some stuff of machine learning and SVG. I found linalg that implements linear algebra library write in fortran: LAPACK.
I got this annoying error:
config ext/lapack
checking for g2c.h... no
A full LAPACK installation was not found.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
–with-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
–with-opt-lib
–without-opt-lib=${opt-dir}/lib
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=/home/marco/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
install.rb:152:in `block in config’: configuration failed (RuntimeError)
from install.rb:22:in `block (2 levels) in each’
from install.rb:21:in `chdir’
from install.rb:21:in `block in each’
from install.rb:18:in `each’
from install.rb:18:in `each’
from install.rb:149:in `config’
from install.rb:231:in `auto’
from install.rb:240:in `’
from install.rb:94:in `’
I searched for this g2c.h header file and don’t find it. Well, i find somewhere a tip that is just replace g2c.h to f2c.h. It worked for me. Just remember to install gfortran lib64gfortran3 cfortran packages:
sudo apt-get install gfortran lib64gfortran3 cfortran
marco@macubuntu:~/d/linalg-1.0.1-i686-darwin9-ruby19/ext$ grep "g2c.h" * -R
lapack/mkmf.log:have_header: checking for g2c.h... -------------------- no
lapack/mkmf.log:conftest.c:3:17: fatal error: g2c.h: No such file or directory
lapack/mkmf.log:3: #include <g2c.h>
lapack/extconf.rb: # these are in g2c.h
lapack/extconf.rb: unless have_header("g2c.h") and
lapack/rb_lapack.h:#include <g2c.h>
linalg/xmatrix.h.tmpl:#include <g2c.h>
linalg/dcomplex.h:#include <g2c.h>
linalg/extconf.rb:unless have_header("g2c.h") and
linalg/xdata.h:#include <g2c.h>
marco@macubuntu:~/d/linalg-1.0.1-i686-darwin9-ruby19/ext$
Just change every of this files. search g2c.h to f2c.h and it will compile like a charm