91 |
ACX_PTHREAD() |
ACX_PTHREAD() |
92 |
|
|
93 |
dnl |
dnl |
94 |
|
dnl check for various library routines etc. |
95 |
|
dnl |
96 |
|
AC_CHECK_FUNCS(posix_memalign) |
97 |
|
if test x"$ac_cv_func_posix_memalign" != xyes ; then |
98 |
|
AC_CHECK_FUNCS(memalign) |
99 |
|
if test x"$ac_cv_func_posix_memalign" != xyes ; then |
100 |
|
AC_CHECK_FUNCS(valloc) |
101 |
|
fi |
102 |
|
fi |
103 |
|
|
104 |
|
AC_CHECK_FUNCS(mach_absolute_time) |
105 |
|
AC_CHECK_TYPES([struct timespec]) |
106 |
|
|
107 |
|
dnl |
108 |
|
dnl check for clock_gettime. On Linux, this requires librt. |
109 |
|
dnl |
110 |
|
save_LIBS=$LIBS |
111 |
|
LIBS="-lrt $LIBS" |
112 |
|
AC_MSG_CHECKING([for clock_gettime]) |
113 |
|
AC_LINK_IFELSE( |
114 |
|
[AC_LANG_PROGRAM( |
115 |
|
[[#include <time.h>]], |
116 |
|
[[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])], |
117 |
|
[ ac_cv_func_clock_gettime=yes; |
118 |
|
AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])], |
119 |
|
[ac_cv_func_clock_gettime=no]) |
120 |
|
AC_MSG_RESULT($ac_cv_func_clock_gettime) |
121 |
|
if test "$ac_cv_func_clock_gettime" = "no" ; then |
122 |
|
LIBS=$save_LIBS |
123 |
|
fi |
124 |
|
|
125 |
|
AC_CHECK_FUNCS(pthread_getcpuclockid) |
126 |
|
AC_CHECK_FUNCS(sigtimedwait nanosleep) |
127 |
|
|
128 |
|
dnl |
129 |
|
dnl check for sched_setaffinity |
130 |
|
dnl |
131 |
|
AC_CHECK_FUNCS(sched_setaffinity) |
132 |
|
|
133 |
|
dnl |
134 |
|
dnl check for pthread_setaffinity_np |
135 |
|
dnl |
136 |
|
save_LIBS=$LIBS |
137 |
|
save_CFLAGS=$CFLAGS |
138 |
|
LIBS="$PTHREAD_LIBS $LIBS" |
139 |
|
CFLAGS="$PTHREAD_CFLAGS $CFLAGS" |
140 |
|
AC_MSG_CHECKING([for pthread_setaffinity_np]) |
141 |
|
AC_LINK_IFELSE( |
142 |
|
[AC_LANG_PROGRAM( |
143 |
|
[[#include <pthread.h>]], |
144 |
|
[[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])], |
145 |
|
[ ac_cv_func_pthread_setaffinity_np=yes; |
146 |
|
AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])], |
147 |
|
[ac_cv_func_pthread_setaffinity_np=no]) |
148 |
|
AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np) |
149 |
|
LIBS=$save_LIBS |
150 |
|
CFLAGS=$save_CFLAGS |
151 |
|
|
152 |
|
dnl |
153 |
|
dnl check for Linux NUMA support (libnuma) |
154 |
|
dnl |
155 |
|
AC_CHECK_LIB(numa,numa_available) |
156 |
|
|
157 |
|
dnl check for /proc/cpuinfo |
158 |
|
dnl |
159 |
|
AC_CHECK_FILES(/proc/cpuinfo) |
160 |
|
|
161 |
|
dnl |
162 |
dnl OS-specific linking issues |
dnl OS-specific linking issues |
163 |
dnl |
dnl |
164 |
LD_NEEDS_RPATH=false; |
LD_NEEDS_RPATH=false; |
282 |
AC_SUBST(INSTALL_SMLNJ_WRAPPER) |
AC_SUBST(INSTALL_SMLNJ_WRAPPER) |
283 |
|
|
284 |
dnl |
dnl |
285 |
|
dnl ******************** C compiler properties ******************** |
286 |
|
dnl |
287 |
|
|
288 |
|
dnl |
289 |
|
dnl run the compiler tests in 64-bit mode |
290 |
|
dnl |
291 |
|
save_CFLAGS=$CFLAGS |
292 |
|
CFLAGS="$CFLAGS $CFLAG_M64" |
293 |
|
|
294 |
|
dnl |
295 |
|
dnl check for gcc builtin atomic operations |
296 |
|
dnl |
297 |
|
AC_MSG_CHECKING([for builtin atomic operations]) |
298 |
|
AC_LINK_IFELSE( |
299 |
|
[AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])], |
300 |
|
AC_MSG_RESULT(yes) |
301 |
|
AC_DEFINE( |
302 |
|
[HAVE_BUILTIN_ATOMIC_OPS], 1, |
303 |
|
[Define to 1 if gcc compiler provides atomic operations.]), |
304 |
|
AC_MSG_RESULT(no)) |
305 |
|
|
306 |
|
AC_C_BIGENDIAN |
307 |
|
|
308 |
|
dnl |
309 |
|
dnl restore CFLAGS |
310 |
|
dnl |
311 |
|
CFLAGS=$save_CFLAGS |
312 |
|
|
313 |
|
dnl |
314 |
|
dnl ******************** config.h stuff ******************** |
315 |
|
dnl |
316 |
|
AH_TOP([ |
317 |
|
/* |
318 |
|
* COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu) |
319 |
|
* All rights reserved. |
320 |
|
*/ |
321 |
|
|
322 |
|
#ifndef _DIDEROT_CONFIG_H_ |
323 |
|
#define _DIDEROT_CONFIG_H_ |
324 |
|
|
325 |
|
]) |
326 |
|
AH_BOTTOM([ |
327 |
|
|
328 |
|
#endif /* !_DIDEROT_CONFIG_H_ */ |
329 |
|
]) |
330 |
|
|
331 |
|
dnl |
332 |
dnl ******************** write output ******************** |
dnl ******************** write output ******************** |
333 |
dnl |
dnl |
334 |
|
|
351 |
src/compiler/common/paths.sml:src/compiler/common/paths_sml.in |
src/compiler/common/paths.sml:src/compiler/common/paths_sml.in |
352 |
) |
) |
353 |
|
|
354 |
|
AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in) |
355 |
|
|
356 |
dnl |
dnl |
357 |
dnl shell scripts |
dnl shell scripts |
358 |
dnl |
dnl |
379 |
|
|
380 |
MK_BUILD_DIR(rt-c-f, c-target, [float]) |
MK_BUILD_DIR(rt-c-f, c-target, [float]) |
381 |
MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug]) |
MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug]) |
382 |
|
MK_BUILD_DIR(rt-c-f-par, parallel-target, [parallel float]) |
383 |
|
|
384 |
AC_OUTPUT |
AC_OUTPUT |