<commit_before># -------------------------------------------------------------
# -------------------------------------------------------------
AC_DEFUN([LIBMESH_COMPILER_FEATURES],
[
AC_MSG_RESULT(---------------------------------------------)
AC_MSG_RESULT(------- Configuring compiler features -------)
AC_MSG_RESULT(---------------------------------------------)

# Test using the devel mode flags, which should include any
# user-specified flags
libmesh_compiler_features_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS_DEVEL"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS

# --------------------------------------------------------------
# Real precision - double by default
# --------------------------------------------------------------
ACX_CHOOSE_PRECISION

# --------------------------------------------------------------
# Determine support for the C99 "restrict" keyword in the C++
# compiler.  This should place a pound-define statement in the
# config file along the lines of:
#
# #define _libmesh_restrict __restrict
#
# The restrict keyword allows the compiler to make
# certain optimizations which require non-overlapping pointer
# addresses, i.e. in a call to:
#
# foo(int* restrict a, int* restrict b)
#
# the compiler may assume that the memory addresses pointed to
# by a and b do not overlap, and therefore certain low-level
# optimizations can be made.  From the Autoconf documentation:
#
# If the C compiler recognizes a variant spelling for the restrict
# keyword (__restrict, __restrict__, or _Restrict), then define restrict
# to that; this is more likely to do the right thing with compilers that
# support language variants where plain restrict is not a
# keyword. Otherwise, if the C compiler recognizes the restrict keyword,
# don't do anything. Otherwise, define restrict to be empty. Thus,
# programs may simply use restrict as if every C compiler supported it;
# for those that do not, the makefile or configuration header defines it
# away.
#
# Although support in C++ for the restrict keyword is not required,
# several C++ compilers do accept the keyword. This macro works for
# them, too.
#
# This macro caches 'no' in the ac_cv_c_restrict variable if restrict is
# not supported, and a supported spelling otherwise.
AC_C_RESTRICT


# --------------------------------------------------------------
# getpwuid - enabled by default
# Some systems, for example Crays, actually have getpwuid on the head-node
# but (if I understand correctly) a dynamically-linked glibc is not available
# on the backend, which is running a reduced operating system like Compute
# Node Linux.  Thus functions like getpwuid cannot be called.  This makes
# automatically testing for the existence of getpwuid on the login node
# difficult.  If you know that you are on such a system, configure with
# --disable-getpwuid.
# --------------------------------------------------------------
AC_ARG_ENABLE(getpwuid,
              AS_HELP_STRING([--disable-getpwuid],
                             [do not make calls to getpwuid]),
              enablegetpwuid=$enableval,
              enablegetpwuid=yes)

if test "$enablegetpwuid" != no ; then
  AC_DEFINE(HAVE_GETPWUID, 1,
           [Flag indicating if the library should be built with calls to getpwuid()])
  AC_MSG_RESULT(<<< Configuring library with getpwuid >>>)
fi
# --------------------------------------------------------------



# --------------------------------------------------------------
# C++ exceptions - enabled by default
# --------------------------------------------------------------
AC_ARG_ENABLE(exceptions,
              AS_HELP_STRING([--disable-exceptions],
                             [exit rather than throw exceptions on unexpected errors]),
              enableexceptions=$enableval,
              enableexceptions=yes)

if test "$enableexceptions" != no ; then
  AC_DEFINE(ENABLE_EXCEPTIONS, 1,
           [Flag indicating if the library should be built to throw C++ exceptions on unexpected errors])
  AC_MSG_RESULT(<<< Configuring library with exception throwing support >>>)
fi
# --------------------------------------------------------------



# --------------------------------------------------------------
# __TIME__ __DATE__ stamps - enabled by default
# disabling preprocessor timestamps helps compiler caches such
# as ccache to work more effectively.
# --------------------------------------------------------------
AC_ARG_ENABLE(timestamps,
              AS_HELP_STRING([--disable-timestamps],
                             [do not add preprocessor timestamps to the library (helps ccache)]),
              enabletimestamps=$enableval,
              enabletimestamps=yes)

if test "$enabletimestamps" != no ; then
  AC_DEFINE(ENABLE_TIMESTAMPS, 1,
           [Flag indicating if the library should be built with compile time and date timestamps])
  AC_MSG_RESULT(<<< Configuring library with compile timestamps >>>)
fi
# --------------------------------------------------------------



# --------------------------------------------------------------
# Check for important type sizes
# --------------------------------------------------------------
AC_CHECK_SIZEOF(short int)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(long int)
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(void *)
# Check the size of a function pointer.  This is the same
# as a void* on most systems which matter (POSIX).
# It turns out that AC_CHECK_SIZEOF can't do this
# automatically... so we use a kind of hack with the 3rd
# argument to do it.
AC_CHECK_SIZEOF([function_pointer], [], [typedef void (*function_pointer)();])
# AC_CHECK_SIZEOF([void(*)(void)]) <-- Does not work!

# --------------------------------------------------------------
# Check for Run Time Type Identification support<commit_msg>Add sizeof check for size_t (#962)<commit_after># -------------------------------------------------------------
# -------------------------------------------------------------
AC_DEFUN([LIBMESH_COMPILER_FEATURES],
[
AC_MSG_RESULT(---------------------------------------------)
AC_MSG_RESULT(------- Configuring compiler features -------)
AC_MSG_RESULT(---------------------------------------------)

# Test using the devel mode flags, which should include any
# user-specified flags
libmesh_compiler_features_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS_DEVEL"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS

# --------------------------------------------------------------
# Real precision - double by default
# --------------------------------------------------------------
ACX_CHOOSE_PRECISION

# --------------------------------------------------------------
# Determine support for the C99 "restrict" keyword in the C++
# compiler.  This should place a pound-define statement in the
# config file along the lines of:
#
# #define _libmesh_restrict __restrict
#
# The restrict keyword allows the compiler to make
# certain optimizations which require non-overlapping pointer
# addresses, i.e. in a call to:
#
# foo(int* restrict a, int* restrict b)
#
# the compiler may assume that the memory addresses pointed to
# by a and b do not overlap, and therefore certain low-level
# optimizations can be made.  From the Autoconf documentation:
#
# If the C compiler recognizes a variant spelling for the restrict
# keyword (__restrict, __restrict__, or _Restrict), then define restrict
# to that; this is more likely to do the right thing with compilers that
# support language variants where plain restrict is not a
# keyword. Otherwise, if the C compiler recognizes the restrict keyword,
# don't do anything. Otherwise, define restrict to be empty. Thus,
# programs may simply use restrict as if every C compiler supported it;
# for those that do not, the makefile or configuration header defines it
# away.
#
# Although support in C++ for the restrict keyword is not required,
# several C++ compilers do accept the keyword. This macro works for
# them, too.
#
# This macro caches 'no' in the ac_cv_c_restrict variable if restrict is
# not supported, and a supported spelling otherwise.
AC_C_RESTRICT


# --------------------------------------------------------------
# getpwuid - enabled by default
# Some systems, for example Crays, actually have getpwuid on the head-node
# but (if I understand correctly) a dynamically-linked glibc is not available
# on the backend, which is running a reduced operating system like Compute
# Node Linux.  Thus functions like getpwuid cannot be called.  This makes
# automatically testing for the existence of getpwuid on the login node
# difficult.  If you know that you are on such a system, configure with
# --disable-getpwuid.
# --------------------------------------------------------------
AC_ARG_ENABLE(getpwuid,
              AS_HELP_STRING([--disable-getpwuid],
                             [do not make calls to getpwuid]),
              enablegetpwuid=$enableval,
              enablegetpwuid=yes)

if test "$enablegetpwuid" != no ; then
  AC_DEFINE(HAVE_GETPWUID, 1,
           [Flag indicating if the library should be built with calls to getpwuid()])
  AC_MSG_RESULT(<<< Configuring library with getpwuid >>>)
fi
# --------------------------------------------------------------



# --------------------------------------------------------------
# C++ exceptions - enabled by default
# --------------------------------------------------------------
AC_ARG_ENABLE(exceptions,
              AS_HELP_STRING([--disable-exceptions],
                             [exit rather than throw exceptions on unexpected errors]),
              enableexceptions=$enableval,
              enableexceptions=yes)

if test "$enableexceptions" != no ; then
  AC_DEFINE(ENABLE_EXCEPTIONS, 1,
           [Flag indicating if the library should be built to throw C++ exceptions on unexpected errors])
  AC_MSG_RESULT(<<< Configuring library with exception throwing support >>>)
fi
# --------------------------------------------------------------



# --------------------------------------------------------------
# __TIME__ __DATE__ stamps - enabled by default
# disabling preprocessor timestamps helps compiler caches such
# as ccache to work more effectively.
# --------------------------------------------------------------
AC_ARG_ENABLE(timestamps,
              AS_HELP_STRING([--disable-timestamps],
                             [do not add preprocessor timestamps to the library (helps ccache)]),
              enabletimestamps=$enableval,
              enabletimestamps=yes)

if test "$enabletimestamps" != no ; then
  AC_DEFINE(ENABLE_TIMESTAMPS, 1,
           [Flag indicating if the library should be built with compile time and date timestamps])
  AC_MSG_RESULT(<<< Configuring library with compile timestamps >>>)
fi
# --------------------------------------------------------------



# --------------------------------------------------------------
# Check for important type sizes
# --------------------------------------------------------------
AC_CHECK_SIZEOF(short int)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(long int)
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(void *)
# Check the size of a function pointer.  This is the same
# as a void* on most systems which matter (POSIX).
# It turns out that AC_CHECK_SIZEOF can't do this
# automatically... so we use a kind of hack with the 3rd
# argument to do it.
AC_CHECK_SIZEOF([function_pointer], [], [typedef void (*function_pointer)();])
# AC_CHECK_SIZEOF([void(*)(void)]) <-- Does not work!

# --------------------------------------------------------------
# Check for Run Time Type Identification support
{'fraction_non_alphanumeric': 0.25739264592440214, 'fraction_numerical': 0.0012856775520699408, 'mean_word_length': 1.744765937426488, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2466998', 'n_tokens_mistral': 2759, 'n_tokens_neox': 2669, 'n_words': 1073}