Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/configure.ac
ViewVC logotype

Diff of /branches/vis15/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

branches/vis12/configure.ac revision 2441, Wed Sep 25 17:00:08 2013 UTC branches/vis15/configure.ac revision 4868, Sat Dec 31 21:08:28 2016 UTC
# Line 1  Line 1 
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) 2012 The Diderot Project  dnl This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4    dnl
5    dnl COPYRIGHT (c) 2016 The University of Chicago
6  dnl All rights reserved.  dnl All rights reserved.
7  dnl  dnl
8    
9  AC_INIT(diderot,0.1,)  AC_INIT(diderot,2.0,)
10    
11  AC_PREREQ(2.60)  AC_PREREQ(2.60)
12  AC_COPYRIGHT([[COPYRIGHT (c) 2013 The Diderot Project (http://diderot-language.cs.uchicago.edu)]])  AC_COPYRIGHT([[COPYRIGHT (c) 2016 The University of Chicago]])
13  AC_CONFIG_SRCDIR(src/compiler/driver/main.sml)  AC_CONFIG_SRCDIR(src/compiler/options/ctl.sml)
14  AC_CONFIG_AUX_DIR(config)  AC_CONFIG_AUX_DIR(config)
15  AC_CONFIG_MACRO_DIR(config)  AC_CONFIG_MACRO_DIR(config)
16    
17  dnl  dnl
18    dnl set the following to the name of the branch
19    dnl
20    BRANCH="vis15"
21    AC_SUBST(BRANCH)
22    
23    dnl
24  dnl include additional macros  dnl include additional macros
25  dnl  dnl
26    sinclude(config/ax_check_compile_flag.m4)
27    sinclude(config/ax_gcc_x86_cpuid.m4)
28    sinclude(config/ax_gcc_x86_avx_xgetbv.m4)
29    sinclude(config/ax_ext.m4)
30  sinclude(config/acx_pthread.m4)  sinclude(config/acx_pthread.m4)
31  sinclude(config/check_smlnj.m4)  sinclude(config/check_smlnj.m4)
32  sinclude(config/check_smlnj_heap_suffix.m4)  sinclude(config/check_smlnj_heap_suffix.m4)
33  sinclude(config/ax_check_framework.m4)  sinclude(config/ax_check_framework.m4)
34    sinclude(config/ax_cxx_compile_stdcxx.m4)
35    
36  dnl  dnl
37  dnl get host information  dnl get host information
38  dnl  dnl
39  AC_CANONICAL_HOST  AC_CANONICAL_HOST
40    
41    #################### Paths configuration ####################
42    
43    DIDEROT_ROOT=`pwd`
44    DIDEROT_DOCDIR=$DIDEROT_ROOT/doc
45    DIDEROT_SRCDIR=$DIDEROT_ROOT/src
46    DIDEROT_LIBDIR=$DIDEROT_ROOT/lib
47    DIDEROT_BINDIR=$DIDEROT_ROOT/bin
48    DIDEROT_MKDIR=$DIDEROT_ROOT/mk
49    
50    AC_SUBST(DIDEROT_ROOT)
51    AC_SUBST(DIDEROT_DOCDIR)
52    AC_SUBST(DIDEROT_SRCDIR)
53    AC_SUBST(DIDEROT_LIBDIR)
54    AC_SUBST(DIDEROT_BINDIR)
55    AC_SUBST(DIDEROT_MKDIR)
56    
57    #################### end Paths configuration ####################
58    
59  dnl check for standard programs  dnl check for standard programs
60  dnl  dnl
 AC_PROG_CC([clang gcc cc])  
61  AC_PROG_CPP  AC_PROG_CPP
62    AC_PROG_CC([clang gcc cc])
63    AC_PROG_CXX([clang++ g++ c++])
64    AX_CXX_COMPILE_STDCXX(11,[],[mandatory])
65  AC_PROG_INSTALL  AC_PROG_INSTALL
66  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
67    
# Line 40  Line 73 
73  fi  fi
74  AC_SUBST(LD)  AC_SUBST(LD)
75    
76  dnl check for c99 support  dnl extra compiler options
77  dnl  dnl
78  AC_PROG_CC_C99  CXXFLAGS_BASE="-Wreturn-type -Wuninitialized"
79  if test x"$ac_cv_prog_cc_c99" = xno ; then  
80    AC_MSG_ERROR([Diderot requires c99 support])  dnl check for SIMD support
81  fi  dnl
82    AX_EXT
83    
84  AC_ARG_ENABLE([32-bit],  AC_ARG_ENABLE([32-bit],
85    AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),    AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),
86    [CFLAG_MXX="-m32"],    [CXXFLAG_Mxx="-m32"],
87    [CFLAG_MXX="-m64"])    [CXXFLAG_Mxx="-m64"])
88    
89    CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
90    AC_SUBST(CXXFLAG_Mxx)
91    AC_SUBST(CXXFLAGS_BASE)
92    
93    dnl
94    dnl run the compiler tests in 64-bit mode
95    dnl
96    save_CFLAGS=$CFLAGS
97    CFLAGS="$CFLAGS $CFLAG_MXX"
98    
99    dnl
100    dnl check for gcc builtin atomic operations
101    dnl
102    AC_MSG_CHECKING([for builtin atomic operations])
103    AC_LINK_IFELSE(
104       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
105       AC_MSG_RESULT(yes)
106       AC_DEFINE(
107        [HAVE_BUILTIN_ATOMIC_OPS], 1,
108        [Define to 1 if gcc compiler provides atomic operations.]),
109       AC_MSG_RESULT(no))
110    
111    AC_C_BIGENDIAN
112    
113    #
114    # determine the sizes of the standard C types
115    AC_CHECK_SIZEOF([int])
116    SIZEOF_C_INT=$ac_cv_sizeof_int
117    AC_CHECK_SIZEOF([long])
118    SIZEOF_C_LONG=$ac_cv_sizeof_long
119    AC_CHECK_SIZEOF([float])
120    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
121    AC_CHECK_SIZEOF([double])
122    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
123    
124    AC_SUBST(SIZEOF_C_INT)
125    AC_SUBST(SIZEOF_C_LONG)
126    AC_SUBST(SIZEOF_C_FLOAT)
127    AC_SUBST(SIZEOF_C_DOUBLE)
128    
 dnl extra C compiler options  
129  dnl  dnl
130  CFLAGS=""  dnl restore CFLAGS
131  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"  dnl
132  AC_SUBST(CFLAG_MXX)  CFLAGS=$save_CFLAGS
 AC_SUBST(CFLAGS_BASE)  
133    
134  dnl  dnl
135  dnl standard headers  dnl check for <stdbool.h>, which we use in the C API
136  dnl  dnl
137  AC_HEADER_STDBOOL  AC_HEADER_STDBOOL
138    
139  dnl  dnl
140    dnl the C boolean type to use in generated library headers
141    dnl
142    if test x"$ac_cv_header_stdbool_h" = xyes ; then
143      BOOLTY="bool"
144    elif test "x$ac_cv_type__Bool" = xyes; then
145      BOOLTY="_Bool"
146    else
147      BOOLTY="int"
148    fi
149    AC_SUBST(BOOLTY)
150    
151    dnl
152  dnl check for pthreads support  dnl check for pthreads support
153  dnl  dnl
154  ACX_PTHREAD  ACX_PTHREAD
155    
156  dnl  dnl
157    dnl check for various library routines etc.
158    dnl
159    AC_CHECK_FUNCS(posix_memalign)
160    if test x"$ac_cv_func_posix_memalign" != xyes ; then
161      AC_CHECK_FUNCS(memalign)
162      if test x"$ac_cv_func_posix_memalign" != xyes ; then
163        AC_CHECK_FUNCS(valloc)
164      fi
165    fi
166    
167    AC_CHECK_FUNCS(mach_absolute_time)
168    AC_CHECK_TYPES([struct timespec])
169    AC_CHECK_FUNCS(pthread_barrier_init)
170    
171    dnl
172    dnl check for clock_gettime.  On Linux, this requires librt.
173    dnl
174    save_LIBS=$LIBS
175    LIBS="-lrt $LIBS"
176    AC_MSG_CHECKING([for clock_gettime])
177    AC_LINK_IFELSE(
178      [AC_LANG_PROGRAM(
179        [[#include <time.h>]],
180        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
181      [ ac_cv_func_clock_gettime=yes;
182        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
183      [ac_cv_func_clock_gettime=no])
184    AC_MSG_RESULT($ac_cv_func_clock_gettime)
185    if test "$ac_cv_func_clock_gettime" = "no" ; then
186      LIBS=$save_LIBS
187    fi
188    
189    AC_CHECK_FUNCS(pthread_getcpuclockid)
190    AC_CHECK_FUNCS(sigtimedwait nanosleep)
191    
192    dnl
193    dnl check for sched_setaffinity
194    dnl
195    AC_CHECK_FUNCS(sched_setaffinity)
196    
197    dnl
198    dnl check for pthread_setaffinity_np
199    dnl
200    save_LIBS=$LIBS
201    save_CFLAGS=$CFLAGS
202    LIBS="$PTHREAD_LIBS $LIBS"
203    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
204    AC_MSG_CHECKING([for pthread_setaffinity_np])
205    AC_LINK_IFELSE(
206      [AC_LANG_PROGRAM(
207        [[#include <pthread.h>]],
208        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
209      [ ac_cv_func_pthread_setaffinity_np=yes;
210        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
211      [ac_cv_func_pthread_setaffinity_np=no])
212    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
213    LIBS=$save_LIBS
214    CFLAGS=$save_CFLAGS
215    
216    dnl
217    dnl check for Linux NUMA support (libnuma)
218    dnl
219    AC_CHECK_LIB(numa,numa_available)
220    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
221      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
222    fi
223    
224    dnl check for /proc/cpuinfo
225    dnl
226    AC_CHECK_FILES(/proc/cpuinfo)
227    
228    dnl check for getcpu and/or sched_getcpu
229    dnl
230    AC_CHECK_HEADERS([linux/getcpu.h])
231    AC_CHECK_FUNCS([getcpu sched_getcpu])
232    
233    dnl
234    dnl OS-specific linking issues
235    dnl
236    LD_NEEDS_RPATH=false;
237    LIBM=""
238    case "$host_os" in
239      darwin*) # On Mac OS X we check for the presence of macports and/or fink
240        if test -x /opt/local/bin/port ; then
241          HAS_MACPORTS=yes
242        else
243          HAS_MACPORTS=no
244        fi
245        if test -x /sw/bin/fink ; then
246          HAS_FINK=yes
247        else
248          HAS_FINK=no
249        fi
250      ;;
251      linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
252        LD_NEEDS_RPATH=true
253        LIBM="-lm"
254      ;;
255    esac
256    
257    if test x"$HAS_MACPORTS" = xyes ; then
258      LDPATHS="-L/opt/local/lib"
259    elif test x"$HAS_FINK" = xyes ; then
260      LDPATHS="-L/sw/lib"
261    else
262      LDPATHS=""
263    fi
264    AC_SUBST(LDPATHS)
265    AC_SUBST(LD_NEEDS_RPATH)
266    AC_SUBST(LIBM)
267    
268    #################### Logging configuration ####################
269    
270    LOGGING_ENABLED=false
271    AC_ARG_ENABLE([event-logging],
272      AC_HELP_STRING([--enable-event-logging], [include event-logging support for parallel target]),
273      [LOGGING_ENABLED=true],
274      [LOGGING_ENABLED=false])
275    
276    AC_SUBST(LOGGING_ENABLED)
277    
278    #################### end Logging configuration ####################
279    
280    #################### CUDA configuration ####################
281    
282    AC_ARG_ENABLE([cuda],
283      AC_HELP_STRING([--enable-cuda], [include support for targeting CUDA]))
284    
285    if test "${enable_cuda+set}" = set ; then
286    dnl
287  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
288  dnl  dnl
289  AC_MSG_NOTICE([checking for CUDA and nvcc])  AC_MSG_NOTICE([checking for CUDA and nvcc])
# Line 82  Line 296 
296    AC_MSG_RESULT([$NVCC])    AC_MSG_RESULT([$NVCC])
297    CUDA_ENABLED=true    CUDA_ENABLED=true
298  fi  fi
299    else
300      NVCC=":"
301      CUDA_ENABLED=false
302    fi
303  AC_SUBST(NVCC)  AC_SUBST(NVCC)
304  AC_SUBST(CUDA_ENABLED)  AC_SUBST(CUDA_ENABLED)
305    
306    #################### end CUDA configuration ####################
307    
308    #################### OpenCL configuration ####################
309    
310    AC_ARG_ENABLE([opencl],
311      AC_HELP_STRING([--enable-opencl], [include support for targeting OpenCL]))
312    
313    if test "${enable_opencl+set}" = set ; then
314    
315  dnl  dnl
316  dnl check for OpenCL support  dnl check for OpenCL support
317  dnl  dnl
# Line 120  Line 347 
347    if test x"$HAVE_CL_H" = xno ; then    if test x"$HAVE_CL_H" = xno ; then
348      # check for NVIDIA's SDK      # check for NVIDIA's SDK
349      AC_MSG_CHECKING([for NVIDIA's SDK cl.h])      AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
350      if test -d /usr/local/cuda/include/CL ; then        CUDA_HOME=none
351          for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
352            if test -d /usr/local/$CUDA/include/CL ; then
353              CUDA_HOME=/usr/local/$CUDA
354              break
355            fi
356          done
357          if test x"$CUDA_HOME" != xnone ; then
358        HAVE_CL_H="yes"        HAVE_CL_H="yes"
359            CL_HEADER="$CUDA_HOME/include/CL/cl.h"
360        AC_DEFINE([HAVE_CL_CL_H])        AC_DEFINE([HAVE_CL_CL_H])
361        CPPFLAGS_CL="-I/usr/local/cuda/include"          CPPFLAGS_CL="-I$CUDA_HOME/include"
362      fi      fi
363      AC_MSG_RESULT([$HAVE_CL_H])      AC_MSG_RESULT([$HAVE_CL_H])
364    fi    fi
# Line 149  Line 384 
384  # else  # else
385  #   error no cl.h  #   error no cl.h
386  # endif]],  # endif]],
387  [[#if defined(CL_VERSION_1_1)  [[#if defined(CL_VERSION_1_2)
388    printf("11000\n");    printf("120\n");
389    #elif defined(CL_VERSION_1_1)
390      printf("110\n");
391  #elif defined(CL_VERSION_1_0)  #elif defined(CL_VERSION_1_0)
392    printf("10000\n");    printf("100\n");
393  #else  #else
394    printf("0\n");    printf("0\n");
395  #endif  #endif
# Line 193  Line 430 
430    SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double    SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
431    fi    fi
432  fi  fi
433    else
434      CL_ENABLED=false
435      CL_VERSION="0"
436      SIZEOF_CL_INT="0"
437      SIZEOF_CL_LONG="0"
438      SIZEOF_CL_FLOAT="0"
439      SIZEOF_CL_DOUBLE="0"
440    fi
441    
442  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
443  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)
444    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
445    
446  AC_SUBST(SIZEOF_CL_INT)  AC_SUBST(SIZEOF_CL_INT)
447  AC_SUBST(SIZEOF_CL_LONG)  AC_SUBST(SIZEOF_CL_LONG)
448  AC_SUBST(SIZEOF_CL_FLOAT)  AC_SUBST(SIZEOF_CL_FLOAT)
449  AC_SUBST(SIZEOF_CL_DOUBLE)  AC_SUBST(SIZEOF_CL_DOUBLE)
450    
451  dnl  #################### end OpenCL configuration ####################
 dnl check for various library routines etc.  
 dnl  
 AC_CHECK_FUNCS(posix_memalign)  
 if test x"$ac_cv_func_posix_memalign" != xyes ; then  
   AC_CHECK_FUNCS(memalign)  
   if test x"$ac_cv_func_posix_memalign" != xyes ; then  
     AC_CHECK_FUNCS(valloc)  
   fi  
 fi  
452    
453  AC_CHECK_FUNCS(mach_absolute_time)  #################### Teem configuration ####################
 AC_CHECK_TYPES([struct timespec])  
 AC_CHECK_FUNCS(pthread_barrier_init)  
454    
 dnl  
 dnl check for clock_gettime.  On Linux, this requires librt.  
 dnl  
 save_LIBS=$LIBS  
 LIBS="-lrt $LIBS"  
 AC_MSG_CHECKING([for clock_gettime])  
 AC_LINK_IFELSE(  
   [AC_LANG_PROGRAM(  
     [[#include <time.h>]],  
     [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],  
   [ ac_cv_func_clock_gettime=yes;  
     AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],  
   [ac_cv_func_clock_gettime=no])  
 AC_MSG_RESULT($ac_cv_func_clock_gettime)  
 if test "$ac_cv_func_clock_gettime" = "no" ; then  
   LIBS=$save_LIBS  
 fi  
   
 AC_CHECK_FUNCS(pthread_getcpuclockid)  
 AC_CHECK_FUNCS(sigtimedwait nanosleep)  
   
 dnl  
 dnl check for sched_setaffinity  
 dnl  
 AC_CHECK_FUNCS(sched_setaffinity)  
   
 dnl  
 dnl check for pthread_setaffinity_np  
 dnl  
 save_LIBS=$LIBS  
 save_CFLAGS=$CFLAGS  
 LIBS="$PTHREAD_LIBS $LIBS"  
 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"  
 AC_MSG_CHECKING([for pthread_setaffinity_np])  
 AC_LINK_IFELSE(  
   [AC_LANG_PROGRAM(  
     [[#include <pthread.h>]],  
     [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],  
   [ ac_cv_func_pthread_setaffinity_np=yes;  
     AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],  
   [ac_cv_func_pthread_setaffinity_np=no])  
 AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)  
 LIBS=$save_LIBS  
 CFLAGS=$save_CFLAGS  
   
 dnl  
 dnl check for Linux NUMA support (libnuma)  
 dnl  
 AC_CHECK_LIB(numa,numa_available)  
 if test "$ac_cv_lib_numa_numa_available" = "yes" ; then  
   PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"  
 fi  
   
 dnl check for /proc/cpuinfo  
 dnl  
 AC_CHECK_FILES(/proc/cpuinfo)  
   
 dnl  
 dnl OS-specific linking issues  
 dnl  
 LD_NEEDS_RPATH=false;  
 LIBM=""  
 case "$host_os" in  
   darwin*) # On Mac OS X we check for the presence of macports and/or fink  
     if test -x /opt/local/bin/port ; then  
       HAS_MACPORTS=yes  
     else  
       HAS_MACPORTS=no  
     fi  
     if test -x /sw/bin/fink ; then  
       HAS_FINK=yes  
     else  
       HAS_FINK=no  
     fi  
   ;;  
   linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries  
     LD_NEEDS_RPATH=true  
     LIBM="-lm"  
   ;;  
 esac  
   
 if test x"$HAS_MACPORTS" = xyes ; then  
   LDPATHS="-L/opt/local/lib"  
 elif test x"$HAS_FINK" = xyes ; then  
   LDPATHS="-L/sw/lib"  
 else  
   LDPATHS=""  
 fi  
 AC_SUBST(LDPATHS)  
 AC_SUBST(LD_NEEDS_RPATH)  
 AC_SUBST(LIBM)  
   
 dnl  
455  dnl get the path to the TEEM installation.  We need this to build the Diderot  dnl get the path to the TEEM installation.  We need this to build the Diderot
456  dnl runtime code and we use the path when searching for teem in the Diderot  dnl runtime code and we use the path when searching for teem in the Diderot
457  dnl compiler.  dnl compiler.
458  dnl  dnl
459    
460    dnl the path can be specified using "--with-teem=..." too
461    dnl
462  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
463    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
464    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
465    
466  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
467    dnl search for Teem in some standard places
468    dnl
469      AC_MSG_CHECKING([for teem])
470    TEEM_DIR=none    TEEM_DIR=none
471      POSSIBLE_TEEM_DIRS="/usr/local/teem /usr/local"
472      for dir in $POSSIBLE_TEEM_DIRS ; do
473        if test -f $dir/include/teem/nrrd.h ; then
474          TEEM_DIR=$dir
475          AC_MSG_RESULT([$TEEM_DIR])
476          break
477        fi
478      done
479      if test $TEEM_DIR = none ; then
480        AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
481      fi
482  else  else
483    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
484    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 328  Line 489 
489      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
490      # check that TEEM_DIR actually points to something that looks like teem      # check that TEEM_DIR actually points to something that looks like teem
491      if test -f $TEEM_DIR/include/teem/nrrd.h ; then      if test -f $TEEM_DIR/include/teem/nrrd.h ; then
492        AC_MSG_RESULT([ okay])        AC_MSG_RESULT([yes])
493      else      else
494        TEEM_DIR=none        TEEM_DIR=none
495        AC_MSG_RESULT([ invalid])        AC_MSG_RESULT([invalid path to teem])
496      fi      fi
497    else    else
498      TEEM_DIR=none      TEEM_DIR=none
499      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([invalid path to teem])
500    fi    fi
501  fi  fi
502  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
503    AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])    AC_MSG_ERROR([unable to find teem])
504    fi
505    dnl
506    dnl check that teem supports the nrrdMetaDataNormalize function
507    dnl
508    save_LDFLAGS=$LDFLAGS
509    save_LIBS=$LIBS
510    LDFLAGS="$LDFLAGS -L$TEEM_DIR/lib"
511    LIBS="$LIBS -lteem -lm"
512    AC_CHECK_FUNCS([nrrdMetaDataNormalize])
513    LDFLAGS=$save_LDFLAGS
514    LIBS=$save_LIBS
515    
516    if test "x$ac_cv_func_nrrdMetaDataNormalize" != xyes; then
517      AC_MSG_ERROR(["please update your teem installation"])
518  fi  fi
519    
520  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
521    
522  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
523    
524    #################### SML configuration ####################
525    
526    dnl
527    dnl We support building with both SML/NJ (the default) or MLton.
528  dnl  dnl
529    
530    dnl first check for --with-mlton=path flag
531    dnl
532    AC_ARG_WITH([mlton],
533      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
534        [use the MLton Standard ML compiler to build Diderot])],
535      [with_mlton=yes],[with_mlton=no])
536    if test x"$with_mlton" = xyes ; then
537      if test x"$ac_cv_path_with_mlton" = x ; then
538        # look for mlton in the PATH
539        AC_PATH_PROGS(with_mlton, mlton, no)
540        if test x"$MLTON" = xno ; then
541          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
542        fi
543      else
544        with_mlton=$ac_cv_path_with_mlton
545        case $with_mlton in
546          /*) ;;
547          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
548        esac
549        if test ! -x $with_mlton ; then
550          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
551        fi
552      fi
553    fi
554    
555    if test x"$with_mlton" = xno ; then
556      # we are using SML/NJ
557      #
558    
559  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
560  dnl  dnl
561  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; please add it to your PATH or set SML_CMD])])
562  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
563    -o $SMLNJ_MINOR_VERSION -lt 74      -o $SMLNJ_MINOR_VERSION -lt 80
564  then  then
565    AC_MSG_ERROR([installation requires SML/NJ version 110.74+])      AC_MSG_ERROR([installation requires SML/NJ version 110.80+ (available from smlnj.org)])
566  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
567    
568  dnl determine the heap-image suffix  dnl determine the heap-image suffix
569  dnl  dnl
# Line 363  Line 572 
572    
573  dnl look for ml-makedepend  dnl look for ml-makedepend
574  dnl  dnl
 AC_MSG_CHECKING([for ml-makedepend])  
575  tmpPATH="$SMLNJ_PATH:$PATH"  tmpPATH="$SMLNJ_PATH:$PATH"
576  AC_PATH_PROG(ML_MAKEDEPEND, ml-makedepend, ":", $tmpPATH)  AC_PATH_PROG(ML_MAKEDEPEND, ml-makedepend, ":", $tmpPATH)
 if test $ML_MAKEDEPEND = none ; then  
   AC_MSG_ERROR([ml-makedepend not found])  
 else  
   AC_MSG_RESULT([$ML_MAKEDEPEND])  
 fi  
577  AC_SUBST(ML_MAKEDEPEND)  AC_SUBST(ML_MAKEDEPEND)
578    
579  dnl  dnl
# Line 382  Line 585 
585    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
586  fi  fi
587  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
588      SML=smlnj
589    
590  dnl ******************** Documentation tools ********************    HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
591      INSTALL_SMLNJ_WRAPPER=$DIDEROT_BINDIR/install-sml-wrapper.sh
592      AC_SUBST(HEAP_IMAGE_DIR)
593      AC_SUBST(INSTALL_SMLNJ_WRAPPER)
594    
595    else
596    
597      # we are using MLton
598      MLTON=$with_mlton
599      AC_SUBST(MLTON)
600      SML=mlton
601    
602    fi
603    AC_SUBST(SML)
604    
605    #################### end SML configuration ####################
606    
607    #################### Documentation tools configuration ####################
608    
609  dnl check for doxygen  dnl check for doxygen
610  dnl  dnl
611  AC_ARG_WITH([doxygen],  AC_ARG_WITH([doxygen],
612    [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],    [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
613    [DOXYGEN=$with_doxygen],    [DOXYGEN=$with_doxygen],
614    [DOXYGEN=none])    [DOXYGEN=none])
615  if test x$DOXYGEN = xnone ; then  if test x$DOXYGEN = xnone ; then
# Line 416  Line 637 
637  dnl check for asciidoc and related tools  dnl check for asciidoc and related tools
638  dnl  dnl
639  AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])  AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
640    AC_PATH_PROGS([A2X], [a2x], [none])
641  AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])  AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
642  AC_PATH_PROGS([DBLATEX], [dblatex], [none])  AC_PATH_PROGS([DBLATEX], [dblatex], [none])
643    
# Line 428  Line 650 
650    AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])    AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
651  fi  fi
652  AC_SUBST(ASCIIDOC)  AC_SUBST(ASCIIDOC)
653    AC_SUBST(A2X)
654  AC_SUBST(ASCIIDOC_CONF_DIR)  AC_SUBST(ASCIIDOC_CONF_DIR)
655  AC_SUBST(HIGHLIGHTER)  AC_SUBST(HIGHLIGHTER)
656  AC_SUBST(DBLATEX)  AC_SUBST(DBLATEX)
657    
658    #################### end Documentation tools configuration ####################
659    
660  dnl ******************** Paths ********************  #################### config.h ####################
   
 DIDEROT_ROOT=`pwd`  
 DIDEROT_DOCDIR=$DIDEROT_ROOT/doc  
 DIDEROT_SRCDIR=$DIDEROT_ROOT/src  
 DIDEROT_LIBDIR=$DIDEROT_ROOT/lib  
 DIDEROT_BINDIR=$DIDEROT_ROOT/bin  
 DIDEROT_MKDIR=$DIDEROT_ROOT/mk  
   
 HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  
 INSTALL_SMLNJ_WRAPPER=$DIDEROT_BINDIR/install-sml-wrapper.sh  
   
 AC_SUBST(DIDEROT_ROOT)  
 AC_SUBST(DIDEROT_DOCDIR)  
 AC_SUBST(DIDEROT_SRCDIR)  
 AC_SUBST(DIDEROT_LIBDIR)  
 AC_SUBST(DIDEROT_BINDIR)  
 AC_SUBST(DIDEROT_MKDIR)  
 AC_SUBST(HEAP_IMAGE_DIR)  
 AC_SUBST(INSTALL_SMLNJ_WRAPPER)  
661    
662  dnl  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
 dnl ******************** C compiler properties ********************  
 dnl  
   
 dnl  
 dnl run the compiler tests in 64-bit mode  
 dnl  
 save_CFLAGS=$CFLAGS  
 CFLAGS="$CFLAGS $CFLAG_MXX"  
   
 dnl  
 dnl check for gcc builtin atomic operations  
 dnl  
 AC_MSG_CHECKING([for builtin atomic operations])  
 AC_LINK_IFELSE(  
    [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],  
    AC_MSG_RESULT(yes)  
    AC_DEFINE(  
     [HAVE_BUILTIN_ATOMIC_OPS], 1,  
     [Define to 1 if gcc compiler provides atomic operations.]),  
    AC_MSG_RESULT(no))  
   
 AC_C_BIGENDIAN  
   
 #  
 # determine the sizes of the standard C types  
 AC_CHECK_SIZEOF([int])  
 SIZEOF_C_INT=$ac_cv_sizeof_int  
 AC_CHECK_SIZEOF([long])  
 SIZEOF_C_LONG=$ac_cv_sizeof_long  
 AC_CHECK_SIZEOF([float])  
 SIZEOF_C_FLOAT=$ac_cv_sizeof_float  
 AC_CHECK_SIZEOF([double])  
 SIZEOF_C_DOUBLE=$ac_cv_sizeof_double  
   
 AC_SUBST(SIZEOF_C_INT)  
 AC_SUBST(SIZEOF_C_LONG)  
 AC_SUBST(SIZEOF_C_FLOAT)  
 AC_SUBST(SIZEOF_C_DOUBLE)  
   
 dnl  
 dnl restore CFLAGS  
 dnl  
 CFLAGS=$save_CFLAGS  
   
 dnl  
 dnl ******************** config.h stuff ********************  
 dnl  
   
 AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])  
663    
664  AH_TOP([  AH_TOP([
665  /*  /*
666   * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)   * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
667   * All rights reserved.   *
668     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
669   */   */
670    
671  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 517  Line 674 
674  ])  ])
675  AH_BOTTOM([  AH_BOTTOM([
676    
 #ifdef NDEBUG  
 #define STATIC_INLINE   static inline  
 #else  
 #define STATIC_INLINE   static  
 #endif  
   
677  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
678  ])  ])
679    
680  dnl  #################### end config.h ####################
681  dnl ******************** write output ********************  
682  dnl  #################### write output ####################
683    
684    dnl The compiler Makefile depends on which SML system we are
685    dnl using.
686    if test x"$SML" = xmlton ; then
687      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
688    else
689      COMPILER_MAKEFILE_IN=""
690    fi
691    
692  AC_CONFIG_FILES(  AC_CONFIG_FILES(
693  dnl  dnl
694  dnl ***** Makefiles *****  dnl ***** Makefiles *****
695    Makefile    Makefile
696    doc/Makefile  dnl  doc/Makefile
697    doc/man/Makefile  dnl  doc/man/Makefile
698    src/clinfo/Makefile  dnl  src/clinfo/Makefile
699    src/compiler/Makefile    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
700    src/lib/build/Makefile    src/lib/build/Makefile
701    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/MIP/Makefile  
   test/probe/Makefile  
   test/iso2d-polyline/Makefile  
   test/vr-lite-cam/Makefile  
   test/hlic/Makefile  
702  dnl  dnl
703  dnl ***** SML source files *****  dnl ***** SML source files *****
704    src/compiler/nrrd/run-dnorm.sml:src/compiler/nrrd/run-dnorm_sml.in    src/compiler/nrrd/run-dnorm.sml:src/compiler/nrrd/run-dnorm_sml.in
705    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
706    src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in    src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
707      src/compiler/options/version.sml:src/compiler/options/version_sml.in
708  )  )
709    
710  AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in)  AC_CONFIG_HEADERS(src/lib/include/diderot/config.h:config/config_h.in)
711    
712  dnl  dnl
713  dnl shell scripts  dnl shell scripts
# Line 561  Line 716 
716    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
717  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
718  AC_CONFIG_FILES([  AC_CONFIG_FILES([
719    src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in    src/compiler/gen/fragments/mkfrags.sh:src/compiler/gen/fragments/mkfrags_sh.in
720  ], [chmod +x src/compiler/gen/file2str/file2str.sh])  ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
 AC_CONFIG_FILES([  
   rtest/scripts/run.sh:rtest/scripts/run_sh.in  
 ], [chmod +x rtest/scripts/run.sh])  
721  AC_CONFIG_FILES([  AC_CONFIG_FILES([
722    rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in    src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
723  ], [chmod +x rtest/scripts/run-one.sh])  ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
724    
725    dnl
726    dnl additional files for logging tools
727    dnl
728    if test x"$LOGGING_ENABLED" = xtrue ; then
729      AC_CONFIG_FILES(
730        src/logging/gen/Makefile
731        src/logging/log-analyze/Makefile
732        src/logging/log-dump/Makefile
733        src/logging/gen/main.sml:src/logging/gen/main_sml.in
734        src/logging/lib/default-log-paths.hxx:src/logging/lib/default-log-paths_hxx.in
735      )
736    fi
737    
738  dnl  dnl
739  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
740  dnl  dnl
741  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
742  dnl  dnl
743    dnl where the options are taken from [debug, parallel]
744    dnl
745  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
746      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
747        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 587  Line 754 
754      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
755    ])    ])
756    
757  MK_BUILD_DIR(rt-c-f, c, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
758  MK_BUILD_DIR(rt-c-d, c, [double])  MK_BUILD_DIR(rt-seq-debug, sequential, [debug])
759  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])  MK_BUILD_DIR(rt-par, parallel, [parallel])
760  MK_BUILD_DIR(rt-c-d-debug, c, [double debug])  MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
761  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  
762  MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])  if test x"$LOGGING_ENABLED" = xtrue ; then
763  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])    MK_BUILD_DIR(rt-par-log, parallel, [parallel logging])
 MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])  
   
 if test x"$CL_ENABLED" = xtrue ; then  
   MK_BUILD_DIR(rt-cl-f, cl, [float])  
   MK_BUILD_DIR(rt-cl-d, cl, [double])  
   MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug])  
   MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug])  
764  fi  fi
765    
766    #if test x"$CL_ENABLED" = xtrue ; then
767    #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
768    #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
769    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
770    #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
771    #fi
772    
773  AC_OUTPUT  AC_OUTPUT
774    
775    #################### end write output ####################

Legend:
Removed from v.2441  
changed lines
  Added in v.4868

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0