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 2430, Thu Sep 19 21:41:27 2013 UTC branches/vis15/configure.ac revision 4419, Wed Aug 17 12:49:55 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) 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/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="-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 check to see if we need the explicitly instantiate templates (as required by gcc).
82    dnl
83    case x"$CXX" in
84      xclang*)
85        EXPLICIT_TEMPLATES="false"
86        ;;
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    
 dnl extra C compiler options  
98  dnl  dnl
99  CFLAGS=""  dnl run the compiler tests in 64-bit mode
100  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"  dnl
101  AC_SUBST(CFLAG_MXX)  save_CFLAGS=$CFLAGS
102  AC_SUBST(CFLAGS_BASE)  CFLAGS="$CFLAGS $CFLAG_MXX"
103    
104  dnl  dnl
105  dnl standard headers  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    
 dnl check for doxygen  
161  dnl  dnl
162  AC_ARG_WITH([doxygen],  dnl check for various library routines etc.
163    [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],  dnl
164    [DOXYGEN=$with_doxygen],  AC_CHECK_FUNCS(posix_memalign)
165    [DOXYGEN=none])  if test x"$ac_cv_func_posix_memalign" != xyes ; then
166  if test x$DOXYGEN = xnone ; then    AC_CHECK_FUNCS(memalign)
167    # see if we can find doxygen in the user's path    if test x"$ac_cv_func_posix_memalign" != xyes ; then
168    AC_PATH_PROG(DOXYGEN, [doxygen], [none])      AC_CHECK_FUNCS(valloc)
169  fi  fi
170  if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then  fi
171    AC_MSG_ERROR([--with-doxygen option must specify directory argument])  
172  elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then  AC_CHECK_FUNCS(mach_absolute_time)
173    AC_MSG_ERROR([doxygen not found at $DOXYGEN])  AC_CHECK_TYPES([struct timespec])
174  elif test x$DOXYGEN != xnone ; then  AC_CHECK_FUNCS(pthread_barrier_init)
175    
176  dnl  dnl
177  dnl verify that $DOXYGEN is an absolute path  dnl check for clock_gettime.  On Linux, this requires librt.
178  dnl  dnl
179    case $DOXYGEN in  save_LIBS=$LIBS
180      /*) ;;  LIBS="-lrt $LIBS"
181      *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;  AC_MSG_CHECKING([for clock_gettime])
182    esac  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  fi
193  if test $DOXYGEN = xnone ; then  
194    DOXYGEN=:  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  fi
 AC_SUBST(DOXYGEN)  
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  dnl
275  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
276  dnl  dnl
# Line 110  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 148  Line 335 
335    if test x"$HAVE_CL_H" = xno ; then    if test x"$HAVE_CL_H" = xno ; then
336      # check for NVIDIA's SDK      # check for NVIDIA's SDK
337      AC_MSG_CHECKING([for NVIDIA's SDK cl.h])      AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
338      if test -d /usr/local/cuda/include/CL ; then        CUDA_HOME=none
339          for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
340            if test -d /usr/local/$CUDA/include/CL ; then
341              CUDA_HOME=/usr/local/$CUDA
342              break
343            fi
344          done
345          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"
348        AC_DEFINE([HAVE_CL_CL_H])        AC_DEFINE([HAVE_CL_CL_H])
349        CPPFLAGS_CL="-I/usr/local/cuda/include"          CPPFLAGS_CL="-I$CUDA_HOME/include"
350      fi      fi
351      AC_MSG_RESULT([$HAVE_CL_H])      AC_MSG_RESULT([$HAVE_CL_H])
352    fi    fi
# Line 177  Line 372 
372  # else  # else
373  #   error no cl.h  #   error no cl.h
374  # endif]],  # endif]],
375  [[#if defined(CL_VERSION_1_1)  [[#if defined(CL_VERSION_1_2)
376    printf("11000\n");    printf("120\n");
377    #elif defined(CL_VERSION_1_1)
378      printf("110\n");
379  #elif defined(CL_VERSION_1_0)  #elif defined(CL_VERSION_1_0)
380    printf("10000\n");    printf("100\n");
381  #else  #else
382    printf("0\n");    printf("0\n");
383  #endif  #endif
# Line 221  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])
433    
434  AC_SUBST(SIZEOF_CL_INT)  AC_SUBST(SIZEOF_CL_INT)
435  AC_SUBST(SIZEOF_CL_LONG)  AC_SUBST(SIZEOF_CL_LONG)
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  
440    
441  AC_CHECK_FUNCS(mach_absolute_time)  #################### Teem configuration ####################
 AC_CHECK_TYPES([struct timespec])  
 AC_CHECK_FUNCS(pthread_barrier_init)  
442    
 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  
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 356  Line 477 
477      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
478      # check that TEEM_DIR actually points to something that looks like teem      # check that TEEM_DIR actually points to something that looks like teem
479      if test -f $TEEM_DIR/include/teem/nrrd.h ; then      if test -f $TEEM_DIR/include/teem/nrrd.h ; then
480        AC_MSG_RESULT([ okay])        AC_MSG_RESULT([yes])
481      else      else
482        TEEM_DIR=none        TEEM_DIR=none
483        AC_MSG_RESULT([ invalid])        AC_MSG_RESULT([invalid path to teem])
484      fi      fi
485    else    else
486      TEEM_DIR=none      TEEM_DIR=none
487      AC_MSG_RESULT([ invalid])      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
493    dnl
494    dnl check that unu supports the dnorm command
495    dnl
496    AC_MSG_CHECKING([that \"unu dnorm\" works])
497    if test -x $TEEM_DIR/bin/unu ; then
498      $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null
499      if test $? -eq 0 ; then
500        AC_MSG_RESULT([yes])
501      else
502        AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation])
503  fi  fi
504    else
505      AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])
506    fi
507    
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])])
550  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
551    -o $SMLNJ_MINOR_VERSION -lt 74      -o $SMLNJ_MINOR_VERSION -lt 79
552  then  then
553    AC_MSG_ERROR([installation requires SML/NJ version 110.74+])      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 391  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 410  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
 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  
577    
578  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
579  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)  
580  AC_SUBST(HEAP_IMAGE_DIR)  AC_SUBST(HEAP_IMAGE_DIR)
581  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
582    
583  dnl  else
 dnl ******************** C compiler properties ********************  
 dnl  
584    
585  dnl    # we are using MLton
586  dnl run the compiler tests in 64-bit mode    MLTON=$with_mlton
587  dnl    AC_SUBST(MLTON)
588  save_CFLAGS=$CFLAGS    SML=mlton
 CFLAGS="$CFLAGS $CFLAG_MXX"  
589    
590  dnl  fi
591  dnl check for gcc builtin atomic operations  AC_SUBST(SML)
 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  
592    
593  #  #################### end 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  
594    
595  AC_SUBST(SIZEOF_C_INT)  #################### Documentation tools configuration ####################
 AC_SUBST(SIZEOF_C_LONG)  
 AC_SUBST(SIZEOF_C_FLOAT)  
 AC_SUBST(SIZEOF_C_DOUBLE)  
596    
597    dnl check for doxygen
598  dnl  dnl
599  dnl restore CFLAGS  AC_ARG_WITH([doxygen],
600      [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
601      [DOXYGEN=$with_doxygen],
602      [DOXYGEN=none])
603    if test x$DOXYGEN = xnone ; then
604      # see if we can find doxygen in the user's path
605      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
606    fi
607    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
608      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
609    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
610      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
611    elif test x$DOXYGEN != xnone ; then
612  dnl  dnl
613  CFLAGS=$save_CFLAGS  dnl verify that $DOXYGEN is an absolute path
614    dnl
615      case $DOXYGEN in
616        /*) ;;
617        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
618      esac
619    fi
620    if test $DOXYGEN = xnone ; then
621      DOXYGEN=:
622    fi
623    AC_SUBST(DOXYGEN)
624    
625    dnl check for asciidoc and related tools
626  dnl  dnl
627  dnl ******************** config.h stuff ********************  AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
628    AC_PATH_PROGS([A2X], [a2x], [none])
629    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
630    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
631    
632    dnl
633    dnl get the path to the asciidoc cofiguration files
634  dnl  dnl
635    if test x"$ASCIIDOC" != xnone ; then
636      AC_MSG_CHECKING([path to asciidoc configuration files])
637      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
638      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
639    fi
640    AC_SUBST(ASCIIDOC)
641    AC_SUBST(A2X)
642    AC_SUBST(ASCIIDOC_CONF_DIR)
643    AC_SUBST(HIGHLIGHTER)
644    AC_SUBST(DBLATEX)
645    
646    #################### end Documentation tools configuration ####################
647    
648  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])  #################### config.h ####################
649    
650    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
651    
652  AH_TOP([  AH_TOP([
653  /*  /*
654   * 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)
655   * All rights reserved.   *
656     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
657   */   */
658    
659  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 495  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
682  dnl ***** Makefiles *****  dnl ***** Makefiles *****
683    Makefile    Makefile
684    doc/Makefile  dnl  doc/Makefile
685    src/clinfo/Makefile  dnl  doc/man/Makefile
686    src/compiler/Makefile  dnl  src/clinfo/Makefile
687      src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
688    src/lib/build/Makefile    src/lib/build/Makefile
689    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    test/MIP/Makefile  dnl  test/MIP/Makefile
691    test/probe/Makefile  dnl  test/probe/Makefile
692    test/iso2d-polyline/Makefile  dnl  test/iso2d-polyline/Makefile
693    test/vr-lite-cam/Makefile  dnl  test/vr-lite-cam/Makefile
694    test/hlic/Makefile  dnl  test/hlic/Makefile
695  dnl  dnl
696  dnl ***** SML source files *****  dnl ***** SML source files *****
697    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
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 538  Line 709 
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
725    #
726    # AC_CONFIG_FILES([
727    #   rtest2/scripts/run.sh:rtest2/scripts/run_sh.in
728    # ], [chmod +x rtest2/scripts/run.sh])
729    # AC_CONFIG_FILES([
730    #   rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in
731    # ], [chmod +x rtest2/scripts/run-one.sh])
732    
733  dnl  dnl
734  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
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 564  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])
756  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  
757  MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])  #if test x"$CL_ENABLED" = xtrue ; then
758  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])  #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
759  MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])  #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
760    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
761  if test x"$CL_ENABLED" = xtrue ; then  #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
762    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  
763    
764  AC_OUTPUT  AC_OUTPUT
765    
766    #################### end write output ####################

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

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