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 1843, Sat Apr 14 00:40:58 2012 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) 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  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  CFLAG_M64="-m64"    xclang*)
85  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"      EXPLICIT_TEMPLATES="false"
86  AC_SUBST(CFLAG_M64)      ;;
87  AC_SUBST(CFLAGS_BASE)    *)
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  dnl
101  AC_HEADER_STDBOOL  save_CFLAGS=$CFLAGS
102    CFLAGS="$CFLAGS $CFLAG_MXX"
103    
104  dnl  dnl
105  dnl check for pthreads support  dnl check for gcc builtin atomic operations
106  dnl  dnl
107  ACX_PTHREAD  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    
 dnl check for doxygen  
 dnl  
 AC_ARG_WITH([doxygen],  
   [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],  
   [DOXYGEN=$with_doxygen],  
   [DOXYGEN=none])  
 if test x$DOXYGEN = xnone ; then  
   # see if we can find doxygen in the user's path  
   AC_PATH_PROG(DOXYGEN, [doxygen], [none])  
 fi  
 if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then  
   AC_MSG_ERROR([--with-doxygen option must specify directory argument])  
 elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then  
   AC_MSG_ERROR([doxygen not found at $DOXYGEN])  
 elif test x$DOXYGEN != xnone ; then  
134  dnl  dnl
135  dnl verify that $DOXYGEN is an absolute path  dnl restore CFLAGS
136  dnl  dnl
137    case $DOXYGEN in  CFLAGS=$save_CFLAGS
     /*) ;;  
     *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;  
   esac  
 fi  
 if test $DOXYGEN = xnone ; then  
   DOXYGEN=:  
 fi  
 AC_SUBST(DOXYGEN)  
138    
139  dnl  dnl
140  dnl Look for NVIDIA's nvcc compiler  dnl check for <stdbool.h>, which we use in the C API
141  dnl  dnl
142  AC_MSG_NOTICE([checking for CUDA and nvcc])  AC_HEADER_STDBOOL
 AC_PATH_PROG(NVCC, nvcc, no, $PATH)  
 if test x"$NVCC" = xno ; then  
   AC_MSG_WARN([nvcc not found])  
   CUDA_ENABLED=false  
   NVCC=":"  
 else  
   AC_MSG_RESULT([$NVCC])  
   CUDA_ENABLED=true  
 fi  
 AC_SUBST(NVCC)  
 AC_SUBST(CUDA_ENABLED)  
143    
144  dnl  dnl
145  dnl check for OpenCL support  dnl the C boolean type to use in generated library headers
146  dnl  dnl
147  LIBS_CL="none"  if test x"$ac_cv_header_stdbool_h" = xyes ; then
148  case "$host_os" in    BOOLTY="bool"
149    darwin*) # On Mac OS X we check for installed frameworks  elif test "x$ac_cv_type__Bool" = xyes; then
150      AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])    BOOLTY="_Bool"
   ;;  
   *)  
     AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])  
   ;;  
 esac  
 if test x"$LIBS_CL" = xnone ; then  
   AC_MSG_WARN([no OpenCL library found])  
   CL_ENABLED=false  
   CL_VERSION=0  
151  else  else
152    CL_ENABLED=true    BOOLTY="int"
   CPPFLAGS_CL=""  
   AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"], [HAVE_CL_H="no"])  
   if test x"$HAVE_CL_H" = xno ; then  
     # check for AMD's SDK  
     AC_MSG_CHECKING([for cl.h in AMD's SDK])  
     if test -d /opt/AMDAPP/include/CL ; then  
       HAVE_CL_H="yes"  
       AC_DEFINE([HAVE_CL_CL_H])  
       CPPFLAGS_CL="-I/opt/AMDAPP/include"  
153      fi      fi
154      AC_MSG_RESULT([$HAVE_CL_H])  AC_SUBST(BOOLTY)
155    fi  
   if test x"$HAVE_CL_H" = xno ; then  
     AC_MSG_WARN([no cl.h found])  
     CL_ENABLED=false  
     CL_VERSION=0  
   else  
     # check the cl.h header for which version of OpenCL is supported  
     AC_LANG([C])  
     save_CPPFLAGS=$CPPFLAGS  
     CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"  
     AC_LINK_IFELSE([AC_LANG_PROGRAM([[  
 #include <stdio.h>  
 # ifdef HAVE_CL_CL_H  
 #   include <CL/cl.h>  
 # elif defined(HAVE_OPENCL_CL_H)  
 #   include <OpenCL/cl.h>  
 # else  
 #   error no cl.h  
 # endif]],  
 [[#if defined(CL_VERSION_1_1)  
   printf("11000\n");  
 #elif defined(CL_VERSION_1_0)  
   printf("10000\n");  
 #else  
   printf("0\n");  
 #endif  
       ]])],  
       [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])  
 dnl  
 dnl check to see how we access the host-side vector types.  For OpenCL 1.1,  
 dnl the specification specifies the behavior, but it was unspecified in 1.0.  
 dnl  
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[  
 # ifdef HAVE_CL_CL_H  
 #   include <CL/cl.h>  
 # elif defined(HAVE_OPENCL_CL_H)  
 #   include <OpenCL/cl.h>  
 # else  
 #   error no cl.h  
 # endif]],  
       [[cl_float4 x; x[0] = 0.0;]])],  
       [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],  
156  dnl  dnl
157  dnl not arrays, so try the OpenCL 1.1 structure representation  dnl check for pthreads support
158  dnl  dnl
159        [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[  ACX_PTHREAD
 # ifdef HAVE_CL_CL_H  
 #   include <CL/cl.h>  
 # elif defined(HAVE_OPENCL_CL_H)  
 #   include <OpenCL/cl.h>  
 # else  
 #   error no cl.h  
 # endif]],  
       [[cl_float4 x; x.s[0] = 0.0;]])],  
       [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],  
       [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])  
   # restore saved CPPFLAGS  
     CPPFLAGS=$save_CPPFLAGS  
   # substitutions  
     AC_SUBST(LIBS_CL)  
     AC_SUBST(CPPFLAGS_CL)  
   fi  
 fi  
 AC_SUBST(CL_ENABLED)  
 AC_SUBST(CL_VERSION)  
160    
161  dnl  dnl
162  dnl check for various library routines etc.  dnl check for various library routines etc.
# Line 311  Line 265 
265  AC_SUBST(LD_NEEDS_RPATH)  AC_SUBST(LD_NEEDS_RPATH)
266  AC_SUBST(LIBM)  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 get the path to the TEEM installation  dnl Look for NVIDIA's nvcc compiler
276    dnl
277      AC_MSG_NOTICE([checking for CUDA and nvcc])
278      AC_PATH_PROG(NVCC, nvcc, no, $PATH)
279      if test x"$NVCC" = xno ; then
280        AC_MSG_WARN([nvcc not found])
281        CUDA_ENABLED=false
282        NVCC=":"
283      else
284        AC_MSG_RESULT([$NVCC])
285        CUDA_ENABLED=true
286      fi
287    else
288      NVCC=":"
289      CUDA_ENABLED=false
290    fi
291    AC_SUBST(NVCC)
292    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
304    dnl check for OpenCL support
305    dnl
306      LIBS_CL="none"
307      case "$host_os" in
308        darwin*) # On Mac OS X we check for installed frameworks
309          AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
310        ;;
311        *)
312          AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
313        ;;
314      esac
315      if test x"$LIBS_CL" = xnone ; then
316        AC_MSG_WARN([no OpenCL library found])
317        CL_ENABLED=false
318        CL_VERSION=0
319      else
320        CL_ENABLED=true
321        CPPFLAGS_CL=""
322        CL_HEADER=""
323        AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"])
324        if test x"$HAVE_CL_H" = xno ; then
325          # check for AMD's SDK
326          AC_MSG_CHECKING([for cl.h in AMD's SDK])
327          if test -d /opt/AMDAPP/include/CL ; then
328            HAVE_CL_H="yes"
329            CL_HEADER="/opt/AMDAPP/include/CL/cl.h"
330            AC_DEFINE([HAVE_CL_CL_H])
331            CPPFLAGS_CL="-I/opt/AMDAPP/include"
332          fi
333          AC_MSG_RESULT([$HAVE_CL_H])
334        fi
335        if test x"$HAVE_CL_H" = xno ; then
336          # check for NVIDIA's SDK
337          AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
338          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"
347            CL_HEADER="$CUDA_HOME/include/CL/cl.h"
348            AC_DEFINE([HAVE_CL_CL_H])
349            CPPFLAGS_CL="-I$CUDA_HOME/include"
350          fi
351          AC_MSG_RESULT([$HAVE_CL_H])
352        fi
353        if test x"$HAVE_CL_H" = xno ; then
354          AC_MSG_WARN([no cl.h found])
355          CL_ENABLED=false
356          CL_VERSION=0
357          SIZEOF_CL_INT=0
358          SIZEOF_CL_LONG=0
359          SIZEOF_CL_FLOAT=0
360          SIZEOF_CL_DOUBLE=0
361        else
362          # check the cl.h header for which version of OpenCL is supported
363          AC_LANG([C])
364          save_CPPFLAGS=$CPPFLAGS
365          CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
366          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
367    #include <stdio.h>
368    # ifdef HAVE_CL_CL_H
369    #   include <CL/cl.h>
370    # elif defined(HAVE_OPENCL_CL_H)
371    #   include <OpenCL/cl.h>
372    # else
373    #   error no cl.h
374    # endif]],
375    [[#if defined(CL_VERSION_1_2)
376      printf("120\n");
377    #elif defined(CL_VERSION_1_1)
378      printf("110\n");
379    #elif defined(CL_VERSION_1_0)
380      printf("100\n");
381    #else
382      printf("0\n");
383    #endif
384            ]])],
385            [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
386    dnl
387    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
388    dnl the specification specifies the behavior, but it was unspecified in 1.0.
389    dnl
390          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
391      #include "$CL_HEADER"
392      ]],
393            [[cl_float4 x; x[0] = 0.0;]])],
394            [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
395      dnl
396      dnl not arrays, so try the OpenCL 1.1 structure representation
397      dnl
398            [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
399    #include "$CL_HEADER"
400    ]],
401            [[cl_float4 x; x.s[0] = 0.0;]])],
402            [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
403            [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
404        # restore saved CPPFLAGS
405          CPPFLAGS=$save_CPPFLAGS
406        # substitutions
407          AC_SUBST(LIBS_CL)
408          AC_SUBST(CPPFLAGS_CL)
409        #
410        # determine the sizes of the host-side OpenCL types
411        AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
412        SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
413        AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
414        SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
415        AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
416        SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
417        AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
418        SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
419        fi
420      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)
431    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)
435    AC_SUBST(SIZEOF_CL_LONG)
436    AC_SUBST(SIZEOF_CL_FLOAT)
437    AC_SUBST(SIZEOF_CL_DOUBLE)
438    
439    #################### end OpenCL configuration ####################
440    
441    #################### Teem configuration ####################
442    
443    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
445    dnl compiler.
446    dnl
447    
448    dnl the path can be specified using "--with-teem=..." too
449  dnl  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 329  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])    AC_MSG_ERROR([unable to find teem])
492  fi  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
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 73      -o $SMLNJ_MINOR_VERSION -lt 79
552  then  then
553    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])      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 364  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 383  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_M64"  
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))  
592    
593  AC_C_BIGENDIAN  #################### end SML configuration ####################
594    
595    #################### Documentation tools configuration ####################
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  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])  #################### end Documentation tools configuration ####################
647    
648    #################### 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 455  Line 665 
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/dnorm/Makefile  dnl  src/clinfo/Makefile
687    src/compiler/Makefile    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/fields/run-dnorm.sml:src/compiler/fields/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
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 489  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([
715      src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
716    ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
717  AC_CONFIG_FILES([  AC_CONFIG_FILES([
718    rtest/scripts/run.sh:rtest/scripts/run_sh.in    src/tests/rtest/scripts/run.sh:src/tests/rtest/scripts/run_sh.in
719  ], [chmod +x rtest/scripts/run.sh])  ], [chmod +x src/tests/rtest/scripts/run.sh])
720  AC_CONFIG_FILES([  AC_CONFIG_FILES([
721    rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in    src/tests/rtest/scripts/run-one.sh:src/tests/rtest/scripts/run-one_sh.in
722  ], [chmod +x rtest/scripts/run-one.sh])  ], [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 515  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.1843  
changed lines
  Added in v.4419

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