[SICOPOLIS:8] Re: SICOPOLIS and Lis

Michelle Tigchelaar mtigch @ hawaii.edu
2012年 5月 14日 (月) 11:58:14 JST


Dear Ralf,
I just wanted to add to this that for me to get the model to compile on
my system I had to make some small adjustments to the configure.in file.
I've attached my version of the file to this email. I saw that you also
made some recent changes to this file, but I haven't checked to compare.
Hope this helps.
Best,
Michelle

On 5/13/12 4:52 PM, Ralf Greve wrote:
> Dear colleagues,
>
> since I heard about some problems, let me remind you that for the 
> shallow shelf approximation solver, the Library of Iterative Solvers for 
> Linear Systems (Lis) _version 1.2.53_ is required. You can download the 
> tarball at <http://www.ssisc.org/lis/download.html>.
>
> Later versions of Lis (currently 1.2.64) don't work so far! If you have 
> an idea why, please let me know... ;-)
>
> Best regards,
>
> Ralf
>
-------------- next part --------------
################################################################################
#
#  configure.in
#
#  Author: Malte Thoma, Thomas Goelles
#
################################################################################

# change the version number here
AC_INIT(src/sicopolis.F90, 3.0, sicohelp @ greveweb.net )

AM_INIT_AUTOMAKE
AC_CONFIG_HEADER(config.h)
AC_ISC_POSIX
AC_PROG_RANLIB


################################################################################
# Compiler check & options
# storing the original FCFLAGS, this is needed because AC_PROG_FC also sets
# the flags to the default -g -O2
OLD_FCFLAGS=$FCFLAGS

#ignoring the FFLAGS which are for F77 compilers
if test "$FFLAGS" != "" ; then
  AC_MSG_WARN([ your FFLAGS are ignored only using FCFLAGS ])
fi

#ignoring the F90FLAGS
if test "$F90FLAGS" != "" ; then
  AC_MSG_WARN([ your F90FLAGS are ignored only using FCFLAGS ])
fi

AC_MSG_NOTICE(searching a Fortran 90 compiler ... )

AC_PROG_FC(ifort ifc gfortran)
if test "$FC" != "" ; then
  AC_MSG_RESULT([using Fortran Compiler >$FC<])
  F77=$FC         # use the same compiler for f77
else
  AC_MSG_ERROR([
   *** no Fortran Compiler $FC found, must exit ********************************
   *** please add your compiler in >configure.in< and run autogen.sh again. **])
fi

################################################################################
# setting compiler flags for all compilers
################################################################################
FCFLAGS="${OLD_FCFLAGS} -I../../ -I../ " # location of config.h
FCFLAGS="${FCFLAGS} -O3 " # default Optimisation options
MODULE_INCLUDE_PATH_FLAG="-I"
################################################################################
# setting compiler flags 
# for specific known compiler 
###############################################################################
case $FC in
   ifc|ifort)
      AC_MSG_NOTICE(assuming this is an intel-compiler ... )
       #flags opt for speed 
       # -u means implicit none
       # -no-prec-div means a less precise but faster division
       # default line length in free from is 7200 characters
      FCFLAGS="${FCFLAGS} -u -no-prec-div -fpp"
      OPENMPFLAG="-openmp"
      LARGEFILEFLAG="-mcmodel=medium -shared-intel"
      ;;
   gfortran*)
      AC_MSG_NOTICE(assuming this is a gnu-compiler ...)
      FCFLAGS="${FCFLAGS} -ffree-line-length-none -fimplicit-none "
      # NOTE: no gfortran equivalent to -no-prec-div found!
      LARGEFILEFLAG='-mcmodel=medium '
      OPENMPFLAG="-fopenmp"
      AC_DEFINE([OLD_GFORTRAN_COMPILER], [],
       [because of a bug in GNU Fortran 95 (GCC 4.0.2)])
      ;;
   *) AC_MSG_ERROR([
      *** unknown compiler flags for $FC, please add flags to configure.in ***
      *** run autogen.sh again. *******************************************]) ;;
esac

################################################################################
# adding the mandatory NETCDF library 
################################################################################
AC_ARG_WITH([netcdf],
    [ --with-netcdf=<dir>],
    [NCPATHSET=1],
    [NCPATHSET=0])
    
# if optional parameter used, extend path flags for compiler and linker
if test $NCPATHSET = 1 ; then
   
   NETCDF_DIR=$withval
   FCFLAGS="${FCFLAGS} $MODULE_INCLUDE_PATH_FLAG$NETCDF_DIR/include"
   LDFLAGS="${LDFLAGS} -L$NETCDF_DIR/lib -lnetcdf "
   #checking the library
   AC_CHECK_FILE($NETCDF_DIR/include/netcdf.mod,[],
                 AC_MSG_ERROR([[coudn't find $NETCDF_DIR/include/netcdf.mod,
                    use --with-netcdf=<dir>]]))
                    
   #since netcdf 4.1.1 a seperate netcdf library for fortran is needed  
   # additional -lnetcdff flag               
   AC_CHECK_FILE($NETCDF_DIR/lib/libnetcdff.a,
                [LDFLAGS="${LDFLAGS} -lnetcdff"],  
                 AC_MSG_NOTICE([[looks like you have an old version of netcdf]]))                 
                    
   AC_CHECK_LIB([netcdf],[main],[],
                [AC_MSG_ERROR([unable to find netcdf-library,
                   please define --with-netcdf=<dir> $LDFLAGS])],[])                   
                                      
  AC_MSG_NOTICE([using the netcdf library])                  
else
   AC_MSG_WARN([did not include the netcdf Library which is recommended])     
fi

################################################################################
# adding the optional LIS library 
################################################################################
AC_ARG_WITH([LIS],
    [ --with-LIS=<dir>],
    [LISPATHSET=1],
    [LISPATHSET=0])
	
# if optional parameter used, extend path flags for compliler and linker
if test $LISPATHSET = 1 ; then
    AC_MSG_NOTICE([using the LIS library])
    LIS_DIR=$withval
    LDFLAGS="${LDFLAGS} -L$LIS_DIR/lib"
    LIBS="${LIBS} -llis"
    #checking for some file
    AC_CHECK_FILE($LIS_DIR/lib/liblis.a,[],
     AC_MSG_ERROR([[coudn't find $LIS_DIR/lib/liblis.a, use --with-LIS=<dir>]]))
    FCFLAGS="${FCFLAGS} $MODULE_INCLUDE_PATH_FLAG$LIS_DIR/include "
    LDFLAGS="${LDFLAGS} -L$LIS_DIR/lib -llis"
fi
################################################################################
# enable openmp
################################################################################
AC_MSG_CHECKING(whether to enable openmp)
openmp_default="no"
AC_ARG_ENABLE(openmp, [  --enable-openmp=[no/yes] to turn on openmp  ],
                       [ enable_openmp=${enableval} ],
                       [ enable_openmp=$openmp_default ])
if test "x$enable_openmp" = "xyes"; then
   FCFLAGS="${FCFLAGS} ${OPENMPFLAG}"
   AC_MSG_RESULT(yes)
else
   AC_MSG_RESULT(no)   
fi
################################################################################
# enable Large File support
################################################################################
AC_MSG_CHECKING(whether to enable large_file)
large_file_default="no"
AC_ARG_ENABLE(large_file,
          [  --enable-large_file=[no/yes] to turn on large file support  ],
          [ enable_large_file=${enableval} ],
          [ enable_large_file=$large_file_default ])
if test "x$enable_large_file" = "xyes"; then
   FCFLAGS="${LARGEFILEFLAG} ${FCFLAGS}"
   AC_MSG_RESULT(yes)
else
   AC_MSG_RESULT(no)   
fi
################################################################################
FFLAGS=$FCFLAGS 

AC_MSG_NOTICE([using this flags: $FCFLAGS ])

#definition of Language and source code extension
AC_LANG([Fortran])

#this sets the variables in all makefiles   
AC_SUBST(LDFLAGS) 
AC_SUBST(FCFLAGS)  
AC_SUBST(FFLAGS)  
AC_SUBST(MODULE_INCLUDE_PATH_FLAG)

#if you add a directory please add it here
AC_CONFIG_FILES(
                src/Makefile \
                tools/Makefile \
                tools/sicograph/Makefile \
         )

AC_OUTPUT


SICOPOLIS メーリングリストの案内