[Dart-dev] DART/branches Revision: 11915

dart at ucar.edu dart at ucar.edu
Mon Aug 28 16:58:40 MDT 2017


nancy at ucar.edu
2017-08-28 16:58:40 -0600 (Mon, 28 Aug 2017)
568
try to build the BUFR libs with the same compiler
as we're building the rest of dart with.  it comes
with its own install.sh script so the compiler choice
was hardcoded inside it.  change the buildall script
to set a couple env vars and then have the install script
use them if set - so the gps bufr converter should now
build ok with intel, gnu, or pgi.  i know we support
more compilers but 99% of our testing is with intel
and gfortran.  add more cases if this gets annoying for
some other compiler.  otherwise update the install.sh
script by hand before testing.




Modified: DART/branches/rma_trunk/observations/obs_converters/NCEP/prep_bufr/install.sh
===================================================================
--- DART/branches/rma_trunk/observations/obs_converters/NCEP/prep_bufr/install.sh	2017-08-28 22:55:32 UTC (rev 11914)
+++ DART/branches/rma_trunk/observations/obs_converters/NCEP/prep_bufr/install.sh	2017-08-28 22:58:40 UTC (rev 11915)
@@ -28,24 +28,32 @@
  
 #  ------------------------------------------------------------------------
 #  CCOMP, FCOMP - select the compiler combination to use
+#    either set in the environment before calling, or set here.
 #  ------------------------------------------------------------------------
  
-CCOMP=gnu
-#CCOMP=intel
-#CCOMP=pgi
-#CCOMP=default
+if [ "$CCOMP" == "" ]; then
+ CCOMP=gnu
+ #CCOMP=intel
+ #CCOMP=pgi
+ #CCOMP=default
+fi
 
-FCOMP=gnu
-#FCOMP=intel
-#FCOMP=pgi
-#FCOMP=f77
+if [ "$FCOMP" == "" ]; then
+ FCOMP=gnu
+ #FCOMP=intel
+ #FCOMP=pgi
+ #FCOMP=f77
+fi
 
 #  ------------------------------------------------------------------------
 #  UNDERSCORE - if needed to link the C and fortran subroutine names
+#    either set in the environment before calling, or set here.
 #  ------------------------------------------------------------------------
 
-#UNDERSCORE=none
-UNDERSCORE=add
+if [ "$UNDERSCORE" == "" ]; then
+ #UNDERSCORE=none
+ UNDERSCORE=add
+fi
 
 #  -----------------------------------------------------
  

Modified: DART/branches/rma_trunk/observations/obs_converters/buildall.csh
===================================================================
--- DART/branches/rma_trunk/observations/obs_converters/buildall.csh	2017-08-28 22:55:32 UTC (rev 11914)
+++ DART/branches/rma_trunk/observations/obs_converters/buildall.csh	2017-08-28 22:58:40 UTC (rev 11915)
@@ -11,11 +11,6 @@
 
 set startdir=`pwd`
 
-# the NCEP bufr libs are needed and they build differently.
-# do them first.
-
-cd NCEP/prep_bufr
-
 echo 
 echo 
 echo "=================================================================="
@@ -26,6 +21,40 @@
 echo 
 echo 
 
+# the NCEP bufr libs are needed by at least one other converter
+# (the gps bufr one) and they build differently with their own
+# install.sh script.  we do most of our testing with intel and
+# gfortran, so try to figure out from our mkmf.template file
+# which one is being used and set env vars so the install script
+# will use the right one.  this doesn't cover every compiler
+# we support but it will get 80% of the cases with 20% of the work.
+
+if ( -f ../../build_templates/mkmf.template ) then
+   set fcomp=`grep '^FC' ../../build_templates/mkmf.template | sed -s 's/FC *= *\([A-Za-z][^ ]*\)/\1/' `
+   if ( "$fcomp" == "ifort" ) then
+      setenv CCOMP intel
+      setenv FCOMP intel
+      setenv UNDERSCORE add
+      echo setting the BUFR lib to build using the intel compilers
+   else if ( "$fcomp" == "gfortran" ) then
+      setenv CCOMP gnu
+      setenv FCOMP gnu
+      setenv UNDERSCORE add
+      echo setting the BUFR lib to build using the gnu compilers
+   else if ( "$fcomp" == "pgf90" ) then
+      setenv CCOMP pgi
+      setenv FCOMP pgi
+      setenv UNDERSCORE add
+      echo setting the BUFR lib to build using the pgi compilers
+   else
+      echo unrecognized compiler in ../../build_templates/mkmf.template
+      echo set NCEP BUFR library compiler choice in NCEP/prep_bufr/install.sh
+      echo this script will use whatever compiler is selected there
+   endif
+endif
+
+cd NCEP/prep_bufr


More information about the Dart-dev mailing list