public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Library error message.
@ 2008-01-21 11:14 Peter Morgan
  2008-01-21 13:03 ` Tim Prince
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Morgan @ 2008-01-21 11:14 UTC (permalink / raw)
  To: gcc-help

Hi
I am getting the following error messages when I attempt to run a
fortran 95 test program.

peterm@currawong ~]$ a.out
a.out: error while loading shared libraries: libg2c.so.0: cannot open
shared object file: No such file or directory

The fortran compilation is apparently error less

I have two installations of f95. One down the /opt tree and the other
down the /usr/local tree. Both give the same error message.

My .tcshrc file has the line


 set LD_LIBRARY_PATH = ( /usr/local/lib /opt/lib /usr/lib

and the echo $LD_LIBRARY_PATH yields.


[peterm@currawong ~]$ echo $LD_LIBRARY_PATH
/usr/local/lib /opt/lib /usr/lib

Sorry I cannot see my problem so appreciate comments.
Thanks




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

* Re: Library error message.
  2008-01-21 11:14 Library error message Peter Morgan
@ 2008-01-21 13:03 ` Tim Prince
  2008-01-22 11:36   ` Peter Morgan
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Prince @ 2008-01-21 13:03 UTC (permalink / raw)
  To: petermorgan; +Cc: gcc-help

Peter Morgan wrote:
> Hi
> I am getting the following error messages when I attempt to run a
> fortran 95 test program.
> 
> peterm@currawong ~]$ a.out
> a.out: error while loading shared libraries: libg2c.so.0: cannot open
> shared object file: No such file or directory
> 
> The fortran compilation is apparently error less
> 
> I have two installations of f95. One down the /opt tree and the other
> down the /usr/local tree. Both give the same error message.
> 
> My .tcshrc file has the line
> 
> 
>  set LD_LIBRARY_PATH = ( /usr/local/lib /opt/lib /usr/lib
> 
> and the echo $LD_LIBRARY_PATH yields.
> 
> 
> [peterm@currawong ~]$ echo $LD_LIBRARY_PATH
> /usr/local/lib /opt/lib /usr/lib
> 
f95 is not the normal installed name of any gnu compiler.  libg2c would
come with g77.  If you had a working 32-bit installation of g77 in one
of those places, your LD_LIBRARY_PATH should enable libg2c.so to be
found.  libg2c.so.0 might be intended to be a symlink to an actual .so
library.  In recent years, gfortran has been supported well, while g77
has had no support.  For gfortran installation, see
http://gcc.gnu.org/wiki/GFortran

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

* Re: Library error message.
  2008-01-21 13:03 ` Tim Prince
@ 2008-01-22 11:36   ` Peter Morgan
  2008-01-22 12:27     ` Tim Prince
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Morgan @ 2008-01-22 11:36 UTC (permalink / raw)
  To: Tim Prince; +Cc: gcc-help

Dear Tim
thank you for your message. My sincere apologies for not being careful 
enough in my descriptions.
I am all too aware of the frustrations and wasted time that these lapses 
of care and exactness cause. Please let me try again in greater detail.

Okay I run on a Red Hat Fedora 8 system running on an 2800+ AMD 32 bit 
processor. My standard shell is tcsh.
I have the following modules installed.

 1.   f95 which came as part of the Fedora distro. This is the ONLY 
fortran compiler that currently works on my system. It is based on GNU 4.1.2
[peterm@currawong ~]$ which f95
/usr/bin/f95
Unfortunately this compiler will not support the GAMIT GPS code. The 
main reason for this is the intrinsic functions including fseek. I did 
try to install a test 4.3 in early December hoping to bypass some 
problems but I never got a working 4.3 up.

2. g77 which is GNU 3.4.6 based. This compiler will support GAMIT up to 
10.30. It needs user intervention for the maximum number of logical 
units. I now report the same problem with this compiler that I have with 
the GNU 4.2 compilers. Before December 2007, when I ran a Fedora 7 
system this compiler was operational.
Here are the three command sequences that show the installation and run 
attempt of g77

[peterm@currawong ~]$ which g77
/usr/local/bin/g77

[root@currawong /]
# find . -name libg2c.so -print
./usr/local/lib/libg2c.so
./usr/local/gcc-3.4.6/i686-pc-linux-gnu/libf2c/.libs/libg2c.so

[peterm@currawong ~]$ g77 testg77.f
[peterm@currawong ~]$ a.out
a.out: error while loading shared libraries: libg2c.so.0: cannot open 
shared object file: No such file or directory


3. gfortran which is based on GNU 4.2.2. This compiler was working on my 
Fedora 7 system. I had an important task  for all of December so the 
system work kind of got pushed to the side immediately after putting up 
Fedora 8.

I have installations in  my /opt branch and my /usr/local branch. I 
point to the /opt branch.
[peterm@currawong ~]$ which gfortran
/opt/bin/gfortran

Then
 [root@currawong /]# find . -name "libgfortran*" -print
./media/Fedora 8 i386 DVD/Packages/libgfortran-4.1.2-33.i386.rpm
./media/Fedora 8 i386 DVD/repoview/libgfortran.html
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/libgfortranbegin.la
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/libgfortran.la
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.so.2
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortranbegin.la
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.la
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortranbegin.lai
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortranbegin.a
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.lai
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.so
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.so.2.0.0
./opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.a
./opt/gnu/gcc-4.2.2_source/libgfortran
./opt/gnu/gcc-4.2.2_source/libgfortran/libgfortran.h
./opt/lib/libgfortran.so.2
./opt/lib/gcc/i686-pc-linux-gnu/4.2.2/libgfortranbegin.la
./opt/lib/gcc/i686-pc-linux-gnu/4.2.2/libgfortranbegin.a
./opt/lib/libgfortran.la
./opt/lib/libgfortran.so
./opt/lib/libgfortran.so.2.0.0
./opt/lib/libgfortran.a
./usr/lib/libgfortran.so.1.0.0
./usr/lib/libgfortran.so.1

but

[peterm@currawong ~]$ gfortran testgfortran.f
[peterm@currawong ~]$ a.out
a.out: error while loading shared libraries: libgfortran.so.2: cannot 
open shared object file: No such file or directory

So it appears that it cannot find the libraries either.


The output from
[peterm@currawong ~]$ echo $LD_LIBRARY_PATH
/usr/local/lib /opt/lib /usr/lib

I trust that this is a better description of my problems.
I know that my colleagues at MIT who are on a Fedora 6 system have none 
of the problems that I am now experiencing. They are unable to help at 
this instant.

regards
Peter


Tim Prince wrote:
> Peter Morgan wrote:
>   
>> Hi
>> I am getting the following error messages when I attempt to run a
>> fortran 95 test program.
>>
>> peterm@currawong ~]$ a.out
>> a.out: error while loading shared libraries: libg2c.so.0: cannot open
>> shared object file: No such file or directory
>>
>> The fortran compilation is apparently error less
>>
>> I have two installations of f95. One down the /opt tree and the other
>> down the /usr/local tree. Both give the same error message.
>>
>> My .tcshrc file has the line
>>
>>
>>  set LD_LIBRARY_PATH = ( /usr/local/lib /opt/lib /usr/lib
>>
>> and the echo $LD_LIBRARY_PATH yields.
>>
>>
>> [peterm@currawong ~]$ echo $LD_LIBRARY_PATH
>> /usr/local/lib /opt/lib /usr/lib
>>
>>     
> f95 is not the normal installed name of any gnu compiler.  libg2c would
> come with g77.  If you had a working 32-bit installation of g77 in one
> of those places, your LD_LIBRARY_PATH should enable libg2c.so to be
> found.  libg2c.so.0 might be intended to be a symlink to an actual .so
> library.  In recent years, gfortran has been supported well, while g77
> has had no support.  For gfortran installation, see
> http://gcc.gnu.org/wiki/GFortran
>
>   

-- 
***************************************
*                                     *
*  Peter and Carol Morgan             *
*  20 Goodparla St                    *
*  Hawker, ACT, 2614                  *
*  Australia                          *
*                                     *
* Home Phone      +61 (0)2 6254 0137  *
* Peter's Mobile  +61 (0)4 1854 0137  *
*                                     *
***************************************

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

* Re: Library error message.
  2008-01-22 11:36   ` Peter Morgan
@ 2008-01-22 12:27     ` Tim Prince
  2008-01-24  7:26       ` Peter Morgan
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Prince @ 2008-01-22 12:27 UTC (permalink / raw)
  To: Peter Morgan; +Cc: gcc-help

Peter Morgan wrote:
> Dear Tim
> thank you for your message. My sincere apologies for not being careful
> enough in my descriptions.
> I am all too aware of the frustrations and wasted time that these lapses
> of care and exactness cause. Please let me try again in greater detail.
> 
> Okay I run on a Red Hat Fedora 8 system running on an 2800+ AMD 32 bit
> processor. My standard shell is tcsh.
> I have the following modules installed.
> 
> 1.   f95 which came as part of the Fedora distro. This is the ONLY
> fortran compiler that currently works on my system. It is based on GNU
> 4.1.2
> [peterm@currawong ~]$ which f95
> /usr/bin/f95
> Unfortunately this compiler will not support the GAMIT GPS code. The
> main reason for this is the intrinsic functions including fseek. I did
> try to install a test 4.3 in early December hoping to bypass some
> problems but I never got a working 4.3 up.
> 
> 2. g77 which is GNU 3.4.6 based. This compiler will support GAMIT up to
> 10.30. It needs user intervention for the maximum number of logical
> units. I now report the same problem with this compiler that I have with
> the GNU 4.2 compilers. Before December 2007, when I ran a Fedora 7
> system this compiler was operational.
> Here are the three command sequences that show the installation and run
> attempt of g77
> 
> [peterm@currawong ~]$ which g77
> /usr/local/bin/g77
> 
> [root@currawong /]
> # find . -name libg2c.so -print
> ../usr/local/lib/libg2c.so
> ../usr/local/gcc-3.4.6/i686-pc-linux-gnu/libf2c/.libs/libg2c.so
> 
> [peterm@currawong ~]$ g77 testg77.f
> [peterm@currawong ~]$ a.out
> a.out: error while loading shared libraries: libg2c.so.0: cannot open
> shared object file: No such file or directory
> 
> 
> 3. gfortran which is based on GNU 4.2.2. This compiler was working on my
> Fedora 7 system. I had an important task  for all of December so the
> system work kind of got pushed to the side immediately after putting up
> Fedora 8.
> 
> I have installations in  my /opt branch and my /usr/local branch. I
> point to the /opt branch.
> [peterm@currawong ~]$ which gfortran
> /opt/bin/gfortran
> 
> Then
> [root@currawong /]# find . -name "libgfortran*" -print
> ../media/Fedora 8 i386 DVD/Packages/libgfortran-4.1.2-33.i386.rpm
> ../media/Fedora 8 i386 DVD/repoview/libgfortran.html
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/libgfortranbegin.la
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/libgfortran.la
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.so.2
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortranbegin.la
> 
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.la
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortranbegin.lai
> 
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortranbegin.a
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.lai
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.so
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.so.2.0.0
> 
> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.a
> ../opt/gnu/gcc-4.2.2_source/libgfortran
> ../opt/gnu/gcc-4.2.2_source/libgfortran/libgfortran.h
> ../opt/lib/libgfortran.so.2
> ../opt/lib/gcc/i686-pc-linux-gnu/4.2.2/libgfortranbegin.la
> ../opt/lib/gcc/i686-pc-linux-gnu/4.2.2/libgfortranbegin.a
> ../opt/lib/libgfortran.la
> ../opt/lib/libgfortran.so
> ../opt/lib/libgfortran.so.2.0.0
> ../opt/lib/libgfortran.a
> ../usr/lib/libgfortran.so.1.0.0
> ../usr/lib/libgfortran.so.1
> 
> but
> 
> [peterm@currawong ~]$ gfortran testgfortran.f
> [peterm@currawong ~]$ a.out
> a.out: error while loading shared libraries: libgfortran.so.2: cannot
> open shared object file: No such file or directory
> 
> So it appears that it cannot find the libraries either.
> 
> 
> The output from
> [peterm@currawong ~]$ echo $LD_LIBRARY_PATH
> /usr/local/lib /opt/lib /usr/lib
> 
> I trust that this is a better description of my problems.
> I know that my colleagues at MIT who are on a Fedora 6 system have none
> of the problems that I am now experiencing. They are unable to help at
> this instant.
>
I suppose your f95 may be the g95 compiler.  As that compiler isn't part
 of gnu gcc, you would have to ask questions on its own list.
Neither gfortran nor g95 includes library support for g77.

It does appear that you have g77 installed in /usr/local, and so an
executable built with g77 dynamic run-time library should run if you
have set /usr/local/lib in LD_LIBRARY_PATH.  It looks as if you have at
least some bits of a full gcc/g77 build in /usr/lib/gcc-3.4.6/.  If it's
all there, you should be able to rebuild and re-install from that directory.

Similarly, with your gfortran installation, you would need /opt/lib in
LD_LIBRARY_PATH for running dynamic linked executables.
It appears you may have some bits of a gcc/gfortran build in /opt/lib/gcc/.
It appears that your directory /opt/gnu/gcc-4.2.2/ is set up to build
gcc/gfortran from the source in /opt/gnu/gcc-4.2.2_source/  That
directory could be configured so as to install into /opt.
Apparently, you also have .rpm for installing the pre-built libgfortran
for 4.1.2.

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

* Re: Library error message.
  2008-01-22 12:27     ` Tim Prince
@ 2008-01-24  7:26       ` Peter Morgan
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Morgan @ 2008-01-24  7:26 UTC (permalink / raw)
  To: Tim Prince; +Cc: gcc-help

Dear Tim
Thanks for the notes.
I have resolved the problem. The problem was not the incorrect 
installation of the GNU compiler suite but the correct linking of the 
installed libraries. My solution to the problem was very simple in the 
end. I added two files to ld.so.conf.d
The first, usr-local-lib.conf contained the line /usr/local/lib
The second, opt-local.conf contained the line /opt/local

I then ran ldconfig which is in sbin. If you use the -v option you 
actually see what is in the cache, /etc/ld.so.cache.

Everything is fine now.

thanks for the notes.
Peter

Tim Prince wrote:
> Peter Morgan wrote:
>   
>> Dear Tim
>> thank you for your message. My sincere apologies for not being careful
>> enough in my descriptions.
>> I am all too aware of the frustrations and wasted time that these lapses
>> of care and exactness cause. Please let me try again in greater detail.
>>
>> Okay I run on a Red Hat Fedora 8 system running on an 2800+ AMD 32 bit
>> processor. My standard shell is tcsh.
>> I have the following modules installed.
>>
>> 1.   f95 which came as part of the Fedora distro. This is the ONLY
>> fortran compiler that currently works on my system. It is based on GNU
>> 4.1.2
>> [peterm@currawong ~]$ which f95
>> /usr/bin/f95
>> Unfortunately this compiler will not support the GAMIT GPS code. The
>> main reason for this is the intrinsic functions including fseek. I did
>> try to install a test 4.3 in early December hoping to bypass some
>> problems but I never got a working 4.3 up.
>>
>> 2. g77 which is GNU 3.4.6 based. This compiler will support GAMIT up to
>> 10.30. It needs user intervention for the maximum number of logical
>> units. I now report the same problem with this compiler that I have with
>> the GNU 4.2 compilers. Before December 2007, when I ran a Fedora 7
>> system this compiler was operational.
>> Here are the three command sequences that show the installation and run
>> attempt of g77
>>
>> [peterm@currawong ~]$ which g77
>> /usr/local/bin/g77
>>
>> [root@currawong /]
>> # find . -name libg2c.so -print
>> ../usr/local/lib/libg2c.so
>> ../usr/local/gcc-3.4.6/i686-pc-linux-gnu/libf2c/.libs/libg2c.so
>>
>> [peterm@currawong ~]$ g77 testg77.f
>> [peterm@currawong ~]$ a.out
>> a.out: error while loading shared libraries: libg2c.so.0: cannot open
>> shared object file: No such file or directory
>>
>>
>> 3. gfortran which is based on GNU 4.2.2. This compiler was working on my
>> Fedora 7 system. I had an important task  for all of December so the
>> system work kind of got pushed to the side immediately after putting up
>> Fedora 8.
>>
>> I have installations in  my /opt branch and my /usr/local branch. I
>> point to the /opt branch.
>> [peterm@currawong ~]$ which gfortran
>> /opt/bin/gfortran
>>
>> Then
>> [root@currawong /]# find . -name "libgfortran*" -print
>> ../media/Fedora 8 i386 DVD/Packages/libgfortran-4.1.2-33.i386.rpm
>> ../media/Fedora 8 i386 DVD/repoview/libgfortran.html
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/libgfortranbegin.la
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/libgfortran.la
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.so.2
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortranbegin.la
>>
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.la
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortranbegin.lai
>>
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortranbegin.a
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.lai
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.so
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.so.2.0.0
>>
>> ../opt/gnu/gcc-4.2.2/i686-pc-linux-gnu/libgfortran/.libs/libgfortran.a
>> ../opt/gnu/gcc-4.2.2_source/libgfortran
>> ../opt/gnu/gcc-4.2.2_source/libgfortran/libgfortran.h
>> ../opt/lib/libgfortran.so.2
>> ../opt/lib/gcc/i686-pc-linux-gnu/4.2.2/libgfortranbegin.la
>> ../opt/lib/gcc/i686-pc-linux-gnu/4.2.2/libgfortranbegin.a
>> ../opt/lib/libgfortran.la
>> ../opt/lib/libgfortran.so
>> ../opt/lib/libgfortran.so.2.0.0
>> ../opt/lib/libgfortran.a
>> ../usr/lib/libgfortran.so.1.0.0
>> ../usr/lib/libgfortran.so.1
>>
>> but
>>
>> [peterm@currawong ~]$ gfortran testgfortran.f
>> [peterm@currawong ~]$ a.out
>> a.out: error while loading shared libraries: libgfortran.so.2: cannot
>> open shared object file: No such file or directory
>>
>> So it appears that it cannot find the libraries either.
>>
>>
>> The output from
>> [peterm@currawong ~]$ echo $LD_LIBRARY_PATH
>> /usr/local/lib /opt/lib /usr/lib
>>
>> I trust that this is a better description of my problems.
>> I know that my colleagues at MIT who are on a Fedora 6 system have none
>> of the problems that I am now experiencing. They are unable to help at
>> this instant.
>>
>>     
> I suppose your f95 may be the g95 compiler.  As that compiler isn't part
>  of gnu gcc, you would have to ask questions on its own list.
> Neither gfortran nor g95 includes library support for g77.
>
> It does appear that you have g77 installed in /usr/local, and so an
> executable built with g77 dynamic run-time library should run if you
> have set /usr/local/lib in LD_LIBRARY_PATH.  It looks as if you have at
> least some bits of a full gcc/g77 build in /usr/lib/gcc-3.4.6/.  If it's
> all there, you should be able to rebuild and re-install from that directory.
>
> Similarly, with your gfortran installation, you would need /opt/lib in
> LD_LIBRARY_PATH for running dynamic linked executables.
> It appears you may have some bits of a gcc/gfortran build in /opt/lib/gcc/.
> It appears that your directory /opt/gnu/gcc-4.2.2/ is set up to build
> gcc/gfortran from the source in /opt/gnu/gcc-4.2.2_source/  That
> directory could be configured so as to install into /opt.
> Apparently, you also have .rpm for installing the pre-built libgfortran
> for 4.1.2.
>
>
>   

-- 
***************************************
*                                     *
*  Peter and Carol Morgan             *
*  20 Goodparla St                    *
*  Hawker, ACT, 2614                  *
*  Australia                          *
*                                     *
* Home Phone      +61 (0)2 6254 0137  *
* Peter's Mobile  +61 (0)4 1854 0137  *
*                                     *
***************************************

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

end of thread, other threads:[~2008-01-23  5:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-21 11:14 Library error message Peter Morgan
2008-01-21 13:03 ` Tim Prince
2008-01-22 11:36   ` Peter Morgan
2008-01-22 12:27     ` Tim Prince
2008-01-24  7:26       ` Peter Morgan

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).