Re: WRAPIT compilers on OSX

From: Jared Lee <jaredlee_at_nyahnyahspammersnyahnyah>
Date: Thu Jun 30 2011 - 17:38:36 MDT

Here's the output. I had to remove the -ffortran-bounds-check switch from WRAPIT because my pgf90 didn't recognize it. Once I did that, this is what I got while running WRAPIT:

==========
jaredlee$ ~/tools/WRAPIT -d -pg read_little_R.stub read_little_R.f90
 
WRAPIT Version: 100111
/usr/local/pgi/osx86-64/11.6/bin/pgf90
OPERATING SYSTEM: Darwin
FORTRAN COMPILER (f90c): pgf90
FORTRAN COMPILER OPTIONS (fopts): -v -c
gcc -m64 -c -fno-common -I/usr/local/ncarg/include WRAPIT.c
COMPILING read_little_R.f90
pgf90 -v -c read_little_R.f90

/private/var/autofs/mnt/macos/snowleopard/local/pgi-v11.2/osx86-64/11.6/bin/pgf901 read_little_R.f90 -opt 1 -nohpf -nostatic -quad -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -x 119 0x1000 -x 59 4 -x 129 0x10 -x 51 0x20 -x 124 0x401 -x 19 0x400000 -x 57 0x7b0000 -x 58 0x78031040 -x 119 0x610400 -x 119 0x1000 -x 59 4 -x 129 0x10 -x 48 4608 -x 49 0x100 -x 120 0x200 -stdinc /private/var/autofs/mnt/macos/snowleopard/local/pgi-v11.2/osx86-64/11.6/include:/usr/local/include:/usr/lib/gcc/i686-apple-darwin10/4.2.1/include:/usr/lib/gcc/i686-apple-darwin10/4.2.1/include:/usr/include -def unix -def __unix -def __unix__ -def __LITTLE_ENDIAN__ -def __inline__= -def osx86 -def __osx86 -def __osx86__ -def __APPLE__ -def __LP64__ -def __x86_64__ -def _M_IX86 -def __NO_MATH_INLINES -def __amd64__ -def __extension__= -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -def __SSSE3__ -freeform -vect 48 -y 54 1 -modexport /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf90k3mrELMvp8Ay.cmod -modindex /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf90A3mrorBp6-4b.cmdx -output /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf9063mrUNzf47Ll.ilm
  0 inform, 0 warnings, 0 severes, 0 fatal for globals
  0 inform, 0 warnings, 0 severes, 0 fatal for scan_little_r
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_sfc_header
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_sfc_header_string
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_ua_header
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_ua_header_string
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_sfc_data
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_ua_data
  0 inform, 0 warnings, 0 severes, 0 fatal for readerror
  0 inform, 0 warnings, 0 severes, 0 fatal for myerror
PGF90/x86-64 OSX 11.6-0: compilation successful

/private/var/autofs/mnt/macos/snowleopard/local/pgi-v11.2/osx86-64/11.6/bin/pgf902 /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf9063mrUNzf47Ll.ilm -fn read_little_R.f90 -opt 1 -x 59 4 -x 119 0x10000010 -x 129 0x80 -x 19 0x400000 -dollar '$' -x 119 0x40610400 -x 119 0x1000 -x 59 4 -x 129 0x10 -x 70 0x8000 -x 122 1 -x 125 0x20000 -x 120 0x80 -x 122 0x40 -x 123 0x1000 -x 127 21 -tp nehalem -y 80 0x40000000 -x 120 0x400 -x 120 0x1000 -y 119 0x40000000 -x 51 0x20 -x 124 0x401 -x 124 0x1000 -x 124 0x4000 -y 15 2 -x 57 0x3b0000 -x 58 0x48000000 -x 49 0x100 -x 120 0x200 -astype 1 -x 117 0x2000 -x 124 1 -cmdline '+pgf90 read_little_R.f90 -v -c' -asm /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf90Q3mr_A1-IJjV.s
  0 inform, 0 warnings, 0 severes, 0 fatal for globals
  0 inform, 0 warnings, 0 severes, 0 fatal for scan_little_r
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_sfc_header
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_sfc_header_string
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_ua_header
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_ua_header_string
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_sfc_data
  0 inform, 0 warnings, 0 severes, 0 fatal for read_little_r_ua_data
  0 inform, 0 warnings, 0 severes, 0 fatal for readerror
  0 inform, 0 warnings, 0 severes, 0 fatal for myerror
PGF90/x86-64 OSX 11.6-0: compilation successful

/usr/bin/as -arch x86_64 /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf90Q3mr_A1-IJjV.s -o read_little_R.o

/private/var/autofs/mnt/macos/snowleopard/local/pgi-v11.2/osx86-64/11.6/bin/pgappend -noerror read_little_R.o -name .IPDINFO /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf90k3mrELMvp8Ay.cmod -name .IPEINFO /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf90A3mrorBp6-4b.cmdx
Unlinking /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf9063mrUNzf47Ll.ilm
Unlinking /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf90k3mrELMvp8Ay.cmod
Unlinking /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf90A3mrorBp6-4b.cmdx
Unlinking /var/folders/zz/zzzivhrRnAmviuee+++uXk++Ccw/-Tmp-/pgf90Q3mr_A1-IJjV.s
SHARED OBJECT NAME (SharedObj): read_little_R.so
LINKER SUFFIX (ld_suffix): WRAPIT.o read_little_R.o -o read_little_R.so
 
LINKING
gcc -m64 -bundle -flat_namespace -undefined suppress WRAPIT.o read_little_R.o -o read_little_R.so -pgf90libs
END WRAPIT
==========

Jared

On Jun 30, 2011, at 4:54 PM, Mary Haley wrote:

> Can you run WRAPIT with the -d option and send me all the output so I can see what WRAPIT is doing?
>
> --Mary
>
> On Jun 30, 2011, at 12:52 PM, Jared Lee wrote:
>
>> Hi Mary,
>>
>> I just added -pgf90libs like you suggested, but it had no impact. No errors are reported while running WRAPIT, but this is what I get when I run the NCL script:
>>
>> ncl 0>warning:An error occurred loading the external file ./read_little_R.so, file not loaded
>> dlopen(./read_little_R.so, 2): Symbol not found: _pgf90_compiled
>> Referenced from: /Volumes/Users/jaredlee/programs/VERIF_WRF/read_little_R.so
>> Expected in: flat namespace
>> in /Volumes/Users/jaredlee/programs/VERIF_WRF/read_little_R.so
>> ^Mwarning:error at line 1 in file read_little_R.ncl
>>
>> Jared
>>
>>
>> On Jun 30, 2011, at 12:36 PM, Mary Haley wrote:
>>
>>> You might need to add -pgf77libs or -pgf90libs.
>>>
>>> For example, the code that has:
>>>
>>> case Darwin: # MacOSX
>>> . . .
>>> if ($f90c == gfortran) then # gfortran compiler
>>> set cmd = "$cmd -lgfortran"
>>> endif
>>> if ($f90c == g95) then # g95 compiler
>>> set cmd = "$cmd -lf95"
>>> endif
>>>
>>> can be enhanced with something like:
>>>
>>> case Darwin: # MacOSX
>>> . . .
>>> if ($f90c == gfortran) then # gfortran compiler
>>> set cmd = "$cmd -lgfortran"
>>> endif
>>> if ($f90c == g95) then # g95 compiler
>>> set cmd = "$cmd -lf95"
>>> endif
>>> if ($f90c == pgf90) then # pgf90 compiler
>>> set cmd = "$cmd -pgf90libs"
>>> endif
>>>
>>> --Mary
>>>
>>> On Jun 30, 2011, at 10:36 AM, Jared Lee wrote:
>>>
>>>> Hi Mary,
>>>>
>>>> I replied to Dennis about the same thing yesterday, but apparently I forgot to 'reply all' and cc ncl-talk. So here's what I've already done:
>>>>
>>>> I modified WRAPIT to include Darwin as an option if -pg is chosen for a compiler. Then my pgf90 compiler complained that it didn't recognize the -fPIC or -fno-second-underscore flags (which might be problematic??), so here's my current relevant portion of the switches section of WRAPIT:
>>>>
>>>> ==========
>>>> case Darwin: # MacOSX (g77/gfortran/g95)
>>>> if ($f90c == g77) then # 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
>>>> ## else if loop added by JAL on 29 Jun 2011:
>>>> else if ($f90c == pgf90) then
>>>> if ($debug == 1) then
>>>> set fopts = "$fopts -v -c -ffortran-bounds-check"
>>>> else
>>>> set fopts = "$fopts -c -O"
>>>> endif
>>>> else # gfortran or g95
>>>> if ($debug == 1) then
>>>> set fopts = "$fopts -m{$nbits} -fPIC -v -c -fno-second-underscore"
>>>> else
>>>> set fopts = "$fopts -m{$nbits} -fPIC -c -O -fno-second-underscore"
>>>> endif
>>>> endif
>>>> breaksw
>>>> ==========
>>>>
>>>> Then WRAPIT compiled the shared object file, but I got this error when I ran the code, followed by a cascade of errors whenever I tried to call a function/subroutine in that shared object file:
>>>>
>>>> ==========
>>>> Copyright (C) 1995-2010 - All Rights Reserved
>>>> University Corporation for Atmospheric Research
>>>> NCAR Command Language Version 5.2.1
>>>> The use of this software is governed by a License Agreement.
>>>> See http://www.ncl.ucar.edu/ for more details.
>>>> warning:An error occurred loading the external file ./read_little_R.so, file not loaded
>>>> dlopen(./read_little_R.so, 2): Symbol not found: _pgf90_compiled
>>>> Referenced from: /Volumes/Users/jaredlee/programs/VERIF_WRF/read_little_R.so
>>>> Expected in: flat namespace
>>>> in /Volumes/Users/jaredlee/programs/VERIF_WRF/read_little_R.so
>>>> ^Mwarning:error at line 1 in file ../VERIF_WRF/read_little_R.ncl
>>>> ==========
>>>>
>>>> So apparently this isn't a completely trivial fix, unfortunately (at least for pgf90)...
>>>>
>>>> Jared
>>>>
>>>>
>>>> On Jun 30, 2011, at 7:55 AM, Mary Haley wrote:
>>>>
>>>>> Hi Jared,
>>>>>
>>>>> This was taken offline briefly. It turns out that WRAPIT only recognizes the g77/gfortran compilers for MacOSX right now.
>>>>>
>>>>> I think the quick fix is to edit $NCARG_ROOT/bin/WRAPIT and change the second line in this block of code:
>>>>>
>>>>> else if ($arg:q == "-pg") then
>>>>> if ($OS == Linux) then
>>>>>
>>>>> to:
>>>>>
>>>>> else if ($arg:q == "-pg") then
>>>>> if ($OS == Linux || $OS == Darwin) then
>>>>>
>>>>> Do a similar thing for these lines:
>>>>>
>>>>> else if ($arg:q == "-in") then
>>>>> if ($OS == Linux) then
>>>>>
>>>>> Let me know if this works, and I'll incorporate the changes on our end.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> --Mary
>>>>>
>>>>> On Jun 29, 2011, at 11:45 AM, Dennis Shea wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> %> WRAPIT -h
>>>>>>
>>>>>> [snip]
>>>>>> ------------------------ Linux Compilers ---------------------------
>>>>>> The default linux fortran compiler is the GNU gfortran compiler. If
>>>>>> your system has one of the supported linux fortran compilers you must
>>>>>> specify which one you want to use by the appropriate command line
>>>>>> option, otherwise the gfortran compiler will be used.
>>>>>> The supported linux fortran compilers are the Portland Group
>>>>>> (pgf90), the Lahey/Fujitsu (lf95), and the g95 compiler (g95),
>>>>>> and the Intel compiler (ifc/ifort).
>>>>>> OPTION: -pg to specify the Portland Group compiler.
>>>>>> OPTION: -lf to specify the Lahey/Fujitsu compiler.
>>>>>> OPTION: -in to specify the Intel compiler.
>>>>>> OPTION: -g95 to specify the g95 compiler.
>>>>>> OPTION: -gf to specify the gfortran compiler.
>>>>>> OPTION: -g77 to specify the old g77 compiler.
>>>>>>
>>>>>> [snip]
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 6/29/11 11:30 AM, Jared Lee wrote:
>>>>>>> Hi, is there a reason why WRAPIT is incompatible with the pgf90 and ifort compilers on Mac OSX? Why are gfortran, g95, and g77 the only compilers allowed? (I'm using NCL 5.2.1.)
>>>>>>>
>>>>>>> I ask because my work machine was just changed this week from a Linux system to a Mac (OS 10.6.8), and I'm running these codes on my desktop system. In one of my Fortran 90 codes on which I use WRAPIT, gfortran consistently chokes on the 'backspace' command, by giving me an "unattached unit" error. I never had that problem before on other architectures when WRAPIT allowed me to use other compilers. Fortunately for me, I see a way that I can rework my Fortran code to avoid needing to use 'backspace' (and it should make my code marginally more efficient anyway), because I suspect this is a bug in gfortran (I did an 'inquire' right before the 'backspace' and everything checked out okay... I'm completely stumped why I'm getting the "unattached unit" error).
>>>>>>>
>>>>>>> I also ran into problems with gfortran because some of my lines exceeded 132 characters in length. That was a simple enough fix to make, but still inconvenient because of not being allowed by WRAPIT to use a compiler other than gfortran.
>>>>>>>
>>>>>>> Anyway, can WRAPIT be modified to allow non-GNU compilers to be used on Mac OSX?
>>>>>>>
>>>>>>> Jared
>>>>>>> _______________________________________________
>>>>>>> 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 Thu Jun 30 17:38:39 2011

This archive was generated by hypermail 2.1.8 : Tue Jul 12 2011 - 15:03:53 MDT