<div dir="ltr">Hello all,<div><br></div><div>We have users that use the wrapper scripts ncargf77 and ncargf90 with compilers other than gfortran.  The way we have handled this in the past was to make copies of the bin directory, one for each compiler (Intel and PGI).  For each compiler, we would hand edit the wrapper script to properly compile and link the ncl libraries.  Then depending on the compiler loaded, the path to the appropriate bin directory would be specified.</div><div><br></div><div>As I was setting up version 6.3.0, I thought there might be a better generic way to do this.  Instead of a different wrapper script for each compiler, I changed the wrapper script to overload the variables like fortran, loadflags, and libextra so to allow those variables to be set in the environment and loaded as needed.   Several variables are defined specific to the language used:</div><div><br></div><div>NCARG_F77 - Define the compiler</div><div>NCARG_F77_LOADFLAGS - Define the compiler flags to be used</div><div>NCARG_F77_EXTRALIB - Define any extra libraries necessary</div><div><br></div><div>There are also versions above used in the ncargf90 script, but named with _F90_.</div><div><br></div><div>There is also a generic variable that is not compiler specific (this was created so that I can point to a new Cairo build).</div><div><br></div><div>NCARG_LIBPATH - Define the library path<br></div><div><br></div><div>Am I missing something on how to properly support additional compilers?  Is the method I implemented something than can be included in future versions of NCL?</div><div><br></div><div>Here is the patch for ncargf77, but I have a similar patch for ncargf90 and ncargcc.</div><div><br></div><div><div># diff -urN ncargf77.orig ncargf77</div><div>--- ncargf77.orig<span class="" style="white-space:pre">        </span>2015-07-22 15:25:49.245582280 +0000</div><div>+++ ncargf77<span class="" style="white-space:pre">        </span>2015-07-22 21:30:51.856202314 +0000</div><div>@@ -23,13 +23,32 @@</div><div> set syslibdir = &quot;-L/usr/X11R6/lib64&quot;</div><div> set xlib     = &quot;-lX11 -lXext&quot;</div><div> set cairolib = &quot;-lcairo -lfontconfig -lpixman-1 -lfreetype -lexpat -lpng -lz -lpthread -lXrender -lbz2&quot;</div><div>-set fortran  = &quot;/usr/bin/gfortran&quot;</div><div>-set loadflags  = &quot;-fPIC -fno-second-underscore -fno-range-check -fopenmp  -O   &quot;</div><div> set libdir   = `ncargpath lib`</div><div> set ro       = &quot;$libdir/ncarg/robj&quot;</div><div>-set libpath = &quot;-L$libdir $syslibdir&quot;</div><div><br></div><div>-set libextra = &quot;&quot;</div><div>+if ($?NCARG_F77_FORTRAN) then</div><div>+<span class="" style="white-space:pre">        </span>set fortran = &quot;$NCARG_F77_FORTRAN&quot;</div><div>+else</div><div>+<span class="" style="white-space:pre">        </span>set fortran  = &quot;/usr/bin/gfortran&quot;</div><div>+endif</div><div>+</div><div>+if ($?NCARG_F77_LOADFLAGS) then</div><div>+<span class="" style="white-space:pre">        </span>set loadflags = &quot;$NCARG_F77_LOADFLAGS&quot;</div><div>+else</div><div>+<span class="" style="white-space:pre">        </span>set loadflags  = &quot;-fPIC -fno-second-underscore -fno-range-check -fopenmp  -O   &quot;</div><div>+endif</div><div>+</div><div>+if ($?NCARG_LIBPATH) then</div><div>+<span class="" style="white-space:pre">        </span>set libpath = &quot;-L$libdir $syslibdir $NCARG_LIBPATH&quot;</div><div>+else</div><div>+<span class="" style="white-space:pre">        </span>set libpath = &quot;-L$libdir $syslibdir&quot;</div><div>+endif</div><div>+</div><div>+if ($?NCARG_F77_LIBEXTRA) then</div><div>+<span class="" style="white-space:pre">        </span>set libextra = $NCARG_F77_LIBEXTRA</div><div>+else</div><div>+<span class="" style="white-space:pre">        </span>set libextra = &quot;&quot;</div><div>+endif</div><div><br></div><div> if (! -d &quot;$libdir&quot;) then</div><div>   echo &quot;Library directory &lt;$libdir&gt; does not exist.&quot;</div></div><div><br></div><div>Thanks,</div><div>Craig</div></div>