Select Git revision
configure.ac 15.36 KiB
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([alberta2], [2.0], [Claus.Heine@Mathematik.Uni-Freiburg.DE,kosterdtp@ewi.uwente.nl])
AC_CONFIG_SRCDIR([alberta/src/Common/alberta.h])
AM_MAINTAINER_MODE
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_CONFIG_FILES([Makefile gnu-compat/Makefile
alberta_util/Makefile alberta_util/src/Makefile
alberta_util/src/alberta_util_inlines.h.in
add_ons/Makefile
add_ons/geomview/Makefile
add_ons/grape/Makefile
add_ons/grape/mesh/Makefile
add_ons/grape/mesh/2d/Makefile
add_ons/grape/mesh/3d/Makefile
add_ons/meshtv/Makefile
add_ons/meshtv/1d/Makefile
add_ons/meshtv/2d/Makefile
add_ons/meshtv/3d/Makefile
demo/src/Makefile
demo/src/1d/Makefile
demo/src/2d/Makefile
demo/src/3d/Makefile
demo/src/4d/Makefile
demo/src/5d/Makefile
alberta/Makefile
alberta/src/Makefile
alberta/src/Common/Makefile
alberta/src/Common/Makefile.alberta
alberta/src/alberta2_Nd/Makefile
alberta/src/alberta2_Nd_debug/Makefile])
AC_CONFIG_COMMANDS([demo],
[if ! test "$srcdir" = \. ; then
AC_MSG_NOTICE([Copying $srcdir/demo sources to current directory])
( cd $srcdir && tar cf - demo ) | tar xmf -
find demo -exec chmod u+rwX \{\} \;
fi])
#
# A special command that checks whether alberta_util_inlines.h exists
# and is identical to alberta_util_inlines.h.in. Then do nothing. If
# something has changed, copy albert_util_inlines.h.in to
# alberta_util_inlines.h
#
AC_CONFIG_COMMANDS([alberta_util/src/alberta_util_inlines.h],
[if test -f alberta_util/src/alberta_util_inlines.h && \
cmp alberta_util/src/alberta_util_inlines.h alberta_util/src/alberta_util_inlines.h.in
then
AC_MSG_NOTICE([alberta_util/src/alberta_util_inlines.h is unchanged])
else
AC_MSG_NOTICE([Creating alberta_util/src/alberta_util_inlines.h])
cp \
alberta_util/src/alberta_util_inlines.h.in \
alberta_util/src/alberta_util_inlines.h
fi])
#
# all CONFIG_FILES for the ALBERTA libraries are added through the
# ALBERT_DIMENSION_ENABLE/DISABLE() macros
#
AM_INIT_AUTOMAKE([1.7 dist-bzip2])
AM_CONFIG_HEADER([config.h])
# change the installation directory. This could surely be done more elegantly...
#
# cH: hey, boys and girls, why do we do that?
#
AC_PREFIX_DEFAULT([`pwd`])
AC_ARG_ENABLE([dim-of-world],
[AC_HELP_STRING([--enable-dim-of-world="DIM1 ... DIMk"],
[Compile ALBERTA libraries for DIM_OF_WORLD=DIM1,
..., DIM_OF_WORLD=DIMk. Supported dimensions range from 4 to 9.
Dimensions are separated by spaces.
Note that this does not change the maximal mesh dimension which remains
at 3. The default is NOT to compile for any dimension > 3.])],
[case "${enableval}" in
no|yes)
AC_MSG_ERROR([Option "--enable-dim-of-world" needs an argument])
;;
*)
for dim in $enableval; do
if test "$dim" -gt 9 -o "$dim" -lt 4; then
AC_MSG_ERROR([Supported dimensions range from 4 to 9, you specified ${dim}])
fi
eval BUILD_ALBERTA_${dim}=1
done
EXTRA_DIMENSIONS="${enableval}"
;;
esac])
ASSEMBLE_TYPES="
M_M_M_M
M_M_DM_DM
M_M_SCM_SCM
DM_DM_DM_DM
DM_DM_SCM_SCM
SCM_SCM_SCM_SCM"
ASSEMBLE_FCTS_BASE=assemble_fcts.c
ASSEMBLE_FCTS=""
for variant in ${ASSEMBLE_TYPES}; do
ASSEMBLE_FCTS="${ASSEMBLE_FCTS} ${variant}_${ASSEMBLE_FCTS_BASE}"
done
AC_SUBST(ASSEMBLE_FCTS)
ASSEMBLE_BNDRY_TYPES="M_M M_DM M_SCM DM_DM DM_SCM SCM_SCM"
ASSEMBLE_BNDRY_FCTS_BASE=assemble_bndry_fcts.c
ASS_BNDRY_FCTS=""
for variant in ${ASSEMBLE_BNDRY_TYPES}; do
ASS_BNDRY_FCTS="${ASS_BNDRY_FCTS} ${variant}_${ASSEMBLE_BNDRY_FCTS_BASE}"
done
ASSEMBLE_BNDRY_FCTS="${ASS_BNDRY_FCTS}"
AC_SUBST(ASSEMBLE_BNDRY_FCTS)
# Checks for programs.
AC_PROG_INSTALL
AC_PROG_LN_S
AC_CHECK_PROGS([GZIP_PROGRAM],[gzip])
AC_CHECK_PROGS([TAR_PROGRAM],[gtar tar])
AC_ARG_VAR([GZIP_PROGRAM],[name of gzip program])
AC_ARG_VAR([TAR_PROGRAM],[name of tar program (need _not_ be GNU-tar)])
# Compiler characteristics
#
#
# now check for compilers
#
#
# remember the user override, if any.
#
if test "${CFLAGS+set}" = set; then
alberta_save_CFLAGS="$CFLAGS"
fi
if test "${FFLAGS+set}" = set; then
alberta_save_FFLAGS="$FFLAGS"
fi
AC_PROG_CC
AC_C_INLINE
AC_PROG_CPP
AC_PROG_F77
#
# Support for FORTRAN code in ALBERTA
#
AC_F77_LIBRARY_LDFLAGS
AC_F77_FUNC([dnrm2],[DNRM2_F77_FUNC])
AC_F77_FUNC([daxpy],[DAXPY_F77_FUNC])
AC_F77_FUNC([dexpy],[DEXPY_F77_FUNC])
AC_F77_FUNC([dmxpy],[DMXPY_F77_FUNC])
AC_F77_FUNC([dcopy],[DCOPY_F77_FUNC])
AC_F77_FUNC([ddot],[DDOT_F77_FUNC])
AC_F77_FUNC([dscal],[DSCAL_F77_FUNC])
AC_F77_FUNC([dswap],[DSWAP_F77_FUNC])
AC_F77_FUNC([dxpay],[DXPAY_F77_FUNC])
AC_F77_FUNC([drandn],[DRANDN_F77_FUNC])
AC_SUBST([DNRM2_F77_FUNC])
AC_SUBST([DAXPY_F77_FUNC])
AC_SUBST([DEXPY_F77_FUNC])
AC_SUBST([DMXPY_F77_FUNC])
AC_SUBST([DCOPY_F77_FUNC])
AC_SUBST([DDOT_F77_FUNC])
AC_SUBST([DSCAL_F77_FUNC])
AC_SUBST([DSWAP_F77_FUNC])
AC_SUBST([DXPAY_F77_FUNC])
AC_SUBST([DRANDN_F77_FUNC])
#
# Debugging. Should come first because if not set we can forget about
# ALBERTA_DEBUG_CFLAGS
#
ALBERTA_ENABLE_FLAG([debug],
[disable building of ALBERTA libraries with debugging information.],
1,
BUILD_DEBUG_LIBS)
################################################################################
#
# Set useful default flags for debugging and optimization, but allow
# for user override.
#
if test "${BUILD_DEBUG_LIBS}" = "1"; then
#
# ****************************************************************************
#
# set default debugging flags, but allow for user-override
#
if ! test "${ALBERTA_DEBUG_CFLAGS+set}" = set; then
if test "${alberta_save_CFLAGS+set}" = set; then
if test "$GCC" = yes; then
ALBERTA_DEBUG_CFLAGS="${alberta_save_CFLAGS} -O0 -ggdb3 -fno-inline -fno-builtin"
else
ALBERTA_DEBUG_CFLAGS="${alberta_save_CFLAGS} -g"
fi
else # CFLAGS not set, use our defaults.
if test "$GCC" = yes; then
ALBERTA_DEBUG_CFLAGS="-Wall -pedantic -std=c99 -O0 -ggdb3 -fno-inline -fno-builtin"
else # use autoconf default
ALBERTA_DEBUG_CFLAGS="${CFLAGS}"
fi
fi
fi
AC_ARG_VAR([ALBERTA_DEBUG_CFLAGS],
[Compiler-flags used to create the debug-enabled libraries])
ALBERTA_ISO_C99_CHECK([${ALBERTA_DEBUG_CFLAGS}])
if ! test "${ALBERTA_DEBUG_CXXFLAGS+set}" = set; then
if test "${alberta_save_CXXFLAGS+set}" = set; then
if test "$GCC" = yes; then
ALBERTA_DEBUG_CXXFLAGS="${alberta_save_CXXFLAGS} -fno-rtti -fno-exceptions -O0 -ggdb3 -fno-inline -fno-builtin"
else
ALBERTA_DEBUG_CFLAGS="${alberta_save_CXXFLAGS} -g"
fi
else # CXXFLAGS not set, use our defaults.
if test "$GCC" = yes; then
ALBERTA_DEBUG_CXXFLAGS="-Wall -fno-rtti -fno-exceptions -O0 -ggdb3 -fno-inline -fno-builtin"
else # use autoconf default
ALBERTA_DEBUG_CFXXLAGS="${CXXFLAGS}"
fi
fi
fi
AC_ARG_VAR([ALBERTA_DEBUG_CXXFLAGS],
[C++ cCompiler-flags used to create the debug-enabled libraries])
fi
#
# ****************************************************************************
#
# Set default optimizing flags, but allow for user-override.
# With gcc, provide basic debugging facilities even with optimized
# code.
#
if ! test "${ALBERTA_OPTIMIZE_CFLAGS+set}" = set; then
if test "${alberta_save_CFLAGS+set}" = set; then
ALBERTA_OPTIMIZE_CFLAGS="${alberta_save_CFLAGS}"
else
if test "$GCC" = yes; then
ALBERTA_OPTIMIZE_CFLAGS="-Wall -pedantic -std=c99 -O3"
else # use autoconf default
ALBERTA_OPTIMIZE_CFLAGS="${CFLAGS}"
fi
fi
fi
AC_ARG_VAR([ALBERTA_OPTIMIZE_CFLAGS],
[C compiler-flags used to create the optimised libraries])
ALBERTA_ISO_C99_CHECK([${ALBERTA_OPTIMIZE_CFLAGS}])
if ! test "${ALBERTA_OPTIMIZE_CXXFLAGS+set}" = set; then
if test "${alberta_save_CXXFLAGS+set}" = set; then
ALBERTA_OPTIMIZE_CXXFLAGS="${alberta_save_CXXFLAGS}"
else
if test "$GCC" = yes; then
ALBERTA_OPTIMIZE_CXXFLAGS="-Wall -fno-rtti -fno-exceptions -O3"
else # use autoconf defaults
ALBERTA_OPTIMIZE_CXXFLAGS="${CXXFLAGS}"
fi
fi
fi
AC_ARG_VAR([ALBERTA_OPTIMIZE_CXXFLAGS],
[C++ compiler-flags used to create the optimised libraries])
if ! test "${ALBERTA_FFLAGS+set}" = set; then
if test "${alberta_save_FFLAGS+set}" = set; then
ALBERTA_FFLAGS="${alberta_save_FFLAGS}"
else
if test "$GCC" = yes; then
ALBERTA_FFLAGS="${FFLAGS} -O3"
else
ALBERTA_FFLAGS="-O"
fi
fi
fi
AC_ARG_VAR([ALBERTA_FFLAGS], [Fortran compiler-flags])
#
# Now set the XXFLAGS to the set of flags we will likely use for the
# actual build. Later we will zap them.
#
CFLAGS="${ALBERTA_OPTIMIZE_CFLAGS}"
CXXFLAGS="${ALBERTA_OPTIMIZE_CFLAGS}"
FFLAGS="${ALBERTA_FFLAGS}"
# #
############################### end flags fiddling #############################
# Configure libtool
AC_PROG_LIBTOOL
# Checks for libraries, headers, functions, declarations ...
AC_FUNC_OBSTACK
# Check for libraries
AC_CHECK_LIB([m],[main],,
[AC_MSG_ERROR([no math library, exiting...!])])
# Check for header files.
AC_HEADER_STDC
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([math.h stdlib.h unistd.h string.h rpc/types.h rpc/xdr.h],,
[AC_MSG_ERROR([Sorry, these are needed..])])
#
# try to pull in some special features (but make sure to supply
# replacements if they are not available)
#
AC_DEFINE([_XOPEN_SOURCE], 600, [Define to get POSIX and XPG stuff])
AC_DEFINE([_SVID_SOURCE], 1, [Define to get SVID stuff, e.g. strdup])
#
# check for some functions we need ... add more as needed.
#
AC_CHECK_FUNCS([pow sqrt strdup strchr strstr rand srand xdr_int32_t xdr_int64_t xdr_int],,
[AC_MSG_ERROR([Sorry, these are needed..])])
#
# check whether we also have declarations for those functions
#
AC_CHECK_DECLS([alarm, isfinite, pow, sqrt,
strdup, strchr, strstr, rand, srand,
xdr_int32_t, xdr_int64_t, xdr_int],,,
[#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <math.h>])
#
# define replacements and prototypes if necessary
#
AH_VERBATIM([strdup],
[/* missing strdup() prototype */
#if !HAVE_DECL_STRDUP
extern char *strdup(const char *s);
#endif])
AH_VERBATIM([isfinite],
[/* replacement for isfinite() (C99 standard) */
#if !defined(isfinite) && !HAVE_DECL_ISFINITE
# define isfinite(a) ((a) == (a))
#endif])
AC_FUNC_MALLOC
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([unsetenv])
AC_CHECK_FUNCS([getopt_long],[],
[AC_LIBOBJ([getopt])
AC_LIBOBJ([getopt1])
GNUCOMPAT_INCLUDE_PATH='$(top_srcdir)/gnu-compat/'])
AC_SUBST([GNUCOMPAT_INCLUDE_PATH])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_CHECK_SIZEOF([long long])
# Check the size of the (presumably) largest native integer type
AC_CHECK_SIZEOF(long)
AC_DEFINE([SIZEOF_DOF_FREE_UNIT],
[SIZEOF_LONG],
[size of the integer type used for DOF_FREE_UNIT])
# Check for libltdl
AC_CHECK_LIB([ltdl],[lt_dlinit])
AC_CHECK_HEADERS([ltdl.h])
# try do define HAVE_STRUCT_SIGACTION_SA_SIGACTION for SIGFPE-handler.
AC_CHECK_MEMBERS([struct sigaction.sa_sigaction],,,[#include <signal.h>])
# -----------------------
# THESE ARE OUR OWN TESTS
# -----------------------
#
# check for BLAS library. The BLAS may come under different names. We default
# to -lblas, but other possibilities are sunperf, atlas, cxml (Alpha AXP)
# etc etc etc etc etc etc etc etc etc etc ...........................
#
# Let the user decide what it wants (handled by ALBERTA_CHECK_PACKAGE()
#
ALBERTA_CHECK_PACKAGE([blas],[blas],[],[${FLIBS}],[],[],[],[required])
ALBERTA_ENABLE_FLAG([graphics],
[disable support for visualization, including all add-ons which need graphics.],
1,
ALBERTA_USE_GRAPHICS,
[SUBST cond define])
if test "${ALBERTA_USE_GRAPHICS}" = 1; then
#
# check for X11
#
AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h],,
[AC_MSG_ERROR([Exiting...])])
AC_PATH_X
AC_PATH_XTRA
X_ALL_LIBS="${X_PRE_LIBS} ${X_LIBS} -lX11 ${X_EXTRA_LIBS}"
AC_SUBST(X_ALL_LIBS)
else
#
# disable the packages, but still run the CHECK_PACKAGE() macros, this
# way the automake conditionals should still be defined (to false),
# but the packages will not be used.
#
OPENGL_DISABLE=yes
GLTOOLS_DISABLE=yes
SILO_DISABLE=yes
GRAPE_DISABLE=yes
OPENDX_DISABLE=yes
fi
#
# check for OpenGL
#
ALBERTA_OPENGL_CHECK
#
# check for optional package gltools
#
ALBERTA_GLTOOLS_CHECK
dnl
dnl check for optional package dx
dnl
ALBERTA_OPENDX_CHECK
dnl
dnl GRAPE interface stuff
dnl
ALBERTA_GRAPE_STUFF
#
# MeshTV interface stuff
#
ALBERTA_CHECK_PACKAGE([silo],[silo],[],[],[silo.h],[],[],[optional])
#
# Geomview interface, should not depend on any other installed
# library, just a conversion tool.
#
AM_CONDITIONAL(GEOMVIEW, true)
#
# Whether or not to enable the init_element() stuff. Switching off the
# init_element() feature will result in a library which is compatible
# at the binary and API level for standard application, and which is
# slightly faster because the if-statements testing for the presence
# of the init_element methods are disabled.
#
ALBERTA_ENABLE_FLAG([init-element],
[disable support for per-element initializers for basis-functions and
quadrature rules.],
1,
USE_INIT_ELEMENT,
[subst cond def])
#
# Malloc debugging
#
ALBERTA_ENABLE_FLAG([efence],
[use the malloc debugger "Electric Fence" for all allocations for the DEBUG
libraries, the optimized libraries will still use the default allocators.],
0,
ALBERTA_EFENCE)
test "$ALBERTA_EFENCE" = "1" && EFENCE_DISABLE=no
test "${BUILD_ALBERTA_DEBUG}" = "0" && EFENCE_DISABLE=yes
ALBERTA_CHECK_PACKAGE([efence],[efence],[],[],[efence.h],[],[],
[optional disabled])
if test "$ALBERTA_EFENCE" = 1 -a -z "$EFENCE_LIB"; then
AC_MSG_RESULT(
["EFence" memory debugger not found or disabled, we will not try to use it.])
ALBERTA_EFENCE=0
fi
if test "$ALBERTA_EFENCE" = 0 -a -n "$EFENCE_LIB"; then
AC_MSG_RESULT([using "Electric Fence" memory debugger for debugging libraries.])
ALBERTA_EFENCE=1
fi
#
# Install libtool.alberta for shared libraries?
#
ALBERTA_ENABLE_FLAG([install-libtool], [disable installation of libtool.alberta], 1)
# building of all versions is enabled by default, but can be
# disabled using --disable-DOW-dimension switches (the macros
# below do _not_ disable the builds, but simply implement
# AC_ARG_ENABLE() stuff
#
# BIG FAT NOTE: the DIMENSION_DISABLE macro MUST COME LAST, right
# before the AC_OUTPUT
#
ALBERTA_DIMENSION_DISABLE(1)
ALBERTA_DIMENSION_DISABLE(2)
ALBERTA_DIMENSION_DISABLE(3)
#
# Define the necessary conditional unconditionally, so that automake
# can get hold of the default value.
#
ALBERTA_DEFINE_DIMENSION(4)
ALBERTA_DEFINE_DIMENSION(5)
ALBERTA_DEFINE_DIMENSION(6)
ALBERTA_DEFINE_DIMENSION(7)
ALBERTA_DEFINE_DIMENSION(8)
ALBERTA_DEFINE_DIMENSION(9)
AM_CONDITIONAL([ALBERTA_EXTRA_DIMENSIONS], [test -n "${EXTRA_DIMENSIONS}"])
unset CFLAGS
unset CXXFLAGS
unset FFLAGS
# remove duplicates
CPPFLAGS=`for flag in $CPPFLAGS ; do echo $flag ; done | sort | uniq`
CPPFLAGS=`echo $CPPFLAGS`
if test "z${EXPERIMENTAL}" = "z1"; then
AC_MSG_RESULT([])
AC_MSG_NOTICE([The following experimental features are enabled:])
AC_MSG_RESULT([])
for dim in $EXTRA_DIMENSIONS; do
AC_MSG_RESULT(build ALBERTA libraries for DIM_OF_WORLD=${dim})
done
if test "z${PERIODIC_MESHES}" = "z1"; then
AC_MSG_RESULT([support for periodic meshes])
fi
if test "z${BOUNDARY_OPERATORS}" = "z1"; then
AC_MSG_RESULT([support for boundary operators])
fi
AC_MSG_RESULT([])
fi
#
# flush everything to disk
#
AC_OUTPUT