/* The compilers expect the following macros to have been defined */ /* OPT and DEBUG */ /* determine the host and compiler to be used for the build */ /* function print "getenv WEPS_COMPILER = " [getenv WEPS_COMPILER]; function print "os is:", [os]; function print "os machine is", [os machine]; function print "os system is", [os system]; function print "os version is", [os version]; function print "os release is", [os release]; function print "shell printenv", [shell printenv]; function print "shell which pgf95", [shell which pgf95]; Fcompiler = [find_command pgf95]; function print "Fcompiler", [Fcompiler]; Fcompilerx = [find_command xpgf95]; function print "Fcompilerx", [Fcompilerx]; */ #if [ matches sun%1 [os machine] ] /* Sun machine? */ #if [ matches f90 [getenv WEPS_COMPILER] ] /* f90 compiler? */ FC = f90; #elif [ matches f95 [getenv WEPS_COMPILER] ] /* f95 compiler? */ FC = f95; #include "cookbook/cook.f95" #else /* default to f95 */ #include "cookbook/cook.f95" #endif #elif [ matches Linux [os] ] /* Linux machine? */ #if [ find_command pgf95 ] /* Portland Group compiler? */ /* function print "Found pgf95!!!"; */ FC = pgf95; /* set FC to pgf95 */ #include "cookbook/cook.pgf95" #elif [ matches gfortran [getenv WEPS_COMPILER] ] /* gfortran compiler? */ FC = gfortran; /* set FC to gfortran */ #include "cookbook/cook.gfortran" #else FC = lf95; /* set FC to lf95 */ #include "cookbook/cook.l95" /* default to Lahey */ #endif #elif [ matches OSF1 [os] ] /* Linux machine? */ #if [ matches f90 [getenv WEPS_COMPILER] ] /* f90 compiler? */ FC = f90; /* set FC to f90 */ #include "cookbook/cook.alpha" #else FC = f95; /* set FC to f95 */ #include "cookbook/cook.alpha" /* default to f95 */ #endif #else /* assume a PC */ #if [ matches g77 [getenv WEPS_COMPILER] ] /* g77 compiler? */ FC = g77; #include "cookbook/cook.f90" #elif [ matches wfc386 [getenv WEPS_COMPILER] ] FC = wfc386; /* set FC to wfc386 */ #include "cookbook/cook.wat" /* set to Watcom */ #elif [ matches gfortran [getenv WEPS_COMPILER] ] /* gfortran compiler? */ FC = gfortran; /* set FC to gfortran */ #include "cookbook/cook.gfortran" #else FC = lf95; /* set FC to lf95 */ #include "cookbook/cook.l95" /* default to Lahey */ #endif #endif function print "Using compiler", [FC];