~ubuntu-branches/ubuntu/raring/blitz++/raring

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
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)

AC_INIT(blitz, 0.10, blitz-support@lists.sourceforge.net)

AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(blitz/blitz.h)
AC_CONFIG_HEADERS(blitz/config.h)

AC_CANONICAL_TARGET

AM_INIT_AUTOMAKE([foreign 1.9 dist-bzip2 nostdinc no-installinfo])

# Avoid generating makefile rules to rebuild maintainer-only files by
# default.  Maintainers may override this default and generate these
# makefile rules using the `--enable-maintainer-mode' configure option.
AM_MAINTAINER_MODE

# Blitz++ configure utility, generated by autoconf.
#
# If you want to modify this file, make sure you are editing
# configure.ac, and not configure.  

AC_MSG_NOTICE([

Configuring $PACKAGE_STRING for $target

])

# C++ compiler
AC_PROG_CXX([xlc++ xlC icpc pathCC pgCC cxx aCC c++ CC g++ clang++ KCC FCC])
AC_LANG(C++)
AC_CXX_FLAGS_PRESET

# Option to disable Fortran (benchmarks will not compile)
AC_MSG_CHECKING([whether to enable Fortran compilation for benchmark codes])
AC_ARG_ENABLE(fortran,
  AS_HELP_STRING([--enable-fortran],[Enable Fortran compilation]),,[
  enable_fortran="yes"])
AC_MSG_RESULT([$enable_fortran])
AM_CONDITIONAL(FORTRAN_ENABLED, [test $enable_fortran = yes])

# Fortran compiler
if test $enable_fortran = yes; then
  AC_PROG_F77([xlf ifort pathf90 pgf77 ftn frt gfortran f77 g77 g95])
  AC_PROG_FC([xlf90 ifort pathf90 pgf90 ftn frt f90 gfortran g95])
  AC_FORTRAN_FLAGS_PRESET

  AC_LANG_PUSH(Fortran 77)
  AC_F77_LIBRARY_LDFLAGS
  AC_LANG_POP(Fortran 77)
  AC_LANG_PUSH(Fortran)
  AC_FC_LIBRARY_LDFLAGS

  if test -n "$FC"; then
    AC_FC_FREEFORM(,FC=)
  fi
  if test -n "$FC"; then
    AC_FC_SRCEXT(f90,,FC=)
  fi
  AC_LANG_POP(Fortran)
fi
AM_CONDITIONAL(F90_COMPILER, [test -n "$FC"])

# Prefix config macros with BZ_ and create compiler-specific bzconfig.h
AC_SET_COMPILER_SPECIFIC_HEADER

# makeinfo documentation
AC_CHECK_PROG(MAKEINFO, [makeinfo], [makeinfo], [""])
AM_CONDITIONAL(MAKEINFO_DOC, [test -n "$MAKEINFO"])
# texinfo documentation
AC_CHECK_PROG(TEXI2HTML, [texi2html], [texi2html])
AM_CONDITIONAL(TEXI2HTML_DOC, [test -n "$TEXI2HTML"])
# Doxygen documentation
AC_PROG_DOXYGEN

# Check if the script was called with --enable-64bit
# and if so modify the compilation flags.
AC_COMPILERS_ENABLE_64BITS

# Disable shared library building by default (use --enable-shared to enable)
AM_DISABLE_SHARED
AC_PROG_LIBTOOL

AC_CHECK_FUNC([sin],,[AC_CHECK_LIB(m,sin)])

AC_LIB_BLAS

# Check if the script was called with --enable-optimize or
# --enable-debug, and if so modify the compilation flags.
AC_CXX_ENABLE_OPTIMIZE
AC_CXX_ENABLE_DEBUG

# Option to enable thread-safety (requires thread support or OpenMP)
AC_MSG_CHECKING([whether to enable Blitz thread-safety features])
AC_ARG_ENABLE(threadsafe,
  AS_HELP_STRING([--enable-threadsafe],[Enable thread-safety features]),,[
  enable_threadsafe="no"])
AC_MSG_RESULT([$enable_threadsafe])
if test "$enable_threadsafe" = yes; then
  AC_DEFINE([THREADSAFE],[1],[Enable Blitz thread-safety features])
fi

AC_MSG_CHECKING([if we are using Intel Threading Building Blocks])
AC_ARG_WITH([tbb],
  AS_HELP_STRING([--with-tbb],[Use Intel Threading Building Blocks atomic types]),
    [
    AC_MSG_RESULT([yes])
    AC_CHECK_HEADERS([tbb/atomic.h],,AC_MSG_ERROR([tbb/atomic.h not found]))
    AC_DEFINE([THREADSAFE_USE_TBB],[1],[Use TBB atomic types])
    ],AC_MSG_RESULT([no]))

AC_MSG_CHECKING([for SIMD instruction width])
AC_ARG_ENABLE([simd-width],
  AS_HELP_STRING([--enable-simd-width=n],[Facilitate compiler vectorization optimizations for SIMD instruction width of n bytes.]),
  [ AC_ALIGNMENT_DIRECTIVE
   AC_DEFINE([USE_ALIGNMENT_PRAGMAS],[1],[Specifies whether compiler alignment pragmas should be used]) ],
  [enable_simd_width=no]
  )
AC_MSG_RESULT([$enable_simd_width])
if test "$enable_simd_width" == [no] ; then
   enable_simd_width=1
   # if not set, also define ALIGN_VARIABLE to just declare a variable
   AC_DEFINE([ALIGN_VARIABLE(vartype,varname,alignment)],[vartype varname;])
fi
AC_DEFINE_UNQUOTED([SIMD_WIDTH],[$enable_simd_width],[Set SIMD instruction width in bytes])

AC_MSG_CHECKING([whether to pad array lengths to SIMD instruction width])
AC_ARG_ENABLE([array-length-padding],
  AS_HELP_STRING([--enable-array-length-padding],[Sets the default array padding policy to pad all lowest-rank lengths to nearest larger SIMD width. Caution: This means that arrays will in general be non-contiguous.]),
  [
  AC_MSG_RESULT([yes])
  if test "$enable_simd_width" == [1] ; then
     AC_MSG_WARN([This option is useless without a SIMD width >1.])
  fi
  AC_DEFINE([PAD_ARRAYS],1,[Pad array lengths to SIMD width.])
  ],AC_MSG_RESULT([no]))

AC_MSG_CHECKING([whether to enable Blitz 64-bit dimensions])
AC_ARG_ENABLE([64-bit-dimensions],
  AS_HELP_STRING([--enable-64-bit-dimensions],[Enable dimensions with > 2^31 elements (not yet implemented)]),
  AC_MSG_WARN([Dimensions with > 2^31 elements are not yet implemented])
  AC_DEFINE([FULLY64BIT],[1],[Enable dimensions with > 2^31 elements (NOT IMPLEMENTED)]),AC_MSG_RESULT([no]))

AC_MSG_CHECKING([whether to enable serialization support])
AC_ARG_ENABLE([serialization],
	AS_HELP_STRING([--enable-serialization],[Enable serialization support using Boost::Serialization]), [
	AC_MSG_RESULT([yes])
	AX_BOOST_BASE([1.40.0])						       
	AX_BOOST_SERIALIZATION
	AC_CHECK_HEADERS([boost/mpi.hpp])
	 ], AC_MSG_RESULT([no]))
  
# check for PAPI library
AC_CHECK_LIB([papi],[main])

# autoconf replacement of bzconfig
AC_CHECK_CXX_FEATURES

# Summarize variables
AC_ENV

# Process the Makefile.in's
AC_CONFIG_FILES([
	Makefile 
	bin/Makefile
	blitz/Makefile
	blitz/array/Makefile
	blitz/generate/Makefile
	blitz/meta/Makefile
	random/Makefile
	lib/Makefile
	testsuite/Makefile 
	examples/Makefile
	doc/Makefile
	doc/examples/Makefile
	doc/stencils/Makefile
	doc/doxygen/Makefile
	doc/doxygen/Doxyfile
	])

# Benchmarks require Fortran compiler
if test $enable_fortran = yes; then
AC_CONFIG_FILES([
	benchmarks/Makefile 
	benchmarks/plot_benchmarks.m
	])
fi

# check for valgrind for extra tests
AC_CHECK_PROG([valgrind],[valgrind],[yes],)
AM_CONDITIONAL([HAVE_VALGRIND],[test x$valgrind = xyes])

#	Obsolete makefiles
#
#	demos/Makefile
#	compiler/Makefile
#	manual/Makefile
#	manual/examples/Makefile
#	manual/stencils/Makefile
#	src/Makefile 

AX_CREATE_PKGCONFIG_INFO

AC_OUTPUT

# At some point in the future it would be nice to collect
# information about machines, OSes and compilers which
# people are using.  Obviously this has to be handled in
# a sensitive way.  Current idea: send the output
# of uname -a, $(target) and $(bz_compiler) via an
# anonymous remailer.  Prompt the user and give them
# a chance to override this behaviour.
# AC_SEND_CONFIG

AC_INFO