public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Trouble installing gfortran
@ 2012-01-11  2:44 John Harper
  2012-01-11  3:12 ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: John Harper @ 2012-01-11  2:44 UTC (permalink / raw)
  To: gcc-help


Recently I have been describing my troubles installing gfortran in the
comp.lang.fortran newsgroup, and FX has given useful help. But today
my system won't let me read anything in that newsgroup so I'm emailing
to you.

One thing that wasn't suggested but I find allowed me to configure GCC,
make and make install was  rm -f /tmp/gccobj/prev-* before starting.
(I used a bash shell script saying inter alia

srcdir=/tmp/gcc-4.6.2
objdir=/tmp/gccobj
prefix=/tmp/gf
target="i686-pc-linux-gnu"
gccopts=" --prefix=$prefix --enable-languages=c,c++,fortran"
gccopts=$gccopts" --disable-libada" # unlikely to need ADA!
gccopts=$gccopts" --with-gmp=$HOME --with-mpfr-include=$HOME/mpfr-3.0.0"
gccopts=$gccopts" --with-mpfr-lib=$HOME/mpfr-3.0.0/.libs"
gccopts=$gccopts" --with-mpc=$HOME/mpc-0.9"
$srcdir/configure $gccopts # http://gcc.gnu.org/install/configure.html

because my HOME disk space is too small for GCC and all the things it
needs. I then copied /tmp/gccobj/gcc/gfortran to /tmp/gf/bin/gfortran
and /tmp/gccobj/gcc/f951 to 
/tmp/gf/libexec/gcc/i686-pc-linux-gnu/4.6.2/f951

My little test program then compiled but wouldn't run even though the
library said to be missing does exist. It was presumably put somewhere
that gfortran couldn't find it. What should I do now? Evidence:

rimu[/tmp]$ ls -l */*/libquadmath.so*
lrwxrwxrwx 1 harperj1 harperj1     20 Jan 10 12:35 gf/lib/libquadmath.so -> 
libquadmath.so.0.0.0
lrwxrwxrwx 1 harperj1 harperj1     20 Jan 10 12:35 gf/lib/libquadmath.so.0 -> 
libquadmath.so.0.0.0
-rwxr-xr-x 1 harperj1 harperj1 966329 Jan 10 12:35 gf/lib/libquadmath.so.0.0.0
rimu[/tmp]$ cd
rimu[~]$ /tmp/gf/bin/gfortran -v hello.f
Driving: /tmp/gf/bin/gfortran -v hello.f -l gfortran -l m -shared-libgcc
Using built-in specs.
COLLECT_GCC=/tmp/gf/bin/gfortran
COLLECT_LTO_WRAPPER=/tmp/gf/libexec/gcc/i686-pc-linux-gnu/4.6.2/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: /tmp/gcc-4.6.2/configure --prefix=/tmp/gf 
--enable-languages=c,c++,fortran --disable-libada --with-gmp=/home/harperj1 
--with-mpfr-include=/home/harperj1/mpfr-3.0.0 
--with-mpfr-lib=/home/harperj1/mpfr-3.0.0/.libs 
--with-mpc=/home/harperj1/mpc-0.9
Thread model: posix
gcc version 4.6.2 (GCC)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
  /tmp/gf/libexec/gcc/i686-pc-linux-gnu/4.6.2/f951 hello.f -ffixed-form -quiet 
-dumpbase hello.f -mtune=generic -march=pentiumpro -auxbase hello -version 
-fintrinsic-modules-path /tmp/gf/lib/gcc/i686-pc-linux-gnu/4.6.2/finclude -o 
/tmp/ccDukrje.s
GNU Fortran (GCC) version 4.6.2 (i686-pc-linux-gnu)
         compiled by GNU C version 4.6.2, GMP version 4.3.2, MPFR version 3.0.0, 
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran (GCC) version 4.6.2 (i686-pc-linux-gnu)
         compiled by GNU C version 4.6.2, GMP version 4.3.2, MPFR version 3.0.0, 
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
  as --32 -o /tmp/ccGzx8Uk.o /tmp/ccDukrje.s
Reading specs from 
/tmp/gf/lib/gcc/i686-pc-linux-gnu/4.6.2/../../../libgfortran.spec
rename spec lib to liborig
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
COMPILER_PATH=/tmp/gf/libexec/gcc/i686-pc-linux-gnu/4.6.2/:/tmp/gf/libexec/gcc/i686-pc-linux-gnu/4.6.2/:/tmp/gf/libexec/gcc/i686-pc-linux-gnu/:/tmp/gf/lib/gcc/i686-pc-linux-gnu/4.6.2/:/tmp/gf/lib/gcc/i686-pc-linux-gnu/
LIBRARY_PATH=/tmp/gf/lib/gcc/i686-pc-linux-gnu/4.6.2/:/tmp/gf/lib/gcc/i686-pc-linux-gnu/4.6.2/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
  /tmp/gf/libexec/gcc/i686-pc-linux-gnu/4.6.2/collect2 --eh-frame-hdr -m 
elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o 
/tmp/gf/lib/gcc/i686-pc-linux-gnu/4.6.2/crtbegin.o 
-L/tmp/gf/lib/gcc/i686-pc-linux-gnu/4.6.2 
-L/tmp/gf/lib/gcc/i686-pc-linux-gnu/4.6.2/../../.. /tmp/ccGzx8Uk.o -lgfortran 
-lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc 
/tmp/gf/lib/gcc/i686-pc-linux-gnu/4.6.2/crtend.o /usr/lib/crtn.o
rimu[~]$ ./a.out
./a.out: error while loading shared libraries: libquadmath.so.0: cannot open 
shared object file: No such file or directory
rimu[~]$

-- John Harper, School of Mathematics Statistics and Operations Research
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail john.harper@vuw.ac.nz phone (+64)(4)463 5276 fax (+64)(4)463 5045

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trouble installing gfortran
  2012-01-11  2:44 Trouble installing gfortran John Harper
@ 2012-01-11  3:12 ` Jonathan Wakely
  2012-01-12  8:32   ` John Harper
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2012-01-11  3:12 UTC (permalink / raw)
  To: John Harper; +Cc: gcc-help

On 10 January 2012 20:07, John Harper wrote:
>
> My little test program then compiled but wouldn't run even though the
> library said to be missing does exist. It was presumably put somewhere
>
> that gfortran couldn't find it. What should I do now? Evidence:
[...]
> ./a.out: error while loading shared libraries: libquadmath.so.0: cannot open
> shared object file: No such file or directory

In my reply directing you to the gcc-help list I also answered your
question, I guess you didn't scroll down far enough :)

I said:

The dynamic linker needs to know how to find the library at run time.

http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trouble installing gfortran
  2012-01-11  3:12 ` Jonathan Wakely
@ 2012-01-12  8:32   ` John Harper
  2012-01-12 17:08     ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: John Harper @ 2012-01-12  8:32 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

On Tue, 10 Jan 2012, Jonathan Wakely wrote:

> Date: Tue, 10 Jan 2012 23:10:05 +0000
> From: Jonathan Wakely <jwakely.gcc@gmail.com>
> To: John Harper <John.Harper@msor.vuw.ac.nz>
> Cc: gcc-help@gcc.gnu.org
> Subject: Re: Trouble installing gfortran
> 
> On 10 January 2012 20:07, John Harper wrote:
>>
>> My little test program then compiled but wouldn't run even though the
>> library said to be missing does exist. It was presumably put somewhere
>>
>> that gfortran couldn't find it. What should I do now? Evidence:
> [...]
>> ./a.out: error while loading shared libraries: libquadmath.so.0: cannot open
>> shared object file: No such file or directory
>
> In my reply directing you to the gcc-help list I also answered your
> question, I guess you didn't scroll down far enough :)
>
> I said:
>
> The dynamic linker needs to know how to find the library at run time.
>
> http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths

Thank you - after many, many unsuccessful tries I have at last got
a working gfortran 4.6.2! As will be obvious, I am an extreme newbie as
a systems programmer. One question I have is that our systems people
installed gfortran 4.4.4 and when I use it with -v I get inter alia
Target: i386-redhat-linux6E
but when I installed gfortran 4.6.2 myself on the same machine without 
specifying --target I get
Target: i686-pc-linux-gnu

Why the difference? FWIW the command   set | grep 86   gives
HOSTTYPE=i386
MACH=i386
MACHTYPE=i386-redhat-linux-gnu


-- John Harper, School of Mathematics Statistics and Operations Research
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail john.harper@vuw.ac.nz phone (+64)(4)463 5276 fax (+64)(4)463 5045

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trouble installing gfortran
  2012-01-12  8:32   ` John Harper
@ 2012-01-12 17:08     ` Jonathan Wakely
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2012-01-12 17:08 UTC (permalink / raw)
  To: John Harper; +Cc: gcc-help

On 11 January 2012 22:11, John Harper wrote:
> On Tue, 10 Jan 2012, Jonathan Wakely wrote:
>
> One question I have is that our systems people
> installed gfortran 4.4.4 and when I use it with -v I get inter alia
> Target: i386-redhat-linux6E
> but when I installed gfortran 4.6.2 myself on the same machine without
> specifying --target I get
> Target: i686-pc-linux-gnu
>
> Why the difference? FWIW the command   set | grep 86   gives
> HOSTTYPE=i386
> MACH=i386
> MACHTYPE=i386-redhat-linux-gnu

See http://airs.com/ian/configure/configure_4.html for info on
configuration triplets.  The differences would be more significant if
you were looking at an x86 GNU/Linux machine and e.g.
sparc64-sun-solaris2.10, but for two different triplets for an x86
there isn't a lot of difference.

The "pc" versus "redhat" manufacturer field is not usually used, it's
just descriptive.

Since GCC 4.5 the default instruction set generated by GCC on x86
depends on the machine type it is configured for, so for the GCC 4.4
installation the "i386" is merely descriptive, and of "i386", "i486",
"pentium2" etc would have been equivalent, but for GCC 4.6 it means
that GCC will generate code that assumes it will run on an i686 (or
later).  See http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
for details of how to override the default machine type with -march
option.

I don't think "linux6E" vs "linux-gnu" matters either, I think
configure scripts match on linux*

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-11 22:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-11  2:44 Trouble installing gfortran John Harper
2012-01-11  3:12 ` Jonathan Wakely
2012-01-12  8:32   ` John Harper
2012-01-12 17:08     ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).