Library error message.
Peter Morgan
petermorgan@grapevine.net.au
Thu Jan 24 07:26:00 GMT 2008
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 *
* *
***************************************
More information about the Gcc-help
mailing list