<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Paul,<div><br></div><div>I am not sure what is going on here but I can tell you this much: c.h should not simply be a copy of c.h.sed. The Makefile should have a rule that invokes the 'sed' utility to create c.h from c.h.sed</div><div>that looks something like this:</div><div><br></div><div><div>c.h: c.h.sed Makefile</div><div> @sed -e 's+SED_NGCALLF+$(NGCALLF)+' <c.h.sed >c.h</div></div><div><br></div><div>sed should replace the string SED_NGCALLF with the value of the NGCALLF which is defined earlier in the Makefile. The macro is used to generate the correct form of a name used to call a Fortran procedure from within C code. What is NGCALLF set to in the Makefile? It looks as if it may have been modified from the standard value, which is usually "reg\#\#_" for Linux. It's possible that pgfortran requires something else, I don't know.</div><div><br></div><div>If the standard value is used, where c.h.sed has the lines:</div><div><br></div><div><div>#ifndef NGCALLF</div><div><br></div><div>#define NGCALLF(reg,caps) SED_NGCALLF</div><div><br></div><div>#endif /* NGCALLF */</div></div><div><br></div><div>c.h should have:</div><div><br></div><div><div>#ifndef NGCALLF</div><div><br></div><div>#define NGCALLF(reg,caps) reg##_</div><div><br></div><div>#endif /* NGCALLF */</div></div><div><br></div><div>logic32.c should have the following references to NGCALLF:</div><div><br></div><div><div>logic32.c:</div><div>logic32.c:NGCALLF(iand,IAND)(i, j)</div><div>logic32.c:NGCALLF(ior,IOR)(i, j)</div><div>logic64.c:NGCALLF(ishift,ISHIFT)(i, nshift)</div><div>logic64.c:NGCALLF(iand,IAND)(i, j)</div><div>logic64.c:NGCALLF(ior,IOR)(i, j)</div></div><div><br></div><div><br></div><div>The C preprocessor will replace these lines (as part of the compilation, you won't see it happen) with the first parameter (reg) followed by an underscore. </div><div>NGCALLF(ishift,ISHIFT)(i, nshift) should become ishift_(i,nshift), which is the correct way to call a Fortran routine if gfortran is the Fortran compiler. </div><div><br></div><div>If you can't figure it out based on this information, please send me (off line) the Makefile in c<span class="Apple-style-span" style="font-family: Arial; font-size: 13px; ">ommon/src/libncarg_c plus whatever you used for the system include file. It will be found in</span></div><div><span class="Apple-style-span" style="font-family: Arial; font-size: 13px; ">the config directory and be named in the Makefile as the value of SYSTEM_INCLUDE.</span></div><div><span class="Apple-style-span" style="font-family: Arial; font-size: 13px; "> -dave</span></div><div><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div> </div><div><br><div><div>On Jan 27, 2011, at 10:49 AM, Liang, Jinyou@ARB wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PostalCode">
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City">
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place">
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="State">
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<div lang="EN-US" link="blue" vlink="purple">
<div class="Section1"><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Dear NCL expert,<o:p></o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">Could
you please help me out on the following installation problem with NCL?<o:p></o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">While installing ncl_ncarg-5.2.1 on
a Linux computer running Redhat Enterprise Linux OS version 5.4 using pgfortran
(v10.5) and gcc (4.1.2 20080704 [Red Hat 4.1.2-48]), I encountered an error in
subdirectory “common/src/libncarg_c”. The use of c.h (a copy of
c.h.sed) yielded duplicate definition of SED_NGCALLF due to dozens of functions
named <o:p></o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">NGCALLF(lowercase, uppercase)
(char*, int*)<o:p></o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">In files logic32.c and trnspprt.c,
etc.<o:p></o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">The complete compiler options are as
follow:<o:p></o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">gcc -O2 -m64 -fPIC -O
-I../../.././include -I/usr/X11R6/include -I/usr/local/include/freetype2
-DLinux -DIBM -DNGVERSION='"5.2.1"' -DNCLVERSION='"5.2.1"'
-DNCARGURL='"ngurl"' -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE
-DByteSwapped -DNeedFuncProto -DNDEBUG -c -o rwchinfl.o rwchinfl.c<o:p></o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Did I miss anything in compiler
options (I compiled the same package successfully using earlier version of
gcc/RHEL and gfortran), or do I <font color="navy"><span style="color:navy">have</span></font>
to insert unique definitions in the c.h file for each complaint from the
compiler?<o:p></o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Your response will be greatly
appreciated.<o:p></o:p></span></font></p><p class="MsoNormal" style="margin-left:.5in"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p><p class="MsoNormal" style="margin-left:.5in;text-indent:.5in"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy">Regards,<o:p></o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Paul<o:p></o:p></span></font></p><p class="MsoNormal" style="margin-left:1.0in"><i><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy;
font-style:italic">Jinyou (Paul) Liang, Ph.D.</span></font></i><o:p></o:p></p><p class="MsoNormal" style="margin-left:1.0in"><i><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy;
font-style:italic">Staff Air Pollution Specialist</span></font></i><o:p></o:p></p><p class="MsoNormal" style="margin-left:1.0in"><st1:place w:st="on"><st1:state w:st="on"><i><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;
font-family:Arial;color:navy;font-style:italic">California</span></font></i></st1:state></st1:place><i><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy;font-style:italic"> Air Resources Board</span></font></i><o:p></o:p></p><p class="MsoNormal" style="margin-left:1.0in"><st1:place w:st="on"><st1:city w:st="on"><i><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;
font-family:Arial;color:navy;font-style:italic">Sacramento</span></font></i></st1:city><i><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy;font-style:italic">, <st1:state w:st="on">CA</st1:state> <st1:postalcode w:st="on">95812</st1:postalcode></span></font></i></st1:place><o:p></o:p></p><p class="MsoNormal" style="margin-left:1.0in"><i><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy;
font-style:italic">Phone: (916) 327-8543</span></font></i><o:p></o:p></p><p class="MsoNormal" style="margin-left:1.0in"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><o:p> </o:p></span></font></p>
</div>
<br clear="all">
</div>
_______________________________________________<br>ncl-install mailing list<br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-install">http://mailman.ucar.edu/mailman/listinfo/ncl-install</a><br></o:smarttagtype></o:smarttagtype></o:smarttagtype></o:smarttagtype></blockquote></div><br></div></body></html>