configure.in.in 3.42 KB
Newer Older
prudhomm's avatar
prudhomm committed
1
2
# -*- autoconf -*-
# 
prudhomm's avatar
prudhomm committed
3
#
4
AC_INIT(life, 0.1.90, christophe.prudhomme@epfl.ch)
prudhomm's avatar
prudhomm committed
5
LIFE_PACKAGE=life
6
LIFE_VERSION=0.1.90
7
8
9
10

PACKAGE=$LIFE_PACKAGE
VERSION=$LIFE_VERSION

prudhomm's avatar
prudhomm committed
11
12
13
AC_SUBST(LIFE_PACKAGE)
AC_SUBST(LIFE_VERSION)

prudhomm's avatar
prudhomm committed
14
15
16
17
18
19
20
AC_CONFIG_AUX_DIR(admin)

dnl What the current system and host
AC_CANONICAL_HOST
AC_CANONICAL_SYSTEM


prudhomm's avatar
prudhomm committed
21
AM_INIT_AUTOMAKE(${LIFE_PACKAGE}, ${LIFE_VERSION} )
prudhomm's avatar
prudhomm committed
22
23
AM_CONFIG_HEADER(lifeconfig.h)

prudhomm's avatar
prudhomm committed
24
25
# checks for a C compiler
AC_PROG_CC( gcc-3.3 gcc-3.2 gcc )
prudhomm's avatar
prudhomm committed
26
AC_PROG_CC_C_O
prudhomm's avatar
prudhomm committed
27
28
AC_PROG_CXX( g++-3.3 g++-3.2 g++ )
AC_PROG_F77( g77-3.3 g77-3.2 g77 )
prudhomm's avatar
prudhomm committed
29
AC_PROG_F77_C_O
prudhomm's avatar
prudhomm committed
30
31
AC_PROG_LIBTOOL

32
33
34
# doxygen
AC_CHECK_PROG(DOXYGEN, doxygen, [doxygen], [no-doxygen] )
AC_CHECK_PROG(LIFE_HAS_DOT, dot, [yes] )
prudhomm's avatar
prudhomm committed
35

prudhomm's avatar
prudhomm committed
36

prudhomm's avatar
prudhomm committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
dnl Check debugging mode for compilation.
AC_ARG_ENABLE(debug,
  AC_HELP_STRING([--enable-debug],[enables debugging mode (default=no)]),
  [
   if test $enableval = "no";
     then ac_use_debug_code="no"
     else ac_use_debug_code="yes"
   fi
  ], [ac_use_debug_code="no"])

AC_ARG_ENABLE(opt,
  AC_HELP_STRING([--enable-opt],[enables optimization mode (default=no)]),
  [
   if test $enableval = "no";
     then ac_use_opt_code="no"
     else ac_use_opt_code="yes"
   fi
  ], [ac_use_opt_code="no"])

if test $ac_use_debug_code = "yes" -a $ac_use_opt_code = "yes"
then
  AC_MSG_ERROR(Cannot use --enable-debug and --enable-opt at the same time!)
fi

if test $ac_use_debug_code = "yes"; then
 CXXFLAGS="-g3 -O0 -Wall"
 CFLAGS="-g3 -O0 -Wall"
else 
 if test $ac_use_opt_code = "yes"; then
  CXXFLAGS="-O2 -funroll-all-loops -fargument-noalias-global -fno-gcse -Wall"
  CFLAGS="-O2 -funroll-all-loops -fargument-noalias-global -fno-gcse -Wall"
  CPPFLAGS="-DNDEBUG"
 fi
fi

prudhomm's avatar
prudhomm committed
72
73
74
75
76
77
dnl
dnl checks for some scientific computing libraries
dnl 
dnl libm
AC_CHECK_LIB(m,cos,[LIBS="-lm ${LIBS}"],${LIBS})
dnl umfpack
78
79
# disable it for not since it is not used yet: need to check for "NO"
# AC_CHECK_UMFPACK(4.3.0) # at least umfpack 4.3
80
81
AM_CONDITIONAL(HAVE_UMFPACK, test "x$umfpack_libs" != "x" )

prudhomm's avatar
prudhomm committed
82
83
84
85
dnl aztec
AC_CHECK_AZTEC
dnl petsc
AC_CHECK_PETSC(2.1.6) #
prudhomm's avatar
prudhomm committed
86
87
AM_CONDITIONAL(HAVE_PETSC, test "x$petsc_libs" != "x" )

prudhomm's avatar
prudhomm committed
88
89
dnl parmetis
AC_CHECK_PARMETIS
prudhomm's avatar
prudhomm committed
90

prudhomm's avatar
prudhomm committed
91
92
all_includes="-I\$(top_srcdir)/life/lifecore -I\$(top_srcdir)/life/lifearray  -I\$(top_srcdir)/life/lifemesh -I\$(top_srcdir)/life/lifealg  -I\$(top_srcdir)/life/lifefem -I\$(top_srcdir)/life/lifesolver -I\$(top_srcdir)/life/lifefilters"
AC_SUBST(all_includes)
prudhomm's avatar
prudhomm committed
93

prudhomm's avatar
prudhomm committed
94
95
96
97
CPPFLAGS="-DTHREEDIM ${CPPFLAGS}"

CXXFLAGS="-Wall ${CXXFLAGS}"

prudhomm's avatar
prudhomm committed
98

lformaggia's avatar
lformaggia committed
99
life_libs="\$(top_builddir)/life/lifefilters/liblifefilters.la  \$(top_builddir)/life/lifefem/liblifefem.la \$(top_builddir)/life/lifealg/liblifealg.la \$(top_builddir)/life/lifemesh/liblifemesh.la \$(top_builddir)/life/lifearray/liblifearray.la \$(top_builddir)/life/lifecore/liblifecore.la"
prudhomm's avatar
prudhomm committed
100

lformaggia's avatar
lformaggia committed
101
102
103
#life_libs="\$(top_builddir)/life/lifefilters/liblifefilters.la  \$(top_builddir)/life/lifesolver/liblifesolver.la \$(top_builddir)/life/lifefem/liblifefem.la \$(top_builddir)/life/lifealg/liblifealg.la \$(top_builddir)/life/lifemesh/liblifemesh.la \$(top_builddir)/life/lifearray/liblifearray.la \$(top_builddir)/life/lifecore/liblifecore.la"

#life_libs="\$(top_builddir)/life/lifefilters/liblifefilters.la  \$(top_builddir)/life/lifefem/liblifefem.la \$(top_builddir)/life/lifealg/liblifealg.la \$(top_builddir)/life/lifearray/liblifearray.la \$(top_builddir)/life/lifemesh/liblifemesh.la \$(top_builddir)/life/lifecore/liblifecore.la"
prudhomm's avatar
prudhomm committed
104
105
106

AC_SUBST(life_libs)

prudhomm's avatar
prudhomm committed
107

108
109
110
111
112
113
114
#
# setting prefix
#  
prefix=${prefix:-"/usr"}
if test "x${prefix}" = "xNONE"; then
    prefix=/usr
fi