Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Matthew Mah
RE: Installation problem (x86_64) [ reply ]  
2010-04-06 00:18
I am running suse 11.2 on an x86_64 processor. f2c does not appear to be deprecated on my system - it's in the standard repository. I made the following modifications for successful compilation because the gfortran suggestion did not work.

There may be further possible simplifications, but I am not familiar with these components. I'm also not sure that the comment about f2c.h contents is correct.

diff --git a/ext/lapack/extconf.rb b/ext/lapack/extconf.rb
index feeeb9b..42bee92 100644
--- a/ext/lapack/extconf.rb
+++ b/ext/lapack/extconf.rb
@@ -117,7 +117,7 @@ module FunctionDB
cppdefs = {
"extern" => "",

- # these are in g2c.h
+ # these are in f2c.h
"C_f" => "void",
"Z_f" => "void",
}
@@ -271,8 +271,8 @@ module Main
end

def config
- unless have_header("g2c.h") and
- have_library("g2c") and
+ unless have_header("f2c.h") and
+#have_library("f2c") and
have_library("blas") and
have_library("lapack")
puts "A full LAPACK installation was not found."
@@ -287,7 +287,7 @@ module Main
"rb_lapack_x.c",
]

- $CFLAGS += ' -I.. -include g2c_typedefs.h'
+#$CFLAGS += ' -I.. -include g2c_typedefs.h'
end

def create
diff --git a/ext/lapack/rb_lapack.h b/ext/lapack/rb_lapack.h
index a045fd4..66968e7 100644
--- a/ext/lapack/rb_lapack.h
+++ b/ext/lapack/rb_lapack.h
@@ -7,7 +7,7 @@

#include "ruby.h"

-#include <g2c.h>
+#include <f2c.h>

#include "include/BLAS.h"
#include "include/LAPACK.h"
diff --git a/ext/linalg/dcomplex.h b/ext/linalg/dcomplex.h
index c3a0073..35344b5 100644
--- a/ext/linalg/dcomplex.h
+++ b/ext/linalg/dcomplex.h
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include <math.h>

-#include <g2c.h>
+#include <f2c.h>

#include "ruby.h"

diff --git a/ext/linalg/extconf.rb b/ext/linalg/extconf.rb
index 993ab35..0418336 100644
--- a/ext/linalg/extconf.rb
+++ b/ext/linalg/extconf.rb
@@ -13,8 +13,8 @@ require 'fileutils'
#
####################################################

-unless have_header("g2c.h") and
- have_library("g2c") and
+unless have_header("f2c.h") and
+#have_library("f2c") and
have_library("blas") and
have_library("lapack")
puts "A full LAPACK installation was not found."
@@ -32,7 +32,7 @@ $CFLAGS += " -Wall" if CONFIG["CC"] == "gcc"
# why doesn't $INCFLAGS work
$CFLAGS += " -I../lapack/include"

-$CFLAGS += ' -I.. -include g2c_typedefs.h'
+#$CFLAGS += ' -I.. -include g2c_typedefs.h'

####################################################
#
diff --git a/ext/linalg/xdata.h b/ext/linalg/xdata.h
index 6bc4725..ad60268 100644
--- a/ext/linalg/xdata.h
+++ b/ext/linalg/xdata.h
@@ -10,7 +10,7 @@

#include "ruby.h"

-#include <g2c.h>
+#include <f2c.h>

#include "linalg.h"
#include "dcomplex.h"
diff --git a/ext/linalg/xmatrix.h.tmpl b/ext/linalg/xmatrix.h.tmpl
index 29a642c..18d67b5 100644
--- a/ext/linalg/xmatrix.h.tmpl
+++ b/ext/linalg/xmatrix.h.tmpl
@@ -12,7 +12,7 @@
#include <math.h>
#include <time.h>

-#include <g2c.h>
+#include <f2c.h>

#include "BLAS.h"
#include "LAPACK.h"



By: Evgeny Bogdanov
RE: Installation problem (x86_64) [ reply ]  
2010-01-21 12:53
I had exactly the same problem on Snow Leopard 10.6.2 with x86_64.

The solution that worked for me.
1. I downloaded g77-intel-bin:
http://prdownloads.sourceforge.net/hpc/g77-intel-bin.tar.gz?download
2a. I put libg2c.a from there to my /usr/local/lib
2b. I put g2c.h from there to my /usr/local/include/
3. Then "ruby install.rb" for linalg-1.0.0.tgz worked like a charm!

$ irb
>> require 'linalg'
=> true

Hope it will help somebody

By: Kevin Lynagh
RE: Installation problem (x86_64) [ reply ]  
2010-01-15 07:50
My understanding is that g2c and f2c convert Fortran to C, which is then compiled by gcc. Simply substituting "gfortran" for "g2c" in the code won't work, because the scripts will still try to compile with gcc.

Debian and friends have pulled g2c from the current package repositories is because it is for use with g77, which is being phased out to make room for gfortran.

Anyway, I manually downloaded 'g2c' from the old debian release,

http://packages.debian.org/etch/libg2c0-dev

(Click on your machine arch (i386 is a good guess...) to download)

installed with

dpkg -i <pkg_name>.deb

and then things compiled nicely.

By: Matthew Mah
RE: Installation problem (x86_64) [ reply ]  
2009-11-17 20:50
Has this problem been resolved by the above patches?

By: Adriano Mitre
RE: Installation problem (x86_64) [ reply ]  
2009-08-11 07:46
Same problem here: trouble installing in Ubuntu 9.04 64-bit.

As there is no 64-bit Linux binary available, I downloaded the source code (linalg-1.0.1.tgz) and tried to compile it, unsuccesfully:

$ sudo apt-get install liblapack-dev
$ ruby install.rb

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. [...]

By: Charles Martin
RE: Installation problem (x86_64) [ reply ]  
2009-06-09 18:17
Can you explain how to specify a non-standard path for gfortran.a and gfortran.h

I have tried modifying extconfig.rb to include dir_config("gfortran") but this fails

Thanks

Charles

By: Charles Martin
RE: Installation problem (x86_64) [ reply ]  
2009-06-09 17:04
oh, my bad

It is just in linalg/ext

:P

By: Charles Martin
RE: Installation problem (x86_64) [ reply ]  
2009-06-09 16:58
Can you explain why you did not change:

+# $CFLAGS += ' -I.. -include g2c_typedefs.h'

and where is g2c_typedefs.h?
or gfortran_typedefs.h ?

I am looking in the build and source directory for gcc/gfortran and do not find it

By: Charles Martin
RE: Installation problem (x86_64) [ reply ]  
2009-06-07 16:33
Thanks

I'll try this patch later tonight

I decided to try installing on ms-windows/cygwin, where I know I have lapack, gfortran, and the older g77 installed

Still, I can not get the --with-lapack-lib or --with--gc2c-include options to work for ext/lapack/extconfig

Perhaps it is necessary to augment the have_library() calls with dir_config() and/or find_library() to allow specifying non-standard directories?

By: James M. Lawrence
RE: Installation problem (x86_64) [ reply ]  
2009-06-07 16:20

Hello --

Thanks for the email and sorry for the delay -- I thought I had monitoring enabled for this forum.

The deprecation of g2c is news to me. The last linalg installer change was in response to f2c being deprecated.

Unfortunately I don't have a linux machine handy at the moment. Perhaps we just need to replace "g2c" with "gfortran" in all files? It looks like gfortran.h replaces g2c.h and libgfortran replaces libg2c.

I just pushed the following commit

diff --git a/ext/lapack/extconf.rb b/ext/lapack/extconf.rb
index feeeb9b..faf0288 100644
--- a/ext/lapack/extconf.rb
+++ b/ext/lapack/extconf.rb
@@ -117,7 +117,7 @@ module FunctionDB
cppdefs = {
"extern" => "",

- # these are in g2c.h
+ # these are in gfortran.h?
"C_f" => "void",
"Z_f" => "void",
}
@@ -271,8 +271,8 @@ module Main
end

def config
- unless have_header("g2c.h") and
- have_library("g2c") and
+ unless have_header("gfortran.h") and
+ have_library("gfortran") and
have_library("blas") and
have_library("lapack")
puts "A full LAPACK installation was not found."
@@ -287,7 +287,7 @@ module Main
"rb_lapack_x.c",
]

- $CFLAGS += ' -I.. -include g2c_typedefs.h'
+ # $CFLAGS += ' -I.. -include g2c_typedefs.h'
end

def create
diff --git a/ext/lapack/rb_lapack.h b/ext/lapack/rb_lapack.h
index a045fd4..e25d4b3 100644
--- a/ext/lapack/rb_lapack.h
+++ b/ext/lapack/rb_lapack.h
@@ -7,7 +7,7 @@

#include "ruby.h"

-#include <g2c.h>
+#include <gfortran.h>

#include "include/BLAS.h"
#include "include/LAPACK.h"
diff --git a/ext/linalg/dcomplex.h b/ext/linalg/dcomplex.h
index c3a0073..11589a6 100644
--- a/ext/linalg/dcomplex.h
+++ b/ext/linalg/dcomplex.h
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include <math.h>

-#include <g2c.h>
+#include <gfortran.h>

#include "ruby.h"

diff --git a/ext/linalg/extconf.rb b/ext/linalg/extconf.rb
index 993ab35..9fd8067 100644
--- a/ext/linalg/extconf.rb
+++ b/ext/linalg/extconf.rb
@@ -13,8 +13,8 @@ require 'fileutils'
#
####################################################

-unless have_header("g2c.h") and
- have_library("g2c") and
+unless have_header("gfortran.h") and
+ have_library("gfortran") and
have_library("blas") and
have_library("lapack")
puts "A full LAPACK installation was not found."
@@ -32,7 +32,7 @@ $CFLAGS += " -Wall" if CONFIG["CC"] == "gcc"
# why doesn't $INCFLAGS work
$CFLAGS += " -I../lapack/include"

-$CFLAGS += ' -I.. -include g2c_typedefs.h'
+# $CFLAGS += ' -I.. -include g2c_typedefs.h'

####################################################
#
diff --git a/ext/linalg/xdata.h b/ext/linalg/xdata.h
index 6bc4725..a2df706 100644
--- a/ext/linalg/xdata.h
+++ b/ext/linalg/xdata.h
@@ -10,7 +10,7 @@

#include "ruby.h"

-#include <g2c.h>
+#include <gfortran.h>

#include "linalg.h"
#include "dcomplex.h"
diff --git a/ext/linalg/xmatrix.h.tmpl b/ext/linalg/xmatrix.h.tmpl
index 29a642c..c2e3b25 100644
--- a/ext/linalg/xmatrix.h.tmpl
+++ b/ext/linalg/xmatrix.h.tmpl
@@ -12,7 +12,7 @@
#include <math.h>
#include <time.h>

-#include <g2c.h>
+#include <gfortran.h>

#include "BLAS.h"
#include "LAPACK.h"


By: Charles Martin
RE: Installation problem (x86_64) [ reply ]  
2009-06-05 19:51
Did you find a solution to this problem?
I am trying the same thing (I compiled LAPACK from scratch), and am using the gcc/gfortran 4.1.1

I get the same error , and I also don't know where the g2c.h is , or how to use the config options

Thanks

Charles

By: Luca Pireddu
RE: Installation problem (x86_64) [ reply ]  
2009-02-18 14:31
It seems that g2c.h is no longer available in Debian, nor Ubuntu.

http://packages.debian.org/search?searchon=contents&keywords=g2c.h&mode=exactfilename&suite=stable&arch=any

Any plans by the author to update the linalg library?

By: Reinout van Schouwen
RE: Installation problem (x86_64) [ reply ]  
2009-01-21 14:46
Needless to say, I've also installed lib64lapack-devel-3.1.1.

By: Reinout van Schouwen
Installation problem (x86_64) [ reply ]  
2009-01-21 14:45
Hi,

I have an installation problem with linalg on my x86_64 Mandriva 2009.0 Linux machine.

I cannot install the binary distribution, as i686 binaries are incompatible with x86_64. (You'll get a LoadError complaining abuot the wrong ELF class.)

However, building from source doesn't work either. install.rb requires g2c.h. The only g2c.h in the repositories is part of the gcc3.3-g77 package. Still, even after installation of gcc3.3-g77, this is the error I get:

[reinout@localhost linalg-1.0.0]$ sudo ruby ./install.rb
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.

I've also installed libg2c, to no avail. Please help!