[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[McIDAS #YXD-786071]: Installation trouble : Can't locate file for: -lcc_dynamic



Hi Gautam,

NOTE: the reply below is _long_!  I am using it to document what was
happening on your machine mostly for myself.

re: 
> I looked for libgcc, I found the following files which might be
> relevant (not sure)
> 
> $ ls /usr/lib/libgc*
> /usr/lib/libgcc_s.1.0.dylib             /usr/lib/
> libgcc_s_ppc64.1.0.dylib
> /usr/lib/libgcc_s.1.dylib               /usr/lib/libgcc_s_ppc64.1.dylib
> ls /sw/lib/libgc*
> /sw/lib/libgck-1.2.5.0.0.5.dylib        /sw/lib/libgck-1.2.5.0.dylib

This is not what was needed; please see below.

> I tried compiling the code with relevant lib paths, but this doesn't
> seem to solve the issue.

I found the relevant library path to search; please read on.

> Regarding the SSH access to our machine, here is the relevant info,
> which I hope you would use with discretion:

Thanks!  Allowing me access to your machine was absolutely necessary
to find out what was going on.

> Our machine was once compromised and I hope that you will understand
> our concerns in this regard.

No worries.  The login will not be used by anyone but me.

Here goes:

After logging on, I did the following to become acquainted with your
setup:

- ran 'env' -> this told me that various environment variables used
  in the McIDAS build were not set (e.g., VENDOR, CC, etc.).

  I see that you set McIDAS defines in the file ~/.bash_profile.  I suggest
  that you remove those defines, and add the following to .bashrc instead:

# McINST_ROOT and VENDOR conforming shell defines needed to bulid McIDAS
McINST_ROOT=$HOME
VENDOR=-g77
export McINST_ROOT VENDOR
if [ -e $HOME/admin/mcidas_env.sh ]; then
  . $HOME/admin/mcidas_env.sh
fi

  I 'sourced' the definitions in ~mcidas/admin/mcidas_env.sh by hand using:

cd ~mcidas
. admin/mcidas_env.sh

- next, I wanted to watch as a build failed:

cd mcidas2005/src
make clobber
make

  As expected, the build failed when trying to link 'convdlm', and the error
  message was exactly the same as you reported: can't find '-lgcc'

- I decided to check the LD_LIBRARY_PATH environment variable.  It was
  set to only search an Absoft directory.  I changed this to search the
  library where I found libgcc.a:
  
export LD_LIBRARY_PATH=/usr/lib/gcc/powerpc-apple-darwin8/4.0.0:/usr/lib

  Of course, LD_LIBRARY_PATH is only used to find dynamic libraries, so
  I did not expect this to solve the "can't find '-lgcc'" error

- next, I checked to see what versions of gcc and g77 you would use:

lena:~/mcidas2005/src mcidas$ gcc --version
powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 20041026 (Apple Computer, Inc. 
build 4061)
Copyright (C) 2004 Free Software Foundation, Inc.

lena:~/mcidas2005/src mcidas$ g77 --version
GNU Fortran (GCC) 3.4.3
Copyright (C) 2004 Free Software Foundation, Inc.

- I used the Unix 'locate' command to find all occurrances of 'libgcc':

lena:~/mcidas2005/src mcidas$ locate libgcc
/sw/g95/lib/gcc-lib/powerpc-apple-darwin6.8/4.0.3/libgcc.a
/sw/g95/lib/gcc-lib/powerpc-apple-darwin6.8/4.0.3/libgcc_eh.a
/sw/g95/lib/gcc-lib/powerpc-apple-darwin6.8/4.0.3/libgcc_s.1.0.dylib
/sw/g95/lib/gcc-lib/powerpc-apple-darwin6.8/4.0.3/libgcc_s.dylib
/sw/lib/gcc/powerpc-apple-darwin8.0.0/3.4.3/libgcc.a
/usr/lib/gcc/darwin/3.3/libgcc.a
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/libgcc.a
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/libgcc_eh.a
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/libgcc_s.dylib
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/libgcc_static.a
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/libgcc_s_ppc64.dylib
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/ppc64/libgcc.a
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/ppc64/libgcc_eh.a
/usr/lib/gcc-lib/powerpc-apple-darwin6.8/4.0.3/libgcc.a
/usr/lib/gcc-lib/powerpc-apple-darwin6.8/4.0.3/libgcc_eh.a
/usr/lib/gcc-lib/powerpc-apple-darwin6.8/4.0.3/libgcc_s.1.0.dylib
/usr/lib/gcc-lib/powerpc-apple-darwin6.8/4.0.3/libgcc_s.dylib
/usr/lib/libgcc_s.1.0.dylib
/usr/lib/libgcc_s.1.dylib
/usr/lib/libgcc_s_ppc64.1.0.dylib
/usr/lib/libgcc_s_ppc64.1.dylib
/Volumes/Data/COPY/lib/gcc/powerpc-apple-darwin8.0.0/3.4.3/libgcc.a

  Seeing that libgcc.a for gcc version 4.0.0 is located in
  /usr/lib/gcc/powerpc-apple-darwin8/4.0.0, and knowing that
  gcc was _unexpectedly_ not searching this library, I decided
  to force its use by modifying ~mcidas/mcidas2005/src/mccomp.sh:

  At line 1030, change:

  L_opts="$L_opts -L/usr/X11R6/lib"

  to:

  L_opts="$L_opts -L/usr/X11R6/lib -L/usr/lib/gcc/powerpc-apple-darwin8/4.0.0"

After the last change, I reran 'make'.  This time, 'convdlm' linked successfully
and the build proceeded without error until 'mcwish' was attempted to be linked:
compile wishcrex.c:             done
compile wisherrh.c:             done
compile wishinit.c:             done
compile wishmcid.c:             done
compile wishrglb.c:             done
compile wishutil.c:             done
compile wishxinf.c:             done
compile wishxwin.c:             done
compile tkAppInit.c:            done
link    mcwish:                 FAILED (See 
'/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/mcidas2005/src/makelog'
 for details.)

From the 'makelog', the problem was reported to be:

./tclcomp ./mccomp -O -s -g77 -o mcwish wishcrex.o wisherrh.o wishinit.o 
wishmcid.o wishrglb.o wishutil.o wishxinf.o wishxwin.o tkAppInit.o -L. -lmcidas
mccomp: Using default optimizations
g77 -framework CoreFoundation -O -o mcwish wishcrex.o wisherrh.o wishinit.o 
wishmcid.o wishrglb.o wishutil.o wishxinf.o wishxwin.o tkAppInit.o -L. 
-L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/mcidas2005/tk/unix
 
-L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/mcidas2005/tcl/unix
 -L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/tcl/lib 
-L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/tcl/lib 
-L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/tcl/lib 
-L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/tcl/lib 
-L/usr/X11R6/lib -L/usr/X11R6/lib -L/usr/lib/gcc/powerpc-apple-darwin8/4.0.0 
-lmcidas -ltk8.4 -ltcl8.4 -lX11 -lgcc_g77 -lm
g77: CoreFoundation: No such file or directory
link    mcwish:                 FAILED

The 'CoreFoundation' error was one that another user reported very recently.

Just to see if I could get the build to continue to the end, I linked 'mcwish' 
by
hand:

g77 -O -o mcwish wishcrex.o wisherrh.o wishinit.o wishmcid.o wishrglb.o 
wishutil.o wishxinf.o wishxwin.o tkAppInit.o -L. 
-L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/mcidas2005/tk/unix
 
-L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/mcidas2005/tcl/unix
 -L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/tcl/lib 
-L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/tcl/lib 
-L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/tcl/lib 
-L/Network/Servers/headnode.cluster.lan/Volumes/Data/Home/mcidas/tcl/lib 
-L/usr/X11R6/lib -L/usr/X11R6/lib -L/usr/lib/gcc/powerpc-apple-darwin8/4.0.0 
-lmcidas -ltk8.4 -ltcl8.4 -lX11 -lgcc_g77 -lm

There were lots of warnings, but no errors.

Continuing on with 'make' led to a complete build.  For the heck of it, I 
decided
to see if the XCD (decoder) component of the distribution would build:

make xcd

It proceeded to the end with no errors.

Next, I installed the build:

make install.all

This worked fine also.  After the installation, I decided to exercise 
remote addess to a well known ADDE server:

cd ~mcidas/workdata
dataloc.k ADD GOESEAST unidata2.ssec.wisc.edu

Group Name                    Server IP Address
--------------------         ----------------------------------------
GOESEAST                     UNIDATA2.SSEC.WISC.EDU

<LOCAL-DATA> indicates that data will be accessed from the local data 
directory.DATALOC -- done
lena:~/workdata mcidas$ dsinfo.k I GOESEAST

        Dataset Names of Type: IMAGE in Group: GOESEAST

Name         NumPos   Content
------------ ------   --------------------------------------
IMAGES         289    GOES-East Western Hemisphere Image Sectors
WH-1KVIS        50    GOES-East Western Hemisphere 1 km 0.65 um VIS
WH-4K39         24    GOES-East Western Hemisphere 4 km 3.9 um SHORT IR
WH-4KCO2        24    GOES-East Western Hemisphere 4 km 13.3 um CO2
WH-4KIR         24    GOES-East Western Hemisphere 4 km 10.7 um THERMAL IR
WH-4KVIS        24    GOES-East Western Hemisphere 4 km 0.65 um VIS
WH-4KWV         24    GOES-East Western Hemisphere 4 km 6.5 um WATER VAPOR

DSINFO -- done

This shows that the code just built works, and you can access data outside
of your domain.

So, the questions now are:

1) why 'gcc' did not know where its own library was installed
2) how to resolve the CoreFoundation issue in the link of 'mcwish'

I did a Google (tm) search using 'tcl corefoundation' and found a
TclTk document that told how to turn off building a CoreFoundation
API ('--disable-corefoundation').  I added this to the TclTk configure/build
script in McIDAS, ~/mcidas2005/src/tclcomp.sh:

     68 Darwin)
     69         shared="--disable-shared --disable-corefoundation"

I then decided to try a clean build from scratch:

make clobber
make all

I then started getting 'stale NFS handle' errors (which have nothing to
do with McIDAS, of course).  I waited a few minutes and then tried
the build again.  This time the build succeeded without stopping.

RECAP:

1) the McIDAS-X distribution you downloaded originally had an error in
   ~mcidas/mcidas2005/src/mccomp.sh. The error was the incorrect inclusion
   of the line:
   
   l_opts="$l_opts -lcc_dynamic -lICE -lSM"

   This has been removed from the latest release of Undiata McIDAS-X, v2005c

2) for a reason as yet unknown to me, your installation of 'gcc' does not
   know where its own library is installed.  This strikes me as being
   a gcc installation error, but I will research this more.

3) the Tcl and Tk configure script was building the CoreFoundation API
   by default.  Since this needs to be turned off, I will update the
   copy of ~mcidas/mcidas2005/src/tclcomp.sh in the distribution
   with the mod I made on your machine.

The next step is you to complete the configuration of your installation and
then exercise the various capabilities to make sure that nothing is amiss.







Cheers,

Tom
****************************************************************************
Unidata User Support                                    UCAR Unidata Program
(303) 497-8642                                                 P.O. Box 3000
address@hidden                                   Boulder, CO 80307
----------------------------------------------------------------------------
Unidata HomePage                       http://www.unidata.ucar.edu
****************************************************************************


Ticket Details
===================
Ticket ID: YXD-786071
Department: Support McIDAS
Priority: Normal
Status: Closed