(no subject)

From: Samuel H. Dupree, Jr. (sdupree AT XXXXXX)
Date: Mon Jul 12 2004 - 22:28:41 MDT

  • Next message: Don Morton: "Linux and Intel Compilers"

    Mary Haley wrote:

    >>I've just downloaded and installed NCAR Graphics ver. 4.3.1 onto my Mac
    >>G4. I'm running Mac OS 10.3.4, and I also have XonX (XFree86 v. 4.3.0)
    >>installed. I'm running Absoft Fortran 8.2. My problem is attempting to
    >>run example cpex08.
    >>
    >>First, I noticed that ncargex attempts to compile cpex08.f and cpexcc.f
    >>as a Fortran 90 sources as opposed to Fortran 77 source members.
    >>
    >>
    >
    >Hi Sam,
    >
    >I think this is just because "ncargex" is using "ncargf90" as its
    >default script to use for compiling a program. There should be an
    >"ncargf77" script you can use, that invokes f77 instead. See below.
    >
    >
    >
    >> Second, the compile and link fail due to unresolved references. The listing
    >>below shows my attempted compile and link:
    >> .
    >> .
    >> .
    >>Compiling and linking...
    >>f90 -s -YEXT_NAMES=LCS -YCOM_NAMES=LCS -YCOM_PFX=_ -YCOM_SFX=_ -B108 -O
    >>-o cpex08 cpexcc.f cpex08.f -L/Applications/ncarg/lib -L/usr/X11R6/lib
    >>-lncarg -lncarg_gks -lncarg_c -lXpm -lX11 -lXext
    >>ld: Undefined symbols:
    >>___ftof
    >>___casgn
    >>___cheq
    >>.
    >>.
    >>.
    >>The compile and link failed.
    >>
    >>
    >>
    >
    >I think you might just be missing a system library here. Perhaps you
    >need to load an additional Absoft library? I don't remember what
    >version of Absoft NCAR Graphics was built with, but chances are you
    >have a newer version. This sometimes this causes a slight
    >incompatibility, which you may be seeing here. I think if you pull in
    >the necessary system libraries, you might be okay.
    >
    >
    >
    >>It looks as if ncargex accesses a makefile I cannot find in the NCAR
    >>Graphics installation. The questions I have are:
    >>
    >>
    >
    >"ncargex" doesn't access a Makefile. It calls "ncargf90" (or
    >"ncargf77") which is just a C-shell script for compiling NCAR Graphics
    >programs.
    >
    >
    >
    >> - where is the makefile and how can I modify it?
    >>
    >>
    >
    >Take a look at $NCARG_ROOT/bin/ncargf90 and/or
    >$NCARG_ROOT/bin/ncargf77. One of these scripts are the ones being
    >used to compile your program. You can edit them and add/remove
    >compiler options, libraries, etc as necessary.
    >
    >
    >
    >> - what do I need to fix to successfully compile
    >>and link this (cpex08) and other examples?
    >>
    >>
    >
    >Please see the above about system libraries.
    >
    >
    >
    >> - when I want to use NCAR Graphics from a user's
    >>developed code, what need to do to
    >> make NCAR Graphics work?
    >>
    >>
    >
    >I believe once you get the ncargf77 and/or ncargf90 scripts tuned for
    >your system, then users will be able to use these scripts to compile
    >their NCAR Graphics programs. For example:
    >
    > ncargf77 cpex08.f cpexcc.f -o cpex08
    >
    >
    >>Looking forward to hearing from you and thanks in advance.
    >>
    >>Sam Dupree.
    >>
    >>
    >
    >Hope this helps you get started.
    >
    >--Mary
    >
    >
    >
    >
    >>_______________________________________________
    >>ncarg-talk mailing list
    >>ncarg-talk@ucar.edu
    >>http://mailman.ucar.edu/mailman/listinfo/ncarg-talk
    >>
    >>
    >>

    Mary,

    I took your advice and mmodified the ncargf77 makefile (see below).
    However, for whatever reason I'm getting beaucoup undefined
    references in the compiler/linker output (included in this note). In
    doing a little detective work, most (if not all) of these routines are
    Fortran routines and should be included in libncarg.a. What am I doing
    wrong?

    Looking forward to hearing from you.

    Sam Dupree.

    P.S. - Recall, I'm running Mac OS 10.3.4 on a G4 Mac. I also have XonX
    (XFree86 v. 4.3.0) installed. I'm running Absoft Fortran 8.2.

    = = = c o m p i l e r a n d l i n k e r o u t p u t b e g
    i n n i n g = = =

    [dsl092-237-075:~] samueldu% ncargex cpex08

    NCAR Graphics Fortran Example <cpex08>

      Copying cpex08.f

      Copying cpexcc.f

    Compiling and linking...
    f77 -s -O -o cpex08 cpexcc.f cpex08.f
    -L/Applications/ncarg/lib/libncarg.a
    -L/Applications/ncarg/lib/libncarg_gks.a
    -L/Applications/ncarg/lib/libncarg_c.a
    -L/Applications/ncarg/lib/libngmath.a -L/usr/X11R6/lib -lXpm -lX11 -lXext
    FORTRAN 77 Compiler 8.2a, Copyright (c) 1987-2003, Absoft Corp.
    FORTRAN 77 Compiler 8.2a, Copyright (c) 1987-2003, Absoft Corp.
    ld: Undefined symbols:
    _CPGETI
    _GETSET
    _GSCR
    _PCGETI
    _PCGETR
    _PCSETI
    _PLCHHQ
    _PLOTIF
    _SET
    _ARINAM
    _ARSCAM
    _CPCLAM
    _CPCLDM
    _CPRECT
    _CPSETI
    _CPSETR
    _FRAME
    _GACWK
    _GCLKS
    _GCLWK
    _GDAWK
    _GFA
    _GOPKS
    _GOPWK
    _GPL
    _GSASF
    _GSCLIP
    _GSFACI
    _GSFAIS
    _GSPLCI
    _LBLBAR
    _LBSETI
    _MAPACI
    _MAPBLA
    _MAPGRM
    _MAPINT
    _MAPIQA
    _MAPITA
    _MAPLOT
    _MAPPOS
    _MAPROJ
    _MAPSET
    _MAPSTC
    _MAPSTI
    /tmp/a9MYk0/cpexcc.o reference to undefined _CPGETI
    /tmp/a9MYk0/cpexcc.o reference to undefined _GETSET
    /tmp/a9MYk0/cpexcc.o reference to undefined _GSCR
    /tmp/a9MYk0/cpexcc.o reference to undefined _PCGETI
    /tmp/a9MYk0/cpexcc.o reference to undefined _PCGETR
    /tmp/a9MYk0/cpexcc.o reference to undefined _PCSETI
    /tmp/a9MYk0/cpexcc.o reference to undefined _PLCHHQ
    /tmp/a9MYk0/cpexcc.o reference to undefined _PLOTIF
    /tmp/a9MYk0/cpexcc.o reference to undefined _SET
    /tmp/a9MYk0/cpex08.o reference to undefined _ARINAM
    more references to undefined symbols ...
    link failed.

    The compile and link failed.

    = = = c o m p i l e r a n d l i n k e r o u t p u t e n d
    i n g = = =

    = = = n c a r g f 7 7 M a k e f i l e b e g i n n i n g = = =

    #!/bin/csh -f
    #
    # $Id: ncargf77.csh,v 1.33 2002/05/30 20:55:19 haley Exp $
    #
    # Copyright (C) 2000
    # University Corporation for Atmospheric Research
    # All Rights Reserved
    #
    # This file is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published
    # by the Free Software Foundation; either version 2 of the License,
    # or (at your option) any later version.
    #
    # This software is distributed in the hope that it will be useful, but
    # WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    # General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this software; if not, write to the Free Software
    # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
    # USA.
    #

    #*********************************************#
    # #
    # Make sure NCARG_ROOT is set for this script #
    # #
    #*********************************************#
    setenv NCARG_ROOT `ncargpath root`

    if ($status != 0) then
        exit 1
    endif

    set syslibdir = "-L/usr/X11R6/lib"
    set xlib = "-lXpm -lX11 -lXext"
    set system = "DARWIN"
    set fortran = "f77"
    # set loadflags = "-s -YEXT_NAMES="LCS" -YCOM_NAMES="LCS" -YCOM_PFX="_"
    -YCOM_SFX="_" -B108 -O "
    set loadflags = "-s -O "
    set libdir = `ncargpath lib`
    set ro = "$libdir/ncarg/robj"
    set libpath = "-L$libdir $syslibdir"

    set libextra = ""

    if (! -d "$libdir") then
      echo "Library directory <$libdir> does not exist."
      exit 1
    endif

    set newargv = "$fortran $loadflags"

    set ctrans_libs = ""
    set stub_file = ""

    #
    # set up default libraries
    #
    set libncarg = "-lncarg"
    set libgks = "-lncarg_gks"
    set libncarg_c = "-lncarg_c"
    set libmath = "-lngmath"

    set smooth = "$ro/libdashsmth.o"
    set quick = "$ro/libdashline.o $ro/libconrcqck.o $ro/libconraq.o"
    set super = "$ro/libdashsupr.o $ro/libconrcspr.o $ro/libconras.o"

    set robjs

    foreach arg ($argv)

        switch ($arg)

        case "-ngmath":
          set libmath = "-lngmath"
          breaksw

        case "-sungks":
            echo "Using Sun GKS"
            set libgks="-lgks77 -lgks -lsuntool -lsunwindow -lpixrect -lm"
            breaksw

        case "-smooth":
            echo "Smooth f90 of NCAR Graphics"
            set robjs = "$robjs $smooth"
            breaksw

        case "-super":
            echo "Super f90 of NCAR Graphics"
            set robjs = "$robjs $super"
            breaksw

        case "-quick":
            echo "Quick f90 of NCAR Graphics"
            set robjs = "$robjs $quick"
            breaksw

        case "-agupwrtx":
            echo "Autograph with PWRITX"
            set robjs = "$robjs $ro/libagupwrtx.o"
            breaksw

        case "-conransmooth":
            echo "Smooth Conran"
            set robjs = "$robjs $smooth"
            breaksw

        case "-conranquick":
            echo "Quick Conran"
            set robjs = "$robjs $ro/libconraq.o"
            breaksw

        case "-conransuper":
            echo "Super Conran"
            set robjs = "$robjs $ro/libconras.o $ro/libdashsupr.o"
            breaksw

        case "-conrecsmooth":
            echo "Smooth Conrec"
            set robjs = "$robjs $ro/libdashsmth.o"
            breaksw

        case "-conrecquick":
            echo "Quick Conrec"
            set robjs = "$robjs $ro/libconrcqck.o"
            breaksw

        case "-conrecsuper":
            echo "Super Conrec"
            set robjs = "$robjs $ro/libconrcspr.o $ro/libdashsupr.o"
            breaksw

        case "-dashsmooth":
            echo "Smooth Dash"
            set robjs = "$robjs $ro/libdashsmth.o"
            breaksw

        case "-dashquick":
        case "-dashline":
            echo "Quick Dash"
            set robjs = "$robjs $ro/libdashline.o"
            breaksw

        case "-dashsuper":
            echo "Super Dash"
            set robjs = "$robjs $ro/libdashsupr.o"
            breaksw

        case "-dashchar":
            echo "Normal Dash"
            breaksw

        case "-ictrans":
            echo "Output to ictrans"
            set ctrans_libs = `ctlib`
            set xlib = ""
            set libmath = ""
            set stub_file = $ro/ggkwdr_stub.o
            breaksw

        case "-noX11"
        case "-nox11"
            set stub_file = $ro/ggkwdr_stub.o
            set xlib = ""
            breaksw

        case "-*":
            set newargv = "$newargv $arg"
            breaksw

        default:
            set newargv = "$newargv $arg"
            breaksw

        endsw
    end

    # set ncarg_libs = "$libncarg $libgks $libncarg_c $libmath"
    # set newargv = "$newargv $stub_file $libpath $ctrans_libs $robjs
    $ncarg_libs $xlib $libextra"

    set ncarg_libs = "-L/Applications/ncarg/lib/libncarg.a
    -L/Applications/ncarg/lib/libncarg_gks.a
    -L/Applications/ncarg/lib/libncarg_c.a
    -L/Applications/ncarg/lib/libngmath.a"
    set xlibs = "-L/usr/X11R6/lib/libXpm.a -L/usr/X11R6/lib/libX11.a
    /usr/X11R6/lib/libXext.a"
    set newargv = "$newargv $stub_file $ctrans_libs $robjs $ncarg_libs
    $syslibdir $xlibs $libextra"

    echo $newargv
    eval $newargv

    = = = n c a r g f 7 7 M a k e f i l e e n d i n g = = =

    -- 
    ------------------------------------------------------------------------
                Samuel H. Dupree, Jr.                                        
                sdupree@speakeasy.net
                600 West Harvey Street
                Apartment A-703                                            
        http://www.speakeasy.org/~sdupree/
                Philadelphia, PA 19144-4345, USA
    

    HOME: 215-842-3663 WORK: 610-354-2533 FAX: 610-354-7436

    "What does it take to travel in space?" The will to do it. - Dr. Wernher von Braun ------------------------------------------------------------------------



    This archive was generated by hypermail 2b29 : Tue Jul 13 2004 - 07:23:51 MDT