[Dart-dev] DART/branches Revision: 11859

dart at ucar.edu dart at ucar.edu
Wed Aug 2 09:59:15 MDT 2017


nancy at ucar.edu
2017-08-02 09:59:14 -0600 (Wed, 02 Aug 2017)
251
fix the selection of compilers and flags to be simpler.
it used to ask for a platform type but that isn't really
the choice anymore - choose gnu, intel, pgi, etc and
whether you need the underscores added to the C routine
names to link with fortran.




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-02 15:36:44 UTC (rev 11858)
+++ DART/branches/rma_trunk/observations/obs_converters/NCEP/prep_bufr/install.sh	2017-08-02 15:59:14 UTC (rev 11859)
@@ -27,38 +27,61 @@
 set -eua
  
 #  ------------------------------------------------------------------------
-#  CPLAT - platform type (linux, sgi, aix, sun, macosx)
+#  CCOMP, FCOMP - select the compiler combination to use
 #  ------------------------------------------------------------------------
  
-# this choice here should really be compiler, i.e. ifort, pgi, gfortran
-#CPLAT=macosx
-CPLAT=linux
-#CPLAT=aix
+CCOMP=gnu
+#CCOMP=intel
+#CCOMP=pgi
+#CCOMP=default
 
-#  set up the compilers to use
+FCOMP=gnu
+#FCOMP=intel
+#FCOMP=pgi
+#FCOMP=f77
+
+#  ------------------------------------------------------------------------
+#  UNDERSCORE - if needed to link the C and fortran subroutine names
+#  ------------------------------------------------------------------------
+
+#UNDERSCORE=none
+UNDERSCORE=add
+
 #  -----------------------------------------------------
  
-if [ $CPLAT = sgi ]
-then
-   cc=cc; ff=f77
-elif [ $CPLAT = linux ]
-then
-# possible different compiler choices
-#   cc='cc -O'; ff='pgf90 -O'
-#   cc='icc -O'; ff='ifort -O'
-    cc='gcc -DUNDERSCORE -O'; ff='ifort -O'
-elif [ $CPLAT = aix ]
-then
-   cc='cc -O'; ff='f77 -O'
-elif [ $CPLAT = sun ]
-then
-   cc=cc; ff=f77
-elif [ $CPLAT = macosx ]
-then
-   cc='gcc -DUNDERSCORE'; ff=gfortran
+if   [ $CCOMP = gnu ] ; then
+   cc=gcc ;
+elif [ $CCOMP = intel ] ; then
+   cc=icc ;
+elif [ $CCOMP = pgi ] ;  then
+   cc=pgcc ;
+else
+   cc=cc ;
 fi
 
+if   [ $FCOMP = intel ] ; then
+   ff=ifort 
+elif [ $FCOMP = gnu ] ; then
+   ff=gfortran 
+elif [ $FCOMP = pgi ] ; then
+   ff=pgf90 
+elif [ $FCOMP = f77 ] ; then
+   ff=f77 
+else
+   echo error: unrecognized FCOMP name
+   exit 1
+fi
 
+if [ $UNDERSCORE = add ] ; then
+   cc="$cc -DUNDERSCORE"
+fi
+
+# in any case, add -O for optimized code
+cc="$cc -O"
+ff="$ff -O"
+
+
+
 #  Compile and archive the Bufr Library
 #  ------------------------------------
 


More information about the Dart-dev mailing list