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 2111, Mon Dec 17 16:55:33 2012 UTC branches/vis15/configure.ac revision 4430, Thu Aug 18 23:15:00 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="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"
75  if test x"$ac_cv_prog_cc_c99" = xno ; then  
76    AC_MSG_ERROR([Diderot requires c99 support])  AC_ARG_ENABLE([32-bit],
77  fi    AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),
78      [CXXFLAG_Mxx="-m32"],
79      [CXXFLAG_Mxx="-m64"])
80    
81    CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
82    AC_SUBST(CXXFLAG_Mxx)
83    AC_SUBST(CXXFLAGS_BASE)
84    
 dnl extra C compiler options  
85  dnl  dnl
86  CFLAGS=""  dnl run the compiler tests in 64-bit mode
87  CFLAG_M64="-m64"  dnl
88  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"  save_CFLAGS=$CFLAGS
89  AC_SUBST(CFLAG_M64)  CFLAGS="$CFLAGS $CFLAG_MXX"
 AC_SUBST(CFLAGS_BASE)  
90    
91  dnl  dnl
92  dnl standard headers  dnl check for gcc builtin atomic operations
93    dnl
94    AC_MSG_CHECKING([for builtin atomic operations])
95    AC_LINK_IFELSE(
96       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
97       AC_MSG_RESULT(yes)
98       AC_DEFINE(
99        [HAVE_BUILTIN_ATOMIC_OPS], 1,
100        [Define to 1 if gcc compiler provides atomic operations.]),
101       AC_MSG_RESULT(no))
102    
103    AC_C_BIGENDIAN
104    
105    #
106    # determine the sizes of the standard C types
107    AC_CHECK_SIZEOF([int])
108    SIZEOF_C_INT=$ac_cv_sizeof_int
109    AC_CHECK_SIZEOF([long])
110    SIZEOF_C_LONG=$ac_cv_sizeof_long
111    AC_CHECK_SIZEOF([float])
112    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
113    AC_CHECK_SIZEOF([double])
114    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
115    
116    AC_SUBST(SIZEOF_C_INT)
117    AC_SUBST(SIZEOF_C_LONG)
118    AC_SUBST(SIZEOF_C_FLOAT)
119    AC_SUBST(SIZEOF_C_DOUBLE)
120    
121    dnl
122    dnl restore CFLAGS
123    dnl
124    CFLAGS=$save_CFLAGS
125    
126    dnl
127    dnl check for <stdbool.h>, which we use in the C API
128  dnl  dnl
129  AC_HEADER_STDBOOL  AC_HEADER_STDBOOL
130    
131  dnl  dnl
132    dnl the C boolean type to use in generated library headers
133    dnl
134    if test x"$ac_cv_header_stdbool_h" = xyes ; then
135      BOOLTY="bool"
136    elif test "x$ac_cv_type__Bool" = xyes; then
137      BOOLTY="_Bool"
138    else
139      BOOLTY="int"
140    fi
141    AC_SUBST(BOOLTY)
142    
143    dnl
144  dnl check for pthreads support  dnl check for pthreads support
145  dnl  dnl
146  ACX_PTHREAD  ACX_PTHREAD
147    
 dnl check for doxygen  
148  dnl  dnl
149  AC_ARG_WITH([doxygen],  dnl check for various library routines etc.
150    [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],  dnl
151    [DOXYGEN=$with_doxygen],  AC_CHECK_FUNCS(posix_memalign)
152    [DOXYGEN=none])  if test x"$ac_cv_func_posix_memalign" != xyes ; then
153  if test x$DOXYGEN = xnone ; then    AC_CHECK_FUNCS(memalign)
154    # see if we can find doxygen in the user's path    if test x"$ac_cv_func_posix_memalign" != xyes ; then
155    AC_PATH_PROG(DOXYGEN, [doxygen], [none])      AC_CHECK_FUNCS(valloc)
156  fi  fi
157  if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then  fi
158    AC_MSG_ERROR([--with-doxygen option must specify directory argument])  
159  elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then  AC_CHECK_FUNCS(mach_absolute_time)
160    AC_MSG_ERROR([doxygen not found at $DOXYGEN])  AC_CHECK_TYPES([struct timespec])
161  elif test x$DOXYGEN != xnone ; then  AC_CHECK_FUNCS(pthread_barrier_init)
162    
163  dnl  dnl
164  dnl verify that $DOXYGEN is an absolute path  dnl check for clock_gettime.  On Linux, this requires librt.
165  dnl  dnl
166    case $DOXYGEN in  save_LIBS=$LIBS
167      /*) ;;  LIBS="-lrt $LIBS"
168      *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;  AC_MSG_CHECKING([for clock_gettime])
169    esac  AC_LINK_IFELSE(
170      [AC_LANG_PROGRAM(
171        [[#include <time.h>]],
172        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
173      [ ac_cv_func_clock_gettime=yes;
174        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
175      [ac_cv_func_clock_gettime=no])
176    AC_MSG_RESULT($ac_cv_func_clock_gettime)
177    if test "$ac_cv_func_clock_gettime" = "no" ; then
178      LIBS=$save_LIBS
179  fi  fi
180  if test $DOXYGEN = xnone ; then  
181    DOXYGEN=:  AC_CHECK_FUNCS(pthread_getcpuclockid)
182    AC_CHECK_FUNCS(sigtimedwait nanosleep)
183    
184    dnl
185    dnl check for sched_setaffinity
186    dnl
187    AC_CHECK_FUNCS(sched_setaffinity)
188    
189    dnl
190    dnl check for pthread_setaffinity_np
191    dnl
192    save_LIBS=$LIBS
193    save_CFLAGS=$CFLAGS
194    LIBS="$PTHREAD_LIBS $LIBS"
195    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
196    AC_MSG_CHECKING([for pthread_setaffinity_np])
197    AC_LINK_IFELSE(
198      [AC_LANG_PROGRAM(
199        [[#include <pthread.h>]],
200        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
201      [ ac_cv_func_pthread_setaffinity_np=yes;
202        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
203      [ac_cv_func_pthread_setaffinity_np=no])
204    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
205    LIBS=$save_LIBS
206    CFLAGS=$save_CFLAGS
207    
208    dnl
209    dnl check for Linux NUMA support (libnuma)
210    dnl
211    AC_CHECK_LIB(numa,numa_available)
212    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
213      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
214  fi  fi
 AC_SUBST(DOXYGEN)  
215    
216    dnl check for /proc/cpuinfo
217    dnl
218    AC_CHECK_FILES(/proc/cpuinfo)
219    
220    dnl
221    dnl OS-specific linking issues
222    dnl
223    LD_NEEDS_RPATH=false;
224    LIBM=""
225    case "$host_os" in
226      darwin*) # On Mac OS X we check for the presence of macports and/or fink
227        if test -x /opt/local/bin/port ; then
228          HAS_MACPORTS=yes
229        else
230          HAS_MACPORTS=no
231        fi
232        if test -x /sw/bin/fink ; then
233          HAS_FINK=yes
234        else
235          HAS_FINK=no
236        fi
237      ;;
238      linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
239        LD_NEEDS_RPATH=true
240        LIBM="-lm"
241      ;;
242    esac
243    
244    if test x"$HAS_MACPORTS" = xyes ; then
245      LDPATHS="-L/opt/local/lib"
246    elif test x"$HAS_FINK" = xyes ; then
247      LDPATHS="-L/sw/lib"
248    else
249      LDPATHS=""
250    fi
251    AC_SUBST(LDPATHS)
252    AC_SUBST(LD_NEEDS_RPATH)
253    AC_SUBST(LIBM)
254    
255    #################### CUDA configuration ####################
256    
257    AC_ARG_ENABLE([cuda],
258      AC_HELP_STRING([--enable-cuda], [include support for targeting CUDA]))
259    
260    if test "${enable_cuda+set}" = set ; then
261  dnl  dnl
262  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
263  dnl  dnl
# Line 106  Line 271 
271    AC_MSG_RESULT([$NVCC])    AC_MSG_RESULT([$NVCC])
272    CUDA_ENABLED=true    CUDA_ENABLED=true
273  fi  fi
274    else
275      NVCC=":"
276      CUDA_ENABLED=false
277    fi
278  AC_SUBST(NVCC)  AC_SUBST(NVCC)
279  AC_SUBST(CUDA_ENABLED)  AC_SUBST(CUDA_ENABLED)
280    
281    #################### end CUDA configuration ####################
282    
283    #################### OpenCL configuration ####################
284    
285    AC_ARG_ENABLE([opencl],
286      AC_HELP_STRING([--enable-opencl], [include support for targeting OpenCL]))
287    
288    if test "${enable_opencl+set}" = set ; then
289    
290  dnl  dnl
291  dnl check for OpenCL support  dnl check for OpenCL support
292  dnl  dnl
# Line 142  Line 320 
320      AC_MSG_RESULT([$HAVE_CL_H])      AC_MSG_RESULT([$HAVE_CL_H])
321    fi    fi
322    if test x"$HAVE_CL_H" = xno ; then    if test x"$HAVE_CL_H" = xno ; then
323          # check for NVIDIA's SDK
324          AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
325          CUDA_HOME=none
326          for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
327            if test -d /usr/local/$CUDA/include/CL ; then
328              CUDA_HOME=/usr/local/$CUDA
329              break
330            fi
331          done
332          if test x"$CUDA_HOME" != xnone ; then
333            HAVE_CL_H="yes"
334            CL_HEADER="$CUDA_HOME/include/CL/cl.h"
335            AC_DEFINE([HAVE_CL_CL_H])
336            CPPFLAGS_CL="-I$CUDA_HOME/include"
337          fi
338          AC_MSG_RESULT([$HAVE_CL_H])
339        fi
340        if test x"$HAVE_CL_H" = xno ; then
341      AC_MSG_WARN([no cl.h found])      AC_MSG_WARN([no cl.h found])
342      CL_ENABLED=false      CL_ENABLED=false
343      CL_VERSION=0      CL_VERSION=0
# Line 163  Line 359 
359  # else  # else
360  #   error no cl.h  #   error no cl.h
361  # endif]],  # endif]],
362  [[#if defined(CL_VERSION_1_1)  [[#if defined(CL_VERSION_1_2)
363    printf("11000\n");    printf("120\n");
364    #elif defined(CL_VERSION_1_1)
365      printf("110\n");
366  #elif defined(CL_VERSION_1_0)  #elif defined(CL_VERSION_1_0)
367    printf("10000\n");    printf("100\n");
368  #else  #else
369    printf("0\n");    printf("0\n");
370  #endif  #endif
# Line 207  Line 405 
405    SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double    SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
406    fi    fi
407  fi  fi
408    else
409      CL_ENABLED=false
410      CL_VERSION="0"
411      SIZEOF_CL_INT="0"
412      SIZEOF_CL_LONG="0"
413      SIZEOF_CL_FLOAT="0"
414      SIZEOF_CL_DOUBLE="0"
415    fi
416    
417  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
418  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)
419    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
420    
421  AC_SUBST(SIZEOF_CL_INT)  AC_SUBST(SIZEOF_CL_INT)
422  AC_SUBST(SIZEOF_CL_LONG)  AC_SUBST(SIZEOF_CL_LONG)
423  AC_SUBST(SIZEOF_CL_FLOAT)  AC_SUBST(SIZEOF_CL_FLOAT)
424  AC_SUBST(SIZEOF_CL_DOUBLE)  AC_SUBST(SIZEOF_CL_DOUBLE)
425    
426  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)  
   
 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  
427    
428  dnl  #################### Teem configuration ####################
 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  
429    
430  dnl check for /proc/cpuinfo  dnl get the path to the TEEM installation.  We need this to build the Diderot
431    dnl runtime code and we use the path when searching for teem in the Diderot
432    dnl compiler.
433  dnl  dnl
 AC_CHECK_FILES(/proc/cpuinfo)  
434    
435  dnl  dnl the path can be specified using "--with-teem=..." too
 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  
436  dnl  dnl
437  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
438    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
439    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
440    
441  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
442    dnl search for Teem in some standard places
443    dnl
444      AC_MSG_CHECKING([for teem])
445    TEEM_DIR=none    TEEM_DIR=none
446      POSSIBLE_TEEM_DIRS="/usr/local/teem /usr/local"
447      for dir in $POSSIBLE_TEEM_DIRS ; do
448        if test -f $dir/include/teem/nrrd.h ; then
449          TEEM_DIR=$dir
450          AC_MSG_RESULT([$TEEM_DIR])
451          break
452        fi
453      done
454      if test $TEEM_DIR = none ; then
455        AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
456      fi
457  else  else
458    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
459    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 340  Line 464 
464      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
465      # check that TEEM_DIR actually points to something that looks like teem      # check that TEEM_DIR actually points to something that looks like teem
466      if test -f $TEEM_DIR/include/teem/nrrd.h ; then      if test -f $TEEM_DIR/include/teem/nrrd.h ; then
467        AC_MSG_RESULT([ okay])        AC_MSG_RESULT([yes])
468      else      else
469        TEEM_DIR=none        TEEM_DIR=none
470        AC_MSG_RESULT([ invalid])        AC_MSG_RESULT([invalid path to teem])
471      fi      fi
472    else    else
473      TEEM_DIR=none      TEEM_DIR=none
474      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([invalid path to teem])
475    fi    fi
476  fi  fi
477  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
478    AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])    AC_MSG_ERROR([unable to find teem])
479  fi  fi
480    dnl
481    dnl check that teem supports the nrrdMetaDataNormalize function
482    dnl
483    save_LDFLAGS=$LDFLAGS
484    save_LIBS=$LIBS
485    LDFLAGS="$LDFLAGS -L$TEEM_DIR/lib"
486    LIBS="$LIBS -lteem"
487    AC_CHECK_FUNCS([nrrdMetaDataNormalize])
488    LDFLAGS=$save_LDFLAGS
489    LIBS=$save_LIBS
490    
491    dnl
492    dnl check that unu supports the dnorm command
493    dnl
494    AC_MSG_CHECKING([that \"unu dnorm\" works])
495    if test -x $TEEM_DIR/bin/unu ; then
496      $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null
497      if test $? -eq 0 ; then
498        AC_MSG_RESULT([yes])
499      else
500        AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation])
501      fi
502    else
503      AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])
504    fi
505    
506  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
507    
508  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
509    
510    #################### SML configuration ####################
511    
512  dnl  dnl
513    dnl We support building with both SML/NJ (the default) or MLton.
514    dnl
515    
516    dnl first check for --with-mlton=path flag
517    dnl
518    AC_ARG_WITH([mlton],
519      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
520        [use the MLton Standard ML compiler to build Diderot])],
521      [with_mlton=yes],[with_mlton=no])
522    if test x"$with_mlton" = xyes ; then
523      if test x"$ac_cv_path_with_mlton" = x ; then
524        # look for mlton in the PATH
525        AC_PATH_PROGS(with_mlton, mlton, no)
526        if test x"$MLTON" = xno ; then
527          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
528        fi
529      else
530        with_mlton=$ac_cv_path_with_mlton
531        case $with_mlton in
532          /*) ;;
533          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
534        esac
535        if test ! -x $with_mlton ; then
536          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
537        fi
538      fi
539    fi
540    
541    if test x"$with_mlton" = xno ; then
542      # we are using SML/NJ
543      #
544    
545  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
546  dnl  dnl
547  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])])
548  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
549    -o $SMLNJ_MINOR_VERSION -lt 73      -o $SMLNJ_MINOR_VERSION -lt 79
550  then  then
551    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])      AC_MSG_ERROR([installation requires SML/NJ version 110.79+ (available from smlnj.org)])
552  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
553    
554  dnl determine the heap-image suffix  dnl determine the heap-image suffix
555  dnl  dnl
# Line 375  Line 558 
558    
559  dnl look for ml-makedepend  dnl look for ml-makedepend
560  dnl  dnl
 AC_MSG_CHECKING([for ml-makedepend])  
561  tmpPATH="$SMLNJ_PATH:$PATH"  tmpPATH="$SMLNJ_PATH:$PATH"
562  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  
563  AC_SUBST(ML_MAKEDEPEND)  AC_SUBST(ML_MAKEDEPEND)
564    
565  dnl  dnl
# Line 394  Line 571 
571    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
572  fi  fi
573  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
574      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  
575    
576  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
577  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)  
578  AC_SUBST(HEAP_IMAGE_DIR)  AC_SUBST(HEAP_IMAGE_DIR)
579  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
580    
581  dnl  else
 dnl ******************** C compiler properties ********************  
 dnl  
582    
583  dnl    # we are using MLton
584  dnl run the compiler tests in 64-bit mode    MLTON=$with_mlton
585  dnl    AC_SUBST(MLTON)
586  save_CFLAGS=$CFLAGS    SML=mlton
 CFLAGS="$CFLAGS $CFLAG_M64"  
587    
588  dnl  fi
589  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  
590    
591  #  #################### 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  
592    
593  AC_SUBST(SIZEOF_C_INT)  #################### Documentation tools configuration ####################
 AC_SUBST(SIZEOF_C_LONG)  
 AC_SUBST(SIZEOF_C_FLOAT)  
 AC_SUBST(SIZEOF_C_DOUBLE)  
594    
595    dnl check for doxygen
596  dnl  dnl
597  dnl restore CFLAGS  AC_ARG_WITH([doxygen],
598      [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
599      [DOXYGEN=$with_doxygen],
600      [DOXYGEN=none])
601    if test x$DOXYGEN = xnone ; then
602      # see if we can find doxygen in the user's path
603      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
604    fi
605    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
606      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
607    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
608      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
609    elif test x$DOXYGEN != xnone ; then
610  dnl  dnl
611  CFLAGS=$save_CFLAGS  dnl verify that $DOXYGEN is an absolute path
612    dnl
613      case $DOXYGEN in
614        /*) ;;
615        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
616      esac
617    fi
618    if test $DOXYGEN = xnone ; then
619      DOXYGEN=:
620    fi
621    AC_SUBST(DOXYGEN)
622    
623    dnl check for asciidoc and related tools
624  dnl  dnl
625  dnl ******************** config.h stuff ********************  AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
626    AC_PATH_PROGS([A2X], [a2x], [none])
627    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
628    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
629    
630    dnl
631    dnl get the path to the asciidoc cofiguration files
632  dnl  dnl
633    if test x"$ASCIIDOC" != xnone ; then
634      AC_MSG_CHECKING([path to asciidoc configuration files])
635      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
636      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
637    fi
638    AC_SUBST(ASCIIDOC)
639    AC_SUBST(A2X)
640    AC_SUBST(ASCIIDOC_CONF_DIR)
641    AC_SUBST(HIGHLIGHTER)
642    AC_SUBST(DBLATEX)
643    
644    #################### end Documentation tools configuration ####################
645    
646  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])  #################### config.h ####################
647    
648    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
649    
650  AH_TOP([  AH_TOP([
651  /*  /*
652   * 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)
653   * All rights reserved.   *
654     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
655   */   */
656    
657  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 479  Line 660 
660  ])  ])
661  AH_BOTTOM([  AH_BOTTOM([
662    
 #ifdef NDEBUG  
 #define STATIC_INLINE   static inline  
 #else  
 #define STATIC_INLINE   static  
 #endif  
   
663  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
664  ])  ])
665    
666  dnl  #################### end config.h ####################
667  dnl ******************** write output ********************  
668  dnl  #################### write output ####################
669    
670    dnl The compiler Makefile depends on which SML system we are
671    dnl using.
672    if test x"$SML" = xmlton ; then
673      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
674    else
675      COMPILER_MAKEFILE_IN=""
676    fi
677    
678  AC_CONFIG_FILES(  AC_CONFIG_FILES(
679  dnl  dnl
680  dnl ***** Makefiles *****  dnl ***** Makefiles *****
681    Makefile    Makefile
682    doc/Makefile  dnl  doc/Makefile
683    src/clinfo/Makefile  dnl  doc/man/Makefile
684    src/dnorm/Makefile  dnl  src/clinfo/Makefile
685    src/compiler/Makefile    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
686    src/lib/build/Makefile    src/lib/build/Makefile
687    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
688    test/MIP/Makefile  dnl  test/MIP/Makefile
689    test/probe/Makefile  dnl  test/probe/Makefile
690    test/iso2d-polyline/Makefile  dnl  test/iso2d-polyline/Makefile
691    test/vr-lite-cam/Makefile  dnl  test/vr-lite-cam/Makefile
692    test/hlic/Makefile  dnl  test/hlic/Makefile
693  dnl  dnl
694  dnl ***** SML source files *****  dnl ***** SML source files *****
695    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
696    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
697    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
698      src/compiler/options/version.sml:src/compiler/options/version_sml.in
699  )  )
700    
701  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)
702    
703  dnl  dnl
704  dnl shell scripts  dnl shell scripts
# Line 523  Line 707 
707    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
708  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
709  AC_CONFIG_FILES([  AC_CONFIG_FILES([
710    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
711  ], [chmod +x src/compiler/gen/file2str/file2str.sh])  ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
712  AC_CONFIG_FILES([  AC_CONFIG_FILES([
713    rtest/scripts/run.sh:rtest/scripts/run_sh.in    src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
714  ], [chmod +x rtest/scripts/run.sh])  ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
715  AC_CONFIG_FILES([  AC_CONFIG_FILES([
716    rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in    src/tests/rtest/scripts/run.sh:src/tests/rtest/scripts/run_sh.in
717  ], [chmod +x rtest/scripts/run-one.sh])  ], [chmod +x src/tests/rtest/scripts/run.sh])
718    AC_CONFIG_FILES([
719      src/tests/rtest/scripts/run-one.sh:src/tests/rtest/scripts/run-one_sh.in
720    ], [chmod +x src/tests/rtest/scripts/run-one.sh])
721    #
722    # more regression tests; should merge with rtest at some point
723    #
724    # AC_CONFIG_FILES([
725    #   rtest2/scripts/run.sh:rtest2/scripts/run_sh.in
726    # ], [chmod +x rtest2/scripts/run.sh])
727    # AC_CONFIG_FILES([
728    #   rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in
729    # ], [chmod +x rtest2/scripts/run-one.sh])
730    
731  dnl  dnl
732  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
733  dnl  dnl
734  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
735  dnl  dnl
736    dnl where the options are taken from [debug, parallel]
737    dnl
738  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
739      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
740        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 549  Line 747 
747      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
748    ])    ])
749    
750  MK_BUILD_DIR(rt-c-f, c, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
751  MK_BUILD_DIR(rt-c-d, c, [double])  MK_BUILD_DIR(rt-seq-debug, sequential, [debug])
752  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])  MK_BUILD_DIR(rt-par, parallel, [parallel])
753  MK_BUILD_DIR(rt-c-d-debug, c, [double debug])  MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
754  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  
755  MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])  #if test x"$CL_ENABLED" = xtrue ; then
756  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])  #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
757  MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])  #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
758    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
759  if test x"$CL_ENABLED" = xtrue ; then  #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
760    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  
761    
762  AC_OUTPUT  AC_OUTPUT
763    
764    #################### end write output ####################

Legend:
Removed from v.2111  
changed lines
  Added in v.4430

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