/[escript]/trunk/tools/libescriptreader/configure.ac
ViewVC logotype

Contents of /trunk/tools/libescriptreader/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2733 - (show annotations)
Mon Oct 26 02:05:11 2009 UTC (9 years, 8 months ago) by caltinay
File size: 5512 byte(s)
escriptreader: added debug flag to configure.ac

1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.59)
5 AC_INIT([libescriptreader], [1.0])
6 AM_INIT_AUTOMAKE
7 AC_CONFIG_SRCDIR([src/esdcreate.cpp])
8
9 # Checks for programs.
10 AC_PROG_CXX
11 AC_PROG_CC
12 AM_PROG_LIBTOOL
13
14 # Checks for header files.
15 AC_HEADER_STDC
16 AC_CHECK_HEADERS([float.h limits.h stdint.h stdlib.h string.h])
17
18 # Checks for typedefs, structures, and compiler characteristics.
19 AC_HEADER_STDBOOL
20 AC_C_CONST
21 AC_C_INLINE
22 AC_TYPE_SIZE_T
23 AC_C_VOLATILE
24
25 # Checks for libraries.
26 AC_CHECK_LIB([m], [sqrt])
27
28 # Checks for library functions.
29 AC_FUNC_MALLOC
30 AC_FUNC_REALLOC
31 AC_CHECK_FUNCS([pow sqrt])
32
33 CXXFLAGS="-Wall -O2"
34
35 AC_ARG_ENABLE([debug],
36 AC_HELP_STRING([--enable-debug],
37 [enable debug output]),
38 [
39 if test "x$enableval" = "xyes"; then
40 wants_debug=true
41 else
42 wants_debug=false
43 fi
44 ],
45 [wants_debug=false]
46 )
47 if test "$wants_debug" = "true"; then
48 CXXFLAGS="-D_DEBUG $CXXFLAGS"
49 fi
50
51 AC_ARG_ENABLE([esdcreate],
52 AC_HELP_STRING([--disable-esdcreate],
53 [do not build the esdcreate tool]),
54 [
55 if test "x$enableval" = "xno"; then
56 wants_esdcreate=false
57 else
58 wants_esdcreate=true
59 fi
60 ],
61 [wants_esdcreate=true]
62 )
63
64 AM_CONDITIONAL([BUILD_ESDCREATE], [test "$wants_esdcreate" = true])
65
66 AC_ARG_ENABLE([escript2silo],
67 AC_HELP_STRING([--disable-escript2silo],
68 [do not build the escript to Silo converter]),
69 [
70 if test "x$enableval" = "xno"; then
71 wants_escript2silo=false
72 else
73 wants_escript2silo=true
74 fi
75 ],
76 [wants_escript2silo=true]
77 )
78
79 AC_ARG_WITH([escript-prefix],
80 [AS_HELP_STRING([--with-escript-prefix=PATH],
81 [Prefix of escript installation containing headers])],
82 [ESCRIPTDIR="$withval"])
83
84 AC_MSG_CHECKING([for escript include files])
85 if test "x$ESCRIPTDIR" = "x"; then
86 ESCRIPTDIR="`pwd`/../.."
87 fi
88
89 if ! test -f "$ESCRIPTDIR/include/finley/ReferenceElements.h"; then
90 AC_MSG_RESULT([no])
91 AC_MSG_ERROR([
92 The escript headers could not be found. Please provide the
93 location of your escript installation using --with-escript-prefix
94 ])
95 else
96 ESCRIPT_CFLAGS=" -I$ESCRIPTDIR/include"
97 AC_MSG_RESULT([yes])
98 fi
99
100 AC_SUBST([ESCRIPT_CFLAGS])
101
102
103 # Check for NetCDF library and headers
104
105 AC_ARG_WITH([netcdf-prefix],
106 [AS_HELP_STRING([--with-netcdf-prefix=PATH],
107 [Prefix of NetCDF headers and libraries])],
108 [NETCDFPREFIX="$withval"])
109
110 AC_MSG_CHECKING([for NetCDF files])
111 if ! test "x$NETCDFPREFIX" = "x"; then
112 CPPFLAGS_SAVED="$CPPFLAGS"
113 NETCDF_CFLAGS="-I$NETCDFPREFIX/include"
114 NETCDF_LIBS="-L$NETCDFPREFIX/lib -lnetcdf_c++ -lnetcdf"
115 CPPFLAGS="$CPPFLAGS $NETCDF_CFLAGS"
116 export CPPFLAGS
117 else
118 NETCDF_CFLAGS=""
119 NETCDF_LIBS="-lnetcdf_c++ -lnetcdf"
120 fi
121 AC_LANG_SAVE
122 AC_LANG_CPLUSPLUS
123 AC_TRY_COMPILE(
124 [@%:@include <netcdf.hh>],
125 [NcError ncerr(NcError::verbose_fatal);],
126 [AC_MSG_RESULT([yes])],
127 [AC_MSG_ERROR([
128 The NetCDF headers could not be found. Please provide the
129 location of your NetCDF installation using --with-netcdf-prefix
130 ])
131 ]
132 )
133 AC_LANG_RESTORE
134 if ! test "x$NETCDFPREFIX" = "x"; then
135 CPPFLAGS="$CPPFLAGS_SAVED"
136 fi
137
138 AC_SUBST([NETCDF_CFLAGS])
139 AC_SUBST([NETCDF_LIBS])
140
141
142 # Check for Silo library and headers
143
144 has_silo_lib=false
145 AC_ARG_WITH([silo-prefix],
146 [AS_HELP_STRING([--with-silo-prefix=PATH],
147 [Prefix of Silo headers and libraries])],
148 [SILOPREFIX="$withval"])
149
150 AC_MSG_CHECKING([for Silo files])
151 if test "x$SILOPREFIX" = "x"; then
152 if test -f "/usr/include/silo.h"; then
153 SILOPREFIX="/usr"
154 elif test -f "/usr/local/include/silo.h"; then
155 SILOPREFIX="/usr/local"
156 fi
157 fi
158
159 if test -f "$SILOPREFIX/include/silo.h"; then
160 SILO_CFLAGS=" -I$SILOPREFIX/include"
161
162 if test -f "$SILOPREFIX/lib/libsiloh5.a"; then
163 SILO_LIBS="-L$SILOPREFIX/lib -lsiloh5"
164 has_silo_lib=true
165 elif test -f "$SILOPREFIX/lib/libsilo.a"; then
166 SILO_LIBS="-L$SILOPREFIX/lib -lsilo"
167 has_silo_lib=true
168 fi
169 fi
170 AC_SUBST([SILO_CFLAGS])
171 AC_SUBST([SILO_LIBS])
172
173 if test "$has_silo_lib" = "true"; then
174 AC_MSG_RESULT([yes])
175 AC_DEFINE([HAVE_SILO], [1])
176 AC_CHECK_LIB([mpi], [MPI_Wait])
177 AC_CHECK_LIB([z], [deflate])
178 else
179 AC_MSG_RESULT([no])
180 AC_MSG_WARN([
181 The Silo library could not be found. Your escriptreader library will not
182 be able to save data in the Silo format and the escript2silo tool will
183 not be built. If you need this functionality please download the Silo
184 library from http://silo.llnl.gov/ and specify the install location using
185 --with-silo-prefix.
186 ])
187 wants_escript2silo=false
188 fi
189
190 AM_CONDITIONAL([BUILD_ESCRIPT2SILO], [test "$wants_escript2silo" = true])
191
192 AC_CONFIG_FILES([Makefile
193 src/Makefile
194 src/escriptreader/Makefile
195 ])
196 AC_OUTPUT

  ViewVC Help
Powered by ViewVC 1.1.26