<commit_before>dnl -------------------------------------------------------------
dnl $Id$
dnl -------------------------------------------------------------

dnl -------------------------------------------------------------
dnl PETSc
dnl -------------------------------------------------------------
AC_DEFUN([CONFIGURE_PETSC], 
[
  dnl AC_REQUIRE:
  dnl If the M4 macro AC_PROG_F77 has not already been called, call
  dnl it (without any arguments). Make sure to quote AC_PROG_F77 with
  dnl square brackets. AC_PROG_F77 must have been defined using
  dnl AC_DEFUN or else contain a call to AC_PROVIDE to indicate
  dnl that it has been called.
  AC_REQUIRE([AC_PROG_F77])

  dnl If the user doesn't have any PETSC directory specified, let's check to
  dnl see if it's installed via Ubuntu module
  if test "x$PETSC_DIR" = x ; then
    PETSC_DIR=/usr/lib/petsc
    PETSC_ARCH=linux-gnu-c-opt
  fi

  AC_CHECK_FILE($PETSC_DIR/include/petsc.h,
                PETSC_H_PATH=$PETSC_DIR/include/petsc.h)

  dnl Test to see if PETSC_ARCH set by user.  If not set, then
  dnl disable petsc.
  if test "x$PETSC_ARCH" = x ; then
    enablepetsc=no
    AC_MSG_RESULT(<<< PETSc disabled.  Please set your "\$PETSC_ARCH" environment variable correctly. >>>)
    dnl PETSc config failed.  Try MPI.
    ACX_MPI

  else
    if (test -r $PETSC_DIR/include/petsc.h) ; then
dnl      dnl look for a decent F77 compiler or honor --with-77=...
dnl      FC_TRY_LIST="g77 gfortran ifort f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95"
dnl      AC_ARG_WITH([f77],
dnl      	    AC_HELP_STRING([--with-f77=F77],
dnl                                 [Fortran compiler to use]),
dnl      	    [F77="$withval"],
dnl      	    [])
dnl      
dnl      dnl --------------------------------------------------------------
dnl      dnl Determine a F77 compiler to use.
dnl      dnl --------------------------------------------------------------
dnl      AC_PROG_F77([$F77_TRY_LIST])
dnl      AC_F77_LIBRARY_LDFLAGS

      AC_SUBST(PETSC_ARCH)
      AC_SUBST(PETSC_DIR)
      AC_DEFINE(HAVE_PETSC, 1,
  	      [Flag indicating whether or not PETSc is available])

      dnl Check for snoopable MPI
      if (test -r $PETSC_DIR/bmake/$PETSC_ARCH/petscconf) ; then           dnl 2.3.x	
      	 PETSC_MPI=`grep MPIEXEC $PETSC_DIR/bmake/$PETSC_ARCH/petscconf | grep -v mpiexec.uni` 
      elif (test -r $PETSC_DIR/$PETSC_ARCH/conf/petscvariables) ; then dnl 3.0.x
      	 PETSC_MPI=`grep MPIEXEC $PETSC_DIR/$PETSC_ARCH/conf/petscvariables | grep -v mpiexec.uni`
      fi		 
      if test "x$PETSC_MPI" != x ; then
        AC_DEFINE(HAVE_MPI, 1,
  	        [Flag indicating whether or not MPI is available])
        MPI_IMPL="petsc_snooped"      
	AC_MSG_RESULT(<<< Configuring library with MPI from PETSC config >>>)
      else
	AC_MSG_RESULT(<<< Warning: configuring in serial - no MPI in PETSC config >>>)
      fi

      dnl Some tricks to discover the version of petsc.
      dnl You have to have grep and sed for this to work.
      petscmajor=`grep "define PETSC_VERSION_MAJOR" $PETSC_DIR/include/petscversion.h | sed -e "s/#define PETSC_VERSION_MAJOR[ ]*//g"`
      petscminor=`grep "define PETSC_VERSION_MINOR" $PETSC_DIR/include/petscversion.h | sed -e "s/#define PETSC_VERSION_MINOR[ ]*//g"`
      petscsubminor=`grep "define PETSC_VERSION_SUBMINOR" $PETSC_DIR/include/petscversion.h | sed -e "s/#define PETSC_VERSION_SUBMINOR[ ]*//g"`
      petscversion=$petscmajor.$petscminor.$petscsubminor
      petscmajorminor=$petscmajor.$petscminor.x
      AC_MSG_RESULT(<<< Configuring library with PETSc version $petscversion support >>>)

dnl      PETSCLINKLIBS=`cd $PETSC_DIR ; make getlinklibs`<commit_msg>configuration fix from <NAME> for PETSc prefix (no PETSC_ARCH) case<commit_after>dnl -------------------------------------------------------------
dnl $Id$
dnl -------------------------------------------------------------

dnl -------------------------------------------------------------
dnl PETSc
dnl -------------------------------------------------------------
AC_DEFUN([CONFIGURE_PETSC], 
[
  dnl AC_REQUIRE:
  dnl If the M4 macro AC_PROG_F77 has not already been called, call
  dnl it (without any arguments). Make sure to quote AC_PROG_F77 with
  dnl square brackets. AC_PROG_F77 must have been defined using
  dnl AC_DEFUN or else contain a call to AC_PROVIDE to indicate
  dnl that it has been called.
  AC_REQUIRE([AC_PROG_F77])

  dnl If the user doesn't have any PETSC directory specified, let's check to
  dnl see if it's installed via Ubuntu module
  if test "x$PETSC_DIR" = x ; then
    PETSC_DIR=/usr/lib/petsc
    PETSC_ARCH=linux-gnu-c-opt
  fi

  AC_CHECK_FILE($PETSC_DIR/include/petsc.h,
                PETSC_H_PATH=$PETSC_DIR/include/petsc.h)

  dnl Test to see if PETSC_ARCH set by user.  If not set, then
  dnl disable petsc.
  if test "x$PETSC_ARCH" = x ; then
    enablepetsc=no
    AC_MSG_RESULT(<<< PETSc disabled.  Please set your "\$PETSC_ARCH" environment variable correctly. >>>)
    dnl PETSc config failed.  Try MPI.
    ACX_MPI

  else
    if (test -r $PETSC_DIR/include/petsc.h) ; then
dnl      dnl look for a decent F77 compiler or honor --with-77=...
dnl      FC_TRY_LIST="g77 gfortran ifort f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95"
dnl      AC_ARG_WITH([f77],
dnl      	    AC_HELP_STRING([--with-f77=F77],
dnl                                 [Fortran compiler to use]),
dnl      	    [F77="$withval"],
dnl      	    [])
dnl      
dnl      dnl --------------------------------------------------------------
dnl      dnl Determine a F77 compiler to use.
dnl      dnl --------------------------------------------------------------
dnl      AC_PROG_F77([$F77_TRY_LIST])
dnl      AC_F77_LIBRARY_LDFLAGS

      AC_SUBST(PETSC_ARCH)
      AC_SUBST(PETSC_DIR)
      AC_DEFINE(HAVE_PETSC, 1,
  	      [Flag indicating whether or not PETSc is available])

      dnl Check for snoopable MPI
      if (test -r $PETSC_DIR/bmake/$PETSC_ARCH/petscconf) ; then           dnl 2.3.x	
      	 PETSC_MPI=`grep MPIEXEC $PETSC_DIR/bmake/$PETSC_ARCH/petscconf | grep -v mpiexec.uni` 
      elif (test -r $PETSC_DIR/$PETSC_ARCH/conf/petscvariables) ; then dnl 3.0.x
      	 PETSC_MPI=`grep MPIEXEC $PETSC_DIR/$PETSC_ARCH/conf/petscvariables | grep -v mpiexec.uni`
      elif (test -r $PETSC_DIR/conf/petscvariables) ; then dnl 3.0.x
      	 PETSC_MPI=`grep MPIEXEC $PETSC_DIR/conf/petscvariables | grep -v mpiexec.uni`
      fi		 
      if test "x$PETSC_MPI" != x ; then
        AC_DEFINE(HAVE_MPI, 1,
  	        [Flag indicating whether or not MPI is available])
        MPI_IMPL="petsc_snooped"      
	AC_MSG_RESULT(<<< Configuring library with MPI from PETSC config >>>)
      else
	AC_MSG_RESULT(<<< Warning: configuring in serial - no MPI in PETSC config >>>)
      fi

      dnl Some tricks to discover the version of petsc.
      dnl You have to have grep and sed for this to work.
      petscmajor=`grep "define PETSC_VERSION_MAJOR" $PETSC_DIR/include/petscversion.h | sed -e "s/#define PETSC_VERSION_MAJOR[ ]*//g"`
      petscminor=`grep "define PETSC_VERSION_MINOR" $PETSC_DIR/include/petscversion.h | sed -e "s/#define PETSC_VERSION_MINOR[ ]*//g"`
      petscsubminor=`grep "define PETSC_VERSION_SUBMINOR" $PETSC_DIR/include/petscversion.h | sed -e "s/#define PETSC_VERSION_SUBMINOR[ ]*//g"`
      petscversion=$petscmajor.$petscminor.$petscsubminor
      petscmajorminor=$petscmajor.$petscminor.x
      AC_MSG_RESULT(<<< Configuring library with PETSc version $petscversion support >>>)

dnl      PETSCLINKLIBS=`cd $PETSC_DIR ; make getlinklibs`
{'fraction_non_alphanumeric': 0.17746368276403612, 'fraction_numerical': 0.0167517340662217, 'mean_word_length': 2.101461038961039, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6904301', 'n_tokens_mistral': 2824, 'n_tokens_neox': 2566, 'n_words': 705}