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

Legend:
Removed from v.1744  
changed lines
  Added in v.4841

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