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

revision 3351, Wed Oct 28 16:14:29 2015 UTC revision 4419, Wed Aug 17 12:49:55 2016 UTC
# Line 2  Line 2 
2  dnl  dnl
3  dnl This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)  dnl This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4  dnl  dnl
5  dnl COPYRIGHT (c) 2015 The University of Chicago  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,1.0,)  AC_INIT(diderot,1.0,)
10    
11  AC_PREREQ(2.60)  AC_PREREQ(2.60)
12  AC_COPYRIGHT([[COPYRIGHT (c) 2015 The University of Chicago]])  AC_COPYRIGHT([[COPYRIGHT (c) 2016 The University of Chicago]])
13  AC_CONFIG_SRCDIR(src/compiler/options/ctl.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)
# Line 17  Line 17 
17  dnl  dnl
18  dnl set the following to the name of the branch  dnl set the following to the name of the branch
19  dnl  dnl
20  BRANCH="master"  BRANCH="vis15"
21  AC_SUBST(BRANCH)  AC_SUBST(BRANCH)
22    
23  dnl  dnl
# Line 27  Line 27 
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 48  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="-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    
81  dnl extra C compiler options  dnl check to see if we need the explicitly instantiate templates (as required by gcc).
82  dnl  dnl
83  CFLAGS=""  case x"$CXX" in
84  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"    xclang*)
85  AC_SUBST(CFLAG_MXX)      EXPLICIT_TEMPLATES="false"
86  AC_SUBST(CFLAGS_BASE)      ;;
87      *)
88        CXXFLAGS_BASE="$CXXFLAGS_BASE -fno-implicit-templates"
89        EXPLICIT_TEMPLATES="true"
90        ;;
91    esac
92    
93    CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
94    AC_SUBST(CXXFLAG_Mxx)
95    AC_SUBST(CXXFLAGS_BASE)
96    AC_SUBST(EXPLICIT_TEMPLATES)
97    
98  dnl  dnl
99  dnl standard headers  dnl run the compiler tests in 64-bit mode
100    dnl
101    save_CFLAGS=$CFLAGS
102    CFLAGS="$CFLAGS $CFLAG_MXX"
103    
104    dnl
105    dnl check for gcc builtin atomic operations
106    dnl
107    AC_MSG_CHECKING([for builtin atomic operations])
108    AC_LINK_IFELSE(
109       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
110       AC_MSG_RESULT(yes)
111       AC_DEFINE(
112        [HAVE_BUILTIN_ATOMIC_OPS], 1,
113        [Define to 1 if gcc compiler provides atomic operations.]),
114       AC_MSG_RESULT(no))
115    
116    AC_C_BIGENDIAN
117    
118    #
119    # determine the sizes of the standard C types
120    AC_CHECK_SIZEOF([int])
121    SIZEOF_C_INT=$ac_cv_sizeof_int
122    AC_CHECK_SIZEOF([long])
123    SIZEOF_C_LONG=$ac_cv_sizeof_long
124    AC_CHECK_SIZEOF([float])
125    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
126    AC_CHECK_SIZEOF([double])
127    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
128    
129    AC_SUBST(SIZEOF_C_INT)
130    AC_SUBST(SIZEOF_C_LONG)
131    AC_SUBST(SIZEOF_C_FLOAT)
132    AC_SUBST(SIZEOF_C_DOUBLE)
133    
134    dnl
135    dnl restore CFLAGS
136    dnl
137    CFLAGS=$save_CFLAGS
138    
139    dnl
140    dnl check for <stdbool.h>, which we use in the C API
141  dnl  dnl
142  AC_HEADER_STDBOOL  AC_HEADER_STDBOOL
143    
144  dnl  dnl
145    dnl the C boolean type to use in generated library headers
146    dnl
147    if test x"$ac_cv_header_stdbool_h" = xyes ; then
148      BOOLTY="bool"
149    elif test "x$ac_cv_type__Bool" = xyes; then
150      BOOLTY="_Bool"
151    else
152      BOOLTY="int"
153    fi
154    AC_SUBST(BOOLTY)
155    
156    dnl
157  dnl check for pthreads support  dnl check for pthreads support
158  dnl  dnl
159  ACX_PTHREAD  ACX_PTHREAD
160    
161  dnl  dnl
162    dnl check for various library routines etc.
163    dnl
164    AC_CHECK_FUNCS(posix_memalign)
165    if test x"$ac_cv_func_posix_memalign" != xyes ; then
166      AC_CHECK_FUNCS(memalign)
167      if test x"$ac_cv_func_posix_memalign" != xyes ; then
168        AC_CHECK_FUNCS(valloc)
169      fi
170    fi
171    
172    AC_CHECK_FUNCS(mach_absolute_time)
173    AC_CHECK_TYPES([struct timespec])
174    AC_CHECK_FUNCS(pthread_barrier_init)
175    
176    dnl
177    dnl check for clock_gettime.  On Linux, this requires librt.
178    dnl
179    save_LIBS=$LIBS
180    LIBS="-lrt $LIBS"
181    AC_MSG_CHECKING([for clock_gettime])
182    AC_LINK_IFELSE(
183      [AC_LANG_PROGRAM(
184        [[#include <time.h>]],
185        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
186      [ ac_cv_func_clock_gettime=yes;
187        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
188      [ac_cv_func_clock_gettime=no])
189    AC_MSG_RESULT($ac_cv_func_clock_gettime)
190    if test "$ac_cv_func_clock_gettime" = "no" ; then
191      LIBS=$save_LIBS
192    fi
193    
194    AC_CHECK_FUNCS(pthread_getcpuclockid)
195    AC_CHECK_FUNCS(sigtimedwait nanosleep)
196    
197    dnl
198    dnl check for sched_setaffinity
199    dnl
200    AC_CHECK_FUNCS(sched_setaffinity)
201    
202    dnl
203    dnl check for pthread_setaffinity_np
204    dnl
205    save_LIBS=$LIBS
206    save_CFLAGS=$CFLAGS
207    LIBS="$PTHREAD_LIBS $LIBS"
208    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
209    AC_MSG_CHECKING([for pthread_setaffinity_np])
210    AC_LINK_IFELSE(
211      [AC_LANG_PROGRAM(
212        [[#include <pthread.h>]],
213        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
214      [ ac_cv_func_pthread_setaffinity_np=yes;
215        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
216      [ac_cv_func_pthread_setaffinity_np=no])
217    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
218    LIBS=$save_LIBS
219    CFLAGS=$save_CFLAGS
220    
221    dnl
222    dnl check for Linux NUMA support (libnuma)
223    dnl
224    AC_CHECK_LIB(numa,numa_available)
225    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
226      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
227    fi
228    
229    dnl check for /proc/cpuinfo
230    dnl
231    AC_CHECK_FILES(/proc/cpuinfo)
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    #################### CUDA configuration ####################
269    
270    AC_ARG_ENABLE([cuda],
271      AC_HELP_STRING([--enable-cuda], [include support for targeting CUDA]))
272    
273    if test "${enable_cuda+set}" = set ; then
274    dnl
275  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
276  dnl  dnl
277  AC_MSG_NOTICE([checking for CUDA and nvcc])  AC_MSG_NOTICE([checking for CUDA and nvcc])
# Line 90  Line 284 
284    AC_MSG_RESULT([$NVCC])    AC_MSG_RESULT([$NVCC])
285    CUDA_ENABLED=true    CUDA_ENABLED=true
286  fi  fi
287    else
288      NVCC=":"
289      CUDA_ENABLED=false
290    fi
291  AC_SUBST(NVCC)  AC_SUBST(NVCC)
292  AC_SUBST(CUDA_ENABLED)  AC_SUBST(CUDA_ENABLED)
293    
294    #################### end CUDA configuration ####################
295    
296    #################### OpenCL configuration ####################
297    
298    AC_ARG_ENABLE([opencl],
299      AC_HELP_STRING([--enable-opencl], [include support for targeting OpenCL]))
300    
301    if test "${enable_opencl+set}" = set ; then
302    
303  dnl  dnl
304  dnl check for OpenCL support  dnl check for OpenCL support
305  dnl  dnl
# Line 135  Line 342 
342          break          break
343        fi        fi
344      done      done
345      if test x"$CUDA" != xnone ; then        if test x"$CUDA_HOME" != xnone ; then
346        HAVE_CL_H="yes"        HAVE_CL_H="yes"
347        CL_HEADER="$CUDA_HOME/include/CL/cl.h"        CL_HEADER="$CUDA_HOME/include/CL/cl.h"
348        AC_DEFINE([HAVE_CL_CL_H])        AC_DEFINE([HAVE_CL_CL_H])
# Line 211  Line 418 
418    SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double    SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
419    fi    fi
420  fi  fi
421    else
422      CL_ENABLED=false
423      CL_VERSION="0"
424      SIZEOF_CL_INT="0"
425      SIZEOF_CL_LONG="0"
426      SIZEOF_CL_FLOAT="0"
427      SIZEOF_CL_DOUBLE="0"
428    fi
429    
430  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
431  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)
432  AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])  AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
# Line 220  Line 436 
436  AC_SUBST(SIZEOF_CL_FLOAT)  AC_SUBST(SIZEOF_CL_FLOAT)
437  AC_SUBST(SIZEOF_CL_DOUBLE)  AC_SUBST(SIZEOF_CL_DOUBLE)
438    
439  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  
   
 AC_CHECK_FUNCS(mach_absolute_time)  
 AC_CHECK_TYPES([struct timespec])  
 AC_CHECK_FUNCS(pthread_barrier_init)  
   
 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)  
440    
441  dnl  #################### Teem configuration ####################
 dnl check for sched_setaffinity  
 dnl  
 AC_CHECK_FUNCS(sched_setaffinity)  
442    
 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  
443  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
444  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
445  dnl compiler.  dnl compiler.
446  dnl  dnl
447    
448    dnl the path can be specified using "--with-teem=..." too
449    dnl
450  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
451    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
452    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
453    
454  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
455    dnl search for Teem in some standard places
456    dnl
457      AC_MSG_CHECKING([for teem])
458    TEEM_DIR=none    TEEM_DIR=none
459      POSSIBLE_TEEM_DIRS="/usr/local/teem /usr/local"
460      for dir in $POSSIBLE_TEEM_DIRS ; do
461        if test -f $dir/include/teem/nrrd.h ; then
462          TEEM_DIR=$dir
463          AC_MSG_RESULT([$TEEM_DIR])
464          break
465        fi
466      done
467      if test $TEEM_DIR = none ; then
468        AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
469      fi
470  else  else
471    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
472    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 350  Line 480 
480        AC_MSG_RESULT([yes])        AC_MSG_RESULT([yes])
481      else      else
482        TEEM_DIR=none        TEEM_DIR=none
483        AC_MSG_RESULT([no])        AC_MSG_RESULT([invalid path to teem])
484      fi      fi
485    else    else
486      TEEM_DIR=none      TEEM_DIR=none
487      AC_MSG_RESULT([no])      AC_MSG_RESULT([invalid path to teem])
488    fi    fi
489  fi  fi
490  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
491    AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])    AC_MSG_ERROR([unable to find teem])
492  fi  fi
493  dnl  dnl
494  dnl check that unu supports the dnorm command  dnl check that unu supports the dnorm command
495  dnl  dnl
 if test x"$TEEM_DIR" != xnone ; then  
496    AC_MSG_CHECKING([that \"unu dnorm\" works])    AC_MSG_CHECKING([that \"unu dnorm\" works])
497    if test -x $TEEM_DIR/bin/unu ; then    if test -x $TEEM_DIR/bin/unu ; then
498      $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null      $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null
# Line 375  Line 504 
504    else    else
505      AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])      AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])
506    fi    fi
507  fi  
508  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
509    
510  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
511    
512    #################### SML configuration ####################
513    
514    dnl
515    dnl We support building with both SML/NJ (the default) or MLton.
516  dnl  dnl
517    
518    dnl first check for --with-mlton=path flag
519    dnl
520    AC_ARG_WITH([mlton],
521      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
522        [use the MLton Standard ML compiler to build Diderot])],
523      [with_mlton=yes],[with_mlton=no])
524    if test x"$with_mlton" = xyes ; then
525      if test x"$ac_cv_path_with_mlton" = x ; then
526        # look for mlton in the PATH
527        AC_PATH_PROGS(with_mlton, mlton, no)
528        if test x"$MLTON" = xno ; then
529          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
530        fi
531      else
532        with_mlton=$ac_cv_path_with_mlton
533        case $with_mlton in
534          /*) ;;
535          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
536        esac
537        if test ! -x $with_mlton ; then
538          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
539        fi
540      fi
541    fi
542    
543    if test x"$with_mlton" = xno ; then
544      # we are using SML/NJ
545      #
546    
547  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
548  dnl  dnl
549  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])])
# Line 389  Line 552 
552  then  then
553    AC_MSG_ERROR([installation requires SML/NJ version 110.79+ (available from smlnj.org)])    AC_MSG_ERROR([installation requires SML/NJ version 110.79+ (available from smlnj.org)])
554  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
555    
556  dnl determine the heap-image suffix  dnl determine the heap-image suffix
557  dnl  dnl
# Line 398  Line 560 
560    
561  dnl look for ml-makedepend  dnl look for ml-makedepend
562  dnl  dnl
 AC_MSG_CHECKING([for ml-makedepend])  
563  tmpPATH="$SMLNJ_PATH:$PATH"  tmpPATH="$SMLNJ_PATH:$PATH"
564  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  
565  AC_SUBST(ML_MAKEDEPEND)  AC_SUBST(ML_MAKEDEPEND)
566    
567  dnl  dnl
# Line 417  Line 573 
573    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
574  fi  fi
575  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
576      SML=smlnj
577    
578  dnl ******************** Documentation tools ********************    HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
579      INSTALL_SMLNJ_WRAPPER=$DIDEROT_BINDIR/install-sml-wrapper.sh
580      AC_SUBST(HEAP_IMAGE_DIR)
581      AC_SUBST(INSTALL_SMLNJ_WRAPPER)
582    
583    else
584    
585      # we are using MLton
586      MLTON=$with_mlton
587      AC_SUBST(MLTON)
588      SML=mlton
589    
590    fi
591    AC_SUBST(SML)
592    
593    #################### end SML configuration ####################
594    
595    #################### Documentation tools configuration ####################
596    
597  dnl check for doxygen  dnl check for doxygen
598  dnl  dnl
599  AC_ARG_WITH([doxygen],  AC_ARG_WITH([doxygen],
600    [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],    [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
601    [DOXYGEN=$with_doxygen],    [DOXYGEN=$with_doxygen],
602    [DOXYGEN=none])    [DOXYGEN=none])
603  if test x$DOXYGEN = xnone ; then  if test x$DOXYGEN = xnone ; then
# Line 469  Line 643 
643  AC_SUBST(HIGHLIGHTER)  AC_SUBST(HIGHLIGHTER)
644  AC_SUBST(DBLATEX)  AC_SUBST(DBLATEX)
645    
646    #################### end Documentation tools configuration ####################
647    
648  dnl ******************** Paths ********************  #################### config.h ####################
649    
650  DIDEROT_ROOT=`pwd`  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
 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)  
   
 dnl  
 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])  
651    
652  AH_TOP([  AH_TOP([
653  /*  /*
654   * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)   * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
655   *   *
656   * COPYRIGHT (c) 2015 The University of Chicago * All rights reserved.   * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
657   */   */
658    
659  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 555  Line 662 
662  ])  ])
663  AH_BOTTOM([  AH_BOTTOM([
664    
 #ifdef NDEBUG  
 #define STATIC_INLINE   static inline  
 #else  
 #define STATIC_INLINE   static  
 #endif  
   
665  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
666  ])  ])
667    
668  dnl  #################### end config.h ####################
669  dnl ******************** write output ********************  
670  dnl  #################### write output ####################
671    
672    dnl The compiler Makefile depends on which SML system we are
673    dnl using.
674    if test x"$SML" = xmlton ; then
675      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
676    else
677      COMPILER_MAKEFILE_IN=""
678    fi
679    
680  AC_CONFIG_FILES(  AC_CONFIG_FILES(
681  dnl  dnl
# Line 575  Line 684 
684  dnl  doc/Makefile  dnl  doc/Makefile
685  dnl  doc/man/Makefile  dnl  doc/man/Makefile
686  dnl  src/clinfo/Makefile  dnl  src/clinfo/Makefile
687  dnl  src/compiler/Makefile    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
688  dnl  src/lib/build/Makefile    src/lib/build/Makefile
689  dnl  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
690  dnl  test/MIP/Makefile  dnl  test/MIP/Makefile
691  dnl  test/probe/Makefile  dnl  test/probe/Makefile
692  dnl  test/iso2d-polyline/Makefile  dnl  test/iso2d-polyline/Makefile
# Line 585  Line 694 
694  dnl  test/hlic/Makefile  dnl  test/hlic/Makefile
695  dnl  dnl
696  dnl ***** SML source files *****  dnl ***** SML source files *****
697  dnl  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
698    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
699    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
700    src/compiler/options/version.sml:src/compiler/options/version_sml.in    src/compiler/options/version.sml:src/compiler/options/version_sml.in
701  )  )
702    
703  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)
704    
705  dnl  dnl
706  dnl shell scripts  dnl shell scripts
# Line 599  Line 708 
708  AC_CONFIG_FILES([  AC_CONFIG_FILES([
709    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
710  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
711  # AC_CONFIG_FILES([  AC_CONFIG_FILES([
712  #   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
713  # ], [chmod +x src/compiler/gen/file2str/file2str.sh])  ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
714  # AC_CONFIG_FILES([  AC_CONFIG_FILES([
715  #   rtest/scripts/run.sh:rtest/scripts/run_sh.in    src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
716  # ], [chmod +x rtest/scripts/run.sh])  ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
717  # AC_CONFIG_FILES([  AC_CONFIG_FILES([
718  #   rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in    src/tests/rtest/scripts/run.sh:src/tests/rtest/scripts/run_sh.in
719  # ], [chmod +x rtest/scripts/run-one.sh])  ], [chmod +x src/tests/rtest/scripts/run.sh])
720    AC_CONFIG_FILES([
721      src/tests/rtest/scripts/run-one.sh:src/tests/rtest/scripts/run-one_sh.in
722    ], [chmod +x src/tests/rtest/scripts/run-one.sh])
723  #  #
724  # more regression tests; should merge with rtest at some point  # more regression tests; should merge with rtest at some point
725  #  #
# Line 623  Line 735 
735  dnl  dnl
736  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
737  dnl  dnl
738    dnl where the options are taken from [debug, parallel]
739    dnl
740  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
741      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
742        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 635  Line 749 
749      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
750    ])    ])
751    
752  #MK_BUILD_DIR(rt-c-f, c, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
753  #MK_BUILD_DIR(rt-c-d, c, [double])  MK_BUILD_DIR(rt-seq-debug, sequential, [debug])
754  #MK_BUILD_DIR(rt-c-f-debug, c, [float debug])  MK_BUILD_DIR(rt-par, parallel, [parallel])
755  #MK_BUILD_DIR(rt-c-d-debug, c, [double debug])  MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
 #MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  
 #MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])  
 #MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])  
 #MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])  
756    
757  #if test x"$CL_ENABLED" = xtrue ; then  #if test x"$CL_ENABLED" = xtrue ; then
758  #  MK_BUILD_DIR(rt-cl-f, cl, [float])  #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
759  #  MK_BUILD_DIR(rt-cl-d, cl, [double])  #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
760  #  MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug])  #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
761  #  MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug])  #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
762  #fi  #fi
763    
764  AC_OUTPUT  AC_OUTPUT
765    
766    #################### end write output ####################

Legend:
Removed from v.3351  
changed lines
  Added in v.4419

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