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 1685, Sun Jan 22 15:23:36 2012 UTC branches/vis15/configure.ac revision 4859, Thu Dec 29 15:35:15 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,2.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/ax_check_compile_flag.m4)
27    sinclude(config/ax_gcc_x86_cpuid.m4)
28    sinclude(config/ax_gcc_x86_avx_xgetbv.m4)
29    sinclude(config/ax_ext.m4)
30  sinclude(config/acx_pthread.m4)  sinclude(config/acx_pthread.m4)
31  sinclude(config/check_smlnj.m4)  sinclude(config/check_smlnj.m4)
32  sinclude(config/check_smlnj_heap_suffix.m4)  sinclude(config/check_smlnj_heap_suffix.m4)
33  sinclude(config/ax_check_framework.m4)  sinclude(config/ax_check_framework.m4)
34    sinclude(config/ax_cxx_compile_stdcxx.m4)
35    
36  dnl  dnl
37  dnl get host information  dnl get host information
38  dnl  dnl
39  AC_CANONICAL_HOST  AC_CANONICAL_HOST
40    
41    #################### Paths configuration ####################
42    
43    DIDEROT_ROOT=`pwd`
44    DIDEROT_DOCDIR=$DIDEROT_ROOT/doc
45    DIDEROT_SRCDIR=$DIDEROT_ROOT/src
46    DIDEROT_LIBDIR=$DIDEROT_ROOT/lib
47    DIDEROT_BINDIR=$DIDEROT_ROOT/bin
48    DIDEROT_MKDIR=$DIDEROT_ROOT/mk
49    
50    AC_SUBST(DIDEROT_ROOT)
51    AC_SUBST(DIDEROT_DOCDIR)
52    AC_SUBST(DIDEROT_SRCDIR)
53    AC_SUBST(DIDEROT_LIBDIR)
54    AC_SUBST(DIDEROT_BINDIR)
55    AC_SUBST(DIDEROT_MKDIR)
56    
57    #################### end Paths configuration ####################
58    
59  dnl check for standard programs  dnl check for standard programs
60  dnl  dnl
 AC_PROG_CC([clang gcc cc])  
61  AC_PROG_CPP  AC_PROG_CPP
62    AC_PROG_CC([clang gcc cc])
63    AC_PROG_CXX([clang++ g++ c++])
64    AX_CXX_COMPILE_STDCXX(11,[],[mandatory])
65  AC_PROG_INSTALL  AC_PROG_INSTALL
66  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
67    
68  dnl check for c99 support  dnl FIXME: this works for now, but we should probably switch to libtool
69  dnl  dnl
70  AC_PROG_CC_C99  AC_PATH_PROG(LD, [ld], [none])
71  if test x"$ac_cv_prog_cc_c99" = xno ; then  if test x$LD = xnone ; then
72    AC_MSG_ERROR([Diderot requires c99 support])    AC_MSG_ERROR([cannot find ld command])
73  fi  fi
74    AC_SUBST(LD)
75    
76  dnl extra C compiler options  dnl extra compiler options
77  dnl  dnl
78  CFLAGS=""  CXXFLAGS_BASE="-Wreturn-type -Wuninitialized"
 CFLAG_M64="-m64"  
 CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"  
 AC_SUBST(CFLAG_M64)  
 AC_SUBST(CFLAGS_BASE)  
79    
80    dnl check for SIMD support
81  dnl  dnl
82  dnl check for pthreads support  AX_EXT
83  dnl  
84  ACX_PTHREAD()  AC_ARG_ENABLE([32-bit],
85      AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),
86      [CXXFLAG_Mxx="-m32"],
87      [CXXFLAG_Mxx="-m64"])
88    
89    CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
90    AC_SUBST(CXXFLAG_Mxx)
91    AC_SUBST(CXXFLAGS_BASE)
92    
 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  
93  dnl  dnl
94  dnl verify that $DOXYGEN is an absolute path  dnl run the compiler tests in 64-bit mode
95  dnl  dnl
96    case $DOXYGEN in  save_CFLAGS=$CFLAGS
97      /*) ;;  CFLAGS="$CFLAGS $CFLAG_MXX"
     *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;  
   esac  
 fi  
 if test $DOXYGEN = xnone ; then  
   DOXYGEN=:  
 fi  
 AC_SUBST(DOXYGEN)  
98    
99  dnl  dnl
100  dnl Look for NVIDIA's nvcc compiler  dnl check for gcc builtin atomic operations
101  dnl  dnl
102  AC_MSG_NOTICE([checking for CUDA and nvcc])  AC_MSG_CHECKING([for builtin atomic operations])
103  AC_PATH_PROG(NVCC, nvcc, no, $PATH)  AC_LINK_IFELSE(
104  if test x"$NVCC" = xno ; then     [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
105    AC_MSG_WARN([nvcc not found])     AC_MSG_RESULT(yes)
106    CUDA_ENABLED=false     AC_DEFINE(
107    NVCC=":"      [HAVE_BUILTIN_ATOMIC_OPS], 1,
108  else      [Define to 1 if gcc compiler provides atomic operations.]),
109    AC_MSG_RESULT([$NVCC])     AC_MSG_RESULT(no))
110    CUDA_ENABLED=true  
111  fi  AC_C_BIGENDIAN
112  AC_SUBST(NVCC)  
113  AC_SUBST(CUDA_ENABLED)  #
114    # determine the sizes of the standard C types
115    AC_CHECK_SIZEOF([int])
116    SIZEOF_C_INT=$ac_cv_sizeof_int
117    AC_CHECK_SIZEOF([long])
118    SIZEOF_C_LONG=$ac_cv_sizeof_long
119    AC_CHECK_SIZEOF([float])
120    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
121    AC_CHECK_SIZEOF([double])
122    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
123    
124    AC_SUBST(SIZEOF_C_INT)
125    AC_SUBST(SIZEOF_C_LONG)
126    AC_SUBST(SIZEOF_C_FLOAT)
127    AC_SUBST(SIZEOF_C_DOUBLE)
128    
129  dnl  dnl
130  dnl check for OpenCL support  dnl restore CFLAGS
131  dnl  dnl
132  CL_LIBS="none"  CFLAGS=$save_CFLAGS
133  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])  
134  dnl  dnl
135  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.  
136  dnl  dnl
137    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[  AC_HEADER_STDBOOL
138  # 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])],  
139  dnl  dnl
140  dnl not arrays, so try the OpenCL 1.1 structure representation  dnl the C boolean type to use in generated library headers
141  dnl  dnl
142      [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[  if test x"$ac_cv_header_stdbool_h" = xyes ; then
143  # ifdef HAVE_CL_CL_H    BOOLTY="bool"
144  #   include <CL/cl.h>  elif test "x$ac_cv_type__Bool" = xyes; then
145  # elif defined(HAVE_OPENCL_CL_H)    BOOLTY="_Bool"
146  #   include <OpenCL/cl.h>  else
147  # else    BOOLTY="int"
 #   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)  
148  fi  fi
149  AC_SUBST(CL_ENABLED)  AC_SUBST(BOOLTY)
150  AC_SUBST(CL_VERSION)  
151    dnl
152    dnl check for pthreads support
153    dnl
154    ACX_PTHREAD
155    
156  dnl  dnl
157  dnl check for various library routines etc.  dnl check for various library routines etc.
# Line 276  Line 260 
260  AC_SUBST(LD_NEEDS_RPATH)  AC_SUBST(LD_NEEDS_RPATH)
261  AC_SUBST(LIBM)  AC_SUBST(LIBM)
262    
263    #################### Logging configuration ####################
264    
265    LOGGING_ENABLED=false
266    AC_ARG_ENABLE([event-logging],
267      AC_HELP_STRING([--enable-event-logging], [include event-logging support for parallel target]),
268      [LOGGING_ENABLED=true],
269      [LOGGING_ENABLED=false])
270    
271    AC_SUBST(LOGGING_ENABLED)
272    
273    #################### end Logging configuration ####################
274    
275    #################### CUDA configuration ####################
276    
277    AC_ARG_ENABLE([cuda],
278      AC_HELP_STRING([--enable-cuda], [include support for targeting CUDA]))
279    
280    if test "${enable_cuda+set}" = set ; then
281    dnl
282    dnl Look for NVIDIA's nvcc compiler
283    dnl
284      AC_MSG_NOTICE([checking for CUDA and nvcc])
285      AC_PATH_PROG(NVCC, nvcc, no, $PATH)
286      if test x"$NVCC" = xno ; then
287        AC_MSG_WARN([nvcc not found])
288        CUDA_ENABLED=false
289        NVCC=":"
290      else
291        AC_MSG_RESULT([$NVCC])
292        CUDA_ENABLED=true
293      fi
294    else
295      NVCC=":"
296      CUDA_ENABLED=false
297    fi
298    AC_SUBST(NVCC)
299    AC_SUBST(CUDA_ENABLED)
300    
301    #################### end CUDA configuration ####################
302    
303    #################### OpenCL configuration ####################
304    
305    AC_ARG_ENABLE([opencl],
306      AC_HELP_STRING([--enable-opencl], [include support for targeting OpenCL]))
307    
308    if test "${enable_opencl+set}" = set ; then
309    
310  dnl  dnl
311  dnl get the path to the TEEM installation  dnl check for OpenCL support
312    dnl
313      LIBS_CL="none"
314      case "$host_os" in
315        darwin*) # On Mac OS X we check for installed frameworks
316          AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
317        ;;
318        *)
319          AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
320        ;;
321      esac
322      if test x"$LIBS_CL" = xnone ; then
323        AC_MSG_WARN([no OpenCL library found])
324        CL_ENABLED=false
325        CL_VERSION=0
326      else
327        CL_ENABLED=true
328        CPPFLAGS_CL=""
329        CL_HEADER=""
330        AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"])
331        if test x"$HAVE_CL_H" = xno ; then
332          # check for AMD's SDK
333          AC_MSG_CHECKING([for cl.h in AMD's SDK])
334          if test -d /opt/AMDAPP/include/CL ; then
335            HAVE_CL_H="yes"
336            CL_HEADER="/opt/AMDAPP/include/CL/cl.h"
337            AC_DEFINE([HAVE_CL_CL_H])
338            CPPFLAGS_CL="-I/opt/AMDAPP/include"
339          fi
340          AC_MSG_RESULT([$HAVE_CL_H])
341        fi
342        if test x"$HAVE_CL_H" = xno ; then
343          # check for NVIDIA's SDK
344          AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
345          CUDA_HOME=none
346          for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
347            if test -d /usr/local/$CUDA/include/CL ; then
348              CUDA_HOME=/usr/local/$CUDA
349              break
350            fi
351          done
352          if test x"$CUDA_HOME" != xnone ; then
353            HAVE_CL_H="yes"
354            CL_HEADER="$CUDA_HOME/include/CL/cl.h"
355            AC_DEFINE([HAVE_CL_CL_H])
356            CPPFLAGS_CL="-I$CUDA_HOME/include"
357          fi
358          AC_MSG_RESULT([$HAVE_CL_H])
359        fi
360        if test x"$HAVE_CL_H" = xno ; then
361          AC_MSG_WARN([no cl.h found])
362          CL_ENABLED=false
363          CL_VERSION=0
364          SIZEOF_CL_INT=0
365          SIZEOF_CL_LONG=0
366          SIZEOF_CL_FLOAT=0
367          SIZEOF_CL_DOUBLE=0
368        else
369          # check the cl.h header for which version of OpenCL is supported
370          AC_LANG([C])
371          save_CPPFLAGS=$CPPFLAGS
372          CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
373          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
374    #include <stdio.h>
375    # ifdef HAVE_CL_CL_H
376    #   include <CL/cl.h>
377    # elif defined(HAVE_OPENCL_CL_H)
378    #   include <OpenCL/cl.h>
379    # else
380    #   error no cl.h
381    # endif]],
382    [[#if defined(CL_VERSION_1_2)
383      printf("120\n");
384    #elif defined(CL_VERSION_1_1)
385      printf("110\n");
386    #elif defined(CL_VERSION_1_0)
387      printf("100\n");
388    #else
389      printf("0\n");
390    #endif
391            ]])],
392            [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
393    dnl
394    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
395    dnl the specification specifies the behavior, but it was unspecified in 1.0.
396    dnl
397          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
398      #include "$CL_HEADER"
399      ]],
400            [[cl_float4 x; x[0] = 0.0;]])],
401            [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
402      dnl
403      dnl not arrays, so try the OpenCL 1.1 structure representation
404      dnl
405            [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
406    #include "$CL_HEADER"
407    ]],
408            [[cl_float4 x; x.s[0] = 0.0;]])],
409            [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
410            [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
411        # restore saved CPPFLAGS
412          CPPFLAGS=$save_CPPFLAGS
413        # substitutions
414          AC_SUBST(LIBS_CL)
415          AC_SUBST(CPPFLAGS_CL)
416        #
417        # determine the sizes of the host-side OpenCL types
418        AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
419        SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
420        AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
421        SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
422        AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
423        SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
424        AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
425        SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
426        fi
427      fi
428    else
429      CL_ENABLED=false
430      CL_VERSION="0"
431      SIZEOF_CL_INT="0"
432      SIZEOF_CL_LONG="0"
433      SIZEOF_CL_FLOAT="0"
434      SIZEOF_CL_DOUBLE="0"
435    fi
436    
437    AC_SUBST(CL_ENABLED)
438    AC_SUBST(CL_VERSION)
439    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
440    
441    AC_SUBST(SIZEOF_CL_INT)
442    AC_SUBST(SIZEOF_CL_LONG)
443    AC_SUBST(SIZEOF_CL_FLOAT)
444    AC_SUBST(SIZEOF_CL_DOUBLE)
445    
446    #################### end OpenCL configuration ####################
447    
448    #################### Teem configuration ####################
449    
450    dnl get the path to the TEEM installation.  We need this to build the Diderot
451    dnl runtime code and we use the path when searching for teem in the Diderot
452    dnl compiler.
453    dnl
454    
455    dnl the path can be specified using "--with-teem=..." too
456  dnl  dnl
457  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
458    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
459    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
460    
461  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
462    dnl search for Teem in some standard places
463    dnl
464      AC_MSG_CHECKING([for teem])
465    TEEM_DIR=none    TEEM_DIR=none
466      POSSIBLE_TEEM_DIRS="/usr/local/teem /usr/local"
467      for dir in $POSSIBLE_TEEM_DIRS ; do
468        if test -f $dir/include/teem/nrrd.h ; then
469          TEEM_DIR=$dir
470          AC_MSG_RESULT([$TEEM_DIR])
471          break
472        fi
473      done
474      if test $TEEM_DIR = none ; then
475        AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
476      fi
477  else  else
478    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
479    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 294  Line 484 
484      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
485      # check that TEEM_DIR actually points to something that looks like teem      # check that TEEM_DIR actually points to something that looks like teem
486      if test -f $TEEM_DIR/include/teem/nrrd.h ; then      if test -f $TEEM_DIR/include/teem/nrrd.h ; then
487        AC_MSG_RESULT([ okay])        AC_MSG_RESULT([yes])
488      else      else
489        TEEM_DIR=none        TEEM_DIR=none
490        AC_MSG_RESULT([ invalid])        AC_MSG_RESULT([invalid path to teem])
491      fi      fi
492    else    else
493      TEEM_DIR=none      TEEM_DIR=none
494      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([invalid path to teem])
495    fi    fi
496  fi  fi
497  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
498    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem])
499  fi  fi
500    dnl
501    dnl check that teem supports the nrrdMetaDataNormalize function
502    dnl
503    save_LDFLAGS=$LDFLAGS
504    save_LIBS=$LIBS
505    LDFLAGS="$LDFLAGS -L$TEEM_DIR/lib"
506    LIBS="$LIBS -lteem -lm"
507    AC_CHECK_FUNCS([nrrdMetaDataNormalize])
508    LDFLAGS=$save_LDFLAGS
509    LIBS=$save_LIBS
510    
511    if test "x$ac_cv_func_nrrdMetaDataNormalize" != xyes; then
512      AC_MSG_ERROR(["please update your teem installation"])
513    fi
514    
515  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
516    
517  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
518    
519    #################### SML configuration ####################
520    
521  dnl  dnl
522    dnl We support building with both SML/NJ (the default) or MLton.
523    dnl
524    
525    dnl first check for --with-mlton=path flag
526    dnl
527    AC_ARG_WITH([mlton],
528      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
529        [use the MLton Standard ML compiler to build Diderot])],
530      [with_mlton=yes],[with_mlton=no])
531    if test x"$with_mlton" = xyes ; then
532      if test x"$ac_cv_path_with_mlton" = x ; then
533        # look for mlton in the PATH
534        AC_PATH_PROGS(with_mlton, mlton, no)
535        if test x"$MLTON" = xno ; then
536          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
537        fi
538      else
539        with_mlton=$ac_cv_path_with_mlton
540        case $with_mlton in
541          /*) ;;
542          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
543        esac
544        if test ! -x $with_mlton ; then
545          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
546        fi
547      fi
548    fi
549    
550    if test x"$with_mlton" = xno ; then
551      # we are using SML/NJ
552      #
553    
554  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
555  dnl  dnl
556  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; please add it to your PATH or set SML_CMD])])
557  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
558    -o $SMLNJ_MINOR_VERSION -lt 73      -o $SMLNJ_MINOR_VERSION -lt 80
559  then  then
560    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])      AC_MSG_ERROR([installation requires SML/NJ version 110.80+ (available from smlnj.org)])
561  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
562    
563  dnl determine the heap-image suffix  dnl determine the heap-image suffix
564  dnl  dnl
# Line 329  Line 567 
567    
568  dnl look for ml-makedepend  dnl look for ml-makedepend
569  dnl  dnl
 AC_MSG_CHECKING([for ml-makedepend])  
570  tmpPATH="$SMLNJ_PATH:$PATH"  tmpPATH="$SMLNJ_PATH:$PATH"
571  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  
572  AC_SUBST(ML_MAKEDEPEND)  AC_SUBST(ML_MAKEDEPEND)
573    
574  dnl  dnl
# Line 348  Line 580 
580    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
581  fi  fi
582  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
583      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  
584    
585  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
586  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)  
587  AC_SUBST(HEAP_IMAGE_DIR)  AC_SUBST(HEAP_IMAGE_DIR)
588  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
589    
590  dnl  else
 dnl ******************** C compiler properties ********************  
 dnl  
591    
592  dnl    # we are using MLton
593  dnl run the compiler tests in 64-bit mode    MLTON=$with_mlton
594  dnl    AC_SUBST(MLTON)
595  save_CFLAGS=$CFLAGS    SML=mlton
 CFLAGS="$CFLAGS $CFLAG_M64"  
596    
597  dnl  fi
598  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))  
599    
600  AC_C_BIGENDIAN  #################### end SML configuration ####################
601    
602    #################### Documentation tools configuration ####################
603    
604    dnl check for doxygen
605  dnl  dnl
606  dnl restore CFLAGS  AC_ARG_WITH([doxygen],
607      [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
608      [DOXYGEN=$with_doxygen],
609      [DOXYGEN=none])
610    if test x$DOXYGEN = xnone ; then
611      # see if we can find doxygen in the user's path
612      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
613    fi
614    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
615      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
616    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
617      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
618    elif test x$DOXYGEN != xnone ; then
619  dnl  dnl
620  CFLAGS=$save_CFLAGS  dnl verify that $DOXYGEN is an absolute path
621    dnl
622      case $DOXYGEN in
623        /*) ;;
624        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
625      esac
626    fi
627    if test $DOXYGEN = xnone ; then
628      DOXYGEN=:
629    fi
630    AC_SUBST(DOXYGEN)
631    
632    dnl check for asciidoc and related tools
633  dnl  dnl
634  dnl ******************** config.h stuff ********************  AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
635    AC_PATH_PROGS([A2X], [a2x], [none])
636    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
637    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
638    
639    dnl
640    dnl get the path to the asciidoc cofiguration files
641  dnl  dnl
642    if test x"$ASCIIDOC" != xnone ; then
643      AC_MSG_CHECKING([path to asciidoc configuration files])
644      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
645      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
646    fi
647    AC_SUBST(ASCIIDOC)
648    AC_SUBST(A2X)
649    AC_SUBST(ASCIIDOC_CONF_DIR)
650    AC_SUBST(HIGHLIGHTER)
651    AC_SUBST(DBLATEX)
652    
653  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])  #################### end Documentation tools configuration ####################
654    
655    #################### config.h ####################
656    
657    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
658    
659  AH_TOP([  AH_TOP([
660  /*  /*
661   * 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)
662   * All rights reserved.   *
663     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
664   */   */
665    
666  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 420  Line 672 
672  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
673  ])  ])
674    
675  dnl  #################### end config.h ####################
676  dnl ******************** write output ********************  
677  dnl  #################### write output ####################
678    
679    dnl The compiler Makefile depends on which SML system we are
680    dnl using.
681    if test x"$SML" = xmlton ; then
682      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
683    else
684      COMPILER_MAKEFILE_IN=""
685    fi
686    
687  AC_CONFIG_FILES(  AC_CONFIG_FILES(
688  dnl  dnl
689  dnl ***** Makefiles *****  dnl ***** Makefiles *****
690    Makefile    Makefile
691    doc/Makefile  dnl  doc/Makefile
692    src/clinfo/Makefile  dnl  doc/man/Makefile
693    src/dnorm/Makefile  dnl  src/clinfo/Makefile
694    src/compiler/Makefile    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
695    src/lib/build/Makefile    src/lib/build/Makefile
696    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
   test/MIP/Makefile  
   test/probe/Makefile  
697  dnl  dnl
698  dnl ***** SML source files *****  dnl ***** SML source files *****
699    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
700    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
701      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
702      src/compiler/options/version.sml:src/compiler/options/version_sml.in
703  )  )
704    
705  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)
706    
707  dnl  dnl
708  dnl shell scripts  dnl shell scripts
# Line 451  Line 711 
711    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
712  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
713  AC_CONFIG_FILES([  AC_CONFIG_FILES([
714    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
715  ], [chmod +x src/compiler/gen/file2str/file2str.sh])  ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
716    AC_CONFIG_FILES([
717      src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
718    ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
719    
720    dnl
721    dnl additional files for logging tools
722    dnl
723    if test x"$LOGGING_ENABLED" = xtrue ; then
724      AC_CONFIG_FILES(
725        src/logging/gen/Makefile
726        src/logging/log-analyze/Makefile
727        src/logging/log-dump/Makefile
728        src/logging/gen/main.sml:src/logging/gen/main_sml.in
729        src/logging/lib/default-log-paths.hxx:src/logging/lib/default-log-paths_hxx.in
730      )
731    fi
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 471  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"$LOGGING_ENABLED" = xtrue ; then
758  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])    MK_BUILD_DIR(rt-par-log, parallel, [parallel logging])
 MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])  
   
 if test x"$CL_ENABLED" = xtrue ; then  
   MK_BUILD_DIR(rt-cl-f, cl, [float])  
   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])  
759  fi  fi
760    
761    #if test x"$CL_ENABLED" = xtrue ; then
762    #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
763    #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
764    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
765    #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
766    #fi
767    
768  AC_OUTPUT  AC_OUTPUT
769    
770    #################### end write output ####################

Legend:
Removed from v.1685  
changed lines
  Added in v.4859

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