This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Library error message.


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 * * * ***************************************


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]