# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # # ------------------------------------------------------------------- # Summary of configuration procedure # # * check args (--with-gamess-uk, --with-gulp, # --with-ga, --with-peigs, --with-mpi, --with-integer8) # * check for programs # * identify tcl locn # * search for libraries # * check system and make asjustments # # # * Choose the commmand to load the program # set up NUM_DIRS (list of directories to build in) # set up NUMERIC (extra .a files to load agains) # set up OPT_DIRS (extra interfaces) # * build Makefiles # # # ------------------------------------------------------------------- # Control Variables # # LINK_GAMESS # LINK_GULP # LINK_GA # LINK_PEIGS # LINK_GA # LINK_MPI # INTEGER8 # BITS64 (not yet.. hardwired in for AIX) # USERLIBS # # ------------------------------------------------------------------- # AC_PREREQ(2.57) AC_INIT(ChemShell, 3.0,p.sherwood@dl.ac.uk) AC_CONFIG_SRCDIR([../chemsh/chem.c]) AC_CONFIG_HEADER([config.h]) MAKESHELL='/bin/sh -e' MAKEPROG='make' PARALLEL=0 # # Enable arguments # AC_MSG_CHECKING(if direct linking with GAMESS-UK wanted) LINK_GAMESS=0 AC_ARG_WITH(gamess-uk, AC_HELP_STRING([--with-gamess-uk], [use GAMESS-UK distribution specified]), [if test "$withval" = yes; then AC_MSG_ERROR("Provide the root directory of GAMESS-UK") elif test "$withval" = no; then LINK_GAMESS=0 AC_MSG_RESULT(NO) else LINK_GAMESS=1 gamessukdir=$withval AC_DEFINE(GAMESS) AC_MSG_RESULT($withval) fi], [AC_MSG_RESULT(no)]) export LINK_GAMESS AC_MSG_CHECKING(if direct linking with GULP wanted) LINK_GULP=0 AC_ARG_WITH(gulp, AC_HELP_STRING([--with-gulp], [use GULP distribution specified]), [if test "$withval" = yes; then AC_MSG_ERROR("Provide the root directory of GULP") elif test "$withval" = no; then LINK_GULP=0 AC_MSG_RESULT(NO) else LINK_GULP=1 gulpdir=$withval AC_DEFINE(GULP) AC_MSG_RESULT($withval) fi], [AC_MSG_RESULT(no)]) export LINK_GULP AC_MSG_CHECKING(if GA-based parallelism is needed) LINK_GA=0 AC_ARG_WITH(ga, AC_HELP_STRING([--with-ga], [use the Global Array tools (and optionally specify the location)]), [if test "$withval" = yes; then LINK_GA=1 PARALLEL=1 gadir=../../g if test $LINK_GAMESS -eq 1 then gadir=$gamessukdir/g fi AC_MSG_RESULT(YES) elif test "$withval" = no; then LINK_GA=0 AC_MSG_RESULT(NO) else LINK_GA=1 PARALLEL=1 gadir=$withval AC_DEFINE(GA) AC_MSG_RESULT($withval) fi], [AC_MSG_RESULT(no)]) export LINK_GA # AC_MSG_CHECKING(if Peigs librariy) LINK_PEIGS=0 AC_ARG_WITH(peigs, AC_HELP_STRING([--with-peigs], [use PEIGS distribution specified]), [if test "$withval" = yes; then LINK_PEIGS=1 if test $LINK_GAMESS -eq 0 then echo Peigs not available unless GAMESS-UK is part of the build exit -1 fi peigsdir=$gamessukdir/peigs AC_MSG_RESULT(YES) elif test "$withval" = no; then LINK_PEIGS=0 AC_MSG_RESULT(NO) else LINK_PEIGS=1 peigsdir=$withval AC_DEFINE(PEIGS) AC_MSG_RESULT($withval) fi], [AC_MSG_RESULT(no)]) export LINK_PEIGS # AC_MSG_CHECKING(if TCGMSG requested build) SKIP_TCGMSG=0 AC_ARG_WITH(tcgmsg, AC_HELP_STRING([--with-tcgmsg], [use TCGMSG component of GA]), [if test "$withval" = yes; then if test $LINK_GA -eq 0 then echo TCGMSG not available unless GA build exit -1 fi AC_MSG_RESULT(YES) elif test "$withval" = no; then SKIP_TCGMSG=1 AC_MSG_RESULT(NO) else SKIP_TCGMSG=0 echo invalid setting --with-tcgmsg= $withval AC_MSG_RESULT($withval) fi], [AC_MSG_RESULT(no)]) export SKIP_TCGMSG # Check for MPI AC_MSG_CHECKING(if linking to MPI is needed) LINK_MPI=0 AC_ARG_WITH(mpi, AC_HELP_STRING([--with-mpi], [use MPI libraries as specified]), [if test "$withval" = "yes"; then LINK_MPI=1 PARALLEL=1 # # need mpi defaults here (? take from environment) # # AC_MSG_RESULT(YES) elif test "$withval" = "no"; then LINK_MPI=0 AC_MSG_RESULT(NO) else LINK_MPI=1 LIBMPI="-lmpi" PARALLEL=1 MPI_INCLUDE="-I $withval/include" MPI_LIB="-I $withval/lib" AC_DEFINE(MPI) AC_MSG_RESULT($withval) fi], [AC_MSG_RESULT(no)]) export LINK_MPI # Check for integer8 AC_MSG_CHECKING(if integer*8 requested) INTEGER8=0 AC_ARG_WITH(integer8, AC_HELP_STRING([--with-integer8], [use long (64bit) integers]), [if test "$withval" = yes; then INTEGER8=1 # AC_MSG_RESULT(YES) elif test "$withval" = no; then INTEGER8=0 AC_MSG_RESULT(NO) else INTEGER8=1 AC_MSG_RESULT(YES) fi], [AC_MSG_RESULT(no)]) export INTEGER8 # Save User-specified flags # and may need additional (gromos, mopac.. here?) user_CFLAGS=${CFLAGS:-unset} user_FFLAGS=${FFLAGS:-unset} user_F90FLAGS=${F90FLAGS:-unset} user_F90=${F90:-unset} user_F77=${F77:-unset} user_LD=${LD:-unset} user_LDFLAGS=${LDFLAGS:-unset} user_LDCFLAGS=${LDCFLAGS:-unset} if test $user_F90 != 'unset' then if test $user_F77 == 'unset' then user_F77=$user_F90 F77=$F90 fi fi # # Check arguments for validity to catch any mis-spellings # crash=0 for x in $* do ok=0 t1=`echo $x | awk -F= '{print $1}'` t2=`echo $x | awk -F= '{print $2}'` if test $t1 = '--with-gamess-uk';then ok=1; fi if test $t1 = '--with-gulp';then ok=1; fi if test $t1 = '--with-mpi'; then ok=1; if test "$t2" != ""; then echo '--with-mpi doesnt accept an mpi location';crash=1;fi fi if test $t1 = '--with-peigs';then ok=1; fi if test $t1 = '--with-ga';then ok=1; fi if test $t1 = '--with-integer8';then ok=1; fi if test $t1 = '--with-tcgmsg';then ok=1; fi if test $ok -eq 0; then echo 'Invalid argument ' $t1; crash=1; fi done if test $crash -eq 1; then exit; fi # echo "User-supplied flags:" echo "F90: $user_F90" echo "F77: $user_F77" echo "CFLAGS: $user_CFLAGS" echo "FFLAGS: $user_FFLAGS" echo "F90FLAGS: $user_F90FLAGS" echo "LDFLAGS: $user_LDFLAGS" echo "LDCFLAGS: $user_LDCFLAGS" # Switches for graphical capabilities (pretty much obsolete) USE_TK=0 export USE_TK USE_OPENGL=0 export USE_OPENGL USE_MESA=0 export USE_MESA # Checks for programs. # one of the commented out ones sets LD (may be needed later) dnl AC_PROG_AWK AC_PROG_CC AC_PROG_F77 AC_PROG_F90 AC_PROG_LN_S dnl AC_PROG_MAKE_SET dnl AC_PROG_CPP AC_PROG_RANLIB # Reset flags set by AC_PROG macros if test "$user_CFLAGS" != "unset" ; then CFLAGS="$user_CFLAGS" else CFLAGS="" fi if test "$user_FFLAGS" != "unset" ; then FFLAGS="$user_FFLAGS" else FFLAGS="" fi if test "$user_F90FLAGS" != "unset" ; then F90FLAGS="$user_F90FLAGS" else F90FLAGS="" fi if test "$user_LDFLAGS" != "unset" ; then LDFLAGS="$user_LDFLAGS" else LDFLAGS="" fi CPP=/lib/cpp ARCHIVE="ar rcv" dnl ------------------------------------------------------------ dnl Useful subroutines from: dnl Bruce Blinn, "Portable Shell Programming" dnl Prentice-Hall, 1996, ISBN 0-13-451494-7 dnl ------------------------------------------------------------ dnl ------------------------------------------------------------ dnl Define BSD/SYSV-compliant write dnl ------------------------------------------------------------ Write() { if test "`echo -n`" = "-n" ; then echo "$@\c" else echo -n "$@" fi } GetYesNo() { _ANSWER= while test "1" -eq "1" ; do if test "`echo -n`" = "-n" ; then echo "$@\c" else echo -n "$@" fi read _ANSWER case "$_ANSWER" in y | Y | yes | YES | Yes) return 0 ;; n | N | no | NO | No ) return 1 ;; * ) echo "Please enter y or n." ;; esac done } dnl ------------------------------------------------------------ dnl Find Location of Tcl dnl ------------------------------------------------------------ AC_DEFUN(AC_TCLROOT,[ #!/bin/sh Write 'checking Tcl location ... ' tclroot=${TCLROOT:=undef} dnl emulate 'case' by 'if echo...' to maximize portability if echo "$tclroot" | grep "undef" >/dev/null; then echo echo 'Please specify TCLROOT' echo 'This should reference' echo ' $TCLROOT/include/tcl.h' echo ' $TCLROOT/lib/libtcl8.4.so' echo 'etc' Write 'Enter TCLROOT : ' read ans TCLROOT=$ans else echo "TCLROOT set to $tclroot" fi ]) AC_TCLROOT # obvious dangers of incompatibilities here TCL_INCLUDE=$TCLROOT/include TCL_LIB_DIR=$TCLROOT/lib TCL_LIB_FLAG=-ltcl8.4 TTT=${LIBTCL:=undef} if echo "$TTT" | grep "undef" >/dev/null; then LIBTCL="-L$TCLROOT/lib -R$TCLROOT/lib $TCL_LIB_FLAG" else echo "LIBTCL set to $LIBTCL" fi # # Checks for libraries. # Checks for libraries. # a number of these can be stripped out # # FIXME: Replace `main' with a function in `-ladebug': dnl AC_CHECK_LIB([adebug], [main]) # # Searches for Tcl in system places are suppressed # for the moment for safety, we need to be able to i # include the nominated directory in the search # dnl AC_CHECK_LIB([tcl], [Tcl_CreateCommand]) dnl if test $ac_cv_lib_tcl_Tcl_CreateCommand = yes; then dnl LIBTCL="" dnl fi dnl AC_CHECK_LIB([tcl8.4], [Tcl_CreateCommand]) dnl if test $ac_cv_lib_tcl8_4_Tcl_CreateCommand = yes; then dnl LIBTCL="" dnl fi dnl AC_CHECK_LIB([tcl84], [Tcl_CreateCommand]) dnl if test $ac_cv_lib_tcl84_Tcl_CreateCommand = yes; then dnl LIBTCL="" dnl fi # FIXME: Replace `main' with a function in `-lc': AC_CHECK_LIB([c], [main]) HAVE_BLAS_LIB=0 HAVE_LAPACK_LIB=0 HAVE_LINPACK_LIB=0 HAVE_EISPACK_LIB=0 #hms Disabled checking for libblas: For some compilers (e.g., #hms PGI's) libblas is in the standard search path, but #hms is an unoptimized version of BLAS one does not really #hms want to use. #AC_CHECK_LIB([blas], [daxpy]) #if test $ac_cv_lib_blas_daxpy = yes; then # HAVE_BLAS_LIB=1 #fi #AC_CHECK_LIB([blas], [daxpy_]) #if test $ac_cv_lib_blas_daxpy_ = yes; then # HAVE_BLAS_LIB=1 #fi #hms DXML is really outdated by now; skip it #AC_CHECK_LIB([dxml], [daxpy]) #if test $ac_cv_lib_dxml_daxpy = yes; then # HAVE_BLAS_LIB=1 #fi #AC_CHECK_LIB([dxml], [daxpy_]) #if test $ac_cv_lib_dxml_daxpy_ = yes; then # HAVE_BLAS_LIB=1 #fi AC_CHECK_LIB([cxml], [daxpy_]) if test $ac_cv_lib_cxml_daxpy_ = yes; then HAVE_BLAS_LIB=1 fi AC_CHECK_LIB([cxml], [dgetrf_]) if test $ac_cv_lib_cxml_dgetrf_ = yes; then HAVE_LAPACK_LIB=1 fi AC_CHECK_LIB([cxml], [tred1_]) if test $ac_cv_lib_cxml_tred1_ = yes; then HAVE_EISPACK_LIB=1 fi AC_CHECK_LIB([cxml], [dgedi_]) if test $ac_cv_lib_cxml_dgedi_ = yes; then HAVE_LINPACK_LIB=1 fi # FIXME: Replace `main' with a function in `-lm': AC_CHECK_LIB([m], [main]) # FIXME: Replace `main' with a function in `-lmpi': dnl AC_CHECK_LIB([mpi], [main]) # System checks and machine dependent flags # NB This is not the way autoconf is meant to be used!! AC_CANONICAL_SYSTEM # Checks for programs. # skip quasi for now CORE_DIRS='util block objects fragment trmat field xtal matrix zmatrix cutils futils trmat hybrid opt newopt basis bintrj dl_poly dynamics vibrate lsqfit' # these contain no chemshell interface (or Tcl) files PROG_DIRS='mndocore symmetry' PROGNAME=chemsh.x # For processing the script (uses ccnvert processor) ARCH=unknown SCRIPT_FLAGS=notk # Lots more to do for MOPAC5 here.... # MOPAC5_FFLAGS='$(FFLAGS)' MOPAC5_CFLAGS='$(CFLAGS)' MOPAC5_LDFLAGS='$(LDFLAGS)' MOPAC5_EXTRAS='igetarg.o' # Need to switch gromos in/out # Initialise C and F Flags # if test $INTEGER8 -eq 1; then MACHINE_CFLAGS="-DF_INT_IS_LONG" # This will need to be overwritten for many platforms # so best to handle consistently below # MACHINE_FFLAGS="-i8" # use of integer*8 means we need fortran code here HAVE_BLAS_LIB=0 HAVE_LAPACK_LIB=0 HAVE_LINPACK_LIB=0 HAVE_EISPACK_LIB=0 else MACHINE_CFLAGS="" MACHINE_FFLAGS="" fi MACHINE_LDFLAGS="" # Defaults for building GROMOS routines GROMOS_FC=$F90 GROMOS_FFLAGS='-r8 -u $(FFLAGS)' # # ======= Settings for specific architectures or compilers ======= # # # first allow manual compiler choice for wrappers (mpif90 etc) F77TEST=${F77} if test ${COMPILER_IS_PGI:=0} == 1; then F77TEST=pgf fi if test ${COMPILER_IS_INTEL:=0} == 1; then F77TEST=ifort fi if test ${COMPILER_IS_GFORTRAN:=0} == 1; then F77TEST=gfortran fi if test ${COMPILER_IS_G95:=0} == 1; then F77TEST=g95 fi if echo "$target_os" | grep "osf" >/dev/null; then # ask for f90 echo 'OSF Detected' # CXML libs already detected and set above # Add i8 if requested if test $INTEGER8 -eq 1; then T=$MACHINE_FFLAGS; MACHINE_FFLAGS=$T" -i8" fi T=$MACHINE_FFLAGS; MACHINE_FFLAGS=$T" -fast -O5 -math_library accurate -r8" T=$MACHINE_CFLAGS # Can't use -fast for cc because it assumes standard compliance MACHINE_CFLAGS=$T" -DTRU64 -O4 -fp_reorder -assume nomath_errno -ifo -arch host -tune host -D_INTRINSICS -D_INLINE_INTRINSICS" F90FLAGS=$FFLAGS MACHINE_LDFLAGS="-fast -O5 -math_library accurate" LDCFLAGS="-O4 -fp_reorder -assume nomath_errno -ifo -arch host -tune host" GROMOS_FFLAGS='$(FFLAGS) -u' fi if echo "$target_os" | grep "irix" >/dev/null; then echo 'Irix Detected' MOPAC5_FFLAGS='-static -G 0' MOPAC5_EXTRAS='date.o igetarg.o' # Add i8 if requested if test $INTEGER8 -eq 1; then T=$MACHINE_FFLAGS; MACHINE_FFLAGS=$T" -i8" fi T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T' -DSGI' fi if echo "$target_os" | grep "cygwin" >/dev/null; then CPPTRAD='-traditional' CPP=/usr/bin/cpp PROGNAME=chemshprog.exe # we will use the system one so dont need this if echo "$F77TEST" | grep "pgf" >/dev/null; then echo 'Cygwin Detected, PGF compilers' # Add i8 if requested if test $INTEGER8 -eq 1; then T=$MACHINE_FFLAGS; MACHINE_FFLAGS=$T" -i8storage" fi T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T' -DLINUX -DPGF90' # try prepending the new definitions, so that blas is loaded # from PGI rather than /usr/local T=$LIBS if echo "$target_cpu" | grep "x86_64" >/dev/null; then LIBS='-L$(PGI)/linux86-64/6.0/lib -llapack -lblas '$T else LIBS='-L$(PGI)/linux86/lib -llapack -lblas '$T fi echo ........... check gromos flags please -r8 -u -Nn1604 $(FFLAGS) GROMOS_FFLAGS='-r8 -u -Nn1604 $(FFLAGS)' elif echo "$F77TEST" | grep "gfortran" >/dev/null; then # GNU section echo 'Cygwin Detected, gfortran compiler' T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T' -DLINUX ' # need to check # GROMOS_FFLAGS='-r8 -u -Nn1604 $(FFLAGS)' F90FLAGS=-fpointer=NULL # Mopac5 not working yet MOPAC5_FFLAGS=-static MOPAC5_EXTRAS='date_c.o ctime.o igetarg.o' # need extra env var to unbuffer stdout # T=$SCRIPT_FLAGS # SCRIPT_FLAGS="$T g95" elif echo "$F77TEST" | grep "g95" >/dev/null; then # GNU section echo 'Cygwin Detected, g95 compiler' T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T' -DLINUX -DLINUXF2C' GROMOS_FFLAGS='-r8 -u -Nn1604 $(FFLAGS)' F90FLAGS=-fpointer=NULL # Mopac5 not working yet MOPAC5_FFLAGS=-static MOPAC5_EXTRAS='date_c.o ctime.o igetarg.o' # need extra env var to unbuffer stdout T=$SCRIPT_FLAGS SCRIPT_FLAGS="$T g95" else echo Compiler not recognised : $F77 echo If you are using a compiler wrapper, eg mpif90, please set one of these environent variables to 1 echo COMPILER_IS_INTEL, COMPILER_IS_PGI, COMPILER_IS_GFORTRAN, COMPILER_IS_G95 echo exit -1 fi ARCH=cygwin fi if echo "$target_os" | grep "linux" >/dev/null; then if echo "$target_cpu" | grep "alpha" >/dev/null; then echo 'Linux (alpha) Detected' GA_TARGET=LINUX64 elif echo "$target_cpu" | grep "x86_64" >/dev/null; then echo 'Linux 64bit (x86_64) Detected' GA_TARGET=LINUX64 else echo 'Linux (x86) Detected' GA_TARGET=LINUX fi ARCH=linux CPPTRAD='-traditional' # cc -E cannot read from stdin as required CPP=/lib/cpp GROMOS_FFLAGS='$(FFLAGS) -r8 -u -Nn1604' if echo "$F77TEST" | grep "pgf" >/dev/null; then echo PGF selected T=$MACHINE_CFLAGS; MACHINE_CFLAGS="-DLINUX -DPGF90 "$T # Check for ACML (bundled with PGI compilers) AC_LANG(Fortran 77) AC_CHECK_LIB([acml], [daxpy]) if test $ac_cv_lib_acml_daxpy = yes; then HAVE_BLAS_LIB=1 fi AC_CHECK_LIB([acml], [dgetrf]) if test $ac_cv_lib_acml_dgetrf = yes; then HAVE_LAPACK_LIB=1 fi AC_CHECK_LIB([acml], [tred1]) if test $ac_cv_lib_acml_tred1 = yes; then HAVE_EISPACK_LIB=1 fi AC_CHECK_LIB([acml], [dgedi]) if test $ac_cv_lib_acml_dgedi = yes; then HAVE_LINPACK_LIB=1 fi if echo "$CC" | grep "pgcc" >/dev/null; then T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T" -fastsse -Kieee" elif echo "$CC" | grep "gcc" >/dev/null; then T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T" -O2 -mieee-fp" # Assuming we are using ACML, GCC needs to know where it is PGPATH=`echo \`which pgf90\` | sed 's@/bin/pgf90@@'` MACHINE_LDFLAGS="-L$PGPATH/lib" LDCFLAGS="-O2 -mieee-fp -L$PGPATH/lib" fi if test $INTEGER8 -eq 1; then HAVE_BLAS_LIB=0 HAVE_LAPACK_LIB=0 MACHINE_FFLAGS="-i8 -i8storage" #hms Commented out: Overrules the ACML configured above by unoptimized BLAS and LAPACK #hms libs; introduces a hard-wired path to a specific compiler version! #hms else #hms HAVE_BLAS_LIB=1 #hms HAVE_LAPACK_LIB=1 # try prepending the new definitions, so that blas is loaded # from PGI rather than /usr/local #hms T=$LIBS #hms if echo "$target_cpu" | grep "x86_64" >/dev/null; then #hms LIBS='-L$(PGI)/linux86-64/6.0/lib -llapack -lblas '$T #hms else #hms LIBS='-L$(PGI)/linux86/6.0/lib -llapack -lblas '$T #hms fi fi T=$MACHINE_FFLAGS; MACHINE_FFLAGS=$T" -fastsse -Kieee -Mr8" F90FLAGS=$FFLAGS T=$MACHINE_LDFLAGS; MACHINE_LDFLAGS=$T" -fastsse -Kieee" GROMOS_FFLAGS='$(FFLAGS) -Mdclchk -Mr8' MOPAC5_FFLAGS='$(FFLAGS) -Msave -Mr8' elif echo "$F77" | grep "ifc" >/dev/null; then echo Please now use ifort as the name of the Intel fortran compiler exit -1 elif echo "$F77TEST" | grep "ifort" >/dev/null; then T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T' -DLINUX -DIFC' MOPAC5_FFLAGS='-save' #### LIBS_F90=-lPEPCF90 LIBS_F90= # Add i8 flag if requested if test $INTEGER8 -eq 1; then T=$MACHINE_FFLAGS; MACHINE_FFLAGS=$T" -i8" fi # GNU section elif echo "$F77TEST" | grep "gfortran" >/dev/null; then echo 'Linux Detected, gfortran compiler' T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T' -DLINUX ' # GROMOS_FFLAGS='-r8 -u -Nn1604 $(FFLAGS)' # F90FLAGS=-fpointer=NULL # Mopac5 not working yet ??? MOPAC5_FFLAGS=-static MOPAC5_EXTRAS='date_c.o ctime.o igetarg.o' # need extra env var to unbuffer stdout # T=$SCRIPT_FLAGS # SCRIPT_FLAGS="$T g95" elif echo "$F77TEST" | grep "g95" >/dev/null; then echo 'Linux Detected, g95 compiler' T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T' -DLINUX -DLINUXF2C' GROMOS_FFLAGS='-r8 -u -Nn1604 $(FFLAGS)' F90FLAGS=-fpointer=NULL # Mopac5 not working yet MOPAC5_FFLAGS=-static MOPAC5_EXTRAS='date_c.o ctime.o igetarg.o' # need extra env var to unbuffer stdout T=$SCRIPT_FLAGS SCRIPT_FLAGS="$T g95" else echo Compiler not recognised : $F77 echo If you are using a compiler wrapper, eg mpif90, please set one of these environent variables to 1 echo COMPILER_IS_INTEL, COMPILER_IS_PGI, COMPILER_IS_GFORTRAN, COMPILER_IS_G95 echo exit -1 fi fi # added Mac OSX support, tested for 10.5.5 if echo "$target_os" | grep "darwin" >/dev/null; then CPP=/usr/bin/cpp if echo "$F77TEST" | grep "g95" >/dev/null; then # GNU section echo 'MacOSX Detected, g95 compiler' T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T' -DLINUX -DLINUXF2C' GROMOS_FFLAGS='-r8 -u -Nn1604 $(FFLAGS)' F90FLAGS=-fpointer=NULL # Mopac5 not working yet MOPAC5_FFLAGS=-static MOPAC5_EXTRAS='date_c.o ctime.o igetarg.o' # need extra env var to unbuffer stdout T=$SCRIPT_FLAGS SCRIPT_FLAGS="$T g95" else echo Compiler not recognised on osx: $F77 echo Only g95 is supported by this version of the configure script echo If you are using a compiler wrapper, eg mpif90, please set one of these environent variables to 1 echo COMPILER_IS_INTEL, COMPILER_IS_PGI, COMPILER_IS_GFORTRAN, COMPILER_IS_G95 echo exit -1 fi fi if echo "$target_os" | grep "aix" >/dev/null; then echo 'AIX Detected' MOPAC5_FFLAGS=-g MOPAC5_EXTRAS='date_c.o flush_dum.o ctime.o igetarg.o' # extname case T=$MACHINE_FFLAGS; MACHINE_FFLAGS=$T' -qextname' T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T' -DAIX -DRS6000' # no extname case #T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T' -DAIX -DRS6000 -DNOC_' MAKESHELL='/bin/sh' MAKEPROG='gmake' BITS64=1 if test $PARALLEL -eq 1; then # special stuff for running parallel using POE PROGNAME=chemsh.x.poe SP2SCRIPT=../../scripts/sp2_submit T=$SCRIPT_FLAGS SCRIPT_FLAGS="$T sp2" fi ARCH=aix T1="" if test $BITS64 -eq 1; then T1=-q64 fi T2="" if test $INTEGER8 -eq 1; then T2=-qintsize=8 fi T=$MACHINE_FFLAGS; MACHINE_FFLAGS="$T $T1 $T2" T=$MACHINE_CFLAGS; MACHINE_CFLAGS="$T $T1" if test $BITS64 -eq 1; then GA_TARGET=LAPI64 T=$MACHINE_LDFLAGS; MACHINE_LDFLAGS=$T' -q64' echo appending x64 to ldflags ARCHIVE="ar -X 64 rcv" else GA_TARGET=LAPI T=$MACHINE_LDFLAGS; MACHINE_LDFLAGS="$T -bmaxdata:500000000 -bmaxstack:500000000" fi poe=0 # Handling of GA parallel case (LAPI-based) if test $LINK_GA -eq 1; then FLD=mpxlf_r T=$MACHINE_LDFLAGS; MACHINE_LDFLAGS="$T -lpthread" # Invoke poe version of the chemsh script poe=1 fi if test $LINK_MPI -eq 1;then FLD=mpxlf poe=1 fi if test $poe -eq 1; then # configure POE settings T=$SCRIPT_FLAGS;SCRIPT_FLAGS="$T poe" PROGNAME=chemsh.x.poe SP2SCRIPT=../../scripts/sp2_submit fi F90FLAGS="$F90FLAGS -qsuffix=f=f90" fi if echo "$target_os" | grep "hpux" >/dev/null; then echo 'HPUX Detected' # For HP Itanium systems T=$MACHINE_CFLAGS; MACHINE_CFLAGS=$T' -DHPUX' T=$FFLAGS; MOPAC5_FFLAGS=$T' -K' MOPAC5_EXTRAS='igetarg.o date_c.o flush_dum.o ctime.o' # These are IN ADDITION to the standard flags OPT_FFLAGS='+U77' OPT_LDFLAGS='+U77' ARCH=hpux HAVE_BLAS_LIB=1 HAVE_LAPACK_LIB=1 HAVE_LINPACK_LIB=1 HAVE_EISPACK_LIB=1 T=$LIBS LIBS=$T' -Wl,-aarchive_shared -llapack -lveclib' fi # Code to handle Fortran version of libraries MYBLAS=../../lib/libblas.a MYLAPACK=../../lib/liblapack.a MYLINPACK=../../lib/liblinpack.a MYEISPACK=../../lib/libeispack.a NUM_DIRS="" if test $HAVE_BLAS_LIB -eq 1 then echo Using system blas BLAS="" else BLAS=$MYBLAS NUM_DIRS="$NUM_DIRS blas" fi if test $HAVE_LAPACK_LIB -eq 1 then echo Using system lapack LAPACK="" else LAPACK=$MYLAPACK NUM_DIRS="$NUM_DIRS lapack" fi if test $HAVE_LINPACK_LIB -eq 1 then echo Using system linpack LINPACK="" else LINPACK=$MYLINPACK NUM_DIRS="$NUM_DIRS linpack" fi if test $HAVE_EISPACK_LIB -eq 1 then echo Using system eispack EISPACK="" else EISPACK=$MYEISPACK NUM_DIRS="$NUM_DIRS eispack" fi AC_DEFUN(AC_CHEMSHELL_CONFIG,[ #!/bin/sh dnl dnl This used to be the config target in the src/chemsh Makefile dnl The one result we really need for use in the Makefile generation dnl process is the list of libraries, which we can get by sourcing dnl the resulting chemsh_libs files dnl we also have: dnl a list of directories to add to the path - not used dnl code fragments for declaration and execution - OK dnl However we should include the subdirectory loop directly in this script dnl echo 'Executing ChemShell module configure \(src/chemsh/module_config.sh\)' cd ../chemsh ./module_config.sh . ./chemsh_libs cd ../config ]) AC_DEFUN(AC_LOOP_TEST,[ #!/bin/sh dnl dnl Test of embedded loop, this only prints anything when the dnl loop has finished so it is not ideal dnl echo 'executing loop test' TXT='' cd .. dirlist=`/bin/ls` for dir in $dirlist ; do \ if test -d $dir; then cd $dir tester=-1 if test -f CHEMSH_SWITCH >& /dev/null ; then tester=1 if ./CHEMSH_SWITCH ; then tester=0 fi fi if test $tester = 0; then TXT="$TXT $dir" fi cd .. fi done cd config ]) AC_CHEMSHELL_CONFIG # Checks for header files. dnl AC_HEADER_STDC dnl nl AC_HEADER_SYS_WAIT dnl AC_CHECK_HEADERS([fcntl.h locale.h malloc.h memory.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/param.h sys/socket.h sys/time.h sys/timeb.h unistd.h utmp.h]) # Checks for typedefs, structures, and compiler characteristics. dnl AC_C_CONST dnl AC_TYPE_SIZE_T dnl AC_HEADER_TIME dnl AC_STRUCT_TM # Checks for library functions. dnl AC_FUNC_MALLOC dnl AC_FUNC_REALLOC dnl AC_FUNC_SELECT_ARGTYPES dnl AC_FUNC_STRTOD dnl AC_CHECK_FUNCS([bzero gethostbyname gethostname gettimeofday memset pow putenv select setlocale socket sqrt strcasecmp strdup strtol]) # # Select the appropriate makefile for DL-FIND # rm -f ../dl-find/makefile ../dl-find/Makefile.in ${LN_S} Makefile.in.chemsh ../dl-find/Makefile.in # Need any special configuration for MNDO here # Add Peigs library if test $LINK_PEIGS -eq 1;then PEIGS=$peigsdir/lib/$GA_TARGET/libpeigs.a else PEIGS="" fi # DL_POLY, GAMESS-UK and GULP parallel config if test $LINK_GA -eq 1 then T=$DLPOLY_CPPFLAGS DLPOLY_CPPFLAGS="$T -DTCGMSG -DSTRESS" DLPOLY_CFLAGS=-DDLPOLY_MASTERSLAVE GULP_PARALLEL_FLAG=-DPARALLEL T=$EXTRAS if test $SKIP_TCGMSG -eq 1; then EXTRAS="$T tcg2mpi.o parallel_ga.o masterslave.o" else EXTRAS="$T masterslave.o parallel_ga.o" fi T=$CFLAGS CFLAGS="$T -DMASTERSLAVE -DTCGMSG" GA_TOP=$gadir ### echo SKIP_TCGMSG $SKIP_TCGMSG if test $SKIP_TCGMSG -eq 0; then if test $LINK_MPI -eq 1; then TCG=$GA_TOP/lib/$GA_TARGET/libtcgmsg-mpi.a else TCG=$GA_TOP/lib/$GA_TARGET/libtcgmsg.a fi else TCG= fi PAR="$GA_TOP/lib/$GA_TARGET/libglobal.a \ $TCG \ $GA_TOP/lib/$GA_TARGET/libarmci.a \ $GA_TOP/lib/$GA_TARGET/libma.a \ $GA_TOP/lib/$GA_TARGET/liblinalg.a $PEIGS" GA_F77_INC=-I${GA_TOP}/include GA_F77_DEFS= elif test $LINK_MPI -eq 1 then DLPOLY_CPPFLAGS="-DMPI -DSTRESS ${MPIINC}" DLPOLY_CFLAGS=-DDLPOLY_MASTERSLAVE GULP_PARALLEL_FLAG=-DPARALLEL T=$EXTRAS EXTRAS="$T tcg2mpi.o parallel.o masterslave.o" T=$CFLAGS CFLAGS="$T -DMASTERSLAVE -DMPI" # this just switches in mpirun T=$SCRIPT_FLAGS; SCRIPT_FLAGS="$T mpi" else DLPOLY_CPPFLAGS='-DSERIAL -DSTRESS' DLPOLY_CFLAGS='' GULP_PARALLEL_FLAG='' T=$EXTRAS EXTRAS="$T serial.o" fi # # Extra libs for direct-linking to other applications # if test $LINK_GULP -eq 1 then GULPTMP="$gulpdir/libgulp.a \ $gulpdir/Src/FoX-4.0.3/objs/lib/libFoX_common.a \ $gulpdir/Src/FoX-4.0.3/objs/lib/libFoX_utils.a \ $gulpdir/Src/FoX-4.0.3/objs/lib/libFoX_fsys.a \ $gulpdir/Src/FoX-4.0.3/objs/lib/libFoX_wxml.a \ $gulpdir/Src/FoX-4.0.3/objs/lib/libFoX_wcml.a" OPT_GULP=interface_gulp fi if test $LINK_GAMESS -eq 1 then # # check here could include, what names are resolved, # what names are needed # if it exists # GAMTMP="$gamessukdir/m4/libgamess.a \ $gamessukdir/newscf/libnewscf.a \ $gamessukdir/dft/libdft.a \ $gamessukdir/linalg/liblinalg.a" # # Support for peigs-only (no GA) build of GAMESS # if test $LINK_PEIGS -eq 1; then if test $LINK_GA -eq 0; then PAR="$gamessukdir/g/lib/$GA_TARGET/libma.a $PEIGS" fi fi OPT_GAMESS=interface_gamess_2 fi APPLIBS="$GULPTMP $GAMTMP" # # Allow customisation of load line with extra libraries # T=$LIBS LIBS="$T $USERLIBS" # # Append any extra machine dependent compiler flags to the autogenerated ones # This is skipped if the user is overriding the variables if test "$user_FFLAGS" = unset; then T=$FFLAGS; FFLAGS=$T" $MACHINE_FFLAGS" fi if test "$user_F90FLAGS" = unset; then T=$F90FLAGS; F90FLAGS=$T" $MACHINE_FFLAGS" fi if test "$user_CFLAGS" = unset; then T=$CFLAGS; CFLAGS=$T" $MACHINE_CFLAGS" fi if test "$user_LDFLAGS" = unset; then T=$LDFLAGS; LDFLAGS=$T" $MACHINE_LDFLAGS" fi # LDCFLAGS: User-supplied value override if test "$user_LDCFLAGS" != unset; then LDCFLAGS="$user_LDCFLAGS" fi # If nothing has been set, use LDFLAGS as LDCFLAGS if test "$LDCFLAGS" = ""; then LDCFLAGS="$LDFLAGS" fi #---------------------------------------------------------- # Choose the commmand to load the program # this may be set using the LD variable # otherwise if FLD is set in the preceding sections we use this # otherwise we use the F90 compiler #---------------------------------------------------------- test_LD=${LD+set} test_FLD=${FLD+set} if test "$test_LD" = set; then echo ok > /dev/null elif test "$test_FLD" = set; then LD="$FLD" else LD="$F90" fi # If blas and lapack are available NUMERIC="$PAR $LAPACK $EISPACK $LINPACK $BLAS" T=$OPT_DIRS OPT_DIRS="$T $OPT_GAMESS $OPT_GULP" set > config.vars MACHINE_CFLAGS="" AC_SUBST(MACHINE_CFLAGS) AC_SUBST(LDCFLAGS) AC_SUBST(CPP) AC_SUBST(CPPTRAD) AC_SUBST(ARCHIVE) AC_SUBST(TCL_INCLUDE) AC_SUBST(LIBTCL) AC_SUBST(TCLROOT) AC_SUBST(LD) AC_SUBST(MOPAC5_FFLAGS) AC_SUBST(MOPAC5_EXTRAS) AC_SUBST(MOPAC5_CFLAGS) AC_SUBST(MOPAC5_LDFLAGS) AC_SUBST(LIBS_F90) AC_SUBST(GROMOS_FC) AC_SUBST(GROMOS_FFLAGS) AC_SUBST(OPT_FFLAGS) AC_SUBST(OPT_LDFLAGS) AC_SUBST(GULP_PARALLEL_FLAG) AC_SUBST(DLPOLY_CPPFLAGS) AC_SUBST(DLPOLY_CFLAGS) AC_SUBST(EXTRAS) AC_SUBST(NUMERIC) AC_SUBST(PROGNAME) AC_SUBST(MODULE_LIBS) AC_SUBST(CORE_DIRS) AC_SUBST(OPT_DIRS) AC_SUBST(NUM_DIRS) AC_SUBST(PROG_DIRS) AC_SUBST(ARCH) AC_SUBST(SCRIPT_FLAGS) AC_SUBST(APPLIBS) AC_SUBST(GA_F77_INC) AC_SUBST(GA_F77_DEFS) AC_SUBST(SP2SCRIPT) AC_SUBST(MAKESHELL) AC_SUBST(MAKEPROG) AC_SUBST(MPIINC) AC_CONFIG_FILES([../Makefile ../ccnvrt/Makefile ../bintrj/Makefile ../blas/Makefile ../block/Makefile ../chemsh/Makefile ../chemsh/arch.tcl ../cutils/Makefile ../dl_poly/Makefile ../dynamics/Makefile ../eispack/Makefile ../field/Makefile ../fragment/Makefile ../futils/Makefile ../hdlcopt/Makefile ../hybrid/Makefile ../interface_charmm/Makefile ../interface_dmol3/Makefile ../interface_gamess/Makefile ../interface_gamess_2/Makefile ../interface_gromos/Makefile ../interface_gulp/Makefile ../interface_nwchem/Makefile ../lapack/Makefile ../linpack/Makefile ../lsqfit/Makefile ../machine_check/Makefile ../matrix/Makefile ../mndocore/Makefile ../newopt/Makefile ../objects/Makefile ../opt/Makefile ../trmat/Makefile ../util/Makefile ../vibrate/Makefile ../xtal/Makefile ../zmatrix/Makefile ../symmetry/Makefile ../pointcharge/Makefile ../dl-find/Makefile ../cluster/Makefile ../../doc/manual/htp/Makefile.config]) AC_OUTPUT echo To build ChemShell, now issue echo % cd .. echo % make