How to use alternate gfortran-4.3

13 views
Skip to first unread message

Gonzalo Tornaria

unread,
Apr 21, 2008, 5:17:12 PM4/21/08
to sage-...@googlegroups.com
I am compiling with gcc-4.3, my previous build of 3.0rc0 worked fine
(no gfortran installed in the system). However, for my build of 3.0rc1
I tried to install using gfortran-4.3 (from debian/testing).

I followed instructions in README.txt, and set:

export CC=gcc-4.3
export CXX=g++-4.3
export SAGE_FORTRAN=/usr/bin/gfortran-4.3
export SAGE_FORTRAN_LIB=/usr/lib/libgfortran.so.3

However, I get a "ld: cannot find -lgfortran" while building atlas-3.8.1.p1.

What is the correct syntax for "SAGE_FORTRAN_LIB"?

Actually: the install.log doesn't show any trace of using
"gfortran-4.3" as a binary. NOTE: I do *not* have "gfortran" package
installed in my system, so the log is full of "checking for
gfortran... no". But I think gfortran should work fine as long as it
is called by "gfortran-4.3".

Gonzalo

mabshoff

unread,
Apr 21, 2008, 5:37:28 PM4/21/08
to sage-devel
On Apr 21, 11:17 pm, "Gonzalo Tornaria" <torna...@math.utexas.edu>
wrote:

Hi Gonzalo

> I am compiling with gcc-4.3, my previous build of 3.0rc0 worked fine
> (no gfortran installed in the system). However, for my build of 3.0rc1
> I tried to install using gfortran-4.3 (from debian/testing).
>
> I followed instructions in README.txt, and set:
>
> export CC=gcc-4.3
> export CXX=g++-4.3

I am not sure this will work all the time since sometimes we overwrite
CC or CXX. I would suggest you put the 4.3 gcc and g++ somewhere in
$PATH before gcc and g++ - Sage will then use them automatically.

> export SAGE_FORTRAN=/usr/bin/gfortran-4.3

Same as the above for the name. But it will likely work

> export SAGE_FORTRAN_LIB=/usr/lib/libgfortran.so.3

ATLAS only links to libgfortran.so for some reason, so either link it
against that name or copy it somewhere as libgfortran.so and point
SAGE_FORTRAN_LIB to it. Another alternative is to start the build and
then copy libgfortran.so.3 into SAGE_LOCAL/lib as libgfortran.so
before ATLAS get going.

> However, I get a "ld: cannot find -lgfortran" while building atlas-3.8.1.p1.
>
> What is the correct syntax for "SAGE_FORTRAN_LIB"?
>
> Actually: the install.log doesn't show any trace of using
> "gfortran-4.3" as a binary. NOTE: I do *not* have "gfortran" package
> installed in my system, so the log is full of "checking for
> gfortran... no". But I think gfortran should work fine as long as it
> is called by "gfortran-4.3".

Well, many people seem to disagree with you ;) - some times you should
be able to set some env variable to point it to gfortran-4.3. I think
in the vast majority of cases configure checks for some Fortran
compiler ever though they do not compile any Fortran code. Sigh ...
autohell ;)

> Gonzalo

Cheers,

Michael

Gonzalo Tornaria

unread,
Apr 21, 2008, 6:05:39 PM4/21/08
to sage-...@googlegroups.com
On 4/21/08, mabshoff <Michael...@mathematik.uni-dortmund.de> wrote:
>
> > export CC=gcc-4.3
> > export CXX=g++-4.3
>
>
> I am not sure this will work all the time since sometimes we overwrite
> CC or CXX. I would suggest you put the 4.3 gcc and g++ somewhere in
> $PATH before gcc and g++ - Sage will then use them automatically.

Ok, I've switched to

export PATH=~/sage/bin:$PATH
export CC=gcc-4.3
export CXX=g++-4.3
export SAGE_FORTRAN=~/sage/bin/gfortran
export SAGE_FORTRAN_LIB=~/sage/lib/libgfortran.so

(with gcc, g++, gfortran symlinks in ~/sage/bin, and a libgfortran.so
symlink in ~/sage/lib). Maybe I'll have a look at the install.log
later to see which packages honor the env variables and which don't.
(maybe I should link gcc to /bin/false to reallly test this... ;-) )


> ATLAS only links to libgfortran.so for some reason, so either link it
> against that name or copy it somewhere as libgfortran.so and point
> SAGE_FORTRAN_LIB to it. Another alternative is to start the build and
> then copy libgfortran.so.3 into SAGE_LOCAL/lib as libgfortran.so
> before ATLAS get going.

Please consider the following patch for the readme (don't credit me, I
just reworded what you just said :-) ).

--- sage-3.0.rc0/README.txt 2008-04-19 04:32:24.000000000 -0300
+++ sage-3.0.rc1/README.txt 2008-04-21 18:58:39.000000000 -0300
@@ -67,6 +67,14 @@
export SAGE_FORTRAN=/exact/path/to/gfortran
export SAGE_FORTRAN_LIB=/path/to/fortran/libs/libgfortran.so

+ Note that ATLAS only links to libgfortran.so for some reason.
+ If your system-wide library has a different filename (e.g.
+ libgfortran.so.3), either link it against that name or copy it
+ somewhere as libgfortran.so and point SAGE_FORTRAN_LIB to it.
+ Another alternative is to start the build and then copy
+ libgfortran.so.3 into SAGE_LOCAL/lib as libgfortran.so before
+ ATLAS get going.
+
UNSUPPORTED, BUT HIGH PRIORITY TO SUPPORT SOON:
sparc Solaris 9, Solaris 10
x86_64 Solaris 10


> Well, many people seem to disagree with you ;) - some times you should
> be able to set some env variable to point it to gfortran-4.3. I think
> in the vast majority of cases configure checks for some Fortran
> compiler ever though they do not compile any Fortran code. Sigh ...
> autohell ;)

Yes, yes... but I don't know what is the analogue env variable of CC
and CXX for fortran. Is there one?

Gonzalo

mabshoff

unread,
Apr 21, 2008, 6:53:17 PM4/21/08
to sage-devel


On Apr 22, 12:05 am, "Gonzalo Tornaria" <torna...@math.utexas.edu>
wrote:
> On 4/21/08, mabshoff <Michael.Absh...@mathematik.uni-dortmund.de> wrote:
>
>
>
> >  > export CC=gcc-4.3
> >  > export CXX=g++-4.3
>
> > I am not sure this will work all the time since sometimes we overwrite
> >  CC or CXX. I would suggest you put the 4.3 gcc and g++ somewhere in
> >  $PATH before gcc and g++ - Sage will then use them automatically.
>
> Ok, I've switched to
>
> export PATH=~/sage/bin:$PATH
> export CC=gcc-4.3
> export CXX=g++-4.3
> export SAGE_FORTRAN=~/sage/bin/gfortran
> export SAGE_FORTRAN_LIB=~/sage/lib/libgfortran.so

Ok, let us know how it works ;)

> (with gcc, g++, gfortran symlinks in ~/sage/bin, and a libgfortran.so
> symlink in ~/sage/lib). Maybe I'll have a look at the install.log
> later to see which packages honor the env variables and which don't.
> (maybe I should link gcc to /bin/false to reallly test this... ;-) )
>
> > ATLAS only links to libgfortran.so for some reason, so either link it
> >  against that name or copy it somewhere as libgfortran.so and point
> >  SAGE_FORTRAN_LIB to it. Another alternative is to start the build and
> >  then copy libgfortran.so.3 into SAGE_LOCAL/lib as libgfortran.so
> >  before ATLAS get going.

I already treat the case of libgfortran.so.1 special since that is the
default on RHEL5/Itanium. It would be easy to add the special case
libgfortran.so.3 assuming it is relative to gfortran, i.e. in ../lib/
libgfortran.so.3

> Please consider the following patch for the readme (don't credit me, I
> just reworded what you just said :-) ).
>
> --- sage-3.0.rc0/README.txt     2008-04-19 04:32:24.000000000 -0300
> +++ sage-3.0.rc1/README.txt     2008-04-21 18:58:39.000000000 -0300
> @@ -67,6 +67,14 @@
>            export SAGE_FORTRAN=/exact/path/to/gfortran
>            export SAGE_FORTRAN_LIB=/path/to/fortran/libs/libgfortran.so
>
> +      Note that ATLAS only links to libgfortran.so for some reason.
> +      If your system-wide library has a different filename (e.g.
> +      libgfortran.so.3), either link it against that name or copy it
> +      somewhere as libgfortran.so and point SAGE_FORTRAN_LIB to it.
> +      Another alternative is to start the build and then copy
> +      libgfortran.so.3 into SAGE_LOCAL/lib as libgfortran.so before
> +      ATLAS get going.
> +
>  UNSUPPORTED, BUT HIGH PRIORITY TO SUPPORT SOON:
>         sparc           Solaris 9, Solaris 10
>         x86_64          Solaris 10

Sure. I will put it on my list.

> > Well, many people seem to disagree with you ;) - some times you should
> >  be able to set some env variable to point it to gfortran-4.3. I think
> >  in the vast majority of cases configure checks for some Fortran
> >  compiler ever though they do not compile any Fortran code. Sigh  ...
> >  autohell ;)
>
> Yes, yes... but I don't know what is the analogue env variable of CC
> and CXX for fortran. Is there one?

Not that I know off. It seems that there isn't one that is universally
accepted.

> Gonzalo

Cheers,

Michael
Reply all
Reply to author
Forward
0 new messages