Re: gcfortran vs PGI

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu, 5 Mar 2009 16:26:42 -0700 (MST)

Hi Sarah,

1. For starters, you don't need to include "-lncarg -lncarg_gks
    -lncarg_c" when you are compiling the *.c files to create the *.o
    files. These libraries are being included via the use of "ncargf90".

    To prevent these extra libraries from being included, and to ensure
    that pgf90 gets used instead of gfortran, change the references to
    "ncargf90" on any line that contains "-c":

    Change:

     ncargf90 -c frmyz.F90

    to:

     $(COMP) -c frmyz.F90

    However, I think you already have the "rule" set up for building
    *.o files from *.f90 files, so you may not need these lines at all.

2. For the second problem, the error:

    warning: i386 architecture of input file `module_control.o' is
    incompatible with i386:x86-64 output

    indicates that you are building for an i386 system, but you are on
    an x86_64 system. (In other words, you are building 32-bit objects
    when your system is expecting 64-bit objects.)

    I think this will be fixed once you make the change suggested in
    #1.

    If not, you might need to look at the "-tp" option for pgf90 to
    compile for the correct architecture.

3. The third problem:

     plt.F90:(.text+0xb2): undefined reference to `pgf90io_src_info'

     can be fixed by not using "ncargf90" to do the final link of your
     program.

     What you can do is copy the file $NCARG_ROOT/bin/ncargf90
     to your home directory, and call it "ncargpgf90".

     Edit this new file, and change the line:

set fortran = "gfortran"

     to:

set fortran = "pgf90"

     Change the line:

set libextra = "-lgfortran"

     to:

set libextra = "-pgf90libs""

     Save the file and type:

      chmod gou+x ncargpgf90

     Then, edit your Makefile, and edit the remaining references to
     "ncargf90" to point to your new "ncargpgf90" script. For example:

     ncargpgf90 -o plt$(G) $(FFLAGS) plt.o $(OBJS) frmyz.o frmyzh.o

     If the make complains about the "-pgf90libs", then you will need
     to figure out on your own what PGI libraries are needed. You can
     start with something like:

set libextra = "-lpgc -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgftnrtl -lpghpf"

            I've found that these libraries vary, depending on what version
     of PGI you have. Hopefully the "-pgf90libs" will work!

--Mary

On Thu, 5 Mar 2009, Sarah Thompson wrote:

> I appreciate your help. I have attached the Makefile and the error I get
> when trying to make. Sarah
>
> Mary Haley wrote:
>> On Wed, 4 Mar 2009, Sarah Thompson wrote:
>>
>>
>>> I am a sysadmin and have installed the 5.0 binaries on Redhat 5 for one
>>> of my developers.
>>>
>>> I have run your tests
>>>
>>> ng4ex gsun01n
>>> ncl gsun01n.ncl
>>> ncargex cpex08
>>>
>>> and they all run correctly, although It's looking like they are using
>>> gcfortran.
>>> I have setup environmental variables for FC, F77 and F90 to use PGI
>>> (pgf90, pgf77 etc....) but when I run a script that my developer has
>>> given me to test I get this error right away
>>> gfortran: -lncarg: linker input file unused because linking not done
>>>
>>> and then a whole bunch of undefined references to pgf90.
>>> I am in no way a developer, and am really stuck at this point. Is it
>>> not looking at my environment variables? Do I need to tell my developer
>>> to link something in his code? I'm lost. Thanks, Sarah
>>>
>>> --
>>> Sarah Thompson
>>>
>>
>> Sarah,
>>
>> When you run "ncargex" and "ng4ex", they are using hard-coded values
>> for the compiler, so your environment settings will not affect the
>> compilers used by these scripts.
>>
>> As for the script your developer gave you, I need more information.
>> Can you email me the script?
>>
>> As a side, the error:
>>
>> gfortran: -lncarg: linker input file unused because linking not done
>>
>> seems to indicate that you are trying to link the libraries during the
>> non-link phase. You only want to include them when you are doing the
>> file link for the binary.
>>
>> As a second side, you should be able to use the PGI compilers to link
>> against the GNU-compiled NCAR Graphics. However, you may need to
>> include some GNU libraries during the final link phase like
>> "-lgfortran".
>>
>> --Mary
>>
>> _______________________________________________
>> ncl-install mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-install
>>
>
> --
> Sarah Thompson
> Systems Administrator
> Earth System Research Laboratory
> Global Systems Division
> (303) 497-6024
> Sarah.E.Thompson_at_noaa.gov
>
>
_______________________________________________
ncl-install mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-install
Received on Thu Mar 05 2009 - 16:26:42 MST

This archive was generated by hypermail 2.2.0 : Thu Mar 12 2009 - 14:11:14 MDT