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 1714, Sat Mar 10 00:00:50 2012 UTC branches/vis15/configure.ac revision 4422, Wed Aug 17 16:03:13 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) 2010 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) 2011 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"
 if test x"$ac_cv_prog_cc_c99" = xno ; then  
   AC_MSG_ERROR([Diderot requires c99 support])  
 fi  
75    
76  dnl extra C compiler options  AC_ARG_ENABLE([32-bit],
77  dnl    AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),
78  CFLAGS=""    [CXXFLAG_Mxx="-m32"],
79  CFLAG_M64="-m64"    [CXXFLAG_Mxx="-m64"])
80  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"  
81  AC_SUBST(CFLAG_M64)  CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
82  AC_SUBST(CFLAGS_BASE)  AC_SUBST(CXXFLAG_Mxx)
83    AC_SUBST(CXXFLAGS_BASE)
84    
85  dnl  dnl
86  dnl check for pthreads support  dnl run the compiler tests in 64-bit mode
87  dnl  dnl
88  ACX_PTHREAD()  save_CFLAGS=$CFLAGS
89    CFLAGS="$CFLAGS $CFLAG_MXX"
90    
 dnl check for doxygen  
91  dnl  dnl
92  AC_ARG_WITH([doxygen],  dnl check for gcc builtin atomic operations
   [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  
93  dnl  dnl
94    case $DOXYGEN in  AC_MSG_CHECKING([for builtin atomic operations])
95      /*) ;;  AC_LINK_IFELSE(
96      *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;     [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
97    esac     AC_MSG_RESULT(yes)
98  fi     AC_DEFINE(
99  if test $DOXYGEN = xnone ; then      [HAVE_BUILTIN_ATOMIC_OPS], 1,
100    DOXYGEN=:      [Define to 1 if gcc compiler provides atomic operations.]),
101  fi     AC_MSG_RESULT(no))
102  AC_SUBST(DOXYGEN)  
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  dnl
122  dnl Look for NVIDIA's nvcc compiler  dnl restore CFLAGS
123  dnl  dnl
124  AC_MSG_NOTICE([checking for CUDA and nvcc])  CFLAGS=$save_CFLAGS
 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)  
125    
126  dnl  dnl
127  dnl check for OpenCL support  dnl check for <stdbool.h>, which we use in the C API
128  dnl  dnl
129  CL_LIBS="none"  AC_HEADER_STDBOOL
130  case "$host_os" in  
   darwin*) # On Mac OS X we check for installed frameworks  
     AX_CHECK_FRAMEWORK([OpenCL], [CL_LIBS="-framework OpenCL"], [])  
   ;;  
   *)  
     AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[CL_LIBS="-lOpenCL"])  
   ;;  
 esac  
 if test x"$CL_LIBS" = xnone ; then  
   AC_MSG_WARN([no OpenCL library found])  
   CL_ENABLED=false  
   CL_VERSION=0  
 else  
   CL_ENABLED=true  
   AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h])  
   # check the cl.h header for which version of OpenCL is supported  
   AC_LANG([C])  
   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])  
131  dnl  dnl
132  dnl check to see how we access the host-side vector types.  For OpenCL 1.1,  dnl the C boolean type to use in generated library headers
 dnl the specification specifies the behavior, but it was unspecified in 1.0.  
133  dnl  dnl
134    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[  if test x"$ac_cv_header_stdbool_h" = xyes ; then
135  # ifdef HAVE_CL_CL_H    BOOLTY="bool"
136  #   include <CL/cl.h>  elif test "x$ac_cv_type__Bool" = xyes; then
137  # elif defined(HAVE_OPENCL_CL_H)    BOOLTY="_Bool"
138  #   include <OpenCL/cl.h>  else
139  # else    BOOLTY="int"
140  #   error no cl.h  fi
141  # endif]],  AC_SUBST(BOOLTY)
142      [[cl_float4 x; x[0] = 0.0;]])],  
     [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],  
143  dnl  dnl
144  dnl not arrays, so try the OpenCL 1.1 structure representation  dnl check for pthreads support
145  dnl  dnl
146      [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])])])  
   # substitutions  
   AC_SUBST(CL_LIBS)  
 fi  
 AC_SUBST(CL_ENABLED)  
 AC_SUBST(CL_VERSION)  
147    
148  dnl  dnl
149  dnl check for various library routines etc.  dnl check for various library routines etc.
# Line 284  Line 252 
252  AC_SUBST(LD_NEEDS_RPATH)  AC_SUBST(LD_NEEDS_RPATH)
253  AC_SUBST(LIBM)  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
262    dnl Look for NVIDIA's nvcc compiler
263    dnl
264      AC_MSG_NOTICE([checking for CUDA and nvcc])
265      AC_PATH_PROG(NVCC, nvcc, no, $PATH)
266      if test x"$NVCC" = xno ; then
267        AC_MSG_WARN([nvcc not found])
268        CUDA_ENABLED=false
269        NVCC=":"
270      else
271        AC_MSG_RESULT([$NVCC])
272        CUDA_ENABLED=true
273      fi
274    else
275      NVCC=":"
276      CUDA_ENABLED=false
277    fi
278    AC_SUBST(NVCC)
279    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
291    dnl check for OpenCL support
292    dnl
293      LIBS_CL="none"
294      case "$host_os" in
295        darwin*) # On Mac OS X we check for installed frameworks
296          AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
297        ;;
298        *)
299          AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
300        ;;
301      esac
302      if test x"$LIBS_CL" = xnone ; then
303        AC_MSG_WARN([no OpenCL library found])
304        CL_ENABLED=false
305        CL_VERSION=0
306      else
307        CL_ENABLED=true
308        CPPFLAGS_CL=""
309        CL_HEADER=""
310        AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"])
311        if test x"$HAVE_CL_H" = xno ; then
312          # check for AMD's SDK
313          AC_MSG_CHECKING([for cl.h in AMD's SDK])
314          if test -d /opt/AMDAPP/include/CL ; then
315            HAVE_CL_H="yes"
316            CL_HEADER="/opt/AMDAPP/include/CL/cl.h"
317            AC_DEFINE([HAVE_CL_CL_H])
318            CPPFLAGS_CL="-I/opt/AMDAPP/include"
319          fi
320          AC_MSG_RESULT([$HAVE_CL_H])
321        fi
322        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])
342          CL_ENABLED=false
343          CL_VERSION=0
344          SIZEOF_CL_INT=0
345          SIZEOF_CL_LONG=0
346          SIZEOF_CL_FLOAT=0
347          SIZEOF_CL_DOUBLE=0
348        else
349          # check the cl.h header for which version of OpenCL is supported
350          AC_LANG([C])
351          save_CPPFLAGS=$CPPFLAGS
352          CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
353          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
354    #include <stdio.h>
355    # ifdef HAVE_CL_CL_H
356    #   include <CL/cl.h>
357    # elif defined(HAVE_OPENCL_CL_H)
358    #   include <OpenCL/cl.h>
359    # else
360    #   error no cl.h
361    # endif]],
362    [[#if defined(CL_VERSION_1_2)
363      printf("120\n");
364    #elif defined(CL_VERSION_1_1)
365      printf("110\n");
366    #elif defined(CL_VERSION_1_0)
367      printf("100\n");
368    #else
369      printf("0\n");
370    #endif
371            ]])],
372            [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
373    dnl
374    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
375    dnl the specification specifies the behavior, but it was unspecified in 1.0.
376    dnl
377          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
378      #include "$CL_HEADER"
379      ]],
380            [[cl_float4 x; x[0] = 0.0;]])],
381            [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
382      dnl
383      dnl not arrays, so try the OpenCL 1.1 structure representation
384      dnl
385            [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
386    #include "$CL_HEADER"
387    ]],
388            [[cl_float4 x; x.s[0] = 0.0;]])],
389            [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
390            [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
391        # restore saved CPPFLAGS
392          CPPFLAGS=$save_CPPFLAGS
393        # substitutions
394          AC_SUBST(LIBS_CL)
395          AC_SUBST(CPPFLAGS_CL)
396        #
397        # determine the sizes of the host-side OpenCL types
398        AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
399        SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
400        AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
401        SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
402        AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
403        SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
404        AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
405        SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
406        fi
407      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)
418    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)
422    AC_SUBST(SIZEOF_CL_LONG)
423    AC_SUBST(SIZEOF_CL_FLOAT)
424    AC_SUBST(SIZEOF_CL_DOUBLE)
425    
426    #################### end OpenCL configuration ####################
427    
428    #################### Teem configuration ####################
429    
430    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
434  dnl get the path to the TEEM installation  
435    dnl the path can be specified using "--with-teem=..." too
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 302  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])    AC_MSG_ERROR([unable to find teem])
479  fi  fi
480    dnl
481    dnl check that unu supports the dnorm command
482    dnl
483    AC_MSG_CHECKING([that \"unu dnorm\" works])
484    if test -x $TEEM_DIR/bin/unu ; then
485      $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null
486      if test $? -eq 0 ; then
487        AC_MSG_RESULT([yes])
488      else
489        AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation])
490      fi
491    else
492      AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])
493    fi
494    
495  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
496    
497  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
498    
499    #################### SML configuration ####################
500    
501    dnl
502    dnl We support building with both SML/NJ (the default) or MLton.
503  dnl  dnl
504    
505    dnl first check for --with-mlton=path flag
506    dnl
507    AC_ARG_WITH([mlton],
508      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
509        [use the MLton Standard ML compiler to build Diderot])],
510      [with_mlton=yes],[with_mlton=no])
511    if test x"$with_mlton" = xyes ; then
512      if test x"$ac_cv_path_with_mlton" = x ; then
513        # look for mlton in the PATH
514        AC_PATH_PROGS(with_mlton, mlton, no)
515        if test x"$MLTON" = xno ; then
516          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
517        fi
518      else
519        with_mlton=$ac_cv_path_with_mlton
520        case $with_mlton in
521          /*) ;;
522          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
523        esac
524        if test ! -x $with_mlton ; then
525          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
526        fi
527      fi
528    fi
529    
530    if test x"$with_mlton" = xno ; then
531      # we are using SML/NJ
532      #
533    
534  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
535  dnl  dnl
536  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])])
537  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
538    -o $SMLNJ_MINOR_VERSION -lt 73      -o $SMLNJ_MINOR_VERSION -lt 79
539  then  then
540    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])      AC_MSG_ERROR([installation requires SML/NJ version 110.79+ (available from smlnj.org)])
541  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
542    
543  dnl determine the heap-image suffix  dnl determine the heap-image suffix
544  dnl  dnl
# Line 337  Line 547 
547    
548  dnl look for ml-makedepend  dnl look for ml-makedepend
549  dnl  dnl
 AC_MSG_CHECKING([for ml-makedepend])  
550  tmpPATH="$SMLNJ_PATH:$PATH"  tmpPATH="$SMLNJ_PATH:$PATH"
551  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  
552  AC_SUBST(ML_MAKEDEPEND)  AC_SUBST(ML_MAKEDEPEND)
553    
554  dnl  dnl
# Line 356  Line 560 
560    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
561  fi  fi
562  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
563      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  
564    
565  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
566  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)  
567  AC_SUBST(HEAP_IMAGE_DIR)  AC_SUBST(HEAP_IMAGE_DIR)
568  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
569    
570  dnl  else
 dnl ******************** C compiler properties ********************  
 dnl  
571    
572  dnl    # we are using MLton
573  dnl run the compiler tests in 64-bit mode    MLTON=$with_mlton
574  dnl    AC_SUBST(MLTON)
575  save_CFLAGS=$CFLAGS    SML=mlton
 CFLAGS="$CFLAGS $CFLAG_M64"  
576    
577  dnl  fi
578  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))  
579    
580  AC_C_BIGENDIAN  #################### end SML configuration ####################
581    
582    #################### Documentation tools configuration ####################
583    
584    dnl check for doxygen
585  dnl  dnl
586  dnl restore CFLAGS  AC_ARG_WITH([doxygen],
587      [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
588      [DOXYGEN=$with_doxygen],
589      [DOXYGEN=none])
590    if test x$DOXYGEN = xnone ; then
591      # see if we can find doxygen in the user's path
592      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
593    fi
594    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
595      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
596    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
597      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
598    elif test x$DOXYGEN != xnone ; then
599  dnl  dnl
600  CFLAGS=$save_CFLAGS  dnl verify that $DOXYGEN is an absolute path
601    dnl
602      case $DOXYGEN in
603        /*) ;;
604        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
605      esac
606    fi
607    if test $DOXYGEN = xnone ; then
608      DOXYGEN=:
609    fi
610    AC_SUBST(DOXYGEN)
611    
612    dnl check for asciidoc and related tools
613    dnl
614    AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
615    AC_PATH_PROGS([A2X], [a2x], [none])
616    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
617    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
618    
619  dnl  dnl
620  dnl ******************** config.h stuff ********************  dnl get the path to the asciidoc cofiguration files
621  dnl  dnl
622    if test x"$ASCIIDOC" != xnone ; then
623      AC_MSG_CHECKING([path to asciidoc configuration files])
624      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
625      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
626    fi
627    AC_SUBST(ASCIIDOC)
628    AC_SUBST(A2X)
629    AC_SUBST(ASCIIDOC_CONF_DIR)
630    AC_SUBST(HIGHLIGHTER)
631    AC_SUBST(DBLATEX)
632    
633    #################### end Documentation tools configuration ####################
634    
635    #################### config.h ####################
636    
637  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
638    
639  AH_TOP([  AH_TOP([
640  /*  /*
641   * 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)
642   * All rights reserved.   *
643     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
644   */   */
645    
646  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 428  Line 652 
652  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
653  ])  ])
654    
655  dnl  #################### end config.h ####################
656  dnl ******************** write output ********************  
657  dnl  #################### write output ####################
658    
659    dnl The compiler Makefile depends on which SML system we are
660    dnl using.
661    if test x"$SML" = xmlton ; then
662      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
663    else
664      COMPILER_MAKEFILE_IN=""
665    fi
666    
667  AC_CONFIG_FILES(  AC_CONFIG_FILES(
668  dnl  dnl
669  dnl ***** Makefiles *****  dnl ***** Makefiles *****
670    Makefile    Makefile
671    doc/Makefile  dnl  doc/Makefile
672    src/clinfo/Makefile  dnl  doc/man/Makefile
673    src/dnorm/Makefile  dnl  src/clinfo/Makefile
674    src/compiler/Makefile    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
675    src/lib/build/Makefile    src/lib/build/Makefile
676    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
677    test/MIP/Makefile  dnl  test/MIP/Makefile
678    test/probe/Makefile  dnl  test/probe/Makefile
679    dnl  test/iso2d-polyline/Makefile
680    dnl  test/vr-lite-cam/Makefile
681    dnl  test/hlic/Makefile
682  dnl  dnl
683  dnl ***** SML source files *****  dnl ***** SML source files *****
684    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
685    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
686      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
687      src/compiler/options/version.sml:src/compiler/options/version_sml.in
688  )  )
689    
690  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)
691    
692  dnl  dnl
693  dnl shell scripts  dnl shell scripts
# Line 459  Line 696 
696    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
697  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
698  AC_CONFIG_FILES([  AC_CONFIG_FILES([
699    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
700  ], [chmod +x src/compiler/gen/file2str/file2str.sh])  ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
701    AC_CONFIG_FILES([
702      src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
703    ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
704    AC_CONFIG_FILES([
705      src/tests/rtest/scripts/run.sh:src/tests/rtest/scripts/run_sh.in
706    ], [chmod +x src/tests/rtest/scripts/run.sh])
707    AC_CONFIG_FILES([
708      src/tests/rtest/scripts/run-one.sh:src/tests/rtest/scripts/run-one_sh.in
709    ], [chmod +x src/tests/rtest/scripts/run-one.sh])
710    #
711    # more regression tests; should merge with rtest at some point
712    #
713    # AC_CONFIG_FILES([
714    #   rtest2/scripts/run.sh:rtest2/scripts/run_sh.in
715    # ], [chmod +x rtest2/scripts/run.sh])
716    # AC_CONFIG_FILES([
717    #   rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in
718    # ], [chmod +x rtest2/scripts/run-one.sh])
719    
720  dnl  dnl
721  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
722  dnl  dnl
723  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
724  dnl  dnl
725    dnl where the options are taken from [debug, parallel]
726    dnl
727  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
728      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
729        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 479  Line 736 
736      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
737    ])    ])
738    
739  MK_BUILD_DIR(rt-c-f, c, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
740  MK_BUILD_DIR(rt-c-d, c, [double])  MK_BUILD_DIR(rt-seq-debug, sequential, [debug])
741  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])  MK_BUILD_DIR(rt-par, parallel, [parallel])
742  MK_BUILD_DIR(rt-c-d-debug, c, [double debug])  MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
743  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  
744  MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])  #if test x"$CL_ENABLED" = xtrue ; then
745  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])  #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
746  MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])  #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
747    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
748  if test x"$CL_ENABLED" = xtrue ; then  #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
749    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  
750    
751  AC_OUTPUT  AC_OUTPUT
752    
753    #################### end write output ####################

Legend:
Removed from v.1714  
changed lines
  Added in v.4422

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