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

trunk/configure.ac revision 1301, Thu Jun 9 23:58:40 2011 UTC branches/vis15/configure.ac revision 4665, Thu Sep 29 17:57:02 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  dnl NOTE: MANTICORE_DIST_VERSION is an M4 variable defined in config/aclocal.m4  AC_INIT(diderot,2.0,)
 dnl  
 AC_INIT(diderot,0.1,)  
10    
11  AC_PREREQ(2.60)  AC_PREREQ(2.60)
12  AC_COPYRIGHT([[COPYRIGHT (c) 2010 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  CFLAG_M64="-m64"  CXXFLAGS_BASE="-Wreturn-type -Wuninitialized"
 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    
84    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    
93    dnl
94    dnl run the compiler tests in 64-bit mode
95  dnl  dnl
96  ACX_PTHREAD()  save_CFLAGS=$CFLAGS
97    CFLAGS="$CFLAGS $CFLAG_MXX"
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  
134    darwin*) # On Mac OS X we check for installed frameworks  dnl
135      AX_CHECK_FRAMEWORK([OpenCL], [CL_LIBS="-framework OpenCL"], [])  dnl check for <stdbool.h>, which we use in the C API
136    ;;  dnl
137    *)  AC_HEADER_STDBOOL
138      AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[CL_LIBS="-lOpenCL"])  
139    ;;  dnl
140  esac  dnl the C boolean type to use in generated library headers
141  if test x"$CL_LIBS" = xnone ; then  dnl
142    AC_MSG_WARN([no OpenCL library found])  if test x"$ac_cv_header_stdbool_h" = xyes ; then
143    CL_ENABLED=false    BOOLTY="bool"
144    CL_VERSION=0  elif test "x$ac_cv_type__Bool" = xyes; then
145      BOOLTY="_Bool"
146  else  else
147    CL_ENABLED=true    BOOLTY="int"
   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])  
   # 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 221  Line 260 
260  AC_SUBST(LD_NEEDS_RPATH)  AC_SUBST(LD_NEEDS_RPATH)
261  AC_SUBST(LIBM)  AC_SUBST(LIBM)
262    
263    #################### CUDA configuration ####################
264    
265    AC_ARG_ENABLE([cuda],
266      AC_HELP_STRING([--enable-cuda], [include support for targeting CUDA]))
267    
268    if test "${enable_cuda+set}" = set ; then
269    dnl
270    dnl Look for NVIDIA's nvcc compiler
271    dnl
272      AC_MSG_NOTICE([checking for CUDA and nvcc])
273      AC_PATH_PROG(NVCC, nvcc, no, $PATH)
274      if test x"$NVCC" = xno ; then
275        AC_MSG_WARN([nvcc not found])
276        CUDA_ENABLED=false
277        NVCC=":"
278      else
279        AC_MSG_RESULT([$NVCC])
280        CUDA_ENABLED=true
281      fi
282    else
283      NVCC=":"
284      CUDA_ENABLED=false
285    fi
286    AC_SUBST(NVCC)
287    AC_SUBST(CUDA_ENABLED)
288    
289    #################### end CUDA configuration ####################
290    
291    #################### OpenCL configuration ####################
292    
293    AC_ARG_ENABLE([opencl],
294      AC_HELP_STRING([--enable-opencl], [include support for targeting OpenCL]))
295    
296    if test "${enable_opencl+set}" = set ; then
297    
298    dnl
299    dnl check for OpenCL support
300    dnl
301      LIBS_CL="none"
302      case "$host_os" in
303        darwin*) # On Mac OS X we check for installed frameworks
304          AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
305        ;;
306        *)
307          AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
308        ;;
309      esac
310      if test x"$LIBS_CL" = xnone ; then
311        AC_MSG_WARN([no OpenCL library found])
312        CL_ENABLED=false
313        CL_VERSION=0
314      else
315        CL_ENABLED=true
316        CPPFLAGS_CL=""
317        CL_HEADER=""
318        AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"])
319        if test x"$HAVE_CL_H" = xno ; then
320          # check for AMD's SDK
321          AC_MSG_CHECKING([for cl.h in AMD's SDK])
322          if test -d /opt/AMDAPP/include/CL ; then
323            HAVE_CL_H="yes"
324            CL_HEADER="/opt/AMDAPP/include/CL/cl.h"
325            AC_DEFINE([HAVE_CL_CL_H])
326            CPPFLAGS_CL="-I/opt/AMDAPP/include"
327          fi
328          AC_MSG_RESULT([$HAVE_CL_H])
329        fi
330        if test x"$HAVE_CL_H" = xno ; then
331          # check for NVIDIA's SDK
332          AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
333          CUDA_HOME=none
334          for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
335            if test -d /usr/local/$CUDA/include/CL ; then
336              CUDA_HOME=/usr/local/$CUDA
337              break
338            fi
339          done
340          if test x"$CUDA_HOME" != xnone ; then
341            HAVE_CL_H="yes"
342            CL_HEADER="$CUDA_HOME/include/CL/cl.h"
343            AC_DEFINE([HAVE_CL_CL_H])
344            CPPFLAGS_CL="-I$CUDA_HOME/include"
345          fi
346          AC_MSG_RESULT([$HAVE_CL_H])
347        fi
348        if test x"$HAVE_CL_H" = xno ; then
349          AC_MSG_WARN([no cl.h found])
350          CL_ENABLED=false
351          CL_VERSION=0
352          SIZEOF_CL_INT=0
353          SIZEOF_CL_LONG=0
354          SIZEOF_CL_FLOAT=0
355          SIZEOF_CL_DOUBLE=0
356        else
357          # check the cl.h header for which version of OpenCL is supported
358          AC_LANG([C])
359          save_CPPFLAGS=$CPPFLAGS
360          CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
361          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
362    #include <stdio.h>
363    # ifdef HAVE_CL_CL_H
364    #   include <CL/cl.h>
365    # elif defined(HAVE_OPENCL_CL_H)
366    #   include <OpenCL/cl.h>
367    # else
368    #   error no cl.h
369    # endif]],
370    [[#if defined(CL_VERSION_1_2)
371      printf("120\n");
372    #elif defined(CL_VERSION_1_1)
373      printf("110\n");
374    #elif defined(CL_VERSION_1_0)
375      printf("100\n");
376    #else
377      printf("0\n");
378    #endif
379            ]])],
380            [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
381    dnl
382    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
383    dnl the specification specifies the behavior, but it was unspecified in 1.0.
384    dnl
385          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
386      #include "$CL_HEADER"
387      ]],
388            [[cl_float4 x; x[0] = 0.0;]])],
389            [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
390      dnl
391      dnl not arrays, so try the OpenCL 1.1 structure representation
392      dnl
393            [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
394    #include "$CL_HEADER"
395    ]],
396            [[cl_float4 x; x.s[0] = 0.0;]])],
397            [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
398            [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
399        # restore saved CPPFLAGS
400          CPPFLAGS=$save_CPPFLAGS
401        # substitutions
402          AC_SUBST(LIBS_CL)
403          AC_SUBST(CPPFLAGS_CL)
404        #
405        # determine the sizes of the host-side OpenCL types
406        AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
407        SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
408        AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
409        SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
410        AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
411        SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
412        AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
413        SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
414        fi
415      fi
416    else
417      CL_ENABLED=false
418      CL_VERSION="0"
419      SIZEOF_CL_INT="0"
420      SIZEOF_CL_LONG="0"
421      SIZEOF_CL_FLOAT="0"
422      SIZEOF_CL_DOUBLE="0"
423    fi
424    
425    AC_SUBST(CL_ENABLED)
426    AC_SUBST(CL_VERSION)
427    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
428    
429    AC_SUBST(SIZEOF_CL_INT)
430    AC_SUBST(SIZEOF_CL_LONG)
431    AC_SUBST(SIZEOF_CL_FLOAT)
432    AC_SUBST(SIZEOF_CL_DOUBLE)
433    
434    #################### end OpenCL configuration ####################
435    
436    #################### Teem configuration ####################
437    
438    dnl get the path to the TEEM installation.  We need this to build the Diderot
439    dnl runtime code and we use the path when searching for teem in the Diderot
440    dnl compiler.
441  dnl  dnl
442  dnl get the path to the TEEM installation  
443    dnl the path can be specified using "--with-teem=..." too
444  dnl  dnl
445  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
446    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
447    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
448    
449  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
450    dnl search for Teem in some standard places
451    dnl
452      AC_MSG_CHECKING([for teem])
453    TEEM_DIR=none    TEEM_DIR=none
454      POSSIBLE_TEEM_DIRS="/usr/local/teem /usr/local"
455      for dir in $POSSIBLE_TEEM_DIRS ; do
456        if test -f $dir/include/teem/nrrd.h ; then
457          TEEM_DIR=$dir
458          AC_MSG_RESULT([$TEEM_DIR])
459          break
460        fi
461      done
462      if test $TEEM_DIR = none ; then
463        AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
464      fi
465  else  else
466    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
467    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 237  Line 470 
470    esac    esac
471    if test -x $ac_cv_use_teem ; then    if test -x $ac_cv_use_teem ; then
472      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
473      AC_MSG_RESULT([ okay])      # check that TEEM_DIR actually points to something that looks like teem
474        if test -f $TEEM_DIR/include/teem/nrrd.h ; then
475          AC_MSG_RESULT([yes])
476        else
477          TEEM_DIR=none
478          AC_MSG_RESULT([invalid path to teem])
479        fi
480    else    else
481      TEEM_DIR=none      TEEM_DIR=none
482      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([invalid path to teem])
483    fi    fi
484  fi  fi
485  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
486    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem])
487  fi  fi
488    dnl
489    dnl check that teem supports the nrrdMetaDataNormalize function
490    dnl
491    save_LDFLAGS=$LDFLAGS
492    save_LIBS=$LIBS
493    LDFLAGS="$LDFLAGS -L$TEEM_DIR/lib"
494    LIBS="$LIBS -lteem -lm"
495    AC_CHECK_FUNCS([nrrdMetaDataNormalize])
496    LDFLAGS=$save_LDFLAGS
497    LIBS=$save_LIBS
498    
499    if test "x$ac_cv_func_nrrdMetaDataNormalize" != xyes; then
500      AC_MSG_ERROR(["please update your teem installation"])
501    fi
502    
503  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
504    
505  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
506    
507    #################### SML configuration ####################
508    
509    dnl
510    dnl We support building with both SML/NJ (the default) or MLton.
511  dnl  dnl
512    
513    dnl first check for --with-mlton=path flag
514    dnl
515    AC_ARG_WITH([mlton],
516      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
517        [use the MLton Standard ML compiler to build Diderot])],
518      [with_mlton=yes],[with_mlton=no])
519    if test x"$with_mlton" = xyes ; then
520      if test x"$ac_cv_path_with_mlton" = x ; then
521        # look for mlton in the PATH
522        AC_PATH_PROGS(with_mlton, mlton, no)
523        if test x"$MLTON" = xno ; then
524          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
525        fi
526      else
527        with_mlton=$ac_cv_path_with_mlton
528        case $with_mlton in
529          /*) ;;
530          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
531        esac
532        if test ! -x $with_mlton ; then
533          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
534        fi
535      fi
536    fi
537    
538    if test x"$with_mlton" = xno ; then
539      # we are using SML/NJ
540      #
541    
542  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
543  dnl  dnl
544  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])])
545  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
546    -o $SMLNJ_MINOR_VERSION -lt 73      -o $SMLNJ_MINOR_VERSION -lt 80
547  then  then
548    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])      AC_MSG_ERROR([installation requires SML/NJ version 110.80+ (available from smlnj.org)])
549  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
550    
551  dnl determine the heap-image suffix  dnl determine the heap-image suffix
552  dnl  dnl
# Line 268  Line 555 
555    
556  dnl look for ml-makedepend  dnl look for ml-makedepend
557  dnl  dnl
 AC_MSG_CHECKING([for ml-makedepend])  
558  tmpPATH="$SMLNJ_PATH:$PATH"  tmpPATH="$SMLNJ_PATH:$PATH"
559  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  
560  AC_SUBST(ML_MAKEDEPEND)  AC_SUBST(ML_MAKEDEPEND)
561    
562  dnl  dnl
# Line 287  Line 568 
568    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
569  fi  fi
570  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
571      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  
572    
573  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
574  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)  
575  AC_SUBST(HEAP_IMAGE_DIR)  AC_SUBST(HEAP_IMAGE_DIR)
576  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
577    
578  dnl  else
 dnl ******************** C compiler properties ********************  
 dnl  
579    
580  dnl    # we are using MLton
581  dnl run the compiler tests in 64-bit mode    MLTON=$with_mlton
582  dnl    AC_SUBST(MLTON)
583  save_CFLAGS=$CFLAGS    SML=mlton
 CFLAGS="$CFLAGS $CFLAG_M64"  
584    
585  dnl  fi
586  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))  
587    
588  AC_C_BIGENDIAN  #################### end SML configuration ####################
589    
590    #################### Documentation tools configuration ####################
591    
592    dnl check for doxygen
593  dnl  dnl
594  dnl restore CFLAGS  AC_ARG_WITH([doxygen],
595      [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
596      [DOXYGEN=$with_doxygen],
597      [DOXYGEN=none])
598    if test x$DOXYGEN = xnone ; then
599      # see if we can find doxygen in the user's path
600      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
601    fi
602    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
603      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
604    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
605      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
606    elif test x$DOXYGEN != xnone ; then
607  dnl  dnl
608  CFLAGS=$save_CFLAGS  dnl verify that $DOXYGEN is an absolute path
609    dnl
610      case $DOXYGEN in
611        /*) ;;
612        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
613      esac
614    fi
615    if test $DOXYGEN = xnone ; then
616      DOXYGEN=:
617    fi
618    AC_SUBST(DOXYGEN)
619    
620    dnl check for asciidoc and related tools
621    dnl
622    AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
623    AC_PATH_PROGS([A2X], [a2x], [none])
624    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
625    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
626    
627  dnl  dnl
628  dnl ******************** config.h stuff ********************  dnl get the path to the asciidoc cofiguration files
629  dnl  dnl
630    if test x"$ASCIIDOC" != xnone ; then
631      AC_MSG_CHECKING([path to asciidoc configuration files])
632      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
633      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
634    fi
635    AC_SUBST(ASCIIDOC)
636    AC_SUBST(A2X)
637    AC_SUBST(ASCIIDOC_CONF_DIR)
638    AC_SUBST(HIGHLIGHTER)
639    AC_SUBST(DBLATEX)
640    
641    #################### end Documentation tools configuration ####################
642    
643  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])  #################### config.h ####################
644    
645    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
646    
647  AH_TOP([  AH_TOP([
648  /*  /*
649   * 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)
650   * All rights reserved.   *
651     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
652   */   */
653    
654  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 359  Line 660 
660  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
661  ])  ])
662    
663  dnl  #################### end config.h ####################
664  dnl ******************** write output ********************  
665  dnl  #################### write output ####################
666    
667    dnl The compiler Makefile depends on which SML system we are
668    dnl using.
669    if test x"$SML" = xmlton ; then
670      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
671    else
672      COMPILER_MAKEFILE_IN=""
673    fi
674    
675  AC_CONFIG_FILES(  AC_CONFIG_FILES(
676  dnl  dnl
677  dnl ***** Makefiles *****  dnl ***** Makefiles *****
678    Makefile    Makefile
679    src/dnorm/Makefile  dnl  doc/Makefile
680    src/compiler/Makefile  dnl  doc/man/Makefile
681    dnl  src/clinfo/Makefile
682      src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
683    src/lib/build/Makefile    src/lib/build/Makefile
684    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  
   test/teem/Makefile  
 dnl  
 dnl ***** CM files *****  
   src/compiler/codegen/sources.cm:src/compiler/codegen/sources_cm.in  
685  dnl  dnl
686  dnl ***** SML source files *****  dnl ***** SML source files *****
687    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
688    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
689      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
690      src/compiler/options/version.sml:src/compiler/options/version_sml.in
691  )  )
692    
693  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)
694    
695  dnl  dnl
696  dnl shell scripts  dnl shell scripts
# Line 391  Line 698 
698  AC_CONFIG_FILES([  AC_CONFIG_FILES([
699    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
700  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
701    AC_CONFIG_FILES([
702      src/compiler/gen/fragments/mkfrags.sh:src/compiler/gen/fragments/mkfrags_sh.in
703    ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
704    AC_CONFIG_FILES([
705      src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
706    ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
707    AC_CONFIG_FILES([
708      src/tests/rtest/scripts/run.sh:src/tests/rtest/scripts/run_sh.in
709    ], [chmod +x src/tests/rtest/scripts/run.sh])
710    AC_CONFIG_FILES([
711      src/tests/rtest/scripts/run-one.sh:src/tests/rtest/scripts/run-one_sh.in
712    ], [chmod +x src/tests/rtest/scripts/run-one.sh])
713    
714  dnl  dnl
715  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
716  dnl  dnl
717  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
718  dnl  dnl
719    dnl where the options are taken from [debug, parallel]
720    dnl
721  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
722      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
723        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 409  Line 730 
730      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
731    ])    ])
732    
733  MK_BUILD_DIR(rt-c-f, c, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
734  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])  MK_BUILD_DIR(rt-seq-debug, sequential, [debug])
735  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  MK_BUILD_DIR(rt-par, parallel, [parallel])
736  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])  MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
737    
738    #if test x"$CL_ENABLED" = xtrue ; then
739    #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
740    #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
741    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
742    #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
743    #fi
744    
745  AC_OUTPUT  AC_OUTPUT
746    
747    #################### end write output ####################

Legend:
Removed from v.1301  
changed lines
  Added in v.4665

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