Re: using WRAPIT on OS X

From: Mary Haley (haley AT ucar.edu)
Date: Thu Mar 31 2005 - 07:36:27 MST

  • Next message: Mary Haley: "new NCL website to be official"

    On Wed, 30 Mar 2005, Todd Ringler wrote:

    >
    > I am using Mac OS X (10.3.8).
    >
    > I am trying to duplicate the cquad example shown in the MIni-Language Manual
    > (v1.0, page 32). I substitute f90 for g77 in WRAPIT. It produces the
    > quad90.so file with no indication of errors, but NCL (v 4.2.0.a032) will not
    > open it. The error I get is appended. I have checked the manual, web, and
    > archive to make sure I am not missing something obvious (but I probably did
    > miss the obvious). Any suggestions would be appreciated.
    >
    > couloir: /Users/todd/bergd5/forcing > ncl < test.ncl ! (test.ncl opens QUPR
    > as external)
    > Copyright (C) 1995-2004 - All Rights Reserved
    > University Corporation for Atmospheric Research
    > NCAR Command Language Version 4.2.0.a032
    > The use of this software is governed by a License Agreement.
    > See http://ngwww.ucar.edu/ncl/ for more details.
    > warning:An error occurred loading the external file ./quad90.so, file not
    > loaded
    > dlcompat: dyld: ncl Undefined symbols:
    > ___A_FWF
    > _cquad_
    > _prntq_
    >
    > fatal:syntax error: line 10 before or near :
    > QUPR:
    > -----^
    >
    >
    > fatal:syntax error: possibly an undefined procedure
    > fatal:syntax error: line 11 before or near :
    > QUPR:

    Hi Todd,

    Since NCL was built with g77 on the MacOSX, and you are trying to use
    f90 (is this the Absoft compiler?) to create the shared object, you
    are probably running into some compatibility issues between the two
    compilers when the g77-compiled ncl tries to load an f90-compiled
    *.so file.

    I've never actually tried mixing compilers in this fashion on the Mac,
    so I'm not sure how doable it is.

    However, we can start by trying to figure out where the "___A_FWF"
    symbol is coming from. My Mac is at home so I can't look it up, but it
    might come from the g2c or f2c runtime library. If so, then you would
    need to include this on the WRAPIT line:

        WRAPIT -L /path/to/g2c_library -l g2c quad90.f

    where "/path/to/g2c_library" is the location of the g2c (or f2c)
    library.

    Then, on top of this, it looks like your f90 may be doing something
    different with the symbols as it compiles them into the *.so file.
    This part puzzles me, because normally I would say that one
    compiler is appending underscores, and the other isn't. However,
    I know the g77 compiler appends underscores, so it should
    correctly be expecting the symbols to have an underscore appended.
    I'm not sure about the prepended underscore, however.

    Out of curiosity, can you compile a simple Fortran 77 code for me,
    using both "g77" and "f90", and then do an "nm" on the resultant *.o
    file to see how they differ? For example:

         g77 -c simple_program.f
         nm simple_program.o
         f90 -c simple_program.f
         nm simple_program.o

    You can email the output to me personally.

    Thanks,

    --Mary

    -------------------------------------------------
    Mary Haley haley@ucar.edu
    NCAR/SCD/VETS 303-497-1254 (voice)
    1850 Table Mesa Dr 303-497-1804 (fax)
    Boulder, CO 80305
    -------------------------------------------------
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Thu Mar 31 2005 - 09:00:27 MST