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

[McIDAS #CHP-794471]: ** Linker Flags - Solaris 2.10 build of McIDAS 2005



Hi Jim,

Sorry I was not able to respond yesterday...

re:
> I am attempting to build McIDAS-X 2005 on a Sun Solaris 2.10 (SPARC)
> workstation.

This is a configuration that we are not (yet) running here at the UPC, so
please keep that in mind when interpreting my comments.

> I am using the "-g77" VENDOR flag to use the GCC
> compiler that shipped with the Operating System.

OK.

> When building the package, it fails at the following:
> 
> convdlm mdxgra.dlm:             Killed
> FAILED (See '/sw/mcidas/mcidas2005/src/makelog' for details.)
> 
> The entry in the makelog shows:
> 
> ./convdlm mdxgra.dlm
> ld.so.1: convdlm: fatal: libg2c.so.0: open failed: No such file or
> directory
> convdlm mdxgra.dlm:             FAILED
> 
> 
> 
> Simple enough - my "libg2c.so.0" file is located in "/opt/sfw/lib".  I
> realize that this can be corrected by setting the following:
> 
> LD_LIBRARY_PATH    /opt/sfw/lib

GCC should know where it was installed, so it seems odd to me that it
does not know where to find one of its own libraries.  Was the GCC directory
structure modified after the installation?

> However, I would like to add the following compile flags:
> 
> -L/opt/sfw/lib -R/opt/sfw/lib

OK.

> Where is the proper place and environment variable to add these
> flags?

You will have to make modifications in two places:

- the enviornment through setting CFLAGS, etc.

- in ~mcidas/mcidas2005/src/mccomp.sh

> I attempted to set within CFLAGS and FFLAGS, but these
> variables do not seem to be passed into "mcidas2005/src/makefile".

The are not.  This is why you will need to modify mccomp.sh.

> I thought about setting a variable such as "LDFLAGS", but the
> makefile doesn't appear to search for that variable either.

Correct.  The flags needed for various OSes and compilers for
the core McIDAS code are set in mccomp.sh.

> The changes I made to CFLAGS and FFLAGS were reflected in
> files such as "mcidas2005/hdf/Makefile", but not in the
> makefile in the main source folder (mcidas2005/src/makefile).

Yup.

> I did notice a "mccomp.sh" file.   Do I need to edit this file or
> is there a way to simply pass the "-L/opt/sfw/lib -R/opt/sfw/lib"
> flags into that script which may allow it to be used when compiling
> the package?

You will need to edit the file.  Look for the 'SunOS' section (starts
at about line 748).  You will see a comment about setting some compiler
independent flags, and then a section for version 5 of the OS.  I think
you should add your defines in the same way as the other defines that
are already there:

                #-------
                # Note: you must include a corresponding -R option for
                # each -L option for directories where shared libraries
                # are found.
                #
                # The /usr/dt directories are where Motif gets installed
                # in Solaris 2.4.
                #-------

                I_opts="$I_opts -I/usr/dt/include"
                L_opts="$L_opts -R/usr/dt/lib"
                L_opts="$L_opts -L/usr/dt/lib"

                I_opts="$I_opts -I/usr/openwin/include"
                L_opts="$L_opts -R/usr/openwin/lib"
                L_opts="$L_opts -L/usr/openwin/lib"

                I_opts="$I_opts -I/usr/local/include"
                L_opts="$L_opts -R/usr/local/lib"
                L_opts="$L_opts -L/usr/local/lib"


> Any suggestions would be most appreciated.

Please try editing mccomp.sh and let me know if you run into any
problems.

One last comment:

The 'make' process converts mccomp.sh (a template) into mccomp (an
executable shell script).  Please make sure to make your modifications
in mccomps.sh not mccomp.

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: CHP-794471
Department: Support McIDAS
Priority: Normal
Status: Closed