File: configure.ac

package info (click to toggle)
fflas-ffpack 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,128 kB
  • ctags: 1,369
  • sloc: sh: 10,959; cpp: 7,935; makefile: 263; perl: 11; csh: 5
file content (320 lines) | stat: -rw-r--r-- 8,424 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# Copyright (c) 2011 FFLAS-FFPACK
# written by BB <bboyer@imag.fr>
# adapted from LinBox configuration
#
# ========LICENCE========
# This file is part of the library FFLAS-FFPACK.
#
# FFLAS-FFPACK is free software: you can redistribute it and/or modify
# it under the terms of the  GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
# ========LICENCE========
#/



AC_PREREQ([2.61])

AC_INIT([FFLAS-FFPACK], [1.6.0],[ffpack-devel@googlegroups.com],[fflas-ffpack],
		[http://www.linalg.org/projects/fflas-ffpack])
AC_CONFIG_MACRO_DIR([macros])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.8 gnu no-dependencies -Wall -Wno-portability])
AM_CONFIG_HEADER([config.h])
AX_PREFIX_CONFIG_H(fflas-ffpack/fflas-ffpack-config.h, __FFLASFFPACK)
AC_PATH_PROG(RM, rm, $FALSE)
RM="$RM -f"


AM_MAINTAINER_MODE
AM_DEP_TRACK
AM_OUTPUT_DEPENDENCY_COMMANDS

AM_ACLOCAL_INCLUDE(macros)

# work around to fix the backward compatibility issue of automake 1.10 with 1.9 (pb with MKDIR_P)
AC_SUBST([MKDIR_P])

AC_LANG([C++])

echo "-----------------------------------------------"

AC_DEBUG
AC_PROFILE
AC_WARNINGS

echo "-----------------------------------------------"
# CFLAGS=${CFLAGS:-$DEFAULT_CFLAGS}
# CXXFLAGS=${CXXFLAGS:-$DEFAULT_CXXFLAGS}

######################################################
# Try and pass different flags according to compiler #
######################################################

# disable default -g -O2 CXXFLAGS
: ${CXXFLAGS=""}

#set CXX
AC_PROG_CXX

AC_COMPILER_NAME

AC_SUBST([DEFAULT_CFLAGS])
AC_SUBST([DEBUG_CFLAGS])
AC_SUBST([TESTS_CFLAGS])

TESTS_CFLAGS="-O0"
DEBUG_CFLAGS="-g"
DEFAULT_CFLAGS="-pipe"
WARN_CFLAGS="-Wall"

if test "x$DBG" = "xyes" ; then
	DEFAULT_CFLAGS="-O0 ${DEFAULT_CFLAGS} " #those are CXXFLAGS
	DEBUG_CFLAGS="${DEBUG_CFLAGS} -DDEBUG -DFFLASFFPACK_DEBUG"
else
	DEFAULT_CFLAGS="-O2 ${DEFAULT_CFLAGS} "
	DEBUG_CFLAGS="${DEBUG_CFLAGS} -DNDEBUG -UFFLASFFPACK_DEBUG -UFFLASFFPACK_DEBUG"
fi

if test "x$PROF" = "xyes" ; then
	DEFAULT_CFLAGS="${DEFAULT_CFLAGS} -pg"
fi

if test "x$WARN" = "xyes" -o "x$WARN" = "xfull" ; then
	if test "x${CCNAM}" = "xicc" ; then
		WARN_CFLAGS="${WARN_CFLAGS} -Wcheck"
		# DEBUG_CFLAGS="-fast"
	else
		if test "x${CCNAM}" = "xgcc" -o "x${CCNAM}" = "xeko" ; then
			WARN_CFLAGS="${WARN_CFLAGS} -Wextra -Wno-unused-parameter"
			if test "x${WARN}" = "xfull" ; then
				WARN_CFLAGS="${WARN_CFLAGS} -Wuninitialized -Wconversion -Wcast-qual -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-long-long"
			fi
		else
			echo
			echo "*******************************************************"
			echo "unsupported compiler ($CCNAM). Please file a bug."
			echo "*******************************************************"
			echo
			WARN_CFLAGS="${WARN_CFLAGS}"
		fi
	fi
fi


DEFAULT_CFLAGS="${DEFAULT_CFLAGS} ${WARN_CFLAGS} ${DEBUG_CFLAGS}"
TESTS_CFLAGS="${TESTS_CFLAGS} ${WARN_CFLAGS} ${DEBUG_CFLAGS}"


AC_HEADER_STDC
AC_PROG_LIBTOOL

# newer libtool...
LT_PREREQ([2.2])
LT_INIT



echo "-----------------------------------------------"

# Machine characteristics

AC_CHECK_SIZEOF(char, 8)
AC_CHECK_SIZEOF(short, 16)
AC_CHECK_SIZEOF(int, 32)
AC_CHECK_SIZEOF(long, 32)
AC_CHECK_SIZEOF(long long, 64)
AC_CHECK_SIZEOF(__int64, 64)

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([float.h limits.h stddef.h stdlib.h string.h sys/time.h stdint.h])


# check endianness of the architecture
AC_C_BIGENDIAN(
  [AC_DEFINE(HAVE_BIG_ENDIAN, 1, [Define that architecture uses big endian storage])],
  [AC_DEFINE(HAVE_LITTLE_ENDIAN, 1, [Define that architecture uses little endian storage])],
  [])

# Create some useful data types of fixed, known lengths

# We hereby assume that a character is always one byte
# LINBOX_INT8="char";

# case $ac_cv_sizeof_char in
  # 1)
     # TWO_BYTES=2;
     # FOUR_BYTES=4;
     # EIGHT_BYTES=8;
     # ;;
  # 8)
     # TWO_BYTES=16;
     # FOUR_BYTES=32;
     # EIGHT_BYTES=64;
# esac

# case $TWO_BYTES in
  # $ac_cv_sizeof_short)
     # LINBOX_INT16="short";
     # ;;
  # $ac_cv_sizeof_int)
     # LINBOX_INT16="int";
     # ;;
# esac

# case $FOUR_BYTES in
  # $ac_cv_sizeof_short)
     # LINBOX_INT32="short";
     # ;;
  # $ac_cv_sizeof_int)
     # LINBOX_INT32="int";
     # ;;
  # $ac_cv_sizeof_long)
     # LINBOX_INT32="long";
     # ;;
# esac

# case $EIGHT_BYTES in
  # $ac_cv_sizeof_short)
     # LINBOX_INT64="short";
     # ;;
  # $ac_cv_sizeof_int)
     # LINBOX_INT64="int";
     # ;;
  # $ac_cv_sizeof_long)
     # LINBOX_INT64="long";
     # ;;
  # $ac_cv_sizeof_long_long)
     # LINBOX_INT64="long long";
     # ;;
  # $ac_cv_sizeof___int64)
     # LINBOX_INT64="__int64";
     # ;;
# esac

# AC_DEFINE_UNQUOTED(INT8, $LINBOX_INT8, Canonical 8-bit data type)
# AC_DEFINE_UNQUOTED(INT16, $LINBOX_INT16, Canonical 16-bit data type)
# AC_DEFINE_UNQUOTED(INT32, $LINBOX_INT32, Canonical 32-bit data type)
# AC_DEFINE_UNQUOTED(INT64, $LINBOX_INT64, Canonical 64-bit data type)

echo "-----------------------------------------------"
# Feature checks
FF_MISC
# LB_DRIVER

AC_LANG_CPLUSPLUS

echo "-----------------------------------------------"

LB_CHECK_GMP(,,[
echo '*******************************************************************************'
echo ' WARNING: GMP not found! (this is not a problem for the moment)'
echo
echo ' GMP library compiled with --enable-cxx is required for this library to compile.'
echo ' Please make sure GMP is installed and specify its location with the option'
echo ' --with-gmp=<prefix> when running configure.'
echo ' Do not forget to set/export LD_LIBRARY_PATH if necessary.'
echo '*******************************************************************************'
])


LB_CHECK_GIVARO(,,[
echo '*******************************************************************************'
echo ' WARNING: GIVARO not found! (this is not a problem for the moment)'
echo
echo ' GIVARO library is required for some tests in this library.'
echo ' Please make sure GIVARO is installed and specify its location with the'
echo ' option --with-givaro=<prefix> when running configure.'
echo ' Do not forget to set/export LD_LIBRARY_PATH if necessary.'
echo '*******************************************************************************'
])

BLAS_FOUND=false

FF_CHECK_BLAS

FF_CHECK_GOTOBLAS

FF_CHECK_GSL

if test "$BLAS_FOUND" = "false" ; then
	FF_CHECK_CBLAS
fi

if test "$BLAS_FOUND" = "false" ; then
	FF_CHECK_OTHERBLAS
fi

if test "$BLAS_FOUND" = "false" ; then
	echo ''
	echo '*******************************************************************************'
	echo ' ERROR: BLAS not found!'
	echo
	echo ' BLAS routines are required for this library to compile. Please'
	echo ' make sure BLAS are installed and specify its location with the option'
	echo ' --with-blas=<lib> when running configure (or --with-cblas... see configure --help).'
	echo '*******************************************************************************'
	exit 1
fi

FF_CHECK_LAPACK

BLAS_LIBS="${BLAS_LIBS} ${LAPACK_LIBS}"
AC_SUBST(BLAS_LIBS)

# AM_CONDITIONAL(FFLASFFPACK_HAVE_BLAS,  test "x$BLAS_FOUND" != "xfalse")


# FF_BENCH


FF_DOC


# if test ! -d ./benchmarks/data  ; then
	# echo "Creating data dir in benchmark" ;
	# mkdir ./benchmarks/data  ;
# fi

CXXFLAGS="${GMP_CFLAGS} ${CXXFLAGS}"
AC_SUBST(CXXFLAGS)

echo "-----------------------------------------------"

AC_CONFIG_FILES([
Makefile
macros/Makefile
fflas-ffpack-config
fflas-ffpack/Makefile
fflas-ffpack/fflas/Makefile
fflas-ffpack/ffpack/Makefile
fflas-ffpack/field/Makefile
utils/Makefile
doc/Makefile
tests/Makefile
benchmark/Makefile
optimiser/Makefile
benchmark/src/Makefile
benchmark/src/BLOCKING/Makefile
benchmark/src/FFLAS_FFPACK/Makefile
benchmark/src/BLAS_LAPACK/Makefile
benchmark/html/Makefile
benchmark/graph/Makefile
benchmark/test-src/Makefile
])
AC_OUTPUT

echo "-----------------------------------------------"

FF_OPT