[MITgcm-support] cal pkg, OSX, absoft f77, and pragma

m. r. schaferkotter schaferk at bellsouth.net
Sat Jul 30 01:24:52 EDT 2005


hi samar and ed:

this note is long

first i did _not_ try ed/s new script, since it was not necessary.
samar/s suggestion "CPP='/usr/bin/cpp -traditional -P 
-xassembler-with-cpp'"

gets past the "pragma" problem that arises in the cal pkg.

things go downhill after that though, when using the darwin_absoft_f77 
optfile with the CPP edit listed above,
the new problems are _not_ related to the CPP edit.

the build breaks in the diagnostic pkg file

/Applications/Absoft/bin/f77 -w -W -f -N15 -N113 -q  -O -U -c 
diag_readparms.for
  error on line 2252 of diag_readparms.for: duplicate variable 
declaration
  error on line 2254 of diag_readparms.for: PARAMETER declaration error

this is happening because both diagnostic.h and diagnostic_SIZE.h 
instantiate numlists and numperlist.

disabling the diagnostic package in packages.conf and continuing we get:

/Applications/Absoft/bin/f77 -w -W -f -N15 -N113 -q  -O -U -c 
exf_getobcs.for
  error on line 3038 of exf_getobcs.for: data type is undefined for 
variable obnu0

this happens because '-f' is folding symbols to lower case?, if you 
delete the '-f' switch
we end up with error messages about 'cal_IntMonths', though the file is 
name cal_intmonths.F.
oh well, put the '-f' back in.

so i COPY exf_getobcs.F to code subdirectory, convert to lower case and 
replace _RL->_rl.

now we get:

/Applications/Absoft/bin/f77 -w -W -f -N15 -N113 -q  -O -U -c 
exf_interp.for
  error on line 1737 of exf_interp.for: arrayin - adjustable array is 
not a dummy argument
  error on line 1737 of exf_interp.for: x_in - adjustable array is not a 
dummy argument
  error on line 1737 of exf_interp.for: y_in - adjustable array is not a 
dummy argument
  error on line 1737 of exf_interp.for: global - adjustable array is not 
a dummy argument

so absoft f77 doesn/t like adjustable arrays that are not dummy 
argument.
someone should redesign the exf pkg.

but alas, i did find a solution!

Note: i want to use the cal, diagnostic, and exf packages because of  
OBCprescribe  requires cal and exf packages.
diagnostic is there to help in case of trouble.

use f95!

1) create a new optfile called absoft_darwin_f95

# uname -mrsvp:
#Darwin 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005;
#root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC  Power Macintosh powerpc

CPP='/usr/bin/cpp -traditional -P -xassembler-with-cpp'
FC='/Applications/Absoft/bin/f95'
LINK='/Applications/Absoft/bin/f95'
FFLAGS=
FOPTIM=
NOOPTFLAGS=
LIBS='-L/Applications/Absoft/lib -lU77'
S64='$(TOOLSDIR)/set64bitConst.sh'
MAKEDEPEND='makedepend'
DEFINES='-DWORDLENGTH=4'

2) copy diagnostics.h to code subdirectory and comment out numlists, 
numperlist

3) copy exf_getobcs.F to code subdirectory, convert to lower case, and 
replace  _RL -> _rl

the build then proceeds to completion without incident.
the problems seem to arise because of the compiler peculiarities.

the code compiles without incident on a linux box with pgf77 compiler.

thanx samar and ed.

michael



On Friday, July 29, 2005, at 09:50 AM, samar khatiwala wrote:

> Ed:
>
> Not sure if this is the solution, but have you tried (in the build 
> file):
>
> CPP='/usr/bin/cpp -traditional -P -xassembler-with-cpp'
>
> Samar
>
> On Fri, 29 Jul 2005, Ed Hill wrote:
>
>> On Thu, 2005-07-28 at 21:21 -0500, m. r. schaferkotter wrote:
>>> greetings:
>>> i/m trying to build MITgcm with the cal pkg on OSX 10.3 with absoft 
>>> f77
>>> compiler.
>>> the files build on linux with linux_ia32_pgf77 without incident.
>>>
>>> i/m using a build_option file darwin_absoft_f77
>>
>> Hi "m. r.",
>>
>> I found your problem.
>>
>>
>>> the build stops with:
>>>
>>> cat cal_addtime.F | /Users/schaferk/MITgcm/tools/set64bitConst.sh |
>>> /usr/bin/cpp -traditional -P -DWORDLENGTH=4 -I. > cal_addtime.for
>>> /Applications/Absoft/bin/f77 -w -W -f -N15 -N113 -q  -O -U -c
>>> cal_addtime.for
>>>   error on line 1 of cal_addtime.for: illegal syntax
>>>   error on line 1 of cal_addtime.for: illegal syntax
>>>   error on line 1 of : too many continuation lines
>>>   error on line 0 of : spelling error?
>>>   error on line 359 of : RETURN statement in main program unit
>>>
>>> make: *** [cal_addtime.o] Error 1
>>>
>>> cat  cal_addtime.for
>>>
>>> #pragma GCC set_debug_pwd
>>> "/Users/schaferk/MITgcm-expt/LUZ/expt_01.0/build"
>>> C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_addtime.F,v 1.3 2003/10/20
>>> 06:25:16 dimitri Exp $
>>> C $Name:  $
>>
>> The above error is identical to:
>>
>>   http://www.macosx.com/forums/showthread.php?t=229728
>>
>> and is described at
>>
>>   http://developer.apple.com/releasenotes/DeveloperTools/GCC3.html
>>
>> and its caused by the "brilliant" folks at Apple adding their non-
>> standard "Xcode" junk to the version of GCC that they distribute.  The
>> documentation says:
>>
>>   "The GCC 3.3 preprocessor inserts a new pragma, #pragma GCC
>>    set_debug_pwd, as part of the new Distributed Builds feature.
>>    (See below.) This may surprise tools and scripts that depended
>>    on the exact form of preprocessed output from GCC. These
>>    scripts should be rewritten to ignore unrecognized pragmas."
>>
>> so I guess we'll have to add something to get rid of those extra 
>> #pragma
>> statements since I can't (in their on-line documentation, anyway) find
>> an option that gets rid of them for us.
>>
>> Attached is a modified version of the "set64bitConst.sh" script that
>> should fix your "#pragma" problems.  Please give it a try.
>>
>> And if you can find an option that gets rid of the annoying #pragma's
>> that would be even better -- and please tell us about it!
>>
>> Ed
>>
>>
>> --
>> Edward H. Hill III, PhD
>> office:  MIT Dept. of EAPS;  Rm 54-1424;  77 Massachusetts Ave.
>>              Cambridge, MA 02139-4307
>> emails:  eh3 at mit.edu                ed at eh3.com
>> URLs:    http://web.mit.edu/eh3/    http://eh3.com/
>> phone:   617-253-0098
>> fax:     617-253-4464
>>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>




More information about the MITgcm-support mailing list