Debian Codegraph @

configure.ac

raw ◀ ▶
1 Debian patch touch this file
1 dnl Process this file with autoconf to produce configure.
2 AC_INIT(music, 1.2.1)
3 AM_INIT_AUTOMAKE
4 AM_CONFIG_HEADER([config.h])
5 AM_MAINTAINER_MODE
6
7 if test "$MPI_CXX" != ""; then
8 CXX="$MPI_CXX"
9 fi
10
11 AC_PROG_CXX([mpiCC mpixlcxx mpixlcxx_r mpicxx CC])
12 MPI_CXX="$CXX"
13
14 AC_MSG_CHECKING([which MPI system we think we are using])
15 case "$MPI_CXX" in
16 mpiCC)
17 changequote({, })
18 MPI_C=mpicc
19 if $MPI_CXX -compile_info >/dev/null 2>/dev/null; then
20 SYSGUESS=mpich
21 CXX="`$MPI_CXX -compile_info | sed -e 's/^\([^ ]*\).*/\1/'`"
22 else
23 # mpiCC can be a C compiler under OpenMPI
24 if mpicxx -showme >/dev/null 2>/dev/null; then
25 SYSGUESS=openmpi
26 CXX="`mpicxx -showme | sed -e 's/^\([^ ]*\).*/\1/'`"
27 else
28 changequote([, ])
29 AC_MSG_ERROR([
30 Confused when trying to determine MPI_CXX, MPI_CXXFLAGS etc.
31 Please set them manually.])
32 changequote({, })
33 fi
34 fi
35 LAUNCHSTYLE=_mpirun
36 TESTDIR=testsuite
37 EXTRAS=extras
38 changequote([, ])
39 ;;
40 mpixlcxx_r)
41 MPI_C=mpixlc_r
42 SYSGUESS=bgp
43 CXX="$MPI_CXX"
44 #CC="`echo $MPI_CXX | sed -e 's/xlcxx$/xlc/;s/cxx$/cc/'`"
45 CC="$MPI_C"
46 ;;
47 mpixlcxx)
48 MPI_C=mpixlc
49 SYSGUESS=bgq
50 CXX="$MPI_CXX"
51 #CC="`echo $MPI_CXX | sed -e 's/xlcxx$/xlc/;s/cxx$/cc/'`"
52 CC="$MPI_C"
53 ;;
54 mpicxx)
55 MPI_C=mpicc
56 CC="$MPI_C"
57 CXX="$MPI_CXX"
58 if mpich2version >/dev/null 2>/dev/null; then
59 SYSGUESS=mpich2
60 AC_DEFINE(HAVE_MPICH2, 1, [Define to 1 if you have MPICH2.])
61 else
62 SYSGUESS=bgl
63 fi
64 ;;
65 CC)
66 # We should be checking MPI version but for the Cray we do it differently
67 if uname -r | grep -q cray_gem_s; then
68 SYSGUESS=cray_xe6
69 AC_DEFINE(CRAY_XE6, 1, [Define if this is a Cray XE6 system.])
70 CC=cc
71 CXX=CC
72 else
73 SYSGUESS=unknown
74 fi
75 ;;
76 xlC)
77 MPI_C=xlc
78 SYSGUESS=bgq_seq
79 CXX="$MPI_CXX"
80 CC="$MPI_C"
81 ;;
82
83 *)
84 SYSGUESS=unknown
85 ;;
86 esac
87 echo "SYSGUESS=$SYSGUESS"
88
89 AC_MSG_CHECKING(MPI_CXXFLAGS)
90 if test "$MPI_CXXFLAGS" != ""; then
91 echo "$MPI_CXXFLAGS"
92 else
93 case "$SYSGUESS" in
94 mpich|mpich2)
95 changequote(<, >)
96 MPI_CXXFLAGS="`$MPI_CXX -compile_info | sed -e 's/^[^ ]* //;s/ -c / /'`"
97 changequote([, ])
98 ;;
99 openmpi)
100 MPI_CXXFLAGS="`mpicxx -showme:compile`"
101 ;;
102 bgp)
103 MPI_CXXFLAGS="-qarch=450 -qtune=450 -qhot -qnostrict"
104 enable_shared=no
105 ;;
106 bgq)
107 MPI_CXXFLAGS="-qarch=qp -qtune=qp -qhot -qnostrict"
108 enable_shared=no
109 ;;
110 cray_xe6)
111 MPI_CXXFLAGS=""
112 ;;
113 bgq_seq)
114 MPI_CXXFLAGS=""
115 enable_shared=no
116 ;;
117 *)
118 AC_MSG_ERROR([
119 Could not determine proper value for MPI_CXXFLAGS. Please see README.])
120 ;;
121 esac
122 echo "$MPI_CXXFLAGS"
123 fi
124
125 AC_MSG_CHECKING(MPI_CFLAGS)
126 if test "$MPI_CFLAGS" != ""; then
127 echo "$MPI_CFLAGS"
128 else
129 case "$SYSGUESS" in
130 mpich|mpich2)
131 changequote(<, >)
132 MPI_CFLAGS="`$MPI_C -compile_info | sed -e 's/^[^ ]* //;s/ -c / /'`"
133 changequote([, ])
134 ;;
135 openmpi)
136 MPI_CFLAGS="`mpicc -showme:compile`"
137 ;;
138 bgp)
139 MPI_CFLAGS="-qarch=450 -qtune=450 -qhot -qnostrict"
140 enable_shared=no
141 ;;
142 bgq)
143 MPI_CFLAGS="-qarch=qp -qtune=qp -qhot -qnostrict"
144 enable_shared=no
145 ;;
146 cray_xe6)
147 MPI_CFLAGS=""
148 ;;
149 bgq_seq)
150 MPI_CFLAGS=""
151 enable_shared=no
152 ;;
153 *)
154 AC_MSG_ERROR([
155 Could not determine proper value for MPI_CFLAGS. Please see README.])
156 ;;
157 esac
158 echo "$MPI_CFLAGS"
159 fi
160
161 AC_MSG_CHECKING(MPI_LDFLAGS)
162 if test "$MPI_LDFLAGS" != ""; then
163 echo "$MPI_LDFLAGS"
164 else
165 case "$SYSGUESS" in
166 mpich|mpich2)
167 changequote(<, >)
168 MPI_LDFLAGS="`$MPI_CXX -link_info | sed -e 's/^[^ ]* //;s/ -c / /'`"
169 changequote([, ])
170 ;;
171 openmpi)
172 MPI_LDFLAGS="`mpicxx -showme:link`"
173 ;;
174 bgp|bgq|cray_xe6|bgq_seq)
175 MPI_LDFLAGS=""
176 ;;
177 *)
178 AC_MSG_ERROR([
179 Could not determine proper value for MPI_LDFLAGS. Please see README.])
180 ;;
181 esac
182 echo "$MPI_LDFLAGS"
183 fi
184
185 CXXFLAGS="-g -O3 -std=c++11"
186
187 #if test "$ac_test_CXXFLAGS" != set; then
188 # if test "$CXXFLAGS" = "-O2"; then
189 # CXXFLAGS="-O3"
190 # else
191 # CXXFLAGS="-O2"
192 # CXXFLAGS="-g -O0"
193 if test $CXX = g++; then
194 CXXFLAGS="-pedantic -Wall -Wno-long-long $CXXFLAGS"
195 fi
196 # fi
197 #fi
198
199 AC_PROG_CC
200 AC_PROG_LIBTOOL
201
202 dnl Checks for rudeconfig:
203 AC_HEADER_STDC
204 AC_C_CONST
205 AC_C_INLINE
206 AC_TYPE_SIZE_T
207 AC_CHECK_TYPES([long long])
208
209 AC_CHECK_FUNCS([strrchr mallinfo])
210
211 dnl Other checks
212 OPTIONAL_UTILS=""
213 AC_CHECK_HEADER([GL/glut.h], OPTIONAL_UTILS+="viewevents ")
214
215 AC_LANG_PUSH(C++)
216 save_CXX="$CXX"
217 save_LIBS="$LIBS"
218 dnl Must use $CXX, not $MPI_CXX, here
219
220 CXX="$CXX $MPI_CXXFLAGS"
221 LIBS="$LIBS $MPI_LDFLAGS"
222 AC_CHECK_FUNCS([rts_get_personality ompi_comm_free MPI_Comm_create_errhandler MPI_Init_thread])
223
224 AC_ARG_ENABLE(mpi,
225 [ --disable-mpi disable mpi support],
226 MUSIC_USE_MPI="$enableval", MUSIC_USE_MPI="yes")
227 if test $MUSIC_USE_MPI = yes ; then
228 MUSIC_USE_MPI=1
229 MPI_UTILS="eventsource eventsink eventselect eventgenerator eventcounter eventlogger contsink messagesource"
230 EXAMPLESDIR="examples"
231 else
232 MUSIC_USE_MPI=0
233 MPI_UTILS=""
234 OPTIONAL_UTILS=""
235 EXAMPLESDIR=""
236 fi
237 AM_CONDITIONAL([COND_USE_MPI], [test x$MUSIC_USE_MPI = x1])
238
239 AC_ARG_ENABLE(isend,
240 [ --disable-isend disable isend],
241 MUSIC_ISENDWAITALL="$enableval", MUSIC_ISENDWAITALL="yes")
242 if test $MUSIC_ISENDWAITALL = yes ; then
243 MUSIC_ISENDWAITALL=1
244 else
245 MUSIC_ISENDWAITALL=0
246 fi
247
248 AC_ARG_ENABLE(anysource,
249 [ --disable-anysource disable any source receive],
250 MUSIC_ANYSOURCE="$enableval", MUSIC_ANYSOURCE="yes")
251 if test $MUSIC_ANYSOURCE = yes ; then
252 MUSIC_ANYSOURCE=1
253 else
254 MUSIC_ANYSOURCE=0
255 fi
256
257 LIBS="$save_LIBS"
258 CXX="$save_CXX"
259 AC_LANG_POP(C++)
260
261 if test $ac_cv_type_size_t = yes; then
262 MUSIC_HAVE_SIZE_T=1
263 else
264 MUSIC_HAVE_SIZE_T=0
265 fi
266
267 if test $ac_cv_type_long_long = yes; then
268 MUSIC_HAVE_LONG_LONG=1
269 else
270 MUSIC_HAVE_LONG_LONG=0
271 fi
272
273 if test $ac_cv_func_MPI_Comm_create_errhandler = yes; then
274 MUSIC_HAVE_MPI_COMM_CREATE_ERRHANDLER=1
275 else
276 MUSIC_HAVE_MPI_COMM_CREATE_ERRHANDLER=0
277 fi
278
279 # Pre-evaluating some autoconf variables
280 if test "x$prefix" = xNONE; then
281 PREFIX=$ac_default_prefix
282 prefix=$PREFIX
283 else
284 PREFIX="$prefix"
285 fi
286 if test "x$exec_prefix" = xNONE; then
287 EXEC_PREFIX="$PREFIX"
288 exec_prefix=$EXEC_PREFIX
289 else
290 EXEC_PREFIX="`eval echo $exec_prefix`"
291 fi
292 if test "x$bindir" = 'x${exec_prefix}/bin'; then
293 BINDIR="$EXEC_PREFIX/bin"
294 else
295 BINDIR="`eval echo $bindir`"
296 fi
297 if test "x$libdir" = 'x${exec_prefix}/lib'; then
298 LIBDIR="$EXEC_PREFIX/lib"
299 else
300 LIBDIR="`eval echo $libdir`"
301 fi
302 if test "x$datarootdir" = 'x${prefix}/share'; then
303 DATAROOTDIR="$PREFIX/share"
304 else
305 DATAROOTDIR="`eval echo $datarootdir`"
306 fi
307 if test "x$datadir" = 'x${datarootdir}'; then
308 DATADIR="$DATAROOTDIR"
309 else
310 DATADIR="`eval echo $datadir`"
311 fi
312
313 PKGDATADIR="$DATADIR/$PACKAGE-$PACKAGE_VERSION"
314 PKGEXTRABINDIR="$LIBDIR/$PACKAGE-$PACKAGE_VERSION"
315
316 #TEST_SH_LIST=${srcdir}/*.test
317
318 AC_ARG_WITH([python],
319 [AS_HELP_STRING([--without-python], [ignore the presence of Python and disable PyMUSIC])])
320
321 AS_IF([test "x$with_python" != "xno"],
322 [AS_IF([test "x$with_python" != "xyes"],
323 [PYTHON="$with_python"])
324 AM_PATH_PYTHON([2.6], [have_python=yes], [have_python=no])],
325 [have_python=no])
326
327 AS_IF([test "x$have_python" = "xyes"], [
328 PYTHON_INC=`$PYTHON -c 'import sys; import sysconfig; sys.stdout.write(sysconfig.get_path("include"))'`
329 AC_CHECK_FILE(["${PYTHON_INC}/Python.h"],
330 [PYMUSIC_CPPFLAGS="-I${PYTHON_INC}"; PYBUFFER_CPPFLAGS="-I${PYTHON_INC}"],
331 [have_python=no])
332 # This replaces pyexecdir since Automake 1.16 has a bug which concatenates
333 # the prefix (which might be local) and the platlib (might might start with local)
334 PYTHON_EXECDIR=`$PYTHON -c 'import sys; import sysconfig; sys.stdout.write(sysconfig.get_path("platlib"))'`
335 ])
336
337 AC_MSG_CHECKING([whether to build PyMUSIC])
338 AS_IF([test "x$have_python" = "xyes"], [],
339 [AS_IF([test "x$with_python" = "xyes"],
340 [AC_MSG_ERROR([PyMUSIC requested, but Python not found])])])
341 AC_MSG_RESULT([$have_python])
342
343 AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing],
344 [PYMUSIC_CXXFLAGS="-fno-strict-aliasing"; PYBUFFER_CXXFLAGS="-fno-strict-aliasing"],
345 [])
346
347 PYMUSIC_SUBDIR=""
348 if test -z "${COND_USE_MPI_TRUE}"; then
349
350 # FIXME: this means that --without-python make will not recurse into pymusic subdir
351 if test "x$have_python" = "xyes"; then
352 MUSICCONFIGDIR="music-config"
353 PYMUSIC_SUBDIR="pymusic"
354 fi
355
356 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
357
358 AC_ARG_ENABLE([deb],
359 [ --enable-deb use deb package layout for install],
360 [case "${enableval}" in
361 yes) deb_package=true ;;
362 no) deb_package=false ;;
363 *) deb_package=true ;;
364 esac],[deb_package=false])
365 AM_CONDITIONAL([DEB_PACKAGE], [test x$deb_package = xtrue])
366 if test x$deb_package = xtrue; then
367 PYTHON_EXECDIR="\${exec_prefix}/lib/python3/dist-packages"
368 fi
369 # Have files install in the same location as was retried from Python:
370 # (Standard place is site-packages but Debian uses dist-packages.)
371 pythondir=${PYTHON_EXECDIR}
372 pyexecdir=${PYTHON_EXECDIR}
373
374 # if Python is found, configure and compile PyMUSIC
375 if test "x$have_python" = "xyes" ; then
376 AC_CONFIG_FILES(pymusic/Makefile)
377 AC_CONFIG_FILES(pymusic/examples/Makefile)
378 AC_CONFIG_FILES(pymusic/setup.py)
379 fi
380
381 else # not USE_MPI
382
383 # The Python portion of MUSIC as well as the Debian package generation
384 # are MPI dependent
385
386 AM_CONDITIONAL([HAVE_PYTHON], [false])
387 AM_CONDITIONAL([DEB_PACKAGE], [false])
388
389 fi
390
•391 #AC_MSG_CHECKING([whether to build ROS Toolchain])
392 #AC_ARG_WITH([ros])
393 ROS_SUBDIR=""
•394 #AS_IF([test "x$with_ros" = "xyes"], [ROS_SUBDIR="ros"], [with_ros=no])
395 with_ros=no
396 AC_MSG_RESULT([$with_ros])
397
398 # if ROS is to be compiled
•399 #if test "x$with_ros" = "xyes" ; then
400 # AC_CONFIG_FILES(ros/Makefile)
401 # AC_CONFIG_FILES(ros/adapters/Makefile)
402 # AC_CONFIG_FILES(ros/encoder/Makefile)
403 # AC_CONFIG_FILES(ros/decoder/Makefile)
404 #fi
405
406 AC_SUBST([HAVE_PYTHON])
407 AC_SUBST([MUSICCONFIGDIR])
408 AC_SUBST([PYMUSIC_SUBDIR])
409 AC_SUBST([ROS_SUBDIR])
410 AC_SUBST([PYTHON_EXECDIR])
411
412 AC_SUBST([PYTHON])
413 AC_SUBST([PYTHON_VERSION])
414
415 AC_SUBST([PYMUSIC_CPPFLAGS])
416 AC_SUBST([PYMUSIC_CXXFLAGS])
417 AC_SUBST([PYBUFFER_CPPFLAGS])
418 AC_SUBST([PYBUFFER_CXXFLAGS])
419
420 AC_SUBST(MPI_CXXFLAGS)
421 AC_SUBST(MPI_CFLAGS)
422 AC_SUBST(MPI_LDFLAGS)
423 AC_SUBST(MUSIC_HAVE_SIZE_T)
424 AC_SUBST(MUSIC_HAVE_LONG_LONG)
425 AC_SUBST(MUSIC_HAVE_MPI_COMM_CREATE_ERRHANDLER)
426 AC_SUBST(MUSIC_USE_MPI)
427 AC_SUBST(MUSIC_ISENDWAITALL)
428 AC_SUBST(MUSIC_ANYSOURCE)
429 AC_SUBST(MPI_UTILS)
430 AC_SUBST(OPTIONAL_UTILS)
431 AC_SUBST(TESTDIR)
432 AC_SUBST(EXAMPLESDIR)
433 AC_SUBST(EXTRAS)
434 AC_SUBST(BINDIR)
435 AC_SUBST(LIBDIR)
436 AC_SUBST(PKGDATADIR)
437 AC_SUBST(PKGEXTRABINDIR)
438 AC_SUBST(LAUNCHSTYLE)
439
440 AM_CONDITIONAL([LAUNCHSTYLE_SET], [test ! -z "$LAUNCHSTYLE"])
441 #AC_SUBST([TEST_SH_LIST])
442
443 AM_CONDITIONAL([DARWIN], [test $(uname) = Darwin])
444
445 AC_CONFIG_FILES([
446 Makefile
447 mpidep/Makefile
448 src/Makefile
449 src/music/music-config.hh
450 src/music/version.hh
451 rudeconfig/Makefile
452 utils/Makefile
453 examples/Makefile
454 testsuite/Makefile
455 testsuite/music_tests
456 testsuite/unittests/catch/Makefile
457 testsuite/sanitytests/Makefile
458 music-config/Makefile
459 music-config/predict_rank.py
460 doc/Makefile
461 extras/Makefile
462 ])
463
464 AC_OUTPUT
465
466 if test "$ac_cv_header_GL_glut_h" = "no"; then
467 AC_MSG_NOTICE([
468 NOTE: viewevents will not be built since the GL/glut.h header was not
469 found on this system. This is no problem unless you plan to
470 view spiking activity graphically.])
471 fi
472
473 dnl Local Variables:
474 dnl comment-start: "dnl "
475 dnl comment-end: ""
476 dnl comment-start-skip: "\\bdnl\\b\\s *"
477 dnl End: