configure.in.in 4.28 KB
Newer Older
prudhomm's avatar
prudhomm committed
1
2
# -*- autoconf -*-
# 
prudhomm's avatar
prudhomm committed
3
#
4
AC_INIT([lifev], [0.4.0], [lifev-dev@webmail.mate.polimi.it])
5

6
LIFEV_MAJOR_VERSION=0
7
8
LIFEV_MINOR_VERSION=4
LIFEV_MICRO_VERSION=0
prudhomm's avatar
prudhomm committed
9
LIFEV_EXTRA_VERSION=
10
11
12
13
AC_SUBST(LIFEV_MAJOR_VERSION)
AC_SUBST(LIFEV_MINOR_VERSION)
AC_SUBST(LIFEV_MICRO_VERSION)
AC_SUBST(LIFEV_EXTRA_VERSION)
14

15
16
17
18
LIFEV_PACKAGE=lifev
LIFEV_VERSION=${LIFEV_MAJOR_VERSION}.${LIFEV_MINOR_VERSION}.${LIFEV_MICRO_VERSION}${LIFEV_EXTRA_VERSION}


prudhomm's avatar
prudhomm committed
19

20
21
22
23
24
PACKAGE=$LIFEV_PACKAGE
VERSION=$LIFEV_VERSION

AC_SUBST(LIFEV_PACKAGE)
AC_SUBST(LIFEV_VERSION)
prudhomm's avatar
prudhomm committed
25

prudhomm's avatar
prudhomm committed
26
27


prudhomm's avatar
prudhomm committed
28
29
30
31
32
33
34
AC_CONFIG_AUX_DIR(admin)

dnl What the current system and host
AC_CANONICAL_HOST
AC_CANONICAL_SYSTEM


prudhomm's avatar
prudhomm committed
35
AM_INIT_AUTOMAKE([foreign check-news 1.7.8 dist-bzip2])
prudhomm's avatar
prudhomm committed
36
37
AM_CONFIG_HEADER(lifeconfig.h)

prudhomm's avatar
prudhomm committed
38
# checks for a C compiler
39
AC_PROG_CC( gcc-3.4 gcc-3.3 gcc-3.2 gcc )
prudhomm's avatar
prudhomm committed
40
AC_PROG_CC_C_O
41
42
AC_PROG_CXX( g++-3.4 g++-3.3 g++-3.2 g++ )
AC_PROG_F77( g++-3.4 g77-3.3 g77-3.2 g77 )
prudhomm's avatar
prudhomm committed
43
AC_PROG_F77_C_O
prudhomm's avatar
prudhomm committed
44
45
46

# no need for static libs 
AC_DISABLE_STATIC
prudhomm's avatar
prudhomm committed
47
48
AC_PROG_LIBTOOL

prudhomm's avatar
prudhomm committed
49
50
51
# pdflatex
AC_CHECK_PROG(PDFLATEX, pdflatex,[pdflatex],[no])

52
53
54
# doxygen
AC_CHECK_PROG(DOXYGEN, doxygen, [doxygen], [no-doxygen] )
AC_CHECK_PROG(LIFE_HAS_DOT, dot, [yes] )
prudhomm's avatar
prudhomm committed
55

prudhomm's avatar
prudhomm committed
56

prudhomm's avatar
prudhomm committed
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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

81
82
83
84
#CXXFLAGS="-Wall -Wno-long-long -ansi -pedantic"
#CXXFLAGS="-Wall -Wno-long-long  -pedantic"
CXXFLAGS="-Wall -Wno-long-long"

prudhomm's avatar
prudhomm committed
85
if test $ac_use_debug_code = "yes"; then
86
 CPPFLAGS="-DLIFEV_CHECK_ALL ${CPPFLAGS}" 
87
88
 CXXFLAGS="-g3 -O0  ${CXXFLAGS}"
 CFLAGS="-g3 -O0  ${CFLAGS}"
prudhomm's avatar
prudhomm committed
89
90
else 
 if test $ac_use_opt_code = "yes"; then
91
92
  CXXFLAGS="-O2 -funroll-all-loops -fargument-noalias-global -fno-gcse ${CXXFLAGS}"
  CFLAGS="-O2 -funroll-all-loops -fargument-noalias-global -fno-gcse  ${CFLAGS}"
93
  CPPFLAGS="-DNDEBUG ${CPPFLAGS}"
prudhomm's avatar
prudhomm committed
94
95
96
 fi
fi

prudhomm's avatar
prudhomm committed
97
98
99
100
101
102
dnl
dnl checks for some scientific computing libraries
dnl 
dnl libm
AC_CHECK_LIB(m,cos,[LIBS="-lm ${LIBS}"],${LIBS})
dnl umfpack
103
104
# 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
105
106
AM_CONDITIONAL(HAVE_UMFPACK, test "x$umfpack_libs" != "x" )

107
108
109
dnl lapack, blas, g2c
AC_CHECK_LAPACK

prudhomm's avatar
prudhomm committed
110
111
112
113
dnl aztec
AC_CHECK_AZTEC
dnl petsc
AC_CHECK_PETSC(2.1.6) #
prudhomm's avatar
prudhomm committed
114
115
AM_CONDITIONAL(HAVE_PETSC, test "x$petsc_libs" != "x" )

prudhomm's avatar
prudhomm committed
116
117
dnl parmetis
AC_CHECK_PARMETIS
prudhomm's avatar
prudhomm committed
118

prudhomm's avatar
prudhomm committed
119
120
121
122
123
124
dnl grace 
AC_CHECK_HEADERS([grace_np.h])
AC_CHECK_LIB([grace_np],GraceClose,[grace_libs="-lgrace_np"],[grace_libs=""])
AC_SUBST(grace_libs)


prudhomm's avatar
prudhomm committed
125
126
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
127

prudhomm's avatar
prudhomm committed
128
129
130
131
CPPFLAGS="-DTHREEDIM ${CPPFLAGS}"

CXXFLAGS="-Wall ${CXXFLAGS}"

prudhomm's avatar
prudhomm committed
132

lformaggia's avatar
lformaggia committed
133
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
134

lformaggia's avatar
lformaggia committed
135
136
137
#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
138
139
140

AC_SUBST(life_libs)

prudhomm's avatar
prudhomm committed
141

142
143
144
145
146
147
148
#
# setting prefix
#  
prefix=${prefix:-"/usr"}
if test "x${prefix}" = "xNONE"; then
    prefix=/usr
fi
prudhomm's avatar
prudhomm committed
149
150
151
152


dnl testdir
AC_CONFIG_TESTDIR(testsuite)