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 4884, Mon Jan 2 18:46:26 2017 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    
# Line 40  Line 73 
73  fi  fi
74  AC_SUBST(LD)  AC_SUBST(LD)
75    
76  dnl check for c99 support  dnl extra compiler options
77  dnl  dnl
78  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  
79    
80  dnl extra C compiler options  dnl check for SIMD support
81  dnl  dnl
82  CFLAGS=""  AX_EXT
83  CFLAG_M64="-m64"  
84  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"  AC_ARG_ENABLE([32-bit],
85  AC_SUBST(CFLAG_M64)    AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),
86  AC_SUBST(CFLAGS_BASE)    [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  dnl
94  dnl check for pthreads support  dnl run the compiler tests in 64-bit mode
95  dnl  dnl
96  ACX_PTHREAD()  save_CFLAGS=$CFLAGS
97    CFLAGS="$CFLAGS $CFLAG_MXX"
98    
 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  
99  dnl  dnl
100  dnl verify that $DOXYGEN is an absolute path  dnl check for gcc builtin atomic operations
101  dnl  dnl
102    case $DOXYGEN in  AC_MSG_CHECKING([for builtin atomic operations])
103      /*) ;;  AC_LINK_IFELSE(
104      *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;     [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
105    esac     AC_MSG_RESULT(yes)
106  fi     AC_DEFINE(
107  if test $DOXYGEN = xnone ; then      [HAVE_BUILTIN_ATOMIC_OPS], 1,
108    DOXYGEN=:      [Define to 1 if gcc compiler provides atomic operations.]),
109  fi     AC_MSG_RESULT(no))
110  AC_SUBST(DOXYGEN)  
111    AC_C_BIGENDIAN
112    
113    #
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 Look for NVIDIA's nvcc compiler  dnl restore CFLAGS
131  dnl  dnl
132  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)  
133    
134  dnl  dnl
135  dnl check for OpenCL support  dnl check for <stdbool.h>, which we use in the C API
136  dnl  dnl
137  CL_LIBS="none"  AC_HEADER_STDBOOL
138  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])  
139  dnl  dnl
140  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.  
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"
148  #   error no cl.h  fi
149  # endif]],  AC_SUBST(BOOLTY)
150      [[cl_float4 x; x[0] = 0.0;]])],  
     [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],  
151  dnl  dnl
152  dnl not arrays, so try the OpenCL 1.1 structure representation  dnl check for pthreads support
153  dnl  dnl
154      [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)  
155    
156  dnl  dnl
157  dnl check for various library routines etc.  dnl check for various library routines etc.
# Line 249  Line 225 
225  dnl  dnl
226  AC_CHECK_FILES(/proc/cpuinfo)  AC_CHECK_FILES(/proc/cpuinfo)
227    
228    dnl check for getcpu and/or sched_getcpu
229    dnl
230    hasGetCPU=no;
231    AC_CHECK_HEADERS([linux/getcpu.h])
232    if test "x$ac_cv_header_linux_getcpu_h" = xyes; then
233      AC_CHECK_FUNCS([getcpu])
234      hasGetCPU=yes;
235    else
236      # getcpu is usually called using syscall
237      #
238      AC_MSG_CHECKING([SYS_getcpu])
239      AC_RUN_IFELSE([AC_LANG_SOURCE([[
240        #define _GNU_SOURCE
241        #include <unistd.h>
242        #include <sys/syscall.h>
243        int main () {
244          unsigned cpu, node;
245          return syscall (SYS_getcpu, &cpu, &node, 0);
246        }
247        ]])],[hasGetCPU=yes],[])
248      AC_MSG_RESULT([$hasGetCPU])
249      if test x"$hasGetCPU" = xyes ; then
250        AC_DEFINE([HAVE_SYS_GETCPU],[1],[Define if SYS_getcpu is defined in <sys/syscall.h>])
251      fi
252    fi
253    if test x"$hasGetCPU" != xyes ; then
254    AC_CHECK_FUNCS([sched_getcpu])
255    fi
256    
257  dnl  dnl
258  dnl OS-specific linking issues  dnl OS-specific linking issues
259  dnl  dnl
# Line 284  Line 289 
289  AC_SUBST(LD_NEEDS_RPATH)  AC_SUBST(LD_NEEDS_RPATH)
290  AC_SUBST(LIBM)  AC_SUBST(LIBM)
291    
292    #################### Logging configuration ####################
293    
294    LOGGING_ENABLED=false
295    AC_ARG_ENABLE([event-logging],
296      AC_HELP_STRING([--enable-event-logging], [include event-logging support for parallel target]),
297      [LOGGING_ENABLED=true],
298      [LOGGING_ENABLED=false])
299    
300    AC_SUBST(LOGGING_ENABLED)
301    
302    #################### end Logging configuration ####################
303    
304    #################### CUDA configuration ####################
305    
306    AC_ARG_ENABLE([cuda],
307      AC_HELP_STRING([--enable-cuda], [include support for targeting CUDA]))
308    
309    if test "${enable_cuda+set}" = set ; then
310  dnl  dnl
311  dnl get the path to the TEEM installation  dnl Look for NVIDIA's nvcc compiler
312    dnl
313      AC_MSG_NOTICE([checking for CUDA and nvcc])
314      AC_PATH_PROG(NVCC, nvcc, no, $PATH)
315      if test x"$NVCC" = xno ; then
316        AC_MSG_WARN([nvcc not found])
317        CUDA_ENABLED=false
318        NVCC=":"
319      else
320        AC_MSG_RESULT([$NVCC])
321        CUDA_ENABLED=true
322      fi
323    else
324      NVCC=":"
325      CUDA_ENABLED=false
326    fi
327    AC_SUBST(NVCC)
328    AC_SUBST(CUDA_ENABLED)
329    
330    #################### end CUDA configuration ####################
331    
332    #################### OpenCL configuration ####################
333    
334    AC_ARG_ENABLE([opencl],
335      AC_HELP_STRING([--enable-opencl], [include support for targeting OpenCL]))
336    
337    if test "${enable_opencl+set}" = set ; then
338    
339    dnl
340    dnl check for OpenCL support
341    dnl
342      LIBS_CL="none"
343      case "$host_os" in
344        darwin*) # On Mac OS X we check for installed frameworks
345          AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
346        ;;
347        *)
348          AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
349        ;;
350      esac
351      if test x"$LIBS_CL" = xnone ; then
352        AC_MSG_WARN([no OpenCL library found])
353        CL_ENABLED=false
354        CL_VERSION=0
355      else
356        CL_ENABLED=true
357        CPPFLAGS_CL=""
358        CL_HEADER=""
359        AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"])
360        if test x"$HAVE_CL_H" = xno ; then
361          # check for AMD's SDK
362          AC_MSG_CHECKING([for cl.h in AMD's SDK])
363          if test -d /opt/AMDAPP/include/CL ; then
364            HAVE_CL_H="yes"
365            CL_HEADER="/opt/AMDAPP/include/CL/cl.h"
366            AC_DEFINE([HAVE_CL_CL_H])
367            CPPFLAGS_CL="-I/opt/AMDAPP/include"
368          fi
369          AC_MSG_RESULT([$HAVE_CL_H])
370        fi
371        if test x"$HAVE_CL_H" = xno ; then
372          # check for NVIDIA's SDK
373          AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
374          CUDA_HOME=none
375          for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
376            if test -d /usr/local/$CUDA/include/CL ; then
377              CUDA_HOME=/usr/local/$CUDA
378              break
379            fi
380          done
381          if test x"$CUDA_HOME" != xnone ; then
382            HAVE_CL_H="yes"
383            CL_HEADER="$CUDA_HOME/include/CL/cl.h"
384            AC_DEFINE([HAVE_CL_CL_H])
385            CPPFLAGS_CL="-I$CUDA_HOME/include"
386          fi
387          AC_MSG_RESULT([$HAVE_CL_H])
388        fi
389        if test x"$HAVE_CL_H" = xno ; then
390          AC_MSG_WARN([no cl.h found])
391          CL_ENABLED=false
392          CL_VERSION=0
393          SIZEOF_CL_INT=0
394          SIZEOF_CL_LONG=0
395          SIZEOF_CL_FLOAT=0
396          SIZEOF_CL_DOUBLE=0
397        else
398          # check the cl.h header for which version of OpenCL is supported
399          AC_LANG([C])
400          save_CPPFLAGS=$CPPFLAGS
401          CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
402          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
403    #include <stdio.h>
404    # ifdef HAVE_CL_CL_H
405    #   include <CL/cl.h>
406    # elif defined(HAVE_OPENCL_CL_H)
407    #   include <OpenCL/cl.h>
408    # else
409    #   error no cl.h
410    # endif]],
411    [[#if defined(CL_VERSION_1_2)
412      printf("120\n");
413    #elif defined(CL_VERSION_1_1)
414      printf("110\n");
415    #elif defined(CL_VERSION_1_0)
416      printf("100\n");
417    #else
418      printf("0\n");
419    #endif
420            ]])],
421            [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
422    dnl
423    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
424    dnl the specification specifies the behavior, but it was unspecified in 1.0.
425    dnl
426          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
427      #include "$CL_HEADER"
428      ]],
429            [[cl_float4 x; x[0] = 0.0;]])],
430            [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
431      dnl
432      dnl not arrays, so try the OpenCL 1.1 structure representation
433      dnl
434            [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
435    #include "$CL_HEADER"
436    ]],
437            [[cl_float4 x; x.s[0] = 0.0;]])],
438            [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
439            [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
440        # restore saved CPPFLAGS
441          CPPFLAGS=$save_CPPFLAGS
442        # substitutions
443          AC_SUBST(LIBS_CL)
444          AC_SUBST(CPPFLAGS_CL)
445        #
446        # determine the sizes of the host-side OpenCL types
447        AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
448        SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
449        AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
450        SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
451        AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
452        SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
453        AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
454        SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
455        fi
456      fi
457    else
458      CL_ENABLED=false
459      CL_VERSION="0"
460      SIZEOF_CL_INT="0"
461      SIZEOF_CL_LONG="0"
462      SIZEOF_CL_FLOAT="0"
463      SIZEOF_CL_DOUBLE="0"
464    fi
465    
466    AC_SUBST(CL_ENABLED)
467    AC_SUBST(CL_VERSION)
468    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
469    
470    AC_SUBST(SIZEOF_CL_INT)
471    AC_SUBST(SIZEOF_CL_LONG)
472    AC_SUBST(SIZEOF_CL_FLOAT)
473    AC_SUBST(SIZEOF_CL_DOUBLE)
474    
475    #################### end OpenCL configuration ####################
476    
477    #################### Teem configuration ####################
478    
479    dnl get the path to the TEEM installation.  We need this to build the Diderot
480    dnl runtime code and we use the path when searching for teem in the Diderot
481    dnl compiler.
482    dnl
483    
484    dnl the path can be specified using "--with-teem=..." too
485  dnl  dnl
486  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
487    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
488    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
489    
490  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
491    dnl search for Teem in some standard places
492    dnl
493      AC_MSG_CHECKING([for teem])
494    TEEM_DIR=none    TEEM_DIR=none
495      POSSIBLE_TEEM_DIRS="/usr/local/teem /usr/local"
496      for dir in $POSSIBLE_TEEM_DIRS ; do
497        if test -f $dir/include/teem/nrrd.h ; then
498          TEEM_DIR=$dir
499          AC_MSG_RESULT([$TEEM_DIR])
500          break
501        fi
502      done
503      if test $TEEM_DIR = none ; then
504        AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
505      fi
506  else  else
507    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
508    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 302  Line 513 
513      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
514      # check that TEEM_DIR actually points to something that looks like teem      # check that TEEM_DIR actually points to something that looks like teem
515      if test -f $TEEM_DIR/include/teem/nrrd.h ; then      if test -f $TEEM_DIR/include/teem/nrrd.h ; then
516        AC_MSG_RESULT([ okay])        AC_MSG_RESULT([yes])
517      else      else
518        TEEM_DIR=none        TEEM_DIR=none
519        AC_MSG_RESULT([ invalid])        AC_MSG_RESULT([invalid path to teem])
520      fi      fi
521    else    else
522      TEEM_DIR=none      TEEM_DIR=none
523      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([invalid path to teem])
524    fi    fi
525  fi  fi
526  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
527    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem])
528  fi  fi
529    dnl
530    dnl check that teem supports the nrrdMetaDataNormalize function
531    dnl
532    save_LDFLAGS=$LDFLAGS
533    save_LIBS=$LIBS
534    LDFLAGS="$LDFLAGS -L$TEEM_DIR/lib"
535    LIBS="$LIBS -lteem -lm"
536    AC_CHECK_FUNCS([nrrdMetaDataNormalize])
537    LDFLAGS=$save_LDFLAGS
538    LIBS=$save_LIBS
539    
540    if test "x$ac_cv_func_nrrdMetaDataNormalize" != xyes; then
541      AC_MSG_ERROR(["please update your teem installation"])
542    fi
543    
544  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
545    
546  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
547    
548    #################### SML configuration ####################
549    
550    dnl
551    dnl We support building with both SML/NJ (the default) or MLton.
552  dnl  dnl
553    
554    dnl first check for --with-mlton=path flag
555    dnl
556    AC_ARG_WITH([mlton],
557      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
558        [use the MLton Standard ML compiler to build Diderot])],
559      [with_mlton=yes],[with_mlton=no])
560    if test x"$with_mlton" = xyes ; then
561      if test x"$ac_cv_path_with_mlton" = x ; then
562        # look for mlton in the PATH
563        AC_PATH_PROGS(with_mlton, mlton, no)
564        if test x"$MLTON" = xno ; then
565          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
566        fi
567      else
568        with_mlton=$ac_cv_path_with_mlton
569        case $with_mlton in
570          /*) ;;
571          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
572        esac
573        if test ! -x $with_mlton ; then
574          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
575        fi
576      fi
577    fi
578    
579    if test x"$with_mlton" = xno ; then
580      # we are using SML/NJ
581      #
582    
583  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
584  dnl  dnl
585  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])])
586  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
587    -o $SMLNJ_MINOR_VERSION -lt 73      -o $SMLNJ_MINOR_VERSION -lt 80
588  then  then
589    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])      AC_MSG_ERROR([installation requires SML/NJ version 110.80+ (available from smlnj.org)])
590  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
591    
592  dnl determine the heap-image suffix  dnl determine the heap-image suffix
593  dnl  dnl
# Line 337  Line 596 
596    
597  dnl look for ml-makedepend  dnl look for ml-makedepend
598  dnl  dnl
 AC_MSG_CHECKING([for ml-makedepend])  
599  tmpPATH="$SMLNJ_PATH:$PATH"  tmpPATH="$SMLNJ_PATH:$PATH"
600  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  
601  AC_SUBST(ML_MAKEDEPEND)  AC_SUBST(ML_MAKEDEPEND)
602    
603  dnl  dnl
# Line 356  Line 609 
609    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
610  fi  fi
611  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
612      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  
613    
614  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
615  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)  
616  AC_SUBST(HEAP_IMAGE_DIR)  AC_SUBST(HEAP_IMAGE_DIR)
617  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
618    
619  dnl  else
 dnl ******************** C compiler properties ********************  
 dnl  
620    
621  dnl    # we are using MLton
622  dnl run the compiler tests in 64-bit mode    MLTON=$with_mlton
623  dnl    AC_SUBST(MLTON)
624  save_CFLAGS=$CFLAGS    SML=mlton
 CFLAGS="$CFLAGS $CFLAG_M64"  
625    
626  dnl  fi
627  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))  
628    
629  AC_C_BIGENDIAN  #################### end SML configuration ####################
630    
631    #################### Documentation tools configuration ####################
632    
633    dnl check for doxygen
634  dnl  dnl
635  dnl restore CFLAGS  AC_ARG_WITH([doxygen],
636      [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
637      [DOXYGEN=$with_doxygen],
638      [DOXYGEN=none])
639    if test x$DOXYGEN = xnone ; then
640      # see if we can find doxygen in the user's path
641      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
642    fi
643    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
644      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
645    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
646      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
647    elif test x$DOXYGEN != xnone ; then
648  dnl  dnl
649  CFLAGS=$save_CFLAGS  dnl verify that $DOXYGEN is an absolute path
650    dnl
651      case $DOXYGEN in
652        /*) ;;
653        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
654      esac
655    fi
656    if test $DOXYGEN = xnone ; then
657      DOXYGEN=:
658    fi
659    AC_SUBST(DOXYGEN)
660    
661    dnl check for asciidoc and related tools
662  dnl  dnl
663  dnl ******************** config.h stuff ********************  AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
664    AC_PATH_PROGS([A2X], [a2x], [none])
665    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
666    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
667    
668    dnl
669    dnl get the path to the asciidoc cofiguration files
670  dnl  dnl
671    if test x"$ASCIIDOC" != xnone ; then
672      AC_MSG_CHECKING([path to asciidoc configuration files])
673      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
674      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
675    fi
676    AC_SUBST(ASCIIDOC)
677    AC_SUBST(A2X)
678    AC_SUBST(ASCIIDOC_CONF_DIR)
679    AC_SUBST(HIGHLIGHTER)
680    AC_SUBST(DBLATEX)
681    
682  AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])  #################### end Documentation tools configuration ####################
683    
684    #################### config.h ####################
685    
686    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/lib/include"], [path for Diderot header files])
687    
688  AH_TOP([  AH_TOP([
689  /*  /*
690   * 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)
691   * All rights reserved.   *
692     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
693   */   */
694    
695  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 428  Line 701 
701  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
702  ])  ])
703    
704  dnl  #################### end config.h ####################
705  dnl ******************** write output ********************  
706  dnl  #################### write output ####################
707    
708    dnl The compiler Makefile depends on which SML system we are
709    dnl using.
710    if test x"$SML" = xmlton ; then
711      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
712    else
713      COMPILER_MAKEFILE_IN=""
714    fi
715    
716  AC_CONFIG_FILES(  AC_CONFIG_FILES(
717  dnl  dnl
718  dnl ***** Makefiles *****  dnl ***** Makefiles *****
719    Makefile    Makefile
720    doc/Makefile  dnl  doc/Makefile
721    src/clinfo/Makefile  dnl  doc/man/Makefile
722    src/dnorm/Makefile  dnl  src/clinfo/Makefile
723    src/compiler/Makefile    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
724    src/lib/build/Makefile    src/lib/build/Makefile
725    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/iso2d-polyline/Makefile  
   test/vr-lite-cam/Makefile  
   test/hlic/Makefile  
726  dnl  dnl
727  dnl ***** SML source files *****  dnl ***** SML source files *****
728    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
729    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
730      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
731      src/compiler/options/version.sml:src/compiler/options/version_sml.in
732  )  )
733    
734  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)
735    
736  dnl  dnl
737  dnl shell scripts  dnl shell scripts
# Line 462  Line 740 
740    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
741  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
742  AC_CONFIG_FILES([  AC_CONFIG_FILES([
743    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
744  ], [chmod +x src/compiler/gen/file2str/file2str.sh])  ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
745    AC_CONFIG_FILES([
746      src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
747    ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
748    
749    dnl
750    dnl additional files for logging tools
751    dnl
752    if test x"$LOGGING_ENABLED" = xtrue ; then
753      AC_CONFIG_FILES(
754        src/logging/gen/Makefile
755        src/logging/log-analyze/Makefile
756        src/logging/log-dump/Makefile
757        src/logging/gen/main.sml:src/logging/gen/main_sml.in
758        src/logging/lib/default-log-paths.hxx:src/logging/lib/default-log-paths_hxx.in
759      )
760    fi
761    
762  dnl  dnl
763  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
764  dnl  dnl
765  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
766  dnl  dnl
767    dnl where the options are taken from [debug, parallel]
768    dnl
769  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
770      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
771        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 482  Line 778 
778      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
779    ])    ])
780    
781  MK_BUILD_DIR(rt-c-f, c, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
782  MK_BUILD_DIR(rt-c-d, c, [double])  MK_BUILD_DIR(rt-seq-debug, sequentiagetcpul, [debug])
783  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])  MK_BUILD_DIR(rt-par, parallel, [parallel])
784  MK_BUILD_DIR(rt-c-d-debug, c, [double debug])  MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
785  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  
786  MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])  if test x"$LOGGING_ENABLED" = xtrue ; then
787  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])  
788  fi  fi
789    
790    #if test x"$CL_ENABLED" = xtrue ; then
791    #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
792    #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
793    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
794    #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
795    #fi
796    
797  AC_OUTPUT  AC_OUTPUT
798    
799    #################### end write output ####################

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

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