1
# StarPU --- Runtime system for heterogeneous multicore architectures.
3
# Copyright (C) 2009-2012 Université de Bordeaux 1
4
# Copyright (C) 2010, 2011, 2012 Centre National de la Recherche Scientifique
5
# Copyright (C) 2011 Télécom-SudParis
6
# Copyright (C) 2011, 2012 Institut National de Recherche en Informatique et Automatique
8
# StarPU is free software; you can redistribute it and/or modify
9
# it under the terms of the GNU Lesser General Public License as published by
10
# the Free Software Foundation; either version 2.1 of the License, or (at
11
# your option) any later version.
13
# StarPU is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
# See the GNU Lesser General Public License in COPYING.LGPL for more details.
19
AC_INIT([StarPU],1.0.1, [starpu-devel@lists.gforge.inria.fr], starpu)
20
AC_CONFIG_SRCDIR(include/starpu.h)
21
AC_CONFIG_AUX_DIR([build-aux])
25
STARPU_MAJOR_VERSION="`echo $PACKAGE_VERSION | cut -d . -f 1`"
26
STARPU_MINOR_VERSION="`echo $PACKAGE_VERSION | cut -d . -f 2`"
27
AC_SUBST([STARPU_MAJOR_VERSION])
28
AC_SUBST([STARPU_MINOR_VERSION])
29
AC_SUBST([STARPU_EFFECTIVE_VERSION])
30
AC_DEFINE_UNQUOTED([STARPU_MAJOR_VERSION], [$STARPU_MAJOR_VERSION],
31
[Major version number of StarPU.])
32
AC_DEFINE_UNQUOTED([STARPU_MINOR_VERSION], [$STARPU_MINOR_VERSION],
33
[Major version number of StarPU.])
35
. "$srcdir/STARPU-VERSION"
36
AC_SUBST([LIBSTARPU_INTERFACE_CURRENT])
37
AC_SUBST([LIBSTARPU_INTERFACE_REVISION])
38
AC_SUBST([LIBSTARPU_INTERFACE_AGE])
39
AC_SUBST([LIBSTARPUMPI_INTERFACE_CURRENT])
40
AC_SUBST([LIBSTARPUMPI_INTERFACE_REVISION])
41
AC_SUBST([LIBSTARPUMPI_INTERFACE_AGE])
42
AC_SUBST([LIBSTARPUFFT_INTERFACE_CURRENT])
43
AC_SUBST([LIBSTARPUFFT_INTERFACE_REVISION])
44
AC_SUBST([LIBSTARPUFFT_INTERFACE_AGE])
45
AC_SUBST([LIBSOCL_INTERFACE_CURRENT])
46
AC_SUBST([LIBSOCL_INTERFACE_REVISION])
47
AC_SUBST([LIBSOCL_INTERFACE_AGE])
51
dnl Automake 1.11 introduced `silent-rules' and `color-tests'. Use them
52
dnl when they're available.
53
m4_ifdef([AM_SILENT_RULES],
54
[AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign silent-rules color-tests parallel-tests])],
55
[AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign])])
57
m4_ifdef([AM_SILENT_RULES],
58
[AM_SILENT_RULES(yes)])
80
AC_PATH_PROGS([STARPU_MS_LIB], [lib])
81
AC_ARG_VAR([STARPU_MS_LIB], [Path to Microsoft's Visual Studio `lib' tool])
82
AM_CONDITIONAL([STARPU_HAVE_MS_LIB], [test "x$STARPU_MS_LIB" != "x"])
84
*-*-mingw*|*-*-cygwin*)
87
AC_DEFINE(STARPU_HAVE_WINDOWS, [], [Define this on windows.])
90
AM_CONDITIONAL([STARPU_HAVE_WINDOWS], [test "x$starpu_windows" = "xyes"])
92
# on Darwin, GCC targets i386 by default, so we don't have atomic ops
93
AC_CHECK_SIZEOF([void *])
94
SIZEOF_VOID_P=$ac_cv_sizeof_void_p
95
case $SIZEOF_VOID_P in
98
i386-*darwin*) CFLAGS+=" -march=i686 " ;;
100
STARPU_MS_LIB_ARCH=X86
103
STARPU_MS_LIB_ARCH=X64
106
AC_SUBST(STARPU_MS_LIB_ARCH)
108
# This will be useful for program which use CUDA (and .cubin files) which need
109
# some path to the CUDA code at runtime.
110
AC_DEFINE_UNQUOTED(STARPU_BUILD_DIR, "$PWD", [location of StarPU build directory])
111
AC_SUBST(STARPU_BUILD_DIR, $PWD)
113
/*) AC_DEFINE_UNQUOTED(STARPU_SRC_DIR, "$(eval echo ${srcdir})", [location of StarPU sources])
114
AC_SUBST(STARPU_SRC_DIR, "$(eval echo ${srcdir})") ;;
115
*) AC_DEFINE_UNQUOTED(STARPU_SRC_DIR, "$(eval echo $PWD/${srcdir})", [location of StarPU sources])
116
AC_SUBST(STARPU_SRC_DIR, "$(eval echo $PWD/${srcdir})") ;;
121
*-*-mingw*|*-*-cygwin*)
122
AC_ARG_ENABLE(native-winthreads, [AS_HELP_STRING([--enable-native-winthreads],
123
[Use native windows threads instead of pthread])],
124
enable_native_winthreads=$enableval, enable_native_winthreads=no)
127
if test x"$enable_native_winthreads" = xyes
129
CPPFLAGS+=" -I$STARPU_SRC_DIR/include/pthread_win32 "
131
AC_CHECK_LIB([pthread], [pthread_create])
137
]], [[ pthread_t t; pthread_create(&t, NULL, NULL, NULL); ]]),,
138
AC_MSG_ERROR([pthread_create unavailable]))
139
AC_SEARCH_LIBS([sqrt],[m],,AC_MSG_ERROR([math library unavailable]))
140
AC_HAVE_LIBRARY([ws2_32])
141
AC_CHECK_FUNCS([sysconf])
143
AC_CHECK_FUNC([pthread_spin_lock], have_pthread_spin_lock=yes, have_pthread_spin_lock=no)
144
if test x$have_pthread_spin_lock = xyes; then
145
AC_DEFINE(HAVE_PTHREAD_SPIN_LOCK,[],[pthread_spin_lock is available])
148
# yes, that's non portable, but it's still better than sched_setaffinity
149
AC_CHECK_FUNCS(pthread_setaffinity_np)
151
# There is no posix_memalign on Mac OS X, only memalign
152
AC_CHECK_FUNCS([posix_memalign], [AC_DEFINE([STARPU_HAVE_POSIX_MEMALIGN], [1], [Define to 1 if you have the `posix_memalign' function.])])
153
AC_CHECK_FUNCS([memalign], [AC_DEFINE([STARPU_HAVE_MEMALIGN], [1], [Define to 1 if you have the `memalign' function.])])
155
# Some systems don't have drand48
156
AC_CHECK_FUNC([drand48], have_drand48=yes, have_drand48=no)
157
AC_CHECK_FUNC([erand48_r], have_erand48_r=yes, have_erand48_r=no)
158
# Maybe the user still does not want to use the provided drand48
159
AC_ARG_ENABLE(default-drand48, [AS_HELP_STRING([--disable-default-drand48],
160
[Do not use the default version of drand48])],
161
enable_default_drand48=$enableval, enable_default_drand48=yes)
162
if test x$have_drand48 = xyes -a x$enable_default_drand48 = xyes ; then
163
AC_DEFINE([STARPU_USE_DRAND48], [1], [Define to 1 if drandr48 is available and should be used])
165
if test x$have_erand48_r = xyes ; then
166
AC_DEFINE([STARPU_USE_ERAND48_R], [1], [Define to 1 if erandr48_r is available])
169
# Some systems do not define strerror_r
170
AC_CHECK_FUNC([strerror_r], [AC_DEFINE([STARPU_HAVE_STRERROR_R], [1], [Define to 1 if the function strerro_r is available.])])
172
# Some systems do not define unsetenv
173
AC_CHECK_FUNC([unsetenv], [AC_DEFINE([STARPU_HAVE_UNSETENV], [1], [Define to 1 if the function unsetenv is available.])])
175
# Define slow machine
176
AC_ARG_ENABLE(slow-machine, [AS_HELP_STRING([--enable-slow-machine],
177
[Lower default values for the testcases run by make check])],
178
enable_slow_machine=$enableval, enable_slow_machine=false)
179
if test x$enable_slow_machine = xyes; then
180
AC_DEFINE(STARPU_SLOW_MACHINE, [1], [enable slow machine])
183
AC_CHECK_HEADERS([malloc.h], [AC_DEFINE([STARPU_HAVE_MALLOC_H], [1], [Define to 1 if you have the <malloc.h> header file.])])
185
AC_CHECK_HEADERS([valgrind/valgrind.h], [AC_DEFINE([STARPU_HAVE_VALGRIND_H], [1], [Define to 1 if you have the <valgrind/valgrind.h> header file.])])
187
# This defines HAVE_SYNC_VAL_COMPARE_AND_SWAP
188
STARPU_CHECK_SYNC_VAL_COMPARE_AND_SWAP
190
# This defines HAVE_SYNC_BOOL_COMPARE_AND_SWAP
191
STARPU_CHECK_SYNC_BOOL_COMPARE_AND_SWAP
193
# This defines HAVE_SYNC_FETCH_AND_ADD
194
STARPU_CHECK_SYNC_FETCH_AND_ADD
196
# This defines HAVE_SYNC_FETCH_AND_OR
197
STARPU_CHECK_SYNC_FETCH_AND_OR
199
# This defines HAVE_SYNC_LOCK_TEST_AND_SET
200
STARPU_CHECK_SYNC_LOCK_TEST_AND_SET
202
# This defines HAVE_SYNC_SYNCHRONIZE
203
STARPU_CHECK_SYNC_SYNCHRONIZE
205
CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE "
207
STARPU_SEARCH_LIBS([LIBNUMA],[set_mempolicy],[numa],[enable_libnuma=yes],[enable_libnuma=no])
208
AC_MSG_CHECKING(whether libnuma is available)
209
AC_MSG_RESULT($enable_libnuma)
210
if test x$enable_libnuma = xyes; then
211
AC_DEFINE(STARPU_HAVE_LIBNUMA,[],[libnuma is available])
214
###############################################################################
218
###############################################################################
220
AC_MSG_CHECKING(maximum number of CPUs)
221
AC_ARG_ENABLE(maxcpus, [AS_HELP_STRING([--enable-maxcpus=<number>],
222
[maximum number of CPUs])],
223
maxcpus=$enableval, maxcpus=64)
224
AC_MSG_RESULT($maxcpus)
225
AC_DEFINE_UNQUOTED(STARPU_MAXCPUS, [$maxcpus], [Maximum number of CPUs supported])
227
AC_MSG_CHECKING(whether CPUs should be used)
228
AC_ARG_ENABLE(cpu, [AS_HELP_STRING([--disable-cpu],
229
[do not use the CPU(s)])],
230
enable_cpu=$enableval, enable_cpu=yes)
231
AC_MSG_RESULT($enable_cpu)
232
AC_SUBST(STARPU_USE_CPU, $enable_cpu)
234
AM_CONDITIONAL(STARPU_USE_CPU, test x$enable_cpu = xyes)
236
if test x$enable_cpu = xyes; then
237
AC_DEFINE(STARPU_USE_CPU, [1], [CPU driver is activated])
240
# How many parallel worker can we support ?
241
nmaxcombinedworkers=`expr 2 \* $maxcpus`
242
AC_DEFINE_UNQUOTED(STARPU_NMAX_COMBINEDWORKERS,
243
[$nmaxcombinedworkers], [Maximum number of worker combinations])
245
###############################################################################
249
###############################################################################
251
AC_MSG_CHECKING(maximum number of CUDA devices)
252
AC_ARG_ENABLE(maxcudadev, [AS_HELP_STRING([--enable-maxcudadev=<number>],
253
[maximum number of CUDA devices])],
254
nmaxcudadev=$enableval, nmaxcudadev=4)
255
AC_MSG_RESULT($nmaxcudadev)
256
AC_DEFINE_UNQUOTED(STARPU_MAXCUDADEVS, [$nmaxcudadev],
257
[maximum number of CUDA devices])
259
AC_ARG_ENABLE(cuda, [AS_HELP_STRING([--disable-cuda],
260
[do not use CUDA device(s)])],, [enable_cuda=maybe])
262
#AC_MSG_CHECKING(whether CUDA is available)
263
AC_ARG_WITH(cuda-dir,
264
[AS_HELP_STRING([--with-cuda-dir=<path>],
265
[specify CUDA installation directory])],
268
# in case this was not explicit yet
272
AC_ARG_WITH(cuda-include-dir,
273
[AS_HELP_STRING([--with-cuda-include-dir=<path>],
274
[specify where CUDA headers are installed])],
276
cuda_include_dir="$withval"
277
# in case this was not explicit yet
279
], [cuda_include_dir=no])
281
AC_ARG_WITH(cuda-lib-dir,
282
[AS_HELP_STRING([--with-cuda-lib-dir=<path>],
283
[specify where CUDA libraries are installed])],
285
cuda_lib_dir="$withval"
286
# in case this was not explicit yet
288
], [cuda_lib_dir=no])
290
AC_DEFUN([STARPU_CHECK_CUDA_L],
293
SAVED_LDFLAGS="${LDFLAGS}"
294
STARPU_CUDA_LDFLAGS="${__cuda_L}"
295
AC_MSG_CHECKING(whether CUDA is available with: $__cuda_L)
297
LDFLAGS="${SAVED_LDFLAGS} ${__cuda_L}"
298
AC_HAVE_LIBRARY([cuda],[have_valid_cuda=yes],[have_valid_cuda=no])
299
unset ac_cv_lib_cuda_main
300
if test "$have_valid_cuda" = "yes" ; then
301
AC_HAVE_LIBRARY([cudart],[have_valid_cuda=yes],[have_valid_cuda=no])
302
unset ac_cv_lib_cudart_main
303
if test "$have_valid_cuda" = yes ; then
304
STARPU_CUDA_LDFLAGS="$STARPU_CUDA_LDFLAGS -lcudart"
305
LDFLAGS="${SAVED_LDFLAGS} ${STARPU_CUDA_LDFLAGS}"
306
# we also check that CUBLAS is available
307
AC_HAVE_LIBRARY([cublas],[have_valid_cuda=yes],[have_valid_cuda=no])
308
unset ac_cv_lib_cublas_main
309
if test "$have_valid_cuda" = "yes" ; then
310
STARPU_CUDA_LDFLAGS="$STARPU_CUDA_LDFLAGS -lcublas"
314
LDFLAGS="${SAVED_LDFLAGS}"
316
AC_DEFUN([STARPU_CHECK_CUDA],
319
__cuda_include_dir=$2
322
if test -z "$__cuda_lib_dir" ; then
325
if test -z "$__cuda_include_dir" ; then
326
__cuda_include_dir=no
328
if test -z "$__cuda_dir" ; then
332
if test "$__cuda_dir" != "no" ; then
333
AC_MSG_CHECKING(whether CUDA is available in $__cuda_dir, $__cuda_include_dir and $__cuda_lib_dir)
335
AC_MSG_CHECKING(whether CUDA is available)
339
if test "$__cuda_include_dir" = "no" -a "$__cuda_dir" != "no" ; then
340
__cuda_include_dir="$__cuda_dir/include"
343
SAVED_CPPFLAGS="$CPPFLAGS"
346
if test "$__cuda_include_dir" != "no" ; then
347
CPPFLAGS="${CPPFLAGS} -I$__cuda_include_dir"
350
AC_CHECK_HEADER([cuda.h],[have_valid_cuda=yes],[have_valid_cuda=no])
351
unset ac_cv_header_cuda_h
353
if test "$have_valid_cuda" = "yes" ; then
354
if test "$__cuda_lib_dir" != "no" ; then
355
STARPU_CHECK_CUDA_L("-L${__cuda_lib_dir}")
357
if test "$__cuda_dir" != "no" ; then
358
for __cuda_libdir in lib64 lib lib/x64 lib/Win32 ; do
359
STARPU_CHECK_CUDA_L("-L${__cuda_dir}/${__cuda_libdir}")
360
if test "$have_valid_cuda" = yes ; then
365
STARPU_CHECK_CUDA_L("")
370
if test "$have_valid_cuda" = "no" ; then
371
CPPFLAGS="${SAVED_CPPFLAGS}"
372
unset STARPU_CUDA_LDFLAGS
374
if test "$__cuda_include_dir" != "no"; then
375
STARPU_CUDA_CPPFLAGS="-I$__cuda_include_dir"
376
NVCCFLAGS="${NVCCFLAGS} -I$__cuda_include_dir"
381
if test x$enable_cuda = xyes -o x$enable_cuda = xmaybe; then
382
STARPU_CHECK_CUDA("$cuda_dir", "$cuda_include_dir", "$cuda_lib_dir")
383
if test "$have_valid_cuda" = "no" ; then
384
STARPU_CHECK_CUDA("$CUDA_PATH", "$CUDA_INC_PATH", "$CUDA_LIB_PATH")
386
if test "$have_valid_cuda" = "no" ; then
387
for f in "/usr/local/cuda" "/c/cuda" "/cygdrive/c/cuda" "/opt/cuda" "$CUDA_PATH" "$CUDA_INC_PATH/.." "$CUDA_INSTALL_PATH" "$CUDA_TOOLKIT"; do
388
if test -n "$f" ; then
389
STARPU_CHECK_CUDA("$f", "no", "no")
390
if test "$have_valid_cuda" = "yes" ; then
397
# Check cuda is compatible with the C compiler
398
AC_MSG_CHECKING(whether CUDA is working)
399
if test "$have_valid_cuda" = "yes" ; then
400
SAVED_CPPFLAGS="${CPPFLAGS}"
401
CPPFLAGS="${CPPFLAGS} ${STARPU_CUDA_CPPFLAGS}"
402
SAVED_LDFLAGS="${LDFLAGS}"
403
LDFLAGS="${LDFLAGS} ${STARPU_CUDA_LDFLAGS} -lcuda"
404
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
405
[[#include <cuda.h>]],
409
AC_RUN_IFELSE([AC_LANG_PROGRAM(
410
[[#include <cuda.h>]],
413
[have_valid_cuda="yes"],
415
AC_MSG_RESULT([CUDA found and can be compiled, but compiled application can not be run, is the CUDA path missing in LD_LIBRARY_PATH?])
420
AC_MSG_ERROR([CUDA found, but cuda.h could not be compiled])
424
CPPFLAGS="${SAVED_CPPFLAGS}"
425
LDFLAGS="${SAVED_LDFLAGS}"
427
AC_MSG_RESULT($have_valid_cuda)
429
# in case CUDA was explicitely required, but is not available, this is an error
430
if test x$enable_cuda = xyes -a x$have_valid_cuda = xno; then
431
AC_MSG_ERROR([cannot find CUDA])
433
# now we enable CUDA if and only if a proper setup is available
434
enable_cuda=$have_valid_cuda
437
if test x$enable_cuda = xyes; then
438
AC_PATH_PROG([NVCC], [nvcc], [not-found],
439
[$cuda_dir/bin:$PATH:/usr/local/cuda/bin:/usr/bin:/bin])
440
if test "x$NVCC" = "xnot-found"; then
441
AC_MSG_WARN(['nvcc' not found, disabling CUDA])
446
AC_MSG_CHECKING(whether CUDA should be used)
447
AC_MSG_RESULT($enable_cuda)
448
AC_SUBST(STARPU_USE_CUDA, $enable_cuda)
449
AM_CONDITIONAL(STARPU_USE_CUDA, test x$enable_cuda = xyes)
450
if test x$enable_cuda = xyes; then
451
AC_DEFINE(STARPU_USE_CUDA, [1], [CUDA support is activated])
453
# On Darwin, the libstdc++ dependency is not automatically added by nvcc
455
# *-*darwin*) AC_HAVE_LIBRARY([stdc++], []) ;;
456
# #*-*darwin*) AC_HAVE_LIBRARY([stdc++], [STARPU_CUDA_LDFLAGS="$STARPU_CUDA_LDFLAGS -lstdc++"]) ;;
458
STARPU_CUDA_LDFLAGS="$STARPU_CUDA_LDFLAGS -lcuda"
459
STARPU_CUFFT_LDFLAGS="-lcufft"
461
if test "$F77" = "gfortran" ; then
462
STARPU_CUDA_FORTRAN_LDFLAGS="-lgfortran"
463
AC_SUBST(STARPU_CUDA_FORTRAN_LDFLAGS)
466
#in case this is a 64bit setup, we tell nvcc to use a -m64 flag
467
if test x$SIZEOF_VOID_P = x8; then
468
NVCCFLAGS="${NVCCFLAGS} -m64"
474
if test x$enable_cuda = xyes; then
475
PKG_CHECK_MODULES([MAGMA], [magma], [
476
AC_DEFINE([STARPU_HAVE_MAGMA], [1], [Define to 1 if you have the MAGMA library.])
477
AC_SUBST([STARPU_HAVE_MAGMA], [1])
481
AM_CONDITIONAL(STARPU_HAVE_MAGMA, [test x$have_magma = xyes])
482
AC_MSG_CHECKING(whether MAGMA should be used)
483
AC_MSG_RESULT($have_magma)
485
# cufftDoubleComplex may not be available on an old CUDA setup
486
AC_CHECK_TYPE(cufftDoubleComplex,
487
[have_cufftdoublecomplex=yes],
488
[have_cufftdoublecomplex=no], [#include <cufft.h>])
489
AM_CONDITIONAL(STARPU_HAVE_CUFFTDOUBLECOMPLEX, test x$have_cufftdoublecomplex = xyes)
490
if test x$have_cufftdoublecomplex = xyes; then
491
AC_DEFINE(STARPU_HAVE_CUFFTDOUBLECOMPLEX, [1], [cufftDoubleComplex is available])
494
# The CURAND library is only available since CUDA 3.2
495
have_curand=$enable_cuda
496
if test x$enable_cuda = xyes; then
497
SAVED_LDFLAGS="${LDFLAGS}"
498
LDFLAGS="${LDFLAGS} ${STARPU_CUDA_LDFLAGS}"
499
AC_HAVE_LIBRARY([curand],[have_curand=yes],[have_curand=no])
500
LDFLAGS="${SAVED_LDFLAGS}"
502
AC_MSG_CHECKING(whether CURAND is available)
503
AC_MSG_RESULT($have_curand)
504
if test x$have_curand = xyes; then
505
AC_DEFINE(STARPU_HAVE_CURAND,[1], [CURAND is available])
506
STARPU_CURAND_LDFLAGS="$STARPU_CURAND_LDFLAGS -lcurand"
507
AC_SUBST(STARPU_CURAND_LDFLAGS)
510
# Peer transfers are only supported since CUDA 4.0
511
# Disable them if user explicity wants to disable them
512
AC_ARG_ENABLE(cuda_memcpy_peer, [AS_HELP_STRING([--disable-cuda-memcpy-peer], [do not allow peer transfers when using CUDA 4.0])],, [enable_cuda_memcpy_peer=yes])
513
have_cuda_memcpy_peer=no
514
if test x$enable_cuda_memcpy_peer = xyes -a x$enable_cuda = xyes ; then
515
SAVED_LDFLAGS="${LDFLAGS}"
516
LDFLAGS="${LDFLAGS} ${STARPU_CUDA_LDFLAGS}"
517
AC_CHECK_FUNC([cudaMemcpyPeer], have_cuda_memcpy_peer=yes, have_cuda_memcpy_peer=no)
518
LDFLAGS="${SAVED_LDFLAGS}"
520
if test x$have_cuda_memcpy_peer = xyes; then
521
AC_DEFINE(HAVE_CUDA_MEMCPY_PEER,[],[Peer transfers are supported in CUDA])
524
if test x$enable_cuda = xyes; then
525
if test x$starpu_windows != xyes ; then
526
STARPU_CUDA_LDFLAGS="$STARPU_CUDA_LDFLAGS -lstdc++"
528
AC_SUBST(STARPU_CUDA_LDFLAGS)
529
AC_SUBST(STARPU_CUFFT_LDFLAGS)
530
AC_SUBST(STARPU_CUDA_CPPFLAGS)
533
###############################################################################
537
###############################################################################
539
AC_MSG_CHECKING(maximum number of OpenCL devices)
540
AC_ARG_ENABLE(maxopencldev, [AS_HELP_STRING([--enable-maxopencldev=<number>],
541
[maximum number of OPENCL devices])],
542
nmaxopencldev=$enableval, nmaxopencldev=8)
543
AC_MSG_RESULT($nmaxopencldev)
544
AC_DEFINE_UNQUOTED(STARPU_MAXOPENCLDEVS, [$nmaxopencldev],
545
[maximum number of OPENCL devices])
546
AC_ARG_ENABLE(opencl, [AS_HELP_STRING([--disable-opencl],
547
[do not use OpenCL device(s)])],, [enable_opencl=maybe])
549
AC_DEFUN([STARPU_CHECK_OPENCL],
552
__opencl_include_dir=$2
555
if test "$__opencl_dir" != "no" ; then
556
AC_MSG_CHECKING(whether OpenCL is available in $__opencl_dir $__opencl_include_dir and $__opencl_lib_dir)
558
AC_MSG_CHECKING(whether OpenCL is available)
562
if test "$__opencl_include_dir" = "no" -a "$__opencl_dir" != "no" ; then
563
__opencl_include_dir="$__opencl_dir/include"
566
SAVED_CPPFLAGS="$CPPFLAGS"
567
SAVED_LDFLAGS="${LDFLAGS}"
569
if test "$__opencl_include_dir" != "no" ; then
570
CPPFLAGS="${CPPFLAGS} -I$__opencl_include_dir"
572
AC_CHECK_HEADER([CL/cl.h],[have_valid_opencl=yes],[have_valid_opencl=no])
573
unset ac_cv_header_CL_cl_h
575
if test "$have_valid_opencl" = "yes" ; then
576
if test "$__opencl_lib_dir" != "no"; then
577
LDFLAGS="${SAVED_LDFLAGS} -L$__opencl_lib_dir"
578
AC_HAVE_LIBRARY([OpenCL],[have_valid_opencl=yes],[have_valid_opencl=no])
579
unset ac_cv_lib_OpenCL_main
581
AC_MSG_CHECKING(whether OpenCL is available in $__opencl_dir)
583
AC_HAVE_LIBRARY([OpenCL],[have_valid_opencl=yes],[have_valid_opencl=no])
584
unset ac_cv_lib_OpenCL_main
585
if test "$have_valid_opencl" = "no" -a "$__opencl_dir" != "no" ; then
586
for __cuda_libdir in lib64 lib lib/x86 lib/Win32 ; do
587
__opencl_lib_dir="$__opencl_dir/$__cuda_libdir"
588
AC_MSG_CHECKING(whether OpenCL is available in $__opencl_dir and $__opencl_lib_dir)
590
LDFLAGS="${SAVED_LDFLAGS} -L$__opencl_lib_dir"
591
AC_HAVE_LIBRARY([OpenCL],[have_valid_opencl=yes],[have_valid_opencl=no])
592
unset ac_cv_lib_OpenCL_main
593
if test "$have_valid_opencl" = yes ; then
598
LDFLAGS="${SAVED_LDFLAGS}"
599
AC_HAVE_LIBRARY([OpenCL],[have_valid_opencl=yes],[have_valid_opencl=no])
600
unset ac_cv_lib_OpenCL_main
605
if test "$have_valid_opencl" = "yes" -a "$__opencl_include_dir" != "no"; then
606
STARPU_OPENCL_CPPFLAGS="-I$__opencl_include_dir"
607
AC_CHECK_HEADERS([CL/cl_ext.h])
610
CPPFLAGS="${SAVED_CPPFLAGS}"
611
LDFLAGS="${SAVED_LDFLAGS}"
613
if test "$have_valid_opencl" = "yes" ; then
614
if test "$__opencl_lib_dir" != "no"; then
615
STARPU_OPENCL_LDFLAGS="-L$__opencl_lib_dir"
617
STARPU_OPENCL_LDFLAGS="${STARPU_OPENCL_LDFLAGS} -lOpenCL"
622
#AC_MSG_CHECKING(whether OpenCL is available)
623
AC_ARG_WITH(opencl-dir,
624
[AS_HELP_STRING([--with-opencl-dir=<path>],
625
[specify OpenCL installation directory])],
627
opencl_dir="$withval"
628
# in case this was not explicit yet
632
AC_ARG_WITH(opencl-include-dir,
633
[AS_HELP_STRING([--with-opencl-include-dir=<path>],
634
[specify where OpenCL headers are installed])],
636
opencl_include_dir="$withval"
637
# in case this was not explicit yet
639
], [opencl_include_dir=no])
641
AC_ARG_WITH(opencl-lib-dir,
642
[AS_HELP_STRING([--with-opencl-lib-dir=<path>],
643
[specify where OpenCL libraries are installed])],
645
opencl_lib_dir="$withval"
646
# in case this was not explicit yet
648
], [opencl_lib_dir=no])
650
AC_DEFUN([STARPU_LOOK_FOR_OPENCL],
652
if test "x$has_opencl_being_checked" != "xyes" ; then
653
STARPU_CHECK_OPENCL("$opencl_dir", "$opencl_include_dir", "$opencl_lib_dir")
654
if test "$have_valid_opencl" = "no" ; then
655
for f in "/usr/local/cuda" "/c/cuda" "/cygdrive/c/cuda" "/opt/cuda" "$CUDA_PATH" "$CUDA_INC_PATH/.." "$CUDA_INSTALL_PATH" "$CUDA_TOOLKIT"; do
656
if test -n "$f" ; then
657
STARPU_CHECK_OPENCL("$f", "no", "no")
658
if test "$have_valid_opencl" = "yes" ; then
664
has_opencl_being_checked=yes
668
if test x$enable_opencl = xyes -o x$enable_opencl = xmaybe; then
669
STARPU_LOOK_FOR_OPENCL()
670
# in case OpenCL was explicitely required, but is not available, this is an error
671
if test x$enable_opencl = xyes -a x$have_valid_opencl = xno; then
672
AC_MSG_ERROR([cannot find OpenCL])
675
# now we enable OpenCL if and only if a proper setup is available
676
enable_opencl=$have_valid_opencl
679
AC_MSG_CHECKING(whether OpenCL should be used)
680
AC_MSG_RESULT($enable_opencl)
681
AC_SUBST(STARPU_USE_OPENCL, $enable_opencl)
682
AM_CONDITIONAL(STARPU_USE_OPENCL, test x$enable_opencl = xyes)
683
if test x$enable_opencl = xyes ; then
684
AC_DEFINE(STARPU_USE_OPENCL, [1], [OpenCL support is activated])
685
STARPU_OPENCL_CPPFLAGS="${STARPU_OPENCL_CPPFLAGS} -DSTARPU_OPENCL_DATADIR=${datarootdir}/starpu/opencl"
686
AC_SUBST(STARPU_OPENCL_DATAdir, "$(eval echo ${datarootdir}/starpu/opencl/examples)")
687
AC_SUBST(STARPU_OPENCL_CPPFLAGS)
688
AC_SUBST(STARPU_OPENCL_LDFLAGS)
691
###############################################################################
695
###############################################################################
697
#TODO fix the default dir
698
AC_ARG_ENABLE(gordon, [AS_HELP_STRING([--enable-gordon],
699
[use Cell SPUs])],, enable_gordon=maybe)
701
if test x$enable_gordon = xyes -o x$enable_gordon = xmaybe; then
703
AC_ARG_WITH(gordon-dir, [AS_HELP_STRING([--with-gordon-dir=<path>],
704
[specify Gordon installation directory (default is /usr/local/)])],
706
gordon_dir="$withval"
708
], gordon_dir=/usr/local/)
710
# do we have a valid Gordon setup ?
711
have_valid_gordon=yes
713
# can we use dynamic code loading facilities ?
714
AC_CHECK_LIB(elf, elf_memory,, [have_valid_gordon=no])
716
AC_CHECK_LIB(spe2, spe_context_create,,[have_valid_gordon=no])
717
AC_CHECK_FUNC(spe_in_mbox_write, [], [have_valid_gordon=no])
720
if test -d "$gordon_dir"; then
721
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$gordon_dir"
723
AC_SUBST(PKG_CONFIG_PATH)
724
PKG_CHECK_MODULES([GORDON], [libgordon], [], have_valid_gordon=no)
726
CPPFLAGS="${CPPFLAGS} ${GORDON_CFLAGS}"
727
LIBS="${LIBS} ${GORDON_LIBS}"
729
# AC_CHECK_FUNC(gordon_init, [gordon], [have_valid_gordon=no])
731
# in case Gordon was explicitely required, but is not available, this is an error
732
if test x$enable_gordon = xyes -a x$have_valid_gordon = xno; then
733
AC_MSG_ERROR([cannot find Gordon])
737
# now we enable Gordon if and only if a proper setup is available
738
enable_gordon=$have_valid_gordon
741
AC_MSG_CHECKING(whether GORDON should be used)
742
AC_MSG_RESULT($enable_gordon)
743
AC_SUBST(STARPU_USE_GORDON, $enable_gordon)
744
AM_CONDITIONAL(STARPU_USE_GORDON, test x$enable_gordon = xyes)
746
if test x$enable_gordon = xyes; then
747
AC_DEFINE(STARPU_USE_GORDON, [1], [Cell support is enabled])
748
GORDON_REQUIRES=gordon
750
AC_SUBST(GORDON_REQUIRES)
752
AC_MSG_CHECKING(whether blocking drivers should be disabled)
753
AC_ARG_ENABLE(blocking-drivers, [AS_HELP_STRING([--disable-blocking-drivers], [disable blocking drivers])],
754
enable_blocking=$enableval, enable_blocking=$enable_gordon)
755
AC_MSG_RESULT($enable_blocking)
757
if test x$enable_blocking = xno; then
758
AC_DEFINE(STARPU_NON_BLOCKING_DRIVERS, [1], [drivers must progress])
762
###############################################################################
764
# Debug and Performance analysis tools #
766
###############################################################################
768
AC_MSG_CHECKING(whether debug mode should be enabled)
769
AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [enable debug mode])],
770
enable_debug=$enableval, enable_debug=no)
771
AC_MSG_RESULT($enable_debug)
773
if test x$enable_debug = xyes; then
775
AC_DEFINE(STARPU_SPINLOCK_CHECK, [1], [check spinlock use])
779
CFLAGS+=" -gdwarf-2 -g3 "
781
AC_MSG_CHECKING(whether extra checks should be performed)
782
AC_ARG_ENABLE(fast, [AS_HELP_STRING([--enable-fast],
783
[do not enforce assertions])],
784
enable_fast=$enableval, enable_fast=no)
785
AC_MSG_RESULT($enable_fast)
786
if test x$enable_fast = xyes; then
787
AC_DEFINE(STARPU_NO_ASSERT, [1], [disable assertions])
790
AC_MSG_CHECKING(whether memory status should be displayed)
791
AC_ARG_ENABLE(memory-status, [AS_HELP_STRING([--enable-memory-status],
792
[display memory status at the end of execution])],
793
enable_memory_status=$enableval, enable_memory_status=no)
794
AC_MSG_RESULT($enable_memory_status)
795
if test x$enable_memory_status = xyes; then
796
AC_DEFINE(STARPU_MEMORY_STATUS, [1], [display memory status])
800
AC_MSG_CHECKING(whether debug messages should be displayed)
801
AC_ARG_ENABLE(verbose, [AS_HELP_STRING([--enable-verbose],
802
[display verbose debug messages])],
803
enable_verbose=$enableval, enable_verbose=no)
804
AC_MSG_RESULT($enable_verbose)
805
if test x$enable_verbose = xyes; then
806
AC_DEFINE(STARPU_VERBOSE, [1], [display verbose debug messages])
810
AC_MSG_CHECKING(whether coverage testing should be enabled)
811
AC_ARG_ENABLE(coverage, [AS_HELP_STRING([--enable-coverage],
812
[enable coverage checking])],
813
enable_coverage=$enableval, enable_coverage=no)
814
AC_MSG_RESULT($enable_coverage)
815
AC_SUBST(COVERAGE, $enable_coverage)
816
AM_CONDITIONAL(STARPU_COVERAGE_ENABLED, [test "x$enable_coverage" = "xyes"])
817
if test x$enable_coverage = xyes; then
818
CPPFLAGS="${CPPFLAGS} --coverage"
819
LDFLAGS="${LDFLAGS} --coverage"
823
# shall we use FxT to generate trace of the execution ?
824
AC_MSG_CHECKING(whether FxT traces should be generated)
825
AC_ARG_WITH(fxt, [AS_HELP_STRING([--with-fxt[=<dir>]], [generate fxt traces])],
827
if test x$withval != xno; then
829
if test x$withval = xyes; then
831
use_fxt_from_system=yes
834
# TODO check if the dir is actually containing FxT
835
use_fxt_from_system=no
837
AC_MSG_RESULT(yes using $fxtdir)
838
AC_SUBST(FXTDIR, $fxtdir)
849
AC_SUBST(STARPU_USE_FXT, $use_fxt)
850
AM_CONDITIONAL(STARPU_USE_FXT, test x$use_fxt = xyes)
852
if test x$use_fxt = xyes; then
853
AC_DEFINE(STARPU_USE_FXT, [1], [enable FxT traces])
854
AC_DEFINE(CONFIG_FUT, [1], [enable FUT traces])
856
if test x$use_fxt_from_system = xno; then
857
CPPFLAGS="${CPPFLAGS} -I$fxtdir/include/ "
858
LDFLAGS="${LDFLAGS} -L$fxtdir/lib/ -lfxt"
860
PKG_CHECK_MODULES([FXT], [fxt])
864
AC_MSG_CHECKING(whether performance debugging should be enabled)
865
AC_ARG_ENABLE(perf-debug, [AS_HELP_STRING([--enable-perf-debug],
866
[enable performance debugging through gprof])],
867
enable_perf_debug=$enableval, enable_perf_debug=no)
868
AC_MSG_RESULT($enable_perf_debug)
869
AC_SUBST(STARPU_PERF_DEBUG, $enable_perf_debug)
870
if test x$enable_perf_debug = xyes; then
871
AC_DEFINE(STARPU_PERF_DEBUG, [1], [enable performance debug])
872
CPPFLAGS="${CPPFLAGS} -pg -fprofile-arcs "
873
LDFLAGS="${LDFLAGS} -pg -fprofile-arcs "
876
AC_MSG_CHECKING(whether performance model debugging should be enabled)
877
AC_ARG_ENABLE(model-debug, [AS_HELP_STRING([--enable-model-debug],
878
[enable performance model debugging])],
879
enable_model_debug=$enableval, enable_model_debug=no)
880
AC_MSG_RESULT($enable_model_debug)
881
if test x$enable_model_debug = xyes; then
882
AC_DEFINE(STARPU_MODEL_DEBUG, [1], [enable performance model debug])
885
AC_MSG_CHECKING(whether statistics should be generated)
886
AC_ARG_ENABLE(stats, [AS_HELP_STRING([--enable-stats],
887
[enable statistics])],
888
enable_stats=$enableval, enable_stats=no)
889
AC_MSG_RESULT($enable_stats)
890
AC_SUBST(STATS, $enable_stats)
891
AC_SUBST(STARPU_DATA_STATS, $enable_stats)
893
if test x$enable_stats = xyes; then
894
AC_DEFINE(STARPU_DATA_STATS, [1], [enable statistics])
897
AC_CHECK_HEADERS([glpk.h])
898
STARPU_HAVE_LIBRARY(GLPK, [glpk])
900
###############################################################################
902
# Miscellaneous options for StarPU #
904
###############################################################################
906
AC_MSG_CHECKING(how many buffers can be manipulated per task)
907
AC_ARG_ENABLE(maxbuffers, [AS_HELP_STRING([--enable-maxbuffers=<nbuffers>],
908
[maximum number of buffers per task])],
909
nmaxbuffers=$enableval, nmaxbuffers=8)
910
AC_MSG_RESULT($nmaxbuffers)
911
AC_DEFINE_UNQUOTED(STARPU_NMAXBUFS, [$nmaxbuffers],
912
[how many buffers can be manipulated per task])
914
# We have one memory node shared by all CPU workers, one node per GPU, and
915
# currently the Cell driver is using the same memory node as the CPU.
917
if test x$enable_cuda = xyes ; then
918
# we could have used nmaxcudadev + 1, but this would certainly give an
920
maxnodes=`expr $maxnodes + $nmaxcudadev`
922
if test x$enable_opencl = xyes ; then
923
# we could have used nmaxcudadev + 1, but this would certainly give an
925
maxnodes=`expr $maxnodes + $nmaxopencldev`
927
# todo: set maxnodes to the next power of 2 greater than maxnodes
929
AC_MSG_CHECKING(maximum number of memory nodes)
930
AC_MSG_RESULT($maxnodes)
931
AC_DEFINE_UNQUOTED(STARPU_MAXNODES, [$maxnodes],
932
[maximum number of memory nodes])
935
AC_MSG_CHECKING(whether allocation cache should be used)
936
AC_ARG_ENABLE(allocation-cache, [AS_HELP_STRING([--enable-allocation-cache],
937
[enable data allocation cache])],
938
enable_allocation_cache=$enableval, enable_allocation_cache=no)
939
AC_MSG_RESULT($enable_allocation_cache)
940
if test x$enable_allocation_cache = xyes; then
941
AC_DEFINE(STARPU_USE_ALLOCATION_CACHE, [1], [enable data allocation cache])
944
AC_ARG_WITH(perf-model-dir, [AS_HELP_STRING([--with-perf-model-dir=<dir>], [specify where performance models shoulds be stored])],
946
if test x$withval = xno; then
947
AC_MSG_ERROR(--without-perf-model-dir is not a valid option)
950
perf_model_dir="$withval"
951
have_explicit_perf_model_dir=yes
952
AC_DEFINE_UNQUOTED(STARPU_PERF_MODEL_DIR, ["$perf_model_dir"], [performance models location])
954
# by default, we put the performance models in
955
# $HOME/.starpu/sampling/
956
have_explicit_perf_model_dir=no
957
perf_model_dir="\$HOME/.starpu/sampling/"
960
AC_MSG_CHECKING(using explicit performance model location)
961
AC_MSG_RESULT($have_explicit_perf_model_dir)
963
AC_MSG_CHECKING(performance models location)
964
AC_MSG_RESULT($perf_model_dir)
966
# On many multicore CPUs, clock cycles are not synchronized
967
AC_CHECK_LIB([rt], [clock_gettime])
968
AC_CHECK_FUNCS([clock_gettime])
970
# Compute the maximum number of workers (we round it to 16 for alignment
972
nmaxworkers=`expr 16 \* \( \( $maxcpus + $nmaxcudadev + $nmaxopencldev + 15 \) / 16 \) `
973
AC_MSG_CHECKING(Maximum number of workers)
974
AC_MSG_RESULT($nmaxworkers)
975
AC_DEFINE_UNQUOTED(STARPU_NMAXWORKERS, [$nmaxworkers], [Maximum number of workers])
977
# Computes the maximum number of implementations per arch
978
AC_MSG_CHECKING(maximum number of implementations)
979
AC_ARG_ENABLE(maximplementations, [AS_HELP_STRING([--enable-maximplementations=<number>],
980
[maximum number of implementations])],
981
maximplementations=$enableval, maximplementations=4)
982
AC_MSG_RESULT($maximplementations)
983
AC_DEFINE_UNQUOTED(STARPU_MAXIMPLEMENTATIONS, [$maximplementations],
984
[maximum number of implementations])
986
###############################################################################
990
###############################################################################
992
AC_ARG_WITH(mpicc, [AS_HELP_STRING([--with-mpicc[=<path to mpicc>]],
993
[Path of the mpicc compiler])],
995
if test x$withval = xyes; then
996
AC_MSG_ERROR(--with-mpicc must be given a pathname)
1002
# nothing was specified: default value is used
1003
AC_PATH_PROG(mpicc_path, mpicc, [no], [])
1006
# We test if the MPICC compiler exists
1007
if test ! -x $mpicc_path; then
1008
#MPICC does not exists or is not executable
1009
AC_MSG_RESULT(The mpicc compiler is not valid)
1015
AC_MSG_CHECKING(mpicc path)
1016
AC_MSG_RESULT($mpicc_path)
1017
AC_SUBST(MPICC, $mpicc_path)
1018
if test x$use_mpi = xyes; then
1019
cc_or_mpicc=$mpicc_path
1023
AC_SUBST(CC_OR_MPICC, $cc_or_mpicc)
1025
# If the user specifically asks for it, or if we are in a developer checkout, we enable mpi check
1026
AC_ARG_ENABLE(mpi-check, AC_HELP_STRING([--enable-mpi-check], [Enable execution of MPI testcases]))
1027
running_mpi_check=no
1028
if test -d "$srcdir/.svn" ; then
1029
running_mpi_check=yes
1031
if test x$enable_mpi_check = xyes ; then
1032
running_mpi_check=yes
1034
if test x$enable_mpi_check = xno ; then
1035
running_mpi_check=no
1038
# Check if mpiexec is available
1039
AC_ARG_WITH(mpiexec, [AS_HELP_STRING([--with-mpiexec[=<path to mpiexec>]],
1040
[Path of mpiexec])],
1042
if test x$withval = xyes; then
1043
AC_MSG_ERROR(--with-mpiexec must be given a pathname)
1045
mpiexec_path=$withval
1049
# nothing was specified: look in the path
1050
AC_PATH_PROG(mpiexec_path, mpiexec, [no], [$(dirname $mpicc_path):$PATH])
1053
AC_MSG_CHECKING(whether mpiexec is available)
1054
AC_MSG_RESULT($mpiexec_path)
1056
# We test if MPIEXEC exists
1057
if test ! -x $mpiexec_path; then
1058
#MPIEXEC does not exists or is not executable
1059
AC_MSG_RESULT(The mpiexec script is not valid)
1060
running_mpi_check=no
1064
AM_CONDITIONAL(STARPU_MPI_CHECK, test x$running_mpi_check = xyes)
1065
if test x$use_mpi = xyes; then
1066
AC_MSG_CHECKING(whether MPI tests should be run)
1067
AC_MSG_RESULT($running_mpi_check)
1068
AC_SUBST(MPIEXEC,$mpiexec_path)
1071
AC_MSG_CHECKING(whether the StarPU MPI library should be generated)
1072
AC_MSG_RESULT($use_mpi)
1073
AC_SUBST(USE_MPI, $use_mpi)
1074
AM_CONDITIONAL(USE_MPI, test x$use_mpi = xyes)
1075
if test x$use_mpi = xyes; then
1076
AC_DEFINE(STARPU_USE_MPI,[],[whether the StarPU MPI library is available])
1079
###############################################################################
1083
###############################################################################
1085
AC_ARG_ENABLE([starpu-top],
1086
[AS_HELP_STRING([--disable-starpu-top],
1087
[build StarPU-Top])],
1088
[enable_starpu_top="no"],
1089
[enable_starpu_top="maybe"])
1091
# Check whether StarPU-Top can be built
1092
AC_MSG_CHECKING(for StarPU-Top)
1094
if test "x$enable_starpu_top" = "xmaybe" ; then
1095
can_build_starpu_top=no
1096
AC_PATH_PROGS([QMAKE], [qmake-qt4 qmake], [not-found])
1097
if test x$QMAKE != xnot-found; then
1098
QMAKE_VERSION=`$QMAKE --version 2>&1 | head -n 1 | cut -d '.' -f 1 | cut -d ' ' -f 3`
1099
if test $QMAKE_VERSION -ge 2 ; then
1100
PKG_CHECK_EXISTS([QtGui QtNetwork QtOpenGL QtSql], [
1101
QT_MAJVERSION=`$PKG_CONFIG --modversion QtGui | cut -d '.' -f 1`
1102
QT_MINVERSION=`$PKG_CONFIG --modversion QtGui | cut -d '.' -f 2`
1103
if test $QT_MAJVERSION -gt 4 -o \( $QT_MAJVERSION -eq 4 -a $QT_MINVERSION -ge 7 \) ; then
1104
can_build_starpu_top=yes
1107
AC_ARG_WITH(qwt-include-dir,
1108
[AS_HELP_STRING([--with-qwt-include-dir=<path>],
1109
[specify installed libqwt include path])],
1111
STARPU_QWT_INCLUDE="$withval"
1112
AC_SUBST(STARPU_QWT_INCLUDE)
1115
AC_ARG_WITH(qwt-lib-dir,
1116
[AS_HELP_STRING([--with-qwt-lib-dir=<path>],
1117
[specify installed libqwt library path])],
1119
STARPU_QWT_LDFLAGS="-L$withval"
1122
AC_ARG_WITH(qwt-lib,
1123
[AS_HELP_STRING([--with-qwt-lib=<name>],
1124
[specify installed libqwt library name])],
1126
STARPU_QWT_LDFLAGS="${STARPU_QWT_LDFLAGS} -l$withval"
1129
AC_SUBST(STARPU_QWT_LDFLAGS)
1136
if test "x$enable_starpu_top" = "xmaybe" ; then
1137
build_starpu_top=$can_build_starpu_top
1142
AM_CONDITIONAL(BUILD_STARPU_TOP, test x$build_starpu_top = xyes)
1144
###############################################################################
1146
# Flags for C Compiler #
1148
###############################################################################
1150
# IS_SUPPORTED_CFLAG(flag)
1151
# ------------------------
1152
# Check if the CFLAGS `flag' is supported by the compiler
1153
AC_DEFUN([IS_SUPPORTED_CFLAG],
1155
AC_REQUIRE([AC_PROG_CC])
1157
AC_MSG_CHECKING([whether compiler support $1])
1159
SAVED_CFLAGS="$CFLAGS"
1160
CFLAGS="$1" # -we10006"
1167
const char *hello = "Hello World";
1172
GLOBAL_AM_CFLAGS="$GLOBAL_AM_CFLAGS $1"
1177
CFLAGS="$SAVED_CFLAGS"
1180
IS_SUPPORTED_CFLAG(-W)
1181
IS_SUPPORTED_CFLAG(-Wall)
1182
IS_SUPPORTED_CFLAG(-Wextra)
1183
AC_SUBST(GLOBAL_AM_CFLAGS)
1185
if test "x$STARPU_DEVEL" != x; then
1186
AC_DEFINE(STARPU_DEVEL, [1], [enable developer warnings])
1189
# Same value as Automake's, for use in other places.
1190
pkglibdir="\${libdir}/$PACKAGE"
1191
AC_SUBST([pkglibdir])
1194
###############################################################################
1198
###############################################################################
1200
AC_ARG_ENABLE([gcc-extensions],
1201
[AS_HELP_STRING([--enable-gcc-extensions],
1202
[build the GCC plug-in that provides C language extensions (experimental)])],
1203
[enable_gcc_plugin="$enableval"],
1204
[enable_gcc_plugin="maybe"])
1206
if test "x$enable_gcc_plugin" = "xyes" -o "x$enable_gcc_plugin" = "xmaybe" ; then
1207
STARPU_GCC_PLUGIN_SUPPORT
1209
if test "x$ac_cv_have_gcc_plugins" = "xno" ; then
1210
if test "x$enable_gcc_plugin" = "xyes" ; then
1211
# Since this was explicitly asked for, error out.
1212
AC_MSG_ERROR([This compiler lacks GCC plug-in support.])
1214
AC_MSG_WARN([GCC plug-ins not supported; StarPU's GCC plug-in will not be built])
1217
# What GCC version are we using?
1220
# The `.so' itself cannot be called `starpu-gcc.so' (because
1221
# `-fplugin-arg-' option names and such must match the `.so'
1222
# name), so use a meaningful directory name.
1223
gccplugindir="\${pkglibdir}/${STARPU_EFFECTIVE_VERSION}/gcc/${STARPU_GCC_VERSION_MAJOR}.${STARPU_GCC_VERSION_MINOR}"
1224
AC_SUBST([gccplugindir])
1226
# Lines to be inserted in the `.pc' file.
1227
GCC_PLUGIN_DIR_PKGCONFIG="gccplugindir=$gccplugindir"
1228
GCC_PLUGIN_PKGCONFIG="gccplugin=\${gccplugindir}/starpu.so"
1229
AC_SUBST([GCC_PLUGIN_DIR_PKGCONFIG])
1230
AC_SUBST([GCC_PLUGIN_PKGCONFIG])
1235
if test "x$ac_cv_have_gcc_plugins" = "xyes" ; then
1236
build_gcc_plugin="yes"
1238
# GNU Guile 1.8/2.0 is used to run the test suite.
1239
AC_PATH_PROG([GUILE], [guile])
1240
if test "x$GUILE" != "x"; then
1241
if test "x$enable_cpu" = "xyes"; then
1242
run_gcc_plugin_test_suite="yes"
1244
AC_MSG_WARN([CPU back-end disabled; GCC plug-in test suite will not be run])
1245
run_gcc_plugin_test_suite="no"
1248
run_gcc_plugin_test_suite="no"
1251
build_gcc_plugin="no"
1252
run_gcc_plugin_test_suite="no"
1255
# Bison is used to generate the C expression parser. The generated
1256
# parser is part of the distribution, though.
1257
AM_MISSING_PROG([YACC], [bison])
1259
AM_CONDITIONAL([BUILD_GCC_PLUGIN], [test "x$build_gcc_plugin" = "xyes"])
1260
AM_CONDITIONAL([RUN_GCC_PLUGIN_TESTS],
1261
[test "x$run_gcc_plugin_test_suite" = "xyes"])
1263
###############################################################################
1267
###############################################################################
1269
AC_ARG_ENABLE([socl],
1270
[AS_HELP_STRING([--enable-socl],
1271
[build the OpenCL interface (experimental)])],
1272
[enable_socl="$enableval"],
1273
[enable_socl="maybe"])
1275
AC_MSG_CHECKING(for SOCL)
1277
if test "x$enable_socl" = "xyes" -o "x$enable_socl" = "xmaybe" ; then
1278
if test "$have_valid_opencl" = "no" ; then
1279
STARPU_LOOK_FOR_OPENCL()
1283
# in case SOCL was explicitely required, but is not available, this is an error
1284
if test "x$enable_socl" = "xyes" -a "$have_valid_opencl" = "no" ; then
1285
AC_MSG_ERROR([SOCL cannot be enabled without OpenCL])
1288
# now we enable SOCL if and only if a proper setup is available
1289
if test "x$enable_socl" = "xyes" -o "x$enable_socl" = "xmaybe" ; then
1290
build_socl=$have_valid_opencl
1295
AC_MSG_RESULT($build_socl)
1296
AM_CONDITIONAL([BUILD_SOCL], [test "x$build_socl" = "xyes"])
1297
AM_CONDITIONAL([STARPU_USE_SOCL], [test "x$build_socl" = "xyes"])
1299
###############################################################################
1303
###############################################################################
1305
AC_PATH_PROG([GDB], [gdb], [not-found])
1306
if test "x$GDB" != "xnot-found"; then
1307
AC_DEFINE_UNQUOTED([STARPU_GDB_PATH], ["$GDB"],
1308
[Path to the GNU debugger.])
1311
###############################################################################
1315
###############################################################################
1317
AC_ARG_ENABLE(opengl-render, [AS_HELP_STRING([--enable-opengl-render],
1318
[enable OpenGL rendering of some examples])],
1319
enable_opengl_render=$enableval, enable_opengl_render=no)
1321
if test x$enable_opengl_render = xyes; then
1322
STARPU_CHECK_LIB(OPENGL_RENDER, glut, glutInit,,AC_MSG_ERROR([cannot find glut]))
1323
STARPU_CHECK_LIB(OPENGL_RENDER, GL, glXCreateContext,,AC_MSG_ERROR([cannot find GL]))
1324
STARPU_CHECK_LIB(OPENGL_RENDER, GLU, gluLookAt,,AC_MSG_ERROR([cannot find GLU]))
1326
AC_DEFINE(STARPU_OPENGL_RENDER, [1], [enable OpenGL rendering of some examples])
1329
AC_MSG_CHECKING(whether OpenGL rendering is enabled)
1330
AC_SUBST(STARPU_OPENGL_RENDER, $enable_opengl_render)
1331
AC_MSG_RESULT($enable_opengl_render)
1334
if test "x$no_x" != "xyes"; then
1335
AC_DEFINE(STARPU_HAVE_X11, [1], [enable X11])
1337
AM_CONDITIONAL([HAVE_X11], [test "x$no_x" != "xyes"])
1339
# In case there are BLAS kernels that are used by the example applications
1340
# we may specify which library to use. Note that this is not used for StarPU
1344
AC_ARG_ENABLE(blas-lib,
1345
[ --enable-blas-lib[=blaslibname]:
1346
none [default]: no BLAS lib is used
1347
atlas: use ATLAS library
1348
goto: use GotoBLAS library],
1350
if test "x$enableval" = "xatlas" ; then
1352
elif test "x$enableval" = "xgoto" ; then
1354
elif test "x$enableval" = "xnone" ; then
1356
elif test x$enableval = xno; then
1361
echo "Unknown BLAS library"
1366
if test x$blas_lib = xmaybe -o x$blas_lib = xgoto; then
1367
AC_ARG_WITH(goto-dir, [AS_HELP_STRING([--with-goto-dir=<dir>], [specify GotoBLAS lib location])],
1371
AC_SUBST(GOTODIR, $gotodir)
1373
CPPFLAGS="${CPPFLAGS} -I$gotodir/ "
1374
LDFLAGS="${LDFLAGS} -L$gotodir/ "
1378
if test x$blas_lib = xgoto; then
1379
STARPU_CHECK_LIB(BLAS, gfortran, main,,)
1380
# Perhaps that GotoBLAS2 is available instead (so that we have libgotoblas2.{so,a})
1381
STARPU_CHECK_LIB(BLAS, goto2, sgemm_,, [havegoto2=no], [$STARPU_BLAS_LDFLAGS])
1382
if test x$havegoto2 = xno; then
1383
STARPU_CHECK_LIB(BLAS, goto, sgemm_,,AC_MSG_ERROR([cannot find goto lib]), [$STARPU_BLAS_LDFLAGS])
1385
AC_DEFINE(STARPU_GOTO, [1], [use STARPU_GOTO library])
1390
if test x$blas_lib = xmaybe -o x$blas_lib = xatlas; then
1391
AC_ARG_WITH(atlas-dir, [AS_HELP_STRING([--with-atlas-dir=<dir>], [specify ATLAS lib location])],
1393
AC_MSG_CHECKING(STARPU_ATLAS location)
1396
AC_MSG_RESULT($atlasdir)
1397
AC_SUBST(ATLASDIR, $atlasdir)
1399
CPPFLAGS="${CPPFLAGS} -I$atlasdir/include/ "
1400
LDFLAGS="${LDFLAGS} -L$atlasdir/lib/ "
1404
if test x$blas_lib = xatlas; then
1405
# test whether STARPU_ATLAS is actually available
1406
AC_CHECK_HEADER([cblas.h],,AC_MSG_ERROR([cannot find atlas headers]))
1407
STARPU_CHECK_LIB(BLAS, atlas, ATL_sgemm,,AC_MSG_ERROR([cannot find atlas lib]),)
1408
STARPU_CHECK_LIB(BLAS, cblas, cblas_sgemm,,AC_MSG_ERROR([cannot find atlas lib]),[-latlas])
1409
AC_DEFINE(STARPU_ATLAS, [1], [use STARPU_ATLAS library])
1414
if test x$blas_lib = xmaybe; then
1415
# Should we use MKL ?
1416
AC_ARG_WITH(mkl-cflags, [AS_HELP_STRING([--with-mkl-cflags], [specify MKL compilation flags])],
1418
CPPFLAGS="${CPPFLAGS} $withval"
1422
AC_ARG_WITH(mkl-ldflags, [AS_HELP_STRING([--with-mkl-ldflags], [specify MKL linking flags])],
1424
LDFLAGS="${LDFLAGS} $withval"
1427
if test x$blas_lib = xmkl; then
1428
AC_DEFINE(STARPU_MKL, [1], [use MKL library])
1432
if test x$blas_lib = xmaybe; then
1433
#perhaps it is possible to use some BLAS lib from the system
1435
STARPU_SEARCH_LIBS(BLAS,[sgemm_],[blas],use_system_blas=yes,,)
1436
if test x$use_system_blas = xyes; then
1437
AC_DEFINE(STARPU_SYSTEM_BLAS, [1], [use refblas library])
1444
AM_CONDITIONAL(ATLAS_BLAS_LIB, test x$blas_lib = xatlas)
1445
AM_CONDITIONAL(GOTO_BLAS_LIB, test x$blas_lib = xgoto)
1446
AM_CONDITIONAL(MKL_BLAS_LIB, test x$blas_lib = xmkl)
1447
AM_CONDITIONAL(SYSTEM_BLAS_LIB, test x$blas_lib = xsystem)
1448
AM_CONDITIONAL(NO_BLAS_LIB, test x$blas_lib = xnone)
1450
AC_MSG_CHECKING(which BLAS lib should be used)
1451
AC_MSG_RESULT($blas_lib)
1452
AC_SUBST(BLAS_LIB,$blas_lib)
1454
##########################################
1456
##########################################
1463
AC_ARG_ENABLE(starpufft, [AS_HELP_STRING([--disable-starpufft],
1464
[Disable build of StarPU-FFT])],
1465
enable_starpufft=$enableval,enable_starpufft=yes)
1467
PKG_CHECK_MODULES([FFTW], [fftw3], [
1468
AC_DEFINE([STARPU_HAVE_FFTW], [1], [Define to 1 if you have the libfftw3 library.])
1469
AC_SUBST([STARPU_HAVE_FFTW], [1])
1472
AM_CONDITIONAL(STARPU_HAVE_FFTW, [test x$have_fftw = xyes])
1474
PKG_CHECK_MODULES([FFTWF], [fftw3f], [
1475
AC_DEFINE([STARPU_HAVE_FFTWF], [1], [Define to 1 if you have the libfftw3f library.])
1476
AC_SUBST([STARPU_HAVE_FFTWF], [1])
1479
AM_CONDITIONAL(STARPU_HAVE_FFTWF, [test x$have_fftwf = xyes])
1481
PKG_CHECK_MODULES([FFTWL], [fftw3l], [
1482
AC_DEFINE([STARPU_HAVE_FFTWL], [1], [Define to 1 if you have the libfftw3l library.])
1483
AC_SUBST([HAVE_FFTWFL], [1])
1486
AM_CONDITIONAL(STARPU_HAVE_FFTWL, [test x$have_fftwl = xyes])
1488
if test x$enable_starpufft = xyes -a \( \( x$enable_cpu = xyes -a x$have_fftw = xyes -a x$have_fftwf = xyes \) -o x$have_cufftdoublecomplex = xyes \); then
1491
AM_CONDITIONAL(BUILD_STARPUFFT, [test x$fft_support = xyes])
1493
##########################################
1495
##########################################
1497
AC_ARG_WITH([hwloc],
1498
[AS_HELP_STRING([--without-hwloc],
1499
[Disable hwloc (enabled by default)])],
1500
[hwloc_dir="$withval"])
1501
SAVED_LDFLAGS="${LDFLAGS}"
1502
SAVED_CPPFLAGS="${CPPFLAGS}"
1503
AS_IF([test "x$with_hwloc" != "xno"], [
1504
PKG_CHECK_MODULES([HWLOC],[hwloc], [
1505
have_valid_hwloc=yes
1506
have_pkgconfig_hwloc=yes], [
1508
have_pkgconfig_hwloc=no])
1509
AS_IF([test "$have_valid_hwloc" = "no"], [
1510
if test "$hwloc_dir" != "" ; then CPPFLAGS="${SAVED_CPPFLAGS} -I$hwloc_dir/include" ; fi
1511
AC_CHECK_HEADER([hwloc.h],[have_valid_hwloc=yes],[have_valid_hwloc=no])
1512
if test "$hwloc_dir" != "" ; then LDFLAGS="${SAVED_LDFLAGS} -L$hwloc_dir/lib" ; fi
1513
AC_HAVE_LIBRARY([hwloc],[have_valid_hwloc=yes],[have_valid_hwloc=no])
1516
have_valid_hwloc="no")
1517
AS_IF([test "$have_valid_hwloc" = "yes"], [
1518
AC_DEFINE([STARPU_HAVE_HWLOC], [1], [Define to 1 if you have the hwloc library.])
1519
HWLOC_REQUIRES=hwloc
1520
AC_SUBST([STARPU_HAVE_HWLOC], [1])
1521
AS_IF([test "$have_pkgconfig_hwloc" = "no"], [
1522
HWLOC_CFLAGS="-I$hwloc_dir/include"
1523
HWLOC_LIBS="-L$hwloc_dir/lib -lhwloc"])
1525
LDFLAGS="${SAVED_LDFLAGS}"
1526
CPPFLAGS="${SAVED_CPPFLAGS}"
1528
if test "$have_valid_hwloc" = "no" -a "$hwloc_dir" != "no" ; then
1529
AC_MSG_ERROR([hwloc was not found on your system. If the target machine is hyperthreaded the performance may be impacted a lot. It is strongly recommended to install hwloc. However, if you really want to use StarPU without enabling hwloc, please restart configure by specifying the option '--without-hwloc'.])
1531
AC_MSG_CHECKING(whether hwloc should be used)
1532
AC_MSG_RESULT($have_valid_hwloc)
1533
AC_SUBST(HWLOC_REQUIRES)
1535
# is the header file f77.h available ?
1537
AC_CHECK_HEADER([f77.h],,[have_f77_h=no])
1538
AC_MSG_CHECKING(whether header file f77.h is available)
1539
AC_MSG_RESULT($have_f77_h)
1540
AC_SUBST(STARPU_HAVE_F77_H, $have_f77_h)
1541
AM_CONDITIONAL(STARPU_HAVE_F77_H, test x$have_f77_h = xyes)
1542
if test x$have_f77_h = xyes; then
1543
AC_DEFINE([STARPU_HAVE_F77_H], [1], [Define to 1 if you have the <f77.h> header file.])
1546
# Check if icc is available
1547
AC_CHECK_PROGS([ICC], [icc])
1549
# If cuda and icc are both available, check they are compatible
1550
if test "$enable_cuda" = "yes" -a "$ICC" != ""; then
1551
AC_MSG_CHECKING(whether CUDA and ICC are compatible)
1554
OLD_CFLAGS="$CFLAGS"
1555
CFLAGS="-I$PWD/include -I$srcdir/include"
1559
#include <starpu.h>]],
1567
CFLAGS="$OLD_CFLAGS"
1570
# Disable ICC on windows
1571
if test "x$ICC" != "x" -a "$starpu_windows" = "yes" ; then
1574
if test "x$ICC" != "x"; then
1575
AC_DEFINE(STARPU_HAVE_ICC, [], [Define this if icc is available])
1577
AM_CONDITIONAL([STARPU_HAVE_ICC], [test "x$ICC" != "x"])
1579
# Do not generate manpages for the tools if we do not have help2man
1580
AC_CHECK_PROGS([HELP2MAN], [help2man])
1581
# Disable on windows
1582
if test "$starpu_windows" = "yes" ; then
1585
AM_CONDITIONAL([STARPU_HAVE_HELP2MAN], [test "x$HELP2MAN" != "x"])
1587
AC_CHECK_MEMBER([struct cudaDeviceProp.pciDomainID],
1588
AC_DEFINE([STARPU_HAVE_DOMAINID],[1],[Define to 1 if CUDA device properties include DomainID]),
1589
, [[#include <cuda_runtime_api.h>]])
1591
AC_CHECK_MEMBER([struct cudaDeviceProp.pciBusID],
1592
AC_DEFINE([STARPU_HAVE_BUSID],[1],[Define to 1 if CUDA device properties include BusID]),
1593
, [[#include <cuda_runtime_api.h>]])
1595
# File configuration
1596
AC_CONFIG_COMMANDS([executable-scripts], [
1597
chmod +x tests/regression/regression.sh
1598
chmod +x gcc-plugin/tests/run-test
1599
chmod +x tools/starpu_workers_activity
1602
AC_CONFIG_FILES(tests/regression/regression.sh tests/regression/profiles tests/regression/profiles.build.only)
1603
AC_CONFIG_HEADER(src/common/config.h include/starpu_config.h gcc-plugin/src/starpu-gcc-config.h starpu-top/config.h)
1609
tools/starpu_workers_activity
1612
socl/examples/Makefile
1617
mpi/starpumpi-1.0.pc
1619
starpufft/libstarpufft.pc
1620
starpufft/starpufft-1.0.pc
1622
examples/stencil/Makefile
1626
starpu-top/StarPU-Top.pro
1627
starpu-top/StarPU-Top-qwt-embed.pri
1628
starpu-top/StarPU-Top-qwt-system.pri
1630
gcc-plugin/src/Makefile
1631
gcc-plugin/tests/Makefile
1632
gcc-plugin/tests/run-test
1633
gcc-plugin/examples/Makefile
1638
CPUs enabled: $enable_cpu
1639
CUDA enabled: $enable_cuda
1640
OpenCL enabled: $enable_opencl
1641
Cell enabled: $enable_gordon
1644
(change these with --enable-maxcpus, --enable-maxcudadev,
1645
--enable-maxopencldev, --enable-maxbuffers)
1647
Maximum number of CPUs: $maxcpus
1648
Maximum number of CUDA devices: $nmaxcudadev
1649
Maximum number of OpenCL devices: $nmaxopencldev
1650
Maximum number of memory nodes: $maxnodes
1651
Maximum number of task buffers: $nmaxbuffers
1653
GPU-GPU transfers: $have_cuda_memcpy_peer
1654
Allocation cache: $enable_allocation_cache
1656
Magma enabled: $have_magma
1657
BLAS library: $blas_lib
1658
hwloc: $have_valid_hwloc
1659
FxT trace enabled: $use_fxt
1660
StarPU-Top: $build_starpu_top
1663
MPI enabled: $use_mpi
1664
MPI test suite: $running_mpi_check
1665
FFT Support: $fft_support
1666
GCC plug-in: $build_gcc_plugin
1667
GCC plug-in test suite (requires GNU Guile): $run_gcc_plugin_test_suite
1668
SOCL enabled: $build_socl
1671
if test x"$have_valid_hwloc" = xno
1674
WARNING: hwloc was not enabled. If the target machine is hyperthreaded the
1675
performance may be impacted a lot. It is strongly recommended to install