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 2361, Sun Apr 7 16:33:14 2013 UTC branches/vis15/configure.ac revision 4110, Thu Jun 30 04:04:30 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,1.0,)
10    
11  AC_PREREQ(2.60)  AC_PREREQ(2.60)
12  AC_COPYRIGHT([[COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)]])  AC_COPYRIGHT([[COPYRIGHT (c) 2016 The University of Chicago]])
13  AC_CONFIG_SRCDIR(src/dnorm/dnorm.c)  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="master"
21    AC_SUBST(BRANCH)
22    
23    dnl
24  dnl include additional macros  dnl include additional macros
25  dnl  dnl
26  sinclude(config/acx_pthread.m4)  sinclude(config/acx_pthread.m4)
27  sinclude(config/check_smlnj.m4)  sinclude(config/check_smlnj.m4)
28  sinclude(config/check_smlnj_heap_suffix.m4)  sinclude(config/check_smlnj_heap_suffix.m4)
29  sinclude(config/ax_check_framework.m4)  sinclude(config/ax_check_framework.m4)
30    sinclude(config/ax_cxx_compile_stdcxx.m4)
31    
32  dnl  dnl
33  dnl get host information  dnl get host information
34  dnl  dnl
35  AC_CANONICAL_HOST  AC_CANONICAL_HOST
36    
37    #################### Paths configuration ####################
38    
39    DIDEROT_ROOT=`pwd`
40    DIDEROT_DOCDIR=$DIDEROT_ROOT/doc
41    DIDEROT_SRCDIR=$DIDEROT_ROOT/src
42    DIDEROT_LIBDIR=$DIDEROT_ROOT/lib
43    DIDEROT_BINDIR=$DIDEROT_ROOT/bin
44    DIDEROT_MKDIR=$DIDEROT_ROOT/mk
45    
46    AC_SUBST(DIDEROT_ROOT)
47    AC_SUBST(DIDEROT_DOCDIR)
48    AC_SUBST(DIDEROT_SRCDIR)
49    AC_SUBST(DIDEROT_LIBDIR)
50    AC_SUBST(DIDEROT_BINDIR)
51    AC_SUBST(DIDEROT_MKDIR)
52    
53    #################### end Paths configuration ####################
54    
55  dnl check for standard programs  dnl check for standard programs
56  dnl  dnl
 AC_PROG_CC([clang gcc cc])  
57  AC_PROG_CPP  AC_PROG_CPP
58    AC_PROG_CC([clang gcc cc])
59    AC_PROG_CXX([clang++ g++ c++])
60    AX_CXX_COMPILE_STDCXX(11,[],[mandatory])
61  AC_PROG_INSTALL  AC_PROG_INSTALL
62  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
63    
# Line 40  Line 69 
69  fi  fi
70  AC_SUBST(LD)  AC_SUBST(LD)
71    
72  dnl check for c99 support  dnl extra compiler options
73  dnl  dnl
74  AC_PROG_CC_C99  CXXFLAGS_BASE="$CXXFLAGS -Wreturn-type -Wuninitialized"
 if test x"$ac_cv_prog_cc_c99" = xno ; then  
   AC_MSG_ERROR([Diderot requires c99 support])  
 fi  
75    
76  AC_ARG_ENABLE([32-bit],  AC_ARG_ENABLE([32-bit],
77    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]),
78    [CFLAG_MXX="-m32"],    [CXXFLAG_Mxx="-m32"],
79    [CFLAG_MXX="-m64"])    [CXXFLAG_Mxx="-m64"])
80    if test x"$CXX" != "xclang++" ; then
81      CXXFLAGS_BASE="$CXXFLAGS_BASE -fno-implicit-templates"
82    fi
83    
84    CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
85    AC_SUBST(CXXFLAG_Mxx)
86    AC_SUBST(CXXFLAGS_BASE)
87    
 dnl extra C compiler options  
88  dnl  dnl
89  CFLAGS=""  dnl run the compiler tests in 64-bit mode
90  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"  dnl
91  AC_SUBST(CFLAG_MXX)  save_CFLAGS=$CFLAGS
92  AC_SUBST(CFLAGS_BASE)  CFLAGS="$CFLAGS $CFLAG_MXX"
93    
94  dnl  dnl
95  dnl standard headers  dnl check for gcc builtin atomic operations
96    dnl
97    AC_MSG_CHECKING([for builtin atomic operations])
98    AC_LINK_IFELSE(
99       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
100       AC_MSG_RESULT(yes)
101       AC_DEFINE(
102        [HAVE_BUILTIN_ATOMIC_OPS], 1,
103        [Define to 1 if gcc compiler provides atomic operations.]),
104       AC_MSG_RESULT(no))
105    
106    AC_C_BIGENDIAN
107    
108    #
109    # determine the sizes of the standard C types
110    AC_CHECK_SIZEOF([int])
111    SIZEOF_C_INT=$ac_cv_sizeof_int
112    AC_CHECK_SIZEOF([long])
113    SIZEOF_C_LONG=$ac_cv_sizeof_long
114    AC_CHECK_SIZEOF([float])
115    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
116    AC_CHECK_SIZEOF([double])
117    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
118    
119    AC_SUBST(SIZEOF_C_INT)
120    AC_SUBST(SIZEOF_C_LONG)
121    AC_SUBST(SIZEOF_C_FLOAT)
122    AC_SUBST(SIZEOF_C_DOUBLE)
123    
124    dnl
125    dnl restore CFLAGS
126    dnl
127    CFLAGS=$save_CFLAGS
128    
129    dnl
130    dnl check for <stdbool.h>, which we use in the C API
131  dnl  dnl
132  AC_HEADER_STDBOOL  AC_HEADER_STDBOOL
133    
# Line 69  Line 136 
136  dnl  dnl
137  ACX_PTHREAD  ACX_PTHREAD
138    
 dnl check for doxygen  
139  dnl  dnl
140  AC_ARG_WITH([doxygen],  dnl check for various library routines etc.
141    [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],  dnl
142    [DOXYGEN=$with_doxygen],  AC_CHECK_FUNCS(posix_memalign)
143    [DOXYGEN=none])  if test x"$ac_cv_func_posix_memalign" != xyes ; then
144  if test x$DOXYGEN = xnone ; then    AC_CHECK_FUNCS(memalign)
145    # see if we can find doxygen in the user's path    if test x"$ac_cv_func_posix_memalign" != xyes ; then
146    AC_PATH_PROG(DOXYGEN, [doxygen], [none])      AC_CHECK_FUNCS(valloc)
147  fi  fi
148  if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then  fi
149    AC_MSG_ERROR([--with-doxygen option must specify directory argument])  
150  elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then  AC_CHECK_FUNCS(mach_absolute_time)
151    AC_MSG_ERROR([doxygen not found at $DOXYGEN])  AC_CHECK_TYPES([struct timespec])
152  elif test x$DOXYGEN != xnone ; then  AC_CHECK_FUNCS(pthread_barrier_init)
153    
154  dnl  dnl
155  dnl verify that $DOXYGEN is an absolute path  dnl check for clock_gettime.  On Linux, this requires librt.
156  dnl  dnl
157    case $DOXYGEN in  save_LIBS=$LIBS
158      /*) ;;  LIBS="-lrt $LIBS"
159      *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;  AC_MSG_CHECKING([for clock_gettime])
160    esac  AC_LINK_IFELSE(
161      [AC_LANG_PROGRAM(
162        [[#include <time.h>]],
163        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
164      [ ac_cv_func_clock_gettime=yes;
165        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
166      [ac_cv_func_clock_gettime=no])
167    AC_MSG_RESULT($ac_cv_func_clock_gettime)
168    if test "$ac_cv_func_clock_gettime" = "no" ; then
169      LIBS=$save_LIBS
170  fi  fi
171  if test $DOXYGEN = xnone ; then  
172    DOXYGEN=:  AC_CHECK_FUNCS(pthread_getcpuclockid)
173    AC_CHECK_FUNCS(sigtimedwait nanosleep)
174    
175    dnl
176    dnl check for sched_setaffinity
177    dnl
178    AC_CHECK_FUNCS(sched_setaffinity)
179    
180    dnl
181    dnl check for pthread_setaffinity_np
182    dnl
183    save_LIBS=$LIBS
184    save_CFLAGS=$CFLAGS
185    LIBS="$PTHREAD_LIBS $LIBS"
186    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
187    AC_MSG_CHECKING([for pthread_setaffinity_np])
188    AC_LINK_IFELSE(
189      [AC_LANG_PROGRAM(
190        [[#include <pthread.h>]],
191        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
192      [ ac_cv_func_pthread_setaffinity_np=yes;
193        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
194      [ac_cv_func_pthread_setaffinity_np=no])
195    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
196    LIBS=$save_LIBS
197    CFLAGS=$save_CFLAGS
198    
199    dnl
200    dnl check for Linux NUMA support (libnuma)
201    dnl
202    AC_CHECK_LIB(numa,numa_available)
203    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
204      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
205  fi  fi
206  AC_SUBST(DOXYGEN)  
207    dnl check for /proc/cpuinfo
208    dnl
209    AC_CHECK_FILES(/proc/cpuinfo)
210    
211    dnl
212    dnl OS-specific linking issues
213    dnl
214    LD_NEEDS_RPATH=false;
215    LIBM=""
216    case "$host_os" in
217      darwin*) # On Mac OS X we check for the presence of macports and/or fink
218        if test -x /opt/local/bin/port ; then
219          HAS_MACPORTS=yes
220        else
221          HAS_MACPORTS=no
222        fi
223        if test -x /sw/bin/fink ; then
224          HAS_FINK=yes
225        else
226          HAS_FINK=no
227        fi
228      ;;
229      linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
230        LD_NEEDS_RPATH=true
231        LIBM="-lm"
232      ;;
233    esac
234    
235    if test x"$HAS_MACPORTS" = xyes ; then
236      LDPATHS="-L/opt/local/lib"
237    elif test x"$HAS_FINK" = xyes ; then
238      LDPATHS="-L/sw/lib"
239    else
240      LDPATHS=""
241    fi
242    AC_SUBST(LDPATHS)
243    AC_SUBST(LD_NEEDS_RPATH)
244    AC_SUBST(LIBM)
245    
246    #################### CUDA configuration ####################
247    
248  dnl  dnl
249  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
# Line 113  Line 261 
261  AC_SUBST(NVCC)  AC_SUBST(NVCC)
262  AC_SUBST(CUDA_ENABLED)  AC_SUBST(CUDA_ENABLED)
263    
264    #################### end CUDA configuration ####################
265    
266    #################### OpenCL configuration ####################
267    
268  dnl  dnl
269  dnl check for OpenCL support  dnl check for OpenCL support
270  dnl  dnl
# Line 148  Line 300 
300    if test x"$HAVE_CL_H" = xno ; then    if test x"$HAVE_CL_H" = xno ; then
301      # check for NVIDIA's SDK      # check for NVIDIA's SDK
302      AC_MSG_CHECKING([for NVIDIA's SDK cl.h])      AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
303      if test -d /usr/local/cuda/include/CL ; then      CUDA_HOME=none
304        for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
305          if test -d /usr/local/$CUDA/include/CL ; then
306            CUDA_HOME=/usr/local/$CUDA
307            break
308          fi
309        done
310        if test x"$CUDA_HOME" != xnone ; then
311        HAVE_CL_H="yes"        HAVE_CL_H="yes"
312          CL_HEADER="$CUDA_HOME/include/CL/cl.h"
313        AC_DEFINE([HAVE_CL_CL_H])        AC_DEFINE([HAVE_CL_CL_H])
314        CPPFLAGS_CL="-I/usr/local/cuda/include"        CPPFLAGS_CL="-I$CUDA_HOME/include"
315      fi      fi
316      AC_MSG_RESULT([$HAVE_CL_H])      AC_MSG_RESULT([$HAVE_CL_H])
317    fi    fi
# Line 177  Line 337 
337  # else  # else
338  #   error no cl.h  #   error no cl.h
339  # endif]],  # endif]],
340  [[#if defined(CL_VERSION_1_1)  [[#if defined(CL_VERSION_1_2)
341    printf("11000\n");    printf("120\n");
342    #elif defined(CL_VERSION_1_1)
343      printf("110\n");
344  #elif defined(CL_VERSION_1_0)  #elif defined(CL_VERSION_1_0)
345    printf("10000\n");    printf("100\n");
346  #else  #else
347    printf("0\n");    printf("0\n");
348  #endif  #endif
# Line 223  Line 385 
385  fi  fi
386  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
387  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)
388    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
389    
390  AC_SUBST(SIZEOF_CL_INT)  AC_SUBST(SIZEOF_CL_INT)
391  AC_SUBST(SIZEOF_CL_LONG)  AC_SUBST(SIZEOF_CL_LONG)
392  AC_SUBST(SIZEOF_CL_FLOAT)  AC_SUBST(SIZEOF_CL_FLOAT)
393  AC_SUBST(SIZEOF_CL_DOUBLE)  AC_SUBST(SIZEOF_CL_DOUBLE)
394    
395  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  
396    
397  AC_CHECK_FUNCS(mach_absolute_time)  #################### Teem configuration ####################
 AC_CHECK_TYPES([struct timespec])  
 AC_CHECK_FUNCS(pthread_barrier_init)  
398    
399  dnl  dnl
400  dnl check for clock_gettime.  On Linux, this requires librt.  dnl get the path to the TEEM installation.  We need this to build the Diderot
401  dnl  dnl runtime code and we use the path when searching for teem in the Diderot
402  save_LIBS=$LIBS  dnl compiler.
 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  
 dnl get the path to the TEEM installation  
403  dnl  dnl
404  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
405    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
# Line 354  Line 416 
416      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
417      # check that TEEM_DIR actually points to something that looks like teem      # check that TEEM_DIR actually points to something that looks like teem
418      if test -f $TEEM_DIR/include/teem/nrrd.h ; then      if test -f $TEEM_DIR/include/teem/nrrd.h ; then
419        AC_MSG_RESULT([ okay])        AC_MSG_RESULT([yes])
420      else      else
421        TEEM_DIR=none        TEEM_DIR=none
422        AC_MSG_RESULT([ invalid])        AC_MSG_RESULT([no])
423      fi      fi
424    else    else
425      TEEM_DIR=none      TEEM_DIR=none
426      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([no])
427    fi    fi
428  fi  fi
429  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
430    AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])    AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
431  fi  fi
432    dnl
433    dnl check that unu supports the dnorm command
434    dnl
435    if test x"$TEEM_DIR" != xnone ; then
436      AC_MSG_CHECKING([that \"unu dnorm\" works])
437      if test -x $TEEM_DIR/bin/unu ; then
438        $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null
439        if test $? -eq 0 ; then
440          AC_MSG_RESULT([yes])
441        else
442          AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation])
443        fi
444      else
445        AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])
446      fi
447    fi
448  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
449    
450  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
451    
452    #################### SML configuration ####################
453    
454    dnl
455    dnl We support building with both SML/NJ (the default) or MLton.
456  dnl  dnl
457    
458    dnl first check for --with-mlton=path flag
459    dnl
460    AC_ARG_WITH([mlton],
461      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
462        [use the MLton Standard ML compiler to build Diderot])],
463      [with_mlton=yes],[with_mlton=no])
464    if test x"$with_mlton" = xyes ; then
465      if test x"$ac_cv_path_with_mlton" = x ; then
466        # look for mlton in the PATH
467        AC_PATH_PROGS(with_mlton, mlton, no)
468        if test x"$MLTON" = xno ; then
469          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
470        fi
471      else
472        with_mlton=$ac_cv_path_with_mlton
473        case $with_mlton in
474          /*) ;;
475          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
476        esac
477        if test ! -x $with_mlton ; then
478          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
479        fi
480      fi
481    fi
482    
483    if test x"$with_mlton" = xno ; then
484      # we are using SML/NJ
485      #
486    
487  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
488  dnl  dnl
489  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])])
490  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
491    -o $SMLNJ_MINOR_VERSION -lt 74      -o $SMLNJ_MINOR_VERSION -lt 79
492  then  then
493    AC_MSG_ERROR([installation requires SML/NJ version 110.74+])      AC_MSG_ERROR([installation requires SML/NJ version 110.79+ (available from smlnj.org)])
494  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
495    
496  dnl determine the heap-image suffix  dnl determine the heap-image suffix
497  dnl  dnl
# Line 408  Line 519 
519    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
520  fi  fi
521  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
522      SML=smlnj
 dnl ******************** Paths ********************  
   
 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  
523    
524  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
525  INSTALL_SMLNJ_WRAPPER=$DIDEROT_BINDIR/install-sml-wrapper.sh  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)  
526  AC_SUBST(HEAP_IMAGE_DIR)  AC_SUBST(HEAP_IMAGE_DIR)
527  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
528    
529  dnl  else
 dnl ******************** C compiler properties ********************  
 dnl  
   
 dnl  
 dnl run the compiler tests in 64-bit mode  
 dnl  
 save_CFLAGS=$CFLAGS  
 CFLAGS="$CFLAGS $CFLAG_MXX"  
530    
531  dnl    # we are using MLton
532  dnl check for gcc builtin atomic operations    MLTON=$with_mlton
533  dnl    AC_SUBST(MLTON)
534  AC_MSG_CHECKING([for builtin atomic operations])    SML=mlton
 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))  
535    
536  AC_C_BIGENDIAN  fi
537    AC_SUBST(SML)
538    
539  #  #################### SML configuration ####################
 # 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  
540    
541  AC_SUBST(SIZEOF_C_INT)  #################### Documentation tools configuration ####################
 AC_SUBST(SIZEOF_C_LONG)  
 AC_SUBST(SIZEOF_C_FLOAT)  
 AC_SUBST(SIZEOF_C_DOUBLE)  
542    
543    dnl check for doxygen
544  dnl  dnl
545  dnl restore CFLAGS  AC_ARG_WITH([doxygen],
546      [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
547      [DOXYGEN=$with_doxygen],
548      [DOXYGEN=none])
549    if test x$DOXYGEN = xnone ; then
550      # see if we can find doxygen in the user's path
551      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
552    fi
553    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
554      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
555    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
556      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
557    elif test x$DOXYGEN != xnone ; then
558  dnl  dnl
559  CFLAGS=$save_CFLAGS  dnl verify that $DOXYGEN is an absolute path
560    dnl
561      case $DOXYGEN in
562        /*) ;;
563        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
564      esac
565    fi
566    if test $DOXYGEN = xnone ; then
567      DOXYGEN=:
568    fi
569    AC_SUBST(DOXYGEN)
570    
571    dnl check for asciidoc and related tools
572    dnl
573    AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
574    AC_PATH_PROGS([A2X], [a2x], [none])
575    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
576    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
577    
578  dnl  dnl
579  dnl ******************** config.h stuff ********************  dnl get the path to the asciidoc cofiguration files
580  dnl  dnl
581    if test x"$ASCIIDOC" != xnone ; then
582      AC_MSG_CHECKING([path to asciidoc configuration files])
583      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
584      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
585    fi
586    AC_SUBST(ASCIIDOC)
587    AC_SUBST(A2X)
588    AC_SUBST(ASCIIDOC_CONF_DIR)
589    AC_SUBST(HIGHLIGHTER)
590    AC_SUBST(DBLATEX)
591    
592    #################### end Documentation tools configuration ####################
593    
594    #################### config.h ####################
595    
596  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
597    
598  AH_TOP([  AH_TOP([
599  /*  /*
600   * 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)
601   * All rights reserved.   *
602     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
603   */   */
604    
605  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 493  Line 608 
608  ])  ])
609  AH_BOTTOM([  AH_BOTTOM([
610    
 #ifdef NDEBUG  
 #define STATIC_INLINE   static inline  
 #else  
 #define STATIC_INLINE   static  
 #endif  
   
611  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
612  ])  ])
613    
614  dnl  #################### end config.h ####################
615  dnl ******************** write output ********************  
616  dnl  #################### write output ####################
617    
618    dnl The compiler Makefile depends on which SML system we are
619    dnl using.
620    if test x"$SML" = xmlton ; then
621      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
622    else
623      COMPILER_MAKEFILE_IN=""
624    fi
625    
626  AC_CONFIG_FILES(  AC_CONFIG_FILES(
627  dnl  dnl
628  dnl ***** Makefiles *****  dnl ***** Makefiles *****
629    Makefile    Makefile
630    doc/Makefile  dnl  doc/Makefile
631    src/clinfo/Makefile  dnl  doc/man/Makefile
632    src/dnorm/Makefile  dnl  src/clinfo/Makefile
633    src/compiler/Makefile    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
634    src/lib/build/Makefile    src/lib/build/Makefile
635    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
636    test/MIP/Makefile  dnl  test/MIP/Makefile
637    test/probe/Makefile  dnl  test/probe/Makefile
638    test/iso2d-polyline/Makefile  dnl  test/iso2d-polyline/Makefile
639    test/vr-lite-cam/Makefile  dnl  test/vr-lite-cam/Makefile
640    test/hlic/Makefile  dnl  test/hlic/Makefile
641  dnl  dnl
642  dnl ***** SML source files *****  dnl ***** SML source files *****
643    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
644    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
645    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
646      src/compiler/options/version.sml:src/compiler/options/version_sml.in
647  )  )
648    
649  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)
650    
651  dnl  dnl
652  dnl shell scripts  dnl shell scripts
# Line 537  Line 655 
655    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
656  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
657  AC_CONFIG_FILES([  AC_CONFIG_FILES([
658    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
659  ], [chmod +x src/compiler/gen/file2str/file2str.sh])  ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
660  AC_CONFIG_FILES([  AC_CONFIG_FILES([
661    rtest/scripts/run.sh:rtest/scripts/run_sh.in    src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
662  ], [chmod +x rtest/scripts/run.sh])  ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
663  AC_CONFIG_FILES([  AC_CONFIG_FILES([
664    rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in    src/tests/rtest/scripts/run.sh:src/tests/rtest/scripts/run_sh.in
665  ], [chmod +x rtest/scripts/run-one.sh])  ], [chmod +x src/tests/rtest/scripts/run.sh])
666    AC_CONFIG_FILES([
667      src/tests/rtest/scripts/run-one.sh:src/tests/rtest/scripts/run-one_sh.in
668    ], [chmod +x src/tests/rtest/scripts/run-one.sh])
669    #
670    # more regression tests; should merge with rtest at some point
671    #
672    # AC_CONFIG_FILES([
673    #   rtest2/scripts/run.sh:rtest2/scripts/run_sh.in
674    # ], [chmod +x rtest2/scripts/run.sh])
675    # AC_CONFIG_FILES([
676    #   rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in
677    # ], [chmod +x rtest2/scripts/run-one.sh])
678    
679  dnl  dnl
680  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
681  dnl  dnl
682  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
683  dnl  dnl
684    dnl where the options are taken from [debug, parallel]
685    dnl
686  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
687      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
688        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 563  Line 695 
695      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
696    ])    ])
697    
698  MK_BUILD_DIR(rt-c-f, c, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
699  MK_BUILD_DIR(rt-c-d, c, [double])  MK_BUILD_DIR(rt-seq-debug, sequential, [debug])
700  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])  MK_BUILD_DIR(rt-par, parallel, [parallel])
701  MK_BUILD_DIR(rt-c-d-debug, c, [double debug])  MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
702  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  
703  MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])  #if test x"$CL_ENABLED" = xtrue ; then
704  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])  #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
705  MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])  #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
706    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
707  if test x"$CL_ENABLED" = xtrue ; then  #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
708    MK_BUILD_DIR(rt-cl-f, cl, [float])  #fi
   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])  
 fi  
709    
710  AC_OUTPUT  AC_OUTPUT
711    
712    #################### end write output ####################

Legend:
Removed from v.2361  
changed lines
  Added in v.4110

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