1 |
dnl Process this file with autoconf to produce a configure script. |
dnl Process this file with autoconf to produce a configure script. |
2 |
dnl |
dnl |
3 |
dnl COPYRIGHT (c) 2010 The Diderot Project |
dnl This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu) |
4 |
|
dnl |
5 |
|
dnl COPYRIGHT (c) 2015 The University of Chicago |
6 |
dnl All rights reserved. |
dnl All rights reserved. |
7 |
dnl |
dnl |
8 |
|
|
|
dnl NOTE: MANTICORE_DIST_VERSION is an M4 variable defined in config/aclocal.m4 |
|
|
dnl |
|
9 |
AC_INIT(diderot,0.1,) |
AC_INIT(diderot,0.1,) |
10 |
|
|
11 |
AC_PREREQ(2.60) |
AC_PREREQ(2.60) |
12 |
AC_COPYRIGHT([[COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)]]) |
AC_COPYRIGHT([[COPYRIGHT (c) 2015 The University of Chicago]]) |
13 |
AC_CONFIG_SRCDIR(src/dnorm/dnorm.c) |
AC_CONFIG_SRCDIR(src/compiler/driver/main.sml) |
14 |
AC_CONFIG_AUX_DIR(config) |
AC_CONFIG_AUX_DIR(config) |
15 |
AC_CONFIG_MACRO_DIR(config) |
AC_CONFIG_MACRO_DIR(config) |
16 |
|
|
20 |
sinclude(config/acx_pthread.m4) |
sinclude(config/acx_pthread.m4) |
21 |
sinclude(config/check_smlnj.m4) |
sinclude(config/check_smlnj.m4) |
22 |
sinclude(config/check_smlnj_heap_suffix.m4) |
sinclude(config/check_smlnj_heap_suffix.m4) |
23 |
|
sinclude(config/ax_check_framework.m4) |
24 |
|
|
25 |
dnl |
dnl |
26 |
dnl get host information |
dnl get host information |
29 |
|
|
30 |
dnl check for standard programs |
dnl check for standard programs |
31 |
dnl |
dnl |
32 |
|
AC_PROG_CC([clang gcc cc]) |
33 |
AC_PROG_CPP |
AC_PROG_CPP |
34 |
AC_PROG_INSTALL |
AC_PROG_INSTALL |
35 |
AC_PROG_MAKE_SET |
AC_PROG_MAKE_SET |
36 |
|
|
37 |
|
dnl FIXME: this works for now, but we should probably switch to libtool |
38 |
|
dnl |
39 |
|
AC_PATH_PROG(LD, [ld], [none]) |
40 |
|
if test x$LD = xnone ; then |
41 |
|
AC_MSG_ERROR([cannot find ld command]) |
42 |
|
fi |
43 |
|
AC_SUBST(LD) |
44 |
|
|
45 |
dnl check for c99 support |
dnl check for c99 support |
46 |
dnl |
dnl |
47 |
AC_PROG_CC_C99 |
AC_PROG_CC_C99 |
49 |
AC_MSG_ERROR([Diderot requires c99 support]) |
AC_MSG_ERROR([Diderot requires c99 support]) |
50 |
fi |
fi |
51 |
|
|
52 |
|
AC_ARG_ENABLE([32-bit], |
53 |
|
AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]), |
54 |
|
[CFLAG_MXX="-m32"], |
55 |
|
[CFLAG_MXX="-m64"]) |
56 |
|
|
57 |
dnl extra C compiler options |
dnl extra C compiler options |
58 |
dnl |
dnl |
59 |
CFLAG_M64="-m64" |
CFLAGS="" |
60 |
CFLAGS="$CFLAGS -Wformat -Wreturn-type -Wuninitialized" |
CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized" |
61 |
AC_SUBST(CFLAG_M64) |
AC_SUBST(CFLAG_MXX) |
62 |
|
AC_SUBST(CFLAGS_BASE) |
63 |
|
|
64 |
|
dnl |
65 |
|
dnl standard headers |
66 |
|
dnl |
67 |
|
AC_HEADER_STDBOOL |
68 |
|
|
69 |
|
dnl |
70 |
|
dnl check for pthreads support |
71 |
|
dnl |
72 |
|
ACX_PTHREAD |
73 |
|
|
74 |
dnl |
dnl |
75 |
dnl Look for NVIDIA's nvcc compiler |
dnl Look for NVIDIA's nvcc compiler |
76 |
dnl |
dnl |
77 |
AC_MSG_CHECKING([for CUDA and nvcc]) |
AC_MSG_NOTICE([checking for CUDA and nvcc]) |
78 |
AC_PATH_PROG(NVCC, nvcc, ":", $PATH) |
AC_PATH_PROG(NVCC, nvcc, no, $PATH) |
79 |
if test $NVCC = none ; then |
if test x"$NVCC" = xno ; then |
80 |
AC_MSG_WARN([nvcc not found]) |
AC_MSG_WARN([nvcc not found]) |
81 |
|
CUDA_ENABLED=false |
82 |
|
NVCC=":" |
83 |
else |
else |
84 |
AC_MSG_RESULT([$NVCC]) |
AC_MSG_RESULT([$NVCC]) |
85 |
|
CUDA_ENABLED=true |
86 |
fi |
fi |
87 |
AC_SUBST(NVCC) |
AC_SUBST(NVCC) |
88 |
|
AC_SUBST(CUDA_ENABLED) |
89 |
|
|
90 |
dnl |
dnl |
91 |
dnl check for pthreads support |
dnl check for OpenCL support |
92 |
dnl |
dnl |
93 |
ACX_PTHREAD() |
LIBS_CL="none" |
94 |
|
case "$host_os" in |
95 |
|
darwin*) # On Mac OS X we check for installed frameworks |
96 |
|
AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], []) |
97 |
|
;; |
98 |
|
*) |
99 |
|
AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"]) |
100 |
|
;; |
101 |
|
esac |
102 |
|
if test x"$LIBS_CL" = xnone ; then |
103 |
|
AC_MSG_WARN([no OpenCL library found]) |
104 |
|
CL_ENABLED=false |
105 |
|
CL_VERSION=0 |
106 |
|
else |
107 |
|
CL_ENABLED=true |
108 |
|
CPPFLAGS_CL="" |
109 |
|
CL_HEADER="" |
110 |
|
AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"]) |
111 |
|
if test x"$HAVE_CL_H" = xno ; then |
112 |
|
# check for AMD's SDK |
113 |
|
AC_MSG_CHECKING([for cl.h in AMD's SDK]) |
114 |
|
if test -d /opt/AMDAPP/include/CL ; then |
115 |
|
HAVE_CL_H="yes" |
116 |
|
CL_HEADER="/opt/AMDAPP/include/CL/cl.h" |
117 |
|
AC_DEFINE([HAVE_CL_CL_H]) |
118 |
|
CPPFLAGS_CL="-I/opt/AMDAPP/include" |
119 |
|
fi |
120 |
|
AC_MSG_RESULT([$HAVE_CL_H]) |
121 |
|
fi |
122 |
|
if test x"$HAVE_CL_H" = xno ; then |
123 |
|
# check for NVIDIA's SDK |
124 |
|
AC_MSG_CHECKING([for NVIDIA's SDK cl.h]) |
125 |
|
CUDA_HOME=none |
126 |
|
for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do |
127 |
|
if test -d /usr/local/$CUDA/include/CL ; then |
128 |
|
CUDA_HOME=/usr/local/$CUDA |
129 |
|
break |
130 |
|
fi |
131 |
|
done |
132 |
|
if test x"$CUDA" != xnone ; then |
133 |
|
HAVE_CL_H="yes" |
134 |
|
CL_HEADER="$CUDA_HOME/include/CL/cl.h" |
135 |
|
AC_DEFINE([HAVE_CL_CL_H]) |
136 |
|
CPPFLAGS_CL="-I$CUDA_HOME/include" |
137 |
|
fi |
138 |
|
AC_MSG_RESULT([$HAVE_CL_H]) |
139 |
|
fi |
140 |
|
if test x"$HAVE_CL_H" = xno ; then |
141 |
|
AC_MSG_WARN([no cl.h found]) |
142 |
|
CL_ENABLED=false |
143 |
|
CL_VERSION=0 |
144 |
|
SIZEOF_CL_INT=0 |
145 |
|
SIZEOF_CL_LONG=0 |
146 |
|
SIZEOF_CL_FLOAT=0 |
147 |
|
SIZEOF_CL_DOUBLE=0 |
148 |
|
else |
149 |
|
# check the cl.h header for which version of OpenCL is supported |
150 |
|
AC_LANG([C]) |
151 |
|
save_CPPFLAGS=$CPPFLAGS |
152 |
|
CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS" |
153 |
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
154 |
|
#include <stdio.h> |
155 |
|
# ifdef HAVE_CL_CL_H |
156 |
|
# include <CL/cl.h> |
157 |
|
# elif defined(HAVE_OPENCL_CL_H) |
158 |
|
# include <OpenCL/cl.h> |
159 |
|
# else |
160 |
|
# error no cl.h |
161 |
|
# endif]], |
162 |
|
[[#if defined(CL_VERSION_1_2) |
163 |
|
printf("120\n"); |
164 |
|
#elif defined(CL_VERSION_1_1) |
165 |
|
printf("110\n"); |
166 |
|
#elif defined(CL_VERSION_1_0) |
167 |
|
printf("100\n"); |
168 |
|
#else |
169 |
|
printf("0\n"); |
170 |
|
#endif |
171 |
|
]])], |
172 |
|
[CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0]) |
173 |
|
dnl |
174 |
|
dnl check to see how we access the host-side vector types. For OpenCL 1.1, |
175 |
|
dnl the specification specifies the behavior, but it was unspecified in 1.0. |
176 |
|
dnl |
177 |
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
178 |
|
#include "$CL_HEADER" |
179 |
|
]], |
180 |
|
[[cl_float4 x; x[0] = 0.0;]])], |
181 |
|
[AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])], |
182 |
|
dnl |
183 |
|
dnl not arrays, so try the OpenCL 1.1 structure representation |
184 |
|
dnl |
185 |
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
186 |
|
#include "$CL_HEADER" |
187 |
|
]], |
188 |
|
[[cl_float4 x; x.s[0] = 0.0;]])], |
189 |
|
[AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])], |
190 |
|
[AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])]) |
191 |
|
# restore saved CPPFLAGS |
192 |
|
CPPFLAGS=$save_CPPFLAGS |
193 |
|
# substitutions |
194 |
|
AC_SUBST(LIBS_CL) |
195 |
|
AC_SUBST(CPPFLAGS_CL) |
196 |
|
# |
197 |
|
# determine the sizes of the host-side OpenCL types |
198 |
|
AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"]) |
199 |
|
SIZEOF_CL_INT=$ac_cv_sizeof_cl_int |
200 |
|
AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"]) |
201 |
|
SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long |
202 |
|
AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"]) |
203 |
|
SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float |
204 |
|
AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"]) |
205 |
|
SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double |
206 |
|
fi |
207 |
|
fi |
208 |
|
AC_SUBST(CL_ENABLED) |
209 |
|
AC_SUBST(CL_VERSION) |
210 |
|
AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system]) |
211 |
|
|
212 |
|
AC_SUBST(SIZEOF_CL_INT) |
213 |
|
AC_SUBST(SIZEOF_CL_LONG) |
214 |
|
AC_SUBST(SIZEOF_CL_FLOAT) |
215 |
|
AC_SUBST(SIZEOF_CL_DOUBLE) |
216 |
|
|
217 |
|
dnl |
218 |
|
dnl check for various library routines etc. |
219 |
|
dnl |
220 |
|
AC_CHECK_FUNCS(posix_memalign) |
221 |
|
if test x"$ac_cv_func_posix_memalign" != xyes ; then |
222 |
|
AC_CHECK_FUNCS(memalign) |
223 |
|
if test x"$ac_cv_func_posix_memalign" != xyes ; then |
224 |
|
AC_CHECK_FUNCS(valloc) |
225 |
|
fi |
226 |
|
fi |
227 |
|
|
228 |
|
AC_CHECK_FUNCS(mach_absolute_time) |
229 |
|
AC_CHECK_TYPES([struct timespec]) |
230 |
|
AC_CHECK_FUNCS(pthread_barrier_init) |
231 |
|
|
232 |
|
dnl |
233 |
|
dnl check for clock_gettime. On Linux, this requires librt. |
234 |
|
dnl |
235 |
|
save_LIBS=$LIBS |
236 |
|
LIBS="-lrt $LIBS" |
237 |
|
AC_MSG_CHECKING([for clock_gettime]) |
238 |
|
AC_LINK_IFELSE( |
239 |
|
[AC_LANG_PROGRAM( |
240 |
|
[[#include <time.h>]], |
241 |
|
[[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])], |
242 |
|
[ ac_cv_func_clock_gettime=yes; |
243 |
|
AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])], |
244 |
|
[ac_cv_func_clock_gettime=no]) |
245 |
|
AC_MSG_RESULT($ac_cv_func_clock_gettime) |
246 |
|
if test "$ac_cv_func_clock_gettime" = "no" ; then |
247 |
|
LIBS=$save_LIBS |
248 |
|
fi |
249 |
|
|
250 |
|
AC_CHECK_FUNCS(pthread_getcpuclockid) |
251 |
|
AC_CHECK_FUNCS(sigtimedwait nanosleep) |
252 |
|
|
253 |
|
dnl |
254 |
|
dnl check for sched_setaffinity |
255 |
|
dnl |
256 |
|
AC_CHECK_FUNCS(sched_setaffinity) |
257 |
|
|
258 |
|
dnl |
259 |
|
dnl check for pthread_setaffinity_np |
260 |
|
dnl |
261 |
|
save_LIBS=$LIBS |
262 |
|
save_CFLAGS=$CFLAGS |
263 |
|
LIBS="$PTHREAD_LIBS $LIBS" |
264 |
|
CFLAGS="$PTHREAD_CFLAGS $CFLAGS" |
265 |
|
AC_MSG_CHECKING([for pthread_setaffinity_np]) |
266 |
|
AC_LINK_IFELSE( |
267 |
|
[AC_LANG_PROGRAM( |
268 |
|
[[#include <pthread.h>]], |
269 |
|
[[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])], |
270 |
|
[ ac_cv_func_pthread_setaffinity_np=yes; |
271 |
|
AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])], |
272 |
|
[ac_cv_func_pthread_setaffinity_np=no]) |
273 |
|
AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np) |
274 |
|
LIBS=$save_LIBS |
275 |
|
CFLAGS=$save_CFLAGS |
276 |
|
|
277 |
|
dnl |
278 |
|
dnl check for Linux NUMA support (libnuma) |
279 |
|
dnl |
280 |
|
AC_CHECK_LIB(numa,numa_available) |
281 |
|
if test "$ac_cv_lib_numa_numa_available" = "yes" ; then |
282 |
|
PTHREAD_LIBS="$PTHREAD_LIBS -lnuma" |
283 |
|
fi |
284 |
|
|
285 |
|
dnl check for /proc/cpuinfo |
286 |
|
dnl |
287 |
|
AC_CHECK_FILES(/proc/cpuinfo) |
288 |
|
|
289 |
dnl |
dnl |
290 |
dnl OS-specific linking issues |
dnl OS-specific linking issues |
322 |
AC_SUBST(LIBM) |
AC_SUBST(LIBM) |
323 |
|
|
324 |
dnl |
dnl |
325 |
dnl get the path to the TEEM installation |
dnl get the path to the TEEM installation. We need this to build the Diderot |
326 |
|
dnl runtime code and we use the path when searching for teem in the Diderot |
327 |
|
dnl compiler. |
328 |
dnl |
dnl |
329 |
AC_ARG_WITH(teem, |
AC_ARG_WITH(teem, |
330 |
AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]), |
AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]), |
339 |
esac |
esac |
340 |
if test -x $ac_cv_use_teem ; then |
if test -x $ac_cv_use_teem ; then |
341 |
TEEM_DIR=$ac_cv_use_teem |
TEEM_DIR=$ac_cv_use_teem |
342 |
AC_MSG_RESULT([ okay]) |
# check that TEEM_DIR actually points to something that looks like teem |
343 |
|
if test -f $TEEM_DIR/include/teem/nrrd.h ; then |
344 |
|
AC_MSG_RESULT([yes]) |
345 |
|
else |
346 |
|
TEEM_DIR=none |
347 |
|
AC_MSG_RESULT([no]) |
348 |
|
fi |
349 |
else |
else |
350 |
TEEM_DIR=none |
TEEM_DIR=none |
351 |
AC_MSG_RESULT([ invalid]) |
AC_MSG_RESULT([no]) |
352 |
fi |
fi |
353 |
fi |
fi |
354 |
if test x"$TEEM_DIR" = xnone ; then |
if test x"$TEEM_DIR" = xnone ; then |
355 |
AC_MSG_ERROR([unable to find teem]) |
AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location]) |
356 |
|
fi |
357 |
|
dnl |
358 |
|
dnl check that unu supports the dnorm command |
359 |
|
dnl |
360 |
|
if test x"$TEEM_DIR" != xnone ; then |
361 |
|
AC_MSG_CHECKING([that \"unu dnorm\" works]) |
362 |
|
if test -x $TEEM_DIR/bin/unu ; then |
363 |
|
$TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null |
364 |
|
if test $? -eq 0 ; then |
365 |
|
AC_MSG_RESULT([yes]) |
366 |
|
else |
367 |
|
AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation]) |
368 |
|
fi |
369 |
|
else |
370 |
|
AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"]) |
371 |
|
fi |
372 |
fi |
fi |
373 |
AC_SUBST(TEEM_DIR) |
AC_SUBST(TEEM_DIR) |
374 |
|
|
379 |
dnl |
dnl |
380 |
CHECK_SMLNJ([AC_MSG_ERROR([unable to find SML/NJ installation; check your PATH or set SMLNJ_CMD])]) |
CHECK_SMLNJ([AC_MSG_ERROR([unable to find SML/NJ installation; check your PATH or set SMLNJ_CMD])]) |
381 |
if test $SMLNJ_MAJOR_VERSION -lt 110 \ |
if test $SMLNJ_MAJOR_VERSION -lt 110 \ |
382 |
-o $SMLNJ_MINOR_VERSION -lt 72 |
-o $SMLNJ_MINOR_VERSION -lt 77 |
383 |
then |
then |
384 |
AC_MSG_ERROR([installation requires SML/NJ version 110.72+]) |
AC_MSG_ERROR([installation requires SML/NJ version 110.77+ (available from smlnj.org)]) |
385 |
fi |
fi |
386 |
AC_SUBST(SMLNJ_VERSION) |
AC_SUBST(SMLNJ_VERSION) |
387 |
|
|
412 |
fi |
fi |
413 |
AC_SUBST(ML_BUILD) |
AC_SUBST(ML_BUILD) |
414 |
|
|
415 |
|
dnl ******************** Documentation tools ******************** |
416 |
|
|
417 |
|
dnl check for doxygen |
418 |
|
dnl |
419 |
|
AC_ARG_WITH([doxygen], |
420 |
|
[AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])], |
421 |
|
[DOXYGEN=$with_doxygen], |
422 |
|
[DOXYGEN=none]) |
423 |
|
if test x$DOXYGEN = xnone ; then |
424 |
|
# see if we can find doxygen in the user's path |
425 |
|
AC_PATH_PROG(DOXYGEN, [doxygen], [none]) |
426 |
|
fi |
427 |
|
if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then |
428 |
|
AC_MSG_ERROR([--with-doxygen option must specify directory argument]) |
429 |
|
elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then |
430 |
|
AC_MSG_ERROR([doxygen not found at $DOXYGEN]) |
431 |
|
elif test x$DOXYGEN != xnone ; then |
432 |
|
dnl |
433 |
|
dnl verify that $DOXYGEN is an absolute path |
434 |
|
dnl |
435 |
|
case $DOXYGEN in |
436 |
|
/*) ;; |
437 |
|
*) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;; |
438 |
|
esac |
439 |
|
fi |
440 |
|
if test $DOXYGEN = xnone ; then |
441 |
|
DOXYGEN=: |
442 |
|
fi |
443 |
|
AC_SUBST(DOXYGEN) |
444 |
|
|
445 |
|
dnl check for asciidoc and related tools |
446 |
|
dnl |
447 |
|
AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none]) |
448 |
|
AC_PATH_PROGS([A2X], [a2x], [none]) |
449 |
|
AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none]) |
450 |
|
AC_PATH_PROGS([DBLATEX], [dblatex], [none]) |
451 |
|
|
452 |
|
dnl |
453 |
|
dnl get the path to the asciidoc cofiguration files |
454 |
|
dnl |
455 |
|
if test x"$ASCIIDOC" != xnone ; then |
456 |
|
AC_MSG_CHECKING([path to asciidoc configuration files]) |
457 |
|
ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'` |
458 |
|
AC_MSG_RESULT([$ASCIIDOC_CONF_DIR]) |
459 |
|
fi |
460 |
|
AC_SUBST(ASCIIDOC) |
461 |
|
AC_SUBST(A2X) |
462 |
|
AC_SUBST(ASCIIDOC_CONF_DIR) |
463 |
|
AC_SUBST(HIGHLIGHTER) |
464 |
|
AC_SUBST(DBLATEX) |
465 |
|
|
466 |
|
|
467 |
dnl ******************** Paths ******************** |
dnl ******************** Paths ******************** |
468 |
|
|
469 |
DIDEROT_ROOT=`pwd` |
DIDEROT_ROOT=`pwd` |
486 |
AC_SUBST(INSTALL_SMLNJ_WRAPPER) |
AC_SUBST(INSTALL_SMLNJ_WRAPPER) |
487 |
|
|
488 |
dnl |
dnl |
489 |
|
dnl ******************** C compiler properties ******************** |
490 |
|
dnl |
491 |
|
|
492 |
|
dnl |
493 |
|
dnl run the compiler tests in 64-bit mode |
494 |
|
dnl |
495 |
|
save_CFLAGS=$CFLAGS |
496 |
|
CFLAGS="$CFLAGS $CFLAG_MXX" |
497 |
|
|
498 |
|
dnl |
499 |
|
dnl check for gcc builtin atomic operations |
500 |
|
dnl |
501 |
|
AC_MSG_CHECKING([for builtin atomic operations]) |
502 |
|
AC_LINK_IFELSE( |
503 |
|
[AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])], |
504 |
|
AC_MSG_RESULT(yes) |
505 |
|
AC_DEFINE( |
506 |
|
[HAVE_BUILTIN_ATOMIC_OPS], 1, |
507 |
|
[Define to 1 if gcc compiler provides atomic operations.]), |
508 |
|
AC_MSG_RESULT(no)) |
509 |
|
|
510 |
|
AC_C_BIGENDIAN |
511 |
|
|
512 |
|
# |
513 |
|
# determine the sizes of the standard C types |
514 |
|
AC_CHECK_SIZEOF([int]) |
515 |
|
SIZEOF_C_INT=$ac_cv_sizeof_int |
516 |
|
AC_CHECK_SIZEOF([long]) |
517 |
|
SIZEOF_C_LONG=$ac_cv_sizeof_long |
518 |
|
AC_CHECK_SIZEOF([float]) |
519 |
|
SIZEOF_C_FLOAT=$ac_cv_sizeof_float |
520 |
|
AC_CHECK_SIZEOF([double]) |
521 |
|
SIZEOF_C_DOUBLE=$ac_cv_sizeof_double |
522 |
|
|
523 |
|
AC_SUBST(SIZEOF_C_INT) |
524 |
|
AC_SUBST(SIZEOF_C_LONG) |
525 |
|
AC_SUBST(SIZEOF_C_FLOAT) |
526 |
|
AC_SUBST(SIZEOF_C_DOUBLE) |
527 |
|
|
528 |
|
dnl |
529 |
|
dnl restore CFLAGS |
530 |
|
dnl |
531 |
|
CFLAGS=$save_CFLAGS |
532 |
|
|
533 |
|
dnl |
534 |
|
dnl ******************** config.h stuff ******************** |
535 |
|
dnl |
536 |
|
|
537 |
|
AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files]) |
538 |
|
|
539 |
|
AH_TOP([ |
540 |
|
/* |
541 |
|
* COPYRIGHT (c) 2014 Diderot project. (http://diderot-language.cs.uchicago.edu) |
542 |
|
* All rights reserved. |
543 |
|
*/ |
544 |
|
|
545 |
|
#ifndef _DIDEROT_CONFIG_H_ |
546 |
|
#define _DIDEROT_CONFIG_H_ |
547 |
|
|
548 |
|
]) |
549 |
|
AH_BOTTOM([ |
550 |
|
|
551 |
|
#ifdef NDEBUG |
552 |
|
#define STATIC_INLINE static inline |
553 |
|
#else |
554 |
|
#define STATIC_INLINE static |
555 |
|
#endif |
556 |
|
|
557 |
|
#endif /* !_DIDEROT_CONFIG_H_ */ |
558 |
|
]) |
559 |
|
|
560 |
|
dnl |
561 |
dnl ******************** write output ******************** |
dnl ******************** write output ******************** |
562 |
dnl |
dnl |
563 |
|
|
565 |
dnl |
dnl |
566 |
dnl ***** Makefiles ***** |
dnl ***** Makefiles ***** |
567 |
Makefile |
Makefile |
568 |
src/dnorm/Makefile |
doc/Makefile |
569 |
|
doc/man/Makefile |
570 |
|
src/clinfo/Makefile |
571 |
src/compiler/Makefile |
src/compiler/Makefile |
|
src/lib/Makefile |
|
572 |
src/lib/build/Makefile |
src/lib/build/Makefile |
573 |
src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in |
src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in |
|
test/Makefile |
|
574 |
test/MIP/Makefile |
test/MIP/Makefile |
575 |
test/probe/Makefile |
test/probe/Makefile |
576 |
|
test/iso2d-polyline/Makefile |
577 |
|
test/vr-lite-cam/Makefile |
578 |
|
test/hlic/Makefile |
579 |
dnl |
dnl |
580 |
dnl ***** SML source files ***** |
dnl ***** SML source files ***** |
581 |
src/compiler/fields/run-dnorm.sml:src/compiler/fields/run-dnorm_sml.in |
src/compiler/nrrd/run-dnorm.sml:src/compiler/nrrd/run-dnorm_sml.in |
582 |
src/compiler/common/paths.sml:src/compiler/common/paths_sml.in |
src/compiler/common/paths.sml:src/compiler/common/paths_sml.in |
583 |
|
src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in |
584 |
) |
) |
585 |
|
|
586 |
|
AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in) |
587 |
|
|
588 |
dnl |
dnl |
589 |
dnl shell scripts |
dnl shell scripts |
590 |
dnl |
dnl |
591 |
AC_CONFIG_FILES([ |
AC_CONFIG_FILES([ |
592 |
bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in |
bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in |
593 |
], [chmod +x bin/install-sml-wrapper.sh]) |
], [chmod +x bin/install-sml-wrapper.sh]) |
594 |
|
AC_CONFIG_FILES([ |
595 |
|
src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in |
596 |
|
], [chmod +x src/compiler/gen/file2str/file2str.sh]) |
597 |
|
AC_CONFIG_FILES([ |
598 |
|
rtest/scripts/run.sh:rtest/scripts/run_sh.in |
599 |
|
], [chmod +x rtest/scripts/run.sh]) |
600 |
|
AC_CONFIG_FILES([ |
601 |
|
rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in |
602 |
|
], [chmod +x rtest/scripts/run-one.sh]) |
603 |
|
# |
604 |
|
# more regression tests; should merge with rtest at some point |
605 |
|
# |
606 |
|
AC_CONFIG_FILES([ |
607 |
|
rtest2/scripts/run.sh:rtest2/scripts/run_sh.in |
608 |
|
], [chmod +x rtest2/scripts/run.sh]) |
609 |
|
AC_CONFIG_FILES([ |
610 |
|
rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in |
611 |
|
], [chmod +x rtest2/scripts/run-one.sh]) |
612 |
|
|
613 |
dnl |
dnl |
614 |
dnl generate makefiles for runtime library builds |
dnl generate makefiles for runtime library builds |
627 |
AC_CONFIG_FILES(src/lib/build/$1/Makefile) |
AC_CONFIG_FILES(src/lib/build/$1/Makefile) |
628 |
]) |
]) |
629 |
|
|
630 |
MK_BUILD_DIR(rt-c-f, c-target, [float]) |
MK_BUILD_DIR(rt-c-f, c, [float]) |
631 |
MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug]) |
MK_BUILD_DIR(rt-c-d, c, [double]) |
632 |
|
MK_BUILD_DIR(rt-c-f-debug, c, [float debug]) |
633 |
|
MK_BUILD_DIR(rt-c-d-debug, c, [double debug]) |
634 |
|
MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float]) |
635 |
|
MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double]) |
636 |
|
MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug]) |
637 |
|
MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug]) |
638 |
|
|
639 |
|
if test x"$CL_ENABLED" = xtrue ; then |
640 |
|
MK_BUILD_DIR(rt-cl-f, cl, [float]) |
641 |
|
MK_BUILD_DIR(rt-cl-d, cl, [double]) |
642 |
|
MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug]) |
643 |
|
MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug]) |
644 |
|
fi |
645 |
|
|
646 |
AC_OUTPUT |
AC_OUTPUT |