Re: wrapit error

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 12 Oct 2009 00:33:40 -0600

Hi Mike,

Part of the problem is that WRAPIT is not really set up to recognize
the generic "f77" compiler for Linux systems.

It wants to use g77, gfortran, pgf77/pgf90, ifc or lf95.

Also, what I think is happening is that you are on a 64-bit system,
and hence have a 64-bit version of NCL and corresponding libraries
installed.
Meanwhile, "f77" may be trying to compile in 32-bit, which will be
incompatible.

My first suggestion would be to use one of the accepted compilers, if
possible:

     WRAPIT -gf -fPIC part.f

If you don't have "gfortran", you can install it:

   http://gcc.gnu.org/wiki/GFortranBinaries

If you need to use "f77", then you will probably need to make your
own copy of $NCARG_ROOT/bin/WRAPIT and modify it so that it sets the
appropriate options for "f77". I've never tried "f77" with WRAPIT, so
I'm not sure it's going to work.

You'll need to edit the "Linux" sections, and in particular, the
section that sets "fopts" for the Linux Fortran compiler. Since you
are using a compiler that WRAPIT doesn't recognize, I think you'll
want to look at the big nested "if" loop that sets the "fopts" for
LINUX, and change the very last setting. That sections of code should
look something like this:

    else if ($f90c == g77) then # GNU g77
      if ($debug == 1) then
        set fopts = "$fopts -fPIC -v -c -ffortran-bounds-check -fno-
second-underscore"
      else
        set fopts = "$fopts -fPIC -c -O -fno-second-underscore"
      endif

Change the last setting of fopts in the above code; that is, this line:

        set fopts = "$fopts -fPIC -c -O -fno-second-underscore"

and add whatever option will make "f77" compile in 64-bit (if you are
on a 64-bit system), like "-m64" or equivalent.

You may have to do something similar for the "ld" and "cc" command
line options, if you continue to get errors about 32/64 bit.

Again, however, I would recommend using gfortran if at all possible,
or one of the other compilers if you have them installed.

--Mary

On Oct 9, 2009, at 9:57 PM, MICHAEL NOTARO wrote:

> Wei,
>
> Thanks for your email. Using the f77 compiler, when I execute:
> wrapit -fPIC part.f
>
> I get:
>
> /usr/bin/f77
> ERROR: FILE -fPIC DOES NOT EXIST
>
> I assume that I can leave the "[-in|-pg|-gf|fortran-compiler-
> option]" part
> empty since it knows to use f77 anyhow.
>
> Mike
>
> ----- Original Message -----
> From: Wei Huang <huangwei_at_ucar.edu>
> Date: Friday, October 9, 2009 5:40 pm
> Subject: Re: wrapit error
> To: Michael Notaro <mnotaro_at_wisc.edu>
> Cc: ncl-talk NCL <ncl-talk_at_ucar.edu>
>
>> Mike,
>>
>> Please try "WRAPIT [-in|-pg|-gf|fortran-compiler-option] -fPIC your-
>> fortran-file"
>>
>> Wei Huang
>> huangwei_at_ucar.edu
>> VETS/CISL
>> National Center for Atmospheric Research
>> P.O. Box 3000 (1850 Table Mesa Dr.)
>> Boulder, CO 80307-3000 USA
>> (303) 497-8924
>>
>>
>>
>>
>>
>> On Oct 9, 2009, at 4:11 PM, Michael Notaro wrote:
>>
>>> Why does the following very simple fortran script result in the
>>> following error
>>> when I use wrapit (vs. 030422) on it?
>>>
>>> C NCLFORTSTART
>>> subroutine notaro(scf)
>>> C NCLEND
>>> stop
>>> end
>>>
>>>
>>> ld: WRAPIT.o: relocation R_X86_64_32 against `a local symbol' can
>>> not
>>> be used when making a shared object; recompile with -fPIC
>>> WRAPIT.o: could not read symbols: Bad value
>>>
>>> Thanks,
>>> Mike
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Oct 12 2009 - 00:33:40 MDT

This archive was generated by hypermail 2.2.0 : Mon Oct 12 2009 - 03:45:17 MDT