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 1997, Thu Oct 4 11:00:44 2012 UTC branches/vis15/configure.ac revision 4161, Mon Jul 4 18:06:36 2016 UTC
# Line 1  Line 1 
1  dnl Process this file with autoconf to produce a configure script.  dnl Process this file with autoconf to produce a configure script.
2  dnl  dnl
3  dnl COPYRIGHT (c) 2012 The Diderot Project  dnl This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4    dnl
5    dnl COPYRIGHT (c) 2016 The University of Chicago
6  dnl All rights reserved.  dnl All rights reserved.
7  dnl  dnl
8    
9  AC_INIT(diderot,0.1,)  AC_INIT(diderot,1.0,)
10    
11  AC_PREREQ(2.60)  AC_PREREQ(2.60)
12  AC_COPYRIGHT([[COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)]])  AC_COPYRIGHT([[COPYRIGHT (c) 2016 The University of Chicago]])
13  AC_CONFIG_SRCDIR(src/dnorm/dnorm.c)  AC_CONFIG_SRCDIR(src/compiler/options/ctl.sml)
14  AC_CONFIG_AUX_DIR(config)  AC_CONFIG_AUX_DIR(config)
15  AC_CONFIG_MACRO_DIR(config)  AC_CONFIG_MACRO_DIR(config)
16    
17  dnl  dnl
18    dnl set the following to the name of the branch
19    dnl
20    BRANCH="master"
21    AC_SUBST(BRANCH)
22    
23    dnl
24  dnl include additional macros  dnl include additional macros
25  dnl  dnl
26  sinclude(config/acx_pthread.m4)  sinclude(config/acx_pthread.m4)
27  sinclude(config/check_smlnj.m4)  sinclude(config/check_smlnj.m4)
28  sinclude(config/check_smlnj_heap_suffix.m4)  sinclude(config/check_smlnj_heap_suffix.m4)
29  sinclude(config/ax_check_framework.m4)  sinclude(config/ax_check_framework.m4)
30    sinclude(config/ax_cxx_compile_stdcxx.m4)
31    
32  dnl  dnl
33  dnl get host information  dnl get host information
34  dnl  dnl
35  AC_CANONICAL_HOST  AC_CANONICAL_HOST
36    
37    #################### Paths configuration ####################
38    
39    DIDEROT_ROOT=`pwd`
40    DIDEROT_DOCDIR=$DIDEROT_ROOT/doc
41    DIDEROT_SRCDIR=$DIDEROT_ROOT/src
42    DIDEROT_LIBDIR=$DIDEROT_ROOT/lib
43    DIDEROT_BINDIR=$DIDEROT_ROOT/bin
44    DIDEROT_MKDIR=$DIDEROT_ROOT/mk
45    
46    AC_SUBST(DIDEROT_ROOT)
47    AC_SUBST(DIDEROT_DOCDIR)
48    AC_SUBST(DIDEROT_SRCDIR)
49    AC_SUBST(DIDEROT_LIBDIR)
50    AC_SUBST(DIDEROT_BINDIR)
51    AC_SUBST(DIDEROT_MKDIR)
52    
53    #################### end Paths configuration ####################
54    
55  dnl check for standard programs  dnl check for standard programs
56  dnl  dnl
 AC_PROG_CC([clang gcc cc])  
57  AC_PROG_CPP  AC_PROG_CPP
58    AC_PROG_CC([clang gcc cc])
59    AC_PROG_CXX([clang++ g++ c++])
60    AX_CXX_COMPILE_STDCXX(11,[],[mandatory])
61  AC_PROG_INSTALL  AC_PROG_INSTALL
62  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
63    
# Line 40  Line 69 
69  fi  fi
70  AC_SUBST(LD)  AC_SUBST(LD)
71    
72  dnl check for c99 support  dnl extra compiler options
73  dnl  dnl
74  AC_PROG_CC_C99  CXXFLAGS_BASE="-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      AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),
78      [CXXFLAG_Mxx="-m32"],
79      [CXXFLAG_Mxx="-m64"])
80    if test x"$CXX" != "xclang++" ; then
81      CXXFLAGS_BASE="$CXXFLAGS_BASE -fno-implicit-templates"
82  fi  fi
83    
84  dnl extra C compiler options  CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
85  dnl  AC_SUBST(CXXFLAG_Mxx)
86  CFLAGS=""  AC_SUBST(CXXFLAGS_BASE)
 CFLAG_M64="-m64"  
 CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"  
 AC_SUBST(CFLAG_M64)  
 AC_SUBST(CFLAGS_BASE)  
87    
88  dnl  dnl
89  dnl standard headers  dnl run the compiler tests in 64-bit mode
90  dnl  dnl
91  AC_HEADER_STDBOOL  save_CFLAGS=$CFLAGS
92    CFLAGS="$CFLAGS $CFLAG_MXX"
93    
94  dnl  dnl
95  dnl check for pthreads support  dnl check for gcc builtin atomic operations
96  dnl  dnl
97  ACX_PTHREAD  AC_MSG_CHECKING([for builtin atomic operations])
98    AC_LINK_IFELSE(
99       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
100       AC_MSG_RESULT(yes)
101       AC_DEFINE(
102        [HAVE_BUILTIN_ATOMIC_OPS], 1,
103        [Define to 1 if gcc compiler provides atomic operations.]),
104       AC_MSG_RESULT(no))
105    
106  dnl check for doxygen  AC_C_BIGENDIAN
 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  
 dnl  
 dnl verify that $DOXYGEN is an absolute path  
 dnl  
   case $DOXYGEN in  
     /*) ;;  
     *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;  
   esac  
 fi  
 if test $DOXYGEN = xnone ; then  
   DOXYGEN=:  
 fi  
 AC_SUBST(DOXYGEN)  
107    
108  dnl  #
109  dnl Look for NVIDIA's nvcc compiler  # determine the sizes of the standard C types
110  dnl  AC_CHECK_SIZEOF([int])
111  AC_MSG_NOTICE([checking for CUDA and nvcc])  SIZEOF_C_INT=$ac_cv_sizeof_int
112  AC_PATH_PROG(NVCC, nvcc, no, $PATH)  AC_CHECK_SIZEOF([long])
113  if test x"$NVCC" = xno ; then  SIZEOF_C_LONG=$ac_cv_sizeof_long
114    AC_MSG_WARN([nvcc not found])  AC_CHECK_SIZEOF([float])
115    CUDA_ENABLED=false  SIZEOF_C_FLOAT=$ac_cv_sizeof_float
116    NVCC=":"  AC_CHECK_SIZEOF([double])
117  else  SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
118    AC_MSG_RESULT([$NVCC])  
119    CUDA_ENABLED=true  AC_SUBST(SIZEOF_C_INT)
120  fi  AC_SUBST(SIZEOF_C_LONG)
121  AC_SUBST(NVCC)  AC_SUBST(SIZEOF_C_FLOAT)
122  AC_SUBST(CUDA_ENABLED)  AC_SUBST(SIZEOF_C_DOUBLE)
123    
124  dnl  dnl
125  dnl check for OpenCL support  dnl restore CFLAGS
126  dnl  dnl
127  LIBS_CL="none"  CFLAGS=$save_CFLAGS
128  case "$host_os" in  
   darwin*) # On Mac OS X we check for installed frameworks  
     AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])  
   ;;  
   *)  
     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  
 else  
   CL_ENABLED=true  
   CPPFLAGS_CL=""  
   AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; break], [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"  
     fi  
     AC_MSG_RESULT([$HAVE_CL_H])  
   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])  
129  dnl  dnl
130  dnl check to see how we access the host-side vector types.  For OpenCL 1.1,  dnl check for <stdbool.h>, which we use in the C API
 dnl the specification specifies the behavior, but it was unspecified in 1.0.  
131  dnl  dnl
132      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[  AC_HEADER_STDBOOL
133  # 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])],  
134  dnl  dnl
135  dnl not arrays, so try the OpenCL 1.1 structure representation  dnl check for pthreads support
136  dnl  dnl
137        [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)  
138    
139  dnl  dnl
140  dnl check for various library routines etc.  dnl check for various library routines etc.
# Line 311  Line 243 
243  AC_SUBST(LD_NEEDS_RPATH)  AC_SUBST(LD_NEEDS_RPATH)
244  AC_SUBST(LIBM)  AC_SUBST(LIBM)
245    
246    #################### CUDA configuration ####################
247    
248    dnl
249    dnl Look for NVIDIA's nvcc compiler
250    dnl
251    AC_MSG_NOTICE([checking for CUDA and nvcc])
252    AC_PATH_PROG(NVCC, nvcc, no, $PATH)
253    if test x"$NVCC" = xno ; then
254      AC_MSG_WARN([nvcc not found])
255      CUDA_ENABLED=false
256      NVCC=":"
257    else
258      AC_MSG_RESULT([$NVCC])
259      CUDA_ENABLED=true
260    fi
261    AC_SUBST(NVCC)
262    AC_SUBST(CUDA_ENABLED)
263    
264    #################### end CUDA configuration ####################
265    
266    #################### OpenCL configuration ####################
267    
268    dnl
269    dnl check for OpenCL support
270    dnl
271    LIBS_CL="none"
272    case "$host_os" in
273      darwin*) # On Mac OS X we check for installed frameworks
274        AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
275      ;;
276      *)
277        AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
278      ;;
279    esac
280    if test x"$LIBS_CL" = xnone ; then
281      AC_MSG_WARN([no OpenCL library found])
282      CL_ENABLED=false
283      CL_VERSION=0
284    else
285      CL_ENABLED=true
286      CPPFLAGS_CL=""
287      CL_HEADER=""
288      AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"])
289      if test x"$HAVE_CL_H" = xno ; then
290        # check for AMD's SDK
291        AC_MSG_CHECKING([for cl.h in AMD's SDK])
292        if test -d /opt/AMDAPP/include/CL ; then
293          HAVE_CL_H="yes"
294          CL_HEADER="/opt/AMDAPP/include/CL/cl.h"
295          AC_DEFINE([HAVE_CL_CL_H])
296          CPPFLAGS_CL="-I/opt/AMDAPP/include"
297        fi
298        AC_MSG_RESULT([$HAVE_CL_H])
299      fi
300      if test x"$HAVE_CL_H" = xno ; then
301        # check for NVIDIA's SDK
302        AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
303        CUDA_HOME=none
304        for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
305          if test -d /usr/local/$CUDA/include/CL ; then
306            CUDA_HOME=/usr/local/$CUDA
307            break
308          fi
309        done
310        if test x"$CUDA_HOME" != xnone ; then
311          HAVE_CL_H="yes"
312          CL_HEADER="$CUDA_HOME/include/CL/cl.h"
313          AC_DEFINE([HAVE_CL_CL_H])
314          CPPFLAGS_CL="-I$CUDA_HOME/include"
315        fi
316        AC_MSG_RESULT([$HAVE_CL_H])
317      fi
318      if test x"$HAVE_CL_H" = xno ; then
319        AC_MSG_WARN([no cl.h found])
320        CL_ENABLED=false
321        CL_VERSION=0
322        SIZEOF_CL_INT=0
323        SIZEOF_CL_LONG=0
324        SIZEOF_CL_FLOAT=0
325        SIZEOF_CL_DOUBLE=0
326      else
327        # check the cl.h header for which version of OpenCL is supported
328        AC_LANG([C])
329        save_CPPFLAGS=$CPPFLAGS
330        CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
331        AC_LINK_IFELSE([AC_LANG_PROGRAM([[
332    #include <stdio.h>
333    # ifdef HAVE_CL_CL_H
334    #   include <CL/cl.h>
335    # elif defined(HAVE_OPENCL_CL_H)
336    #   include <OpenCL/cl.h>
337    # else
338    #   error no cl.h
339    # endif]],
340    [[#if defined(CL_VERSION_1_2)
341      printf("120\n");
342    #elif defined(CL_VERSION_1_1)
343      printf("110\n");
344    #elif defined(CL_VERSION_1_0)
345      printf("100\n");
346    #else
347      printf("0\n");
348    #endif
349          ]])],
350          [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
351    dnl
352    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
353    dnl the specification specifies the behavior, but it was unspecified in 1.0.
354    dnl
355        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
356    #include "$CL_HEADER"
357    ]],
358          [[cl_float4 x; x[0] = 0.0;]])],
359          [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
360    dnl
361    dnl not arrays, so try the OpenCL 1.1 structure representation
362    dnl
363          [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
364    #include "$CL_HEADER"
365    ]],
366          [[cl_float4 x; x.s[0] = 0.0;]])],
367          [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
368          [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
369      # restore saved CPPFLAGS
370        CPPFLAGS=$save_CPPFLAGS
371      # substitutions
372        AC_SUBST(LIBS_CL)
373        AC_SUBST(CPPFLAGS_CL)
374      #
375      # determine the sizes of the host-side OpenCL types
376      AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
377      SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
378      AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
379      SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
380      AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
381      SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
382      AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
383      SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
384      fi
385    fi
386    AC_SUBST(CL_ENABLED)
387    AC_SUBST(CL_VERSION)
388    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
389    
390    AC_SUBST(SIZEOF_CL_INT)
391    AC_SUBST(SIZEOF_CL_LONG)
392    AC_SUBST(SIZEOF_CL_FLOAT)
393    AC_SUBST(SIZEOF_CL_DOUBLE)
394    
395    #################### end OpenCL configuration ####################
396    
397    #################### Teem configuration ####################
398    
399  dnl  dnl
400  dnl get the path to the TEEM installation  dnl get the path to the TEEM installation.  We need this to build the Diderot
401    dnl runtime code and we use the path when searching for teem in the Diderot
402    dnl compiler.
403  dnl  dnl
404  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
405    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
406    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
407  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
408    TEEM_DIR=none    TEEM_DIR=none
409      AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
410  else  else
411    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
412    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 329  Line 417 
417      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
418      # check that TEEM_DIR actually points to something that looks like teem      # check that TEEM_DIR actually points to something that looks like teem
419      if test -f $TEEM_DIR/include/teem/nrrd.h ; then      if test -f $TEEM_DIR/include/teem/nrrd.h ; then
420        AC_MSG_RESULT([ okay])        AC_MSG_RESULT([yes])
421      else      else
422        TEEM_DIR=none        TEEM_DIR=none
423        AC_MSG_RESULT([ invalid])        AC_MSG_RESULT([invalid path to teem])
424      fi      fi
425    else    else
426      TEEM_DIR=none      TEEM_DIR=none
427      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([invalid path to teem])
428    fi    fi
429  fi  fi
430  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
431    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem])
432  fi  fi
433    dnl
434    dnl check that unu supports the dnorm command
435    dnl
436    if test x"$TEEM_DIR" != xnone ; then
437      AC_MSG_CHECKING([that \"unu dnorm\" works])
438      if test -x $TEEM_DIR/bin/unu ; then
439        $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null
440        if test $? -eq 0 ; then
441          AC_MSG_RESULT([yes])
442        else
443          AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation])
444        fi
445      else
446        AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])
447      fi
448    fi
449  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
450    
451  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
452    
453    #################### SML configuration ####################
454    
455    dnl
456    dnl We support building with both SML/NJ (the default) or MLton.
457    dnl
458    
459    dnl first check for --with-mlton=path flag
460  dnl  dnl
461    AC_ARG_WITH([mlton],
462      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
463        [use the MLton Standard ML compiler to build Diderot])],
464      [with_mlton=yes],[with_mlton=no])
465    if test x"$with_mlton" = xyes ; then
466      if test x"$ac_cv_path_with_mlton" = x ; then
467        # look for mlton in the PATH
468        AC_PATH_PROGS(with_mlton, mlton, no)
469        if test x"$MLTON" = xno ; then
470          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
471        fi
472      else
473        with_mlton=$ac_cv_path_with_mlton
474        case $with_mlton in
475          /*) ;;
476          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
477        esac
478        if test ! -x $with_mlton ; then
479          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
480        fi
481      fi
482    fi
483    
484    if test x"$with_mlton" = xno ; then
485      # we are using SML/NJ
486      #
487    
488  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
489  dnl  dnl
490  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])])
491  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
492    -o $SMLNJ_MINOR_VERSION -lt 73      -o $SMLNJ_MINOR_VERSION -lt 79
493  then  then
494    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])      AC_MSG_ERROR([installation requires SML/NJ version 110.79+ (available from smlnj.org)])
495  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
496    
497  dnl determine the heap-image suffix  dnl determine the heap-image suffix
498  dnl  dnl
# Line 383  Line 520 
520    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
521  fi  fi
522  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
523      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  
524    
525  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
526  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)  
527  AC_SUBST(HEAP_IMAGE_DIR)  AC_SUBST(HEAP_IMAGE_DIR)
528  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
529    
530  dnl  else
 dnl ******************** C compiler properties ********************  
 dnl  
531    
532  dnl    # we are using MLton
533  dnl run the compiler tests in 64-bit mode    MLTON=$with_mlton
534  dnl    AC_SUBST(MLTON)
535  save_CFLAGS=$CFLAGS    SML=mlton
 CFLAGS="$CFLAGS $CFLAG_M64"  
536    
537  dnl  fi
538  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))  
539    
540  AC_C_BIGENDIAN  #################### SML configuration ####################
541    
542    #################### Documentation tools configuration ####################
543    
544    dnl check for doxygen
545  dnl  dnl
546  dnl restore CFLAGS  AC_ARG_WITH([doxygen],
547      [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
548      [DOXYGEN=$with_doxygen],
549      [DOXYGEN=none])
550    if test x$DOXYGEN = xnone ; then
551      # see if we can find doxygen in the user's path
552      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
553    fi
554    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
555      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
556    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
557      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
558    elif test x$DOXYGEN != xnone ; then
559  dnl  dnl
560  CFLAGS=$save_CFLAGS  dnl verify that $DOXYGEN is an absolute path
561    dnl
562      case $DOXYGEN in
563        /*) ;;
564        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
565      esac
566    fi
567    if test $DOXYGEN = xnone ; then
568      DOXYGEN=:
569    fi
570    AC_SUBST(DOXYGEN)
571    
572    dnl check for asciidoc and related tools
573    dnl
574    AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
575    AC_PATH_PROGS([A2X], [a2x], [none])
576    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
577    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
578    
579  dnl  dnl
580  dnl ******************** config.h stuff ********************  dnl get the path to the asciidoc cofiguration files
581  dnl  dnl
582    if test x"$ASCIIDOC" != xnone ; then
583      AC_MSG_CHECKING([path to asciidoc configuration files])
584      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
585      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
586    fi
587    AC_SUBST(ASCIIDOC)
588    AC_SUBST(A2X)
589    AC_SUBST(ASCIIDOC_CONF_DIR)
590    AC_SUBST(HIGHLIGHTER)
591    AC_SUBST(DBLATEX)
592    
593    #################### end Documentation tools configuration ####################
594    
595  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])  #################### config.h ####################
596    
597    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
598    
599  AH_TOP([  AH_TOP([
600  /*  /*
601   * 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)
602   * All rights reserved.   *
603     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
604   */   */
605    
606  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 455  Line 612 
612  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
613  ])  ])
614    
615  dnl  #################### end config.h ####################
616  dnl ******************** write output ********************  
617  dnl  #################### write output ####################
618    
619    dnl The compiler Makefile depends on which SML system we are
620    dnl using.
621    if test x"$SML" = xmlton ; then
622      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
623    else
624      COMPILER_MAKEFILE_IN=""
625    fi
626    
627  AC_CONFIG_FILES(  AC_CONFIG_FILES(
628  dnl  dnl
629  dnl ***** Makefiles *****  dnl ***** Makefiles *****
630    Makefile    Makefile
631    doc/Makefile  dnl  doc/Makefile
632    src/clinfo/Makefile  dnl  doc/man/Makefile
633    src/dnorm/Makefile  dnl  src/clinfo/Makefile
634    src/compiler/Makefile    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
635    src/lib/build/Makefile    src/lib/build/Makefile
636    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
637    test/MIP/Makefile  dnl  test/MIP/Makefile
638    test/probe/Makefile  dnl  test/probe/Makefile
639    test/iso2d-polyline/Makefile  dnl  test/iso2d-polyline/Makefile
640    test/vr-lite-cam/Makefile  dnl  test/vr-lite-cam/Makefile
641    test/hlic/Makefile  dnl  test/hlic/Makefile
642  dnl  dnl
643  dnl ***** SML source files *****  dnl ***** SML source files *****
644    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
645    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
646      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
647      src/compiler/options/version.sml:src/compiler/options/version_sml.in
648  )  )
649    
650  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)
651    
652  dnl  dnl
653  dnl shell scripts  dnl shell scripts
# Line 489  Line 656 
656    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
657  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
658  AC_CONFIG_FILES([  AC_CONFIG_FILES([
659    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
660  ], [chmod +x src/compiler/gen/file2str/file2str.sh])  ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
661    AC_CONFIG_FILES([
662      src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
663    ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
664  AC_CONFIG_FILES([  AC_CONFIG_FILES([
665    rtest/scripts/run.sh:rtest/scripts/run_sh.in    src/tests/rtest/scripts/run.sh:src/tests/rtest/scripts/run_sh.in
666  ], [chmod +x rtest/scripts/run.sh])  ], [chmod +x src/tests/rtest/scripts/run.sh])
667  AC_CONFIG_FILES([  AC_CONFIG_FILES([
668    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
669  ], [chmod +x rtest/scripts/run-one.sh])  ], [chmod +x src/tests/rtest/scripts/run-one.sh])
670    #
671    # more regression tests; should merge with rtest at some point
672    #
673    # AC_CONFIG_FILES([
674    #   rtest2/scripts/run.sh:rtest2/scripts/run_sh.in
675    # ], [chmod +x rtest2/scripts/run.sh])
676    # AC_CONFIG_FILES([
677    #   rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in
678    # ], [chmod +x rtest2/scripts/run-one.sh])
679    
680  dnl  dnl
681  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
682  dnl  dnl
683  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
684  dnl  dnl
685    dnl where the options are taken from [debug, parallel]
686    dnl
687  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
688      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
689        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 515  Line 696 
696      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
697    ])    ])
698    
699  MK_BUILD_DIR(rt-c-f, c, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
700  MK_BUILD_DIR(rt-c-d, c, [double])  MK_BUILD_DIR(rt-seq-debug, sequential, [debug])
701  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])  MK_BUILD_DIR(rt-par, parallel, [parallel])
702  MK_BUILD_DIR(rt-c-d-debug, c, [double debug])  MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
703  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  
704  MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])  #if test x"$CL_ENABLED" = xtrue ; then
705  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])  #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
706  MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])  #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
707    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
708  if test x"$CL_ENABLED" = xtrue ; then  #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
709    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  
710    
711  AC_OUTPUT  AC_OUTPUT
712    
713    #################### end write output ####################

Legend:
Removed from v.1997  
changed lines
  Added in v.4161

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