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 1997, Thu Oct 4 11:00:44 2012 UTC branches/vis15/configure.ac revision 5267, Wed Aug 9 16:30:40 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) 2012 The Diderot Project  dnl This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4    dnl
5    dnl COPYRIGHT (c) 2017 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) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)]])  AC_COPYRIGHT([[COPYRIGHT (c) 2017 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_func_attribute.m4)
28    sinclude(config/ax_gcc_x86_cpuid.m4)
29    sinclude(config/ax_gcc_x86_avx_xgetbv.m4)
30    sinclude(config/ax_ext.m4)
31  sinclude(config/acx_pthread.m4)  sinclude(config/acx_pthread.m4)
32  sinclude(config/check_smlnj.m4)  sinclude(config/check_smlnj.m4)
33  sinclude(config/check_smlnj_heap_suffix.m4)  sinclude(config/check_smlnj_heap_suffix.m4)
34  sinclude(config/ax_check_framework.m4)  sinclude(config/ax_check_framework.m4)
35    sinclude(config/ax_cxx_compile_stdcxx.m4)
36    
37  dnl  dnl
38  dnl get host information  dnl get host information
39  dnl  dnl
40  AC_CANONICAL_HOST  AC_CANONICAL_HOST
41    
42    #################### Paths configuration ####################
43    
44    DIDEROT_ROOT=`pwd`
45    DIDEROT_DOCDIR=$DIDEROT_ROOT/doc
46    DIDEROT_SRCDIR=$DIDEROT_ROOT/src
47    DIDEROT_LIBDIR=$DIDEROT_ROOT/lib
48    DIDEROT_BINDIR=$DIDEROT_ROOT/bin
49    DIDEROT_MKDIR=$DIDEROT_ROOT/mk
50    
51    AC_SUBST(DIDEROT_ROOT)
52    AC_SUBST(DIDEROT_DOCDIR)
53    AC_SUBST(DIDEROT_SRCDIR)
54    AC_SUBST(DIDEROT_LIBDIR)
55    AC_SUBST(DIDEROT_BINDIR)
56    AC_SUBST(DIDEROT_MKDIR)
57    
58    #################### end Paths configuration ####################
59    
60  dnl check for standard programs  dnl check for standard programs
61  dnl  dnl
 AC_PROG_CC([clang gcc cc])  
62  AC_PROG_CPP  AC_PROG_CPP
63    AC_PROG_CC([clang gcc cc])
64    AC_PROG_CXX([clang++ g++ c++])
65    AX_CXX_COMPILE_STDCXX(11,[],[mandatory])
66  AC_PROG_INSTALL  AC_PROG_INSTALL
67  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
68    
# Line 40  Line 74 
74  fi  fi
75  AC_SUBST(LD)  AC_SUBST(LD)
76    
77  dnl check for c99 support  dnl extra compiler options
78  dnl  dnl
79  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  
80    
81  dnl extra C compiler options  AC_LANG_PUSH([C++])
82    AX_GCC_FUNC_ATTRIBUTE(noreturn)
83    AC_LANG_POP([C++])
84    
85    dnl check for SIMD support
86  dnl  dnl
87  CFLAGS=""  AX_EXT
88  CFLAG_M64="-m64"  
89  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"  AC_ARG_ENABLE([32-bit],
90  AC_SUBST(CFLAG_M64)    AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),
91  AC_SUBST(CFLAGS_BASE)    [CXXFLAG_Mxx="-m32"],
92      [CXXFLAG_Mxx="-m64"])
93    
94    CXXFLAGS="$CXXFLAG_Mxx $CXXFLAGS_BASE"
95    AC_SUBST(CXXFLAG_Mxx)
96    AC_SUBST(CXXFLAGS_BASE)
97    
98  dnl  dnl
99  dnl standard headers  dnl run the compiler tests in 64-bit mode
100  dnl  dnl
101  AC_HEADER_STDBOOL  save_CFLAGS=$CFLAGS
102    CFLAGS="$CFLAGS $CFLAG_MXX"
103    
104  dnl  dnl
105  dnl check for pthreads support  dnl check for gcc builtin atomic operations
106  dnl  dnl
107  ACX_PTHREAD  AC_MSG_CHECKING([for builtin atomic operations])
108    AC_LINK_IFELSE(
109       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
110       AC_MSG_RESULT(yes)
111       AC_DEFINE(
112        [HAVE_BUILTIN_ATOMIC_OPS], 1,
113        [Define to 1 if gcc compiler provides atomic operations.]),
114       AC_MSG_RESULT(no))
115    
 dnl check for doxygen  
116  dnl  dnl
117  AC_ARG_WITH([doxygen],  dnl check endianess
   [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  
118  dnl  dnl
119  dnl verify that $DOXYGEN is an absolute path  AC_C_BIGENDIAN
120    
121    #
122    # determine the sizes of the standard C types
123    AC_CHECK_SIZEOF([int])
124    SIZEOF_C_INT=$ac_cv_sizeof_int
125    AC_CHECK_SIZEOF([long])
126    SIZEOF_C_LONG=$ac_cv_sizeof_long
127    AC_CHECK_SIZEOF([float])
128    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
129    AC_CHECK_SIZEOF([double])
130    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
131    
132    AC_SUBST(SIZEOF_C_INT)
133    AC_SUBST(SIZEOF_C_LONG)
134    AC_SUBST(SIZEOF_C_FLOAT)
135    AC_SUBST(SIZEOF_C_DOUBLE)
136    
137  dnl  dnl
138    case $DOXYGEN in  dnl restore CFLAGS
139      /*) ;;  dnl
140      *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;  CFLAGS=$save_CFLAGS
   esac  
 fi  
 if test $DOXYGEN = xnone ; then  
   DOXYGEN=:  
 fi  
 AC_SUBST(DOXYGEN)  
141    
142  dnl  dnl
143  dnl Look for NVIDIA's nvcc compiler  dnl check for <stdbool.h>, which we use in the C API
144  dnl  dnl
145  AC_MSG_NOTICE([checking for CUDA and nvcc])  AC_HEADER_STDBOOL
 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)  
146    
147  dnl  dnl
148  dnl check for OpenCL support  dnl the C boolean type to use in generated library headers
149  dnl  dnl
150  LIBS_CL="none"  if test x"$ac_cv_header_stdbool_h" = xyes ; then
151  case "$host_os" in    BOOLTY="bool"
152    darwin*) # On Mac OS X we check for installed frameworks  elif test "x$ac_cv_type__Bool" = xyes; then
153      AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])    BOOLTY="_Bool"
   ;;  
   *)  
     AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])  
   ;;  
 esac  
 if test x"$LIBS_CL" = xnone ; then  
   AC_MSG_WARN([no OpenCL library found])  
   CL_ENABLED=false  
   CL_VERSION=0  
154  else  else
155    CL_ENABLED=true    BOOLTY="int"
   CPPFLAGS_CL=""  
   AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; break], [HAVE_CL_H="no"])  
   if test x"$HAVE_CL_H" = xno ; then  
     # check for AMD's SDK  
     AC_MSG_CHECKING([for cl.h in AMD's SDK])  
     if test -d /opt/AMDAPP/include/CL ; then  
       HAVE_CL_H="yes"  
       AC_DEFINE([HAVE_CL_CL_H])  
       CPPFLAGS_CL="-I/opt/AMDAPP/include"  
156      fi      fi
157      AC_MSG_RESULT([$HAVE_CL_H])  AC_SUBST(BOOLTY)
158    fi  
   if test x"$HAVE_CL_H" = xno ; then  
     AC_MSG_WARN([no cl.h found])  
     CL_ENABLED=false  
     CL_VERSION=0  
   else  
     # check the cl.h header for which version of OpenCL is supported  
     AC_LANG([C])  
     save_CPPFLAGS=$CPPFLAGS  
     CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"  
     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])  
 dnl  
 dnl check to see how we access the host-side vector types.  For OpenCL 1.1,  
 dnl the specification specifies the behavior, but it was unspecified in 1.0.  
 dnl  
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[  
 # ifdef HAVE_CL_CL_H  
 #   include <CL/cl.h>  
 # elif defined(HAVE_OPENCL_CL_H)  
 #   include <OpenCL/cl.h>  
 # else  
 #   error no cl.h  
 # endif]],  
       [[cl_float4 x; x[0] = 0.0;]])],  
       [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],  
159  dnl  dnl
160  dnl not arrays, so try the OpenCL 1.1 structure representation  dnl check for pthreads support
161  dnl  dnl
162        [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])])])  
   # restore saved CPPFLAGS  
     CPPFLAGS=$save_CPPFLAGS  
   # substitutions  
     AC_SUBST(LIBS_CL)  
     AC_SUBST(CPPFLAGS_CL)  
   fi  
 fi  
 AC_SUBST(CL_ENABLED)  
 AC_SUBST(CL_VERSION)  
163    
164  dnl  dnl
165  dnl check for various library routines etc.  dnl check for various library routines etc.
# Line 241  Line 198 
198  AC_CHECK_FUNCS(sigtimedwait nanosleep)  AC_CHECK_FUNCS(sigtimedwait nanosleep)
199    
200  dnl  dnl
 dnl check for sched_setaffinity  
 dnl  
 AC_CHECK_FUNCS(sched_setaffinity)  
   
 dnl  
201  dnl check for pthread_setaffinity_np  dnl check for pthread_setaffinity_np
202  dnl  dnl
203  save_LIBS=$LIBS  save_LIBS=$LIBS
# Line 276  Line 228 
228  dnl  dnl
229  AC_CHECK_FILES(/proc/cpuinfo)  AC_CHECK_FILES(/proc/cpuinfo)
230    
231    dnl check for getcpu and/or sched_getcpu
232    dnl
233    hasGetCPU=no;
234    AC_CHECK_HEADERS([linux/getcpu.h])
235    if test "x$ac_cv_header_linux_getcpu_h" = xyes; then
236      AC_CHECK_FUNCS([getcpu])
237      hasGetCPU=yes;
238    else
239      # getcpu is usually called using syscall
240      #
241      AC_MSG_CHECKING([SYS_getcpu])
242      AC_RUN_IFELSE([AC_LANG_SOURCE([[
243        #define _GNU_SOURCE
244        #include <unistd.h>
245        #include <sys/syscall.h>
246        int main () {
247          unsigned cpu, node;
248          return syscall (SYS_getcpu, &cpu, &node, 0);
249        }
250        ]])],[hasGetCPU=yes],[])
251      AC_MSG_RESULT([$hasGetCPU])
252      if test x"$hasGetCPU" = xyes ; then
253        AC_DEFINE([HAVE_SYS_GETCPU],[1],[Define if SYS_getcpu is defined in <sys/syscall.h>])
254      fi
255    fi
256    if test x"$hasGetCPU" != xyes ; then
257    AC_CHECK_FUNCS([sched_getcpu])
258    fi
259    
260  dnl  dnl
261  dnl OS-specific linking issues  dnl OS-specific linking issues
262  dnl  dnl
# Line 311  Line 292 
292  AC_SUBST(LD_NEEDS_RPATH)  AC_SUBST(LD_NEEDS_RPATH)
293  AC_SUBST(LIBM)  AC_SUBST(LIBM)
294    
295    #################### Logging configuration ####################
296    
297    LOGGING_ENABLED=false
298    AC_ARG_ENABLE([event-logging],
299      AC_HELP_STRING([--enable-event-logging], [include event-logging support for parallel target]),
300      [LOGGING_ENABLED=true],
301      [LOGGING_ENABLED=false])
302    
303    AC_SUBST(LOGGING_ENABLED)
304    
305    #################### end Logging configuration ####################
306    
307    #################### Diderot Debugger configuration ####################
308    
309    DEBUGGER_ENABLED=false
310    AC_ARG_ENABLE([debugger],
311      AC_HELP_STRING([--enable-debugger], [build the Diderot debugger (experimental)]),
312      [DEBUGGER_ENABLED=true],
313      [DEBUGGER_ENABLED=false])
314    
315    AC_SUBST(DEBUGGER_ENABLED)
316    
317    #################### end Diderot Debugger configuration ####################
318    
319    #################### CUDA configuration ####################
320    
321    AC_ARG_ENABLE([cuda],
322      AC_HELP_STRING([--enable-cuda], [include support for targeting CUDA]))
323    
324    if test "${enable_cuda+set}" = set ; then
325    dnl
326    dnl Look for NVIDIA's nvcc compiler
327    dnl
328      AC_MSG_NOTICE([checking for CUDA and nvcc])
329      AC_PATH_PROG(NVCC, nvcc, no, $PATH)
330      if test x"$NVCC" = xno ; then
331        AC_MSG_WARN([nvcc not found])
332        CUDA_ENABLED=false
333        NVCC=":"
334      else
335        AC_MSG_RESULT([$NVCC])
336        CUDA_ENABLED=true
337      fi
338    else
339      NVCC=":"
340      CUDA_ENABLED=false
341    fi
342    AC_SUBST(NVCC)
343    AC_SUBST(CUDA_ENABLED)
344    
345    #################### end CUDA configuration ####################
346    
347    #################### OpenCL configuration ####################
348    
349    AC_ARG_ENABLE([opencl],
350      AC_HELP_STRING([--enable-opencl], [include support for targeting OpenCL]))
351    
352    if test "${enable_opencl+set}" = set ; then
353    
354  dnl  dnl
355  dnl get the path to the TEEM installation  dnl check for OpenCL support
356    dnl
357      LIBS_CL="none"
358      case "$host_os" in
359        darwin*) # On Mac OS X we check for installed frameworks
360          AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
361        ;;
362        *)
363          AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
364        ;;
365      esac
366      if test x"$LIBS_CL" = xnone ; then
367        AC_MSG_WARN([no OpenCL library found])
368        CL_ENABLED=false
369        CL_VERSION=0
370      else
371        CL_ENABLED=true
372        CPPFLAGS_CL=""
373        CL_HEADER=""
374        AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"])
375        if test x"$HAVE_CL_H" = xno ; then
376          # check for AMD's SDK
377          AC_MSG_CHECKING([for cl.h in AMD's SDK])
378          if test -d /opt/AMDAPP/include/CL ; then
379            HAVE_CL_H="yes"
380            CL_HEADER="/opt/AMDAPP/include/CL/cl.h"
381            AC_DEFINE([HAVE_CL_CL_H])
382            CPPFLAGS_CL="-I/opt/AMDAPP/include"
383          fi
384          AC_MSG_RESULT([$HAVE_CL_H])
385        fi
386        if test x"$HAVE_CL_H" = xno ; then
387          # check for NVIDIA's SDK
388          AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
389          CUDA_HOME=none
390          for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
391            if test -d /usr/local/$CUDA/include/CL ; then
392              CUDA_HOME=/usr/local/$CUDA
393              break
394            fi
395          done
396          if test x"$CUDA_HOME" != xnone ; then
397            HAVE_CL_H="yes"
398            CL_HEADER="$CUDA_HOME/include/CL/cl.h"
399            AC_DEFINE([HAVE_CL_CL_H])
400            CPPFLAGS_CL="-I$CUDA_HOME/include"
401          fi
402          AC_MSG_RESULT([$HAVE_CL_H])
403        fi
404        if test x"$HAVE_CL_H" = xno ; then
405          AC_MSG_WARN([no cl.h found])
406          CL_ENABLED=false
407          CL_VERSION=0
408          SIZEOF_CL_INT=0
409          SIZEOF_CL_LONG=0
410          SIZEOF_CL_FLOAT=0
411          SIZEOF_CL_DOUBLE=0
412        else
413          # check the cl.h header for which version of OpenCL is supported
414          AC_LANG([C])
415          save_CPPFLAGS=$CPPFLAGS
416          CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
417          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
418    #include <stdio.h>
419    # ifdef HAVE_CL_CL_H
420    #   include <CL/cl.h>
421    # elif defined(HAVE_OPENCL_CL_H)
422    #   include <OpenCL/cl.h>
423    # else
424    #   error no cl.h
425    # endif]],
426    [[#if defined(CL_VERSION_1_2)
427      printf("120\n");
428    #elif defined(CL_VERSION_1_1)
429      printf("110\n");
430    #elif defined(CL_VERSION_1_0)
431      printf("100\n");
432    #else
433      printf("0\n");
434    #endif
435            ]])],
436            [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
437    dnl
438    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
439    dnl the specification specifies the behavior, but it was unspecified in 1.0.
440    dnl
441          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
442      #include "$CL_HEADER"
443      ]],
444            [[cl_float4 x; x[0] = 0.0;]])],
445            [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
446      dnl
447      dnl not arrays, so try the OpenCL 1.1 structure representation
448      dnl
449            [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
450    #include "$CL_HEADER"
451    ]],
452            [[cl_float4 x; x.s[0] = 0.0;]])],
453            [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
454            [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
455        # restore saved CPPFLAGS
456          CPPFLAGS=$save_CPPFLAGS
457        # substitutions
458          AC_SUBST(LIBS_CL)
459          AC_SUBST(CPPFLAGS_CL)
460        #
461        # determine the sizes of the host-side OpenCL types
462        AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
463        SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
464        AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
465        SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
466        AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
467        SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
468        AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
469        SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
470        fi
471      fi
472    else
473      CL_ENABLED=false
474      CL_VERSION="0"
475      SIZEOF_CL_INT="0"
476      SIZEOF_CL_LONG="0"
477      SIZEOF_CL_FLOAT="0"
478      SIZEOF_CL_DOUBLE="0"
479    fi
480    
481    AC_SUBST(CL_ENABLED)
482    AC_SUBST(CL_VERSION)
483    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
484    
485    AC_SUBST(SIZEOF_CL_INT)
486    AC_SUBST(SIZEOF_CL_LONG)
487    AC_SUBST(SIZEOF_CL_FLOAT)
488    AC_SUBST(SIZEOF_CL_DOUBLE)
489    
490    #################### end OpenCL configuration ####################
491    
492    #################### Teem configuration ####################
493    
494    dnl get the path to the TEEM installation.  We need this to build the Diderot
495    dnl runtime code and we use the path when searching for teem in the Diderot
496    dnl compiler.
497    dnl
498    
499    dnl the path can be specified using "--with-teem=..." too
500  dnl  dnl
501  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
502    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
503    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])    [ac_cv_use_teem=$withval], [ac_cv_use_teem=no])
504    
505  if test x"$ac_cv_use_teem" = xno ; then  if test x"$ac_cv_use_teem" = xno ; then
506    dnl search for Teem in some standard places
507    dnl
508      AC_MSG_CHECKING([for teem])
509    TEEM_DIR=none    TEEM_DIR=none
510      POSSIBLE_TEEM_DIRS="/usr/local/teem /usr/local"
511      for dir in $POSSIBLE_TEEM_DIRS ; do
512        if test -f $dir/include/teem/nrrd.h ; then
513          TEEM_DIR=$dir
514          AC_MSG_RESULT([$TEEM_DIR])
515          break
516        fi
517      done
518      if test $TEEM_DIR = none ; then
519        AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
520      fi
521  else  else
522    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])    AC_MSG_CHECKING([path to teem ($ac_cv_use_teem)])
523    case $ac_cv_use_teem in    case $ac_cv_use_teem in
# Line 329  Line 528 
528      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
529      # check that TEEM_DIR actually points to something that looks like teem      # check that TEEM_DIR actually points to something that looks like teem
530      if test -f $TEEM_DIR/include/teem/nrrd.h ; then      if test -f $TEEM_DIR/include/teem/nrrd.h ; then
531        AC_MSG_RESULT([ okay])        AC_MSG_RESULT([yes])
532      else      else
533        TEEM_DIR=none        TEEM_DIR=none
534        AC_MSG_RESULT([ invalid])        AC_MSG_RESULT([invalid path to teem])
535      fi      fi
536    else    else
537      TEEM_DIR=none      TEEM_DIR=none
538      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([invalid path to teem])
539    fi    fi
540  fi  fi
541  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
542    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem])
543  fi  fi
544    dnl
545    dnl check that teem supports the nrrdMetaDataNormalize function
546    dnl
547    save_LDFLAGS=$LDFLAGS
548    save_LIBS=$LIBS
549    LDFLAGS="$LDFLAGS -L$TEEM_DIR/lib"
550    LIBS="$LIBS -lteem -lm"
551    AC_CHECK_FUNCS([nrrdMetaDataNormalize])
552    LDFLAGS=$save_LDFLAGS
553    LIBS=$save_LIBS
554    
555    if test "x$ac_cv_func_nrrdMetaDataNormalize" != xyes; then
556      AC_MSG_ERROR(["please update your teem installation"])
557    fi
558    
559  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
560    
561  dnl ******************** SML/NJ configuration ********************  #################### end Teem configuration ####################
562    
563    #################### SML configuration ####################
564    
565    dnl
566    dnl We support building with both SML/NJ (the default) or MLton.
567  dnl  dnl
568    
569    dnl first check for --with-mlton=path flag
570    dnl
571    AC_ARG_WITH([mlton],
572      [AS_HELP_STRING([--with-mlton=<path-to-mlton>],
573        [use the MLton Standard ML compiler to build Diderot])],
574      [with_mlton=yes],[with_mlton=no])
575    if test x"$with_mlton" = xyes ; then
576      if test x"$ac_cv_path_with_mlton" = x ; then
577        # look for mlton in the PATH
578        AC_PATH_PROGS(with_mlton, mlton, no)
579        if test x"$MLTON" = xno ; then
580          AC_MSG_ERROR([unable to find mlton executable; please specify the path])
581        fi
582      else
583        with_mlton=$ac_cv_path_with_mlton
584        case $with_mlton in
585          /*) ;;
586          *) AC_MSG_ERROR([please specify absolute path for mlton executable]) ;;
587        esac
588        if test ! -x $with_mlton ; then
589          AC_MSG_ERROR([invalid path for mlton; $with_mlton is not executable])
590        fi
591      fi
592    fi
593    
594    if test x"$with_mlton" = xno ; then
595      # we are using SML/NJ
596      #
597    
598  dnl check that we have a compatible version of SML/NJ  dnl check that we have a compatible version of SML/NJ
599  dnl  dnl
600  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])])
601  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
602    -o $SMLNJ_MINOR_VERSION -lt 73      -o $SMLNJ_MINOR_VERSION -lt 80
603  then  then
604    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])      AC_MSG_ERROR([installation requires SML/NJ version 110.80+ (available from smlnj.org)])
605  fi  fi
 AC_SUBST(SMLNJ_VERSION)  
606    
607  dnl determine the heap-image suffix  dnl determine the heap-image suffix
608  dnl  dnl
# Line 364  Line 611 
611    
612  dnl look for ml-makedepend  dnl look for ml-makedepend
613  dnl  dnl
 AC_MSG_CHECKING([for ml-makedepend])  
614  tmpPATH="$SMLNJ_PATH:$PATH"  tmpPATH="$SMLNJ_PATH:$PATH"
615  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  
616  AC_SUBST(ML_MAKEDEPEND)  AC_SUBST(ML_MAKEDEPEND)
617    
618  dnl  dnl
# Line 383  Line 624 
624    AC_MSG_ERROR([ml-build not found])    AC_MSG_ERROR([ml-build not found])
625  fi  fi
626  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
627      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  
628    
629  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap  HEAP_IMAGE_DIR=$DIDEROT_BINDIR/.heap
630  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)  
631  AC_SUBST(HEAP_IMAGE_DIR)  AC_SUBST(HEAP_IMAGE_DIR)
632  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
633    
634  dnl  else
 dnl ******************** C compiler properties ********************  
 dnl  
635    
636  dnl    # we are using MLton
637  dnl run the compiler tests in 64-bit mode    MLTON=$with_mlton
638  dnl    AC_SUBST(MLTON)
639  save_CFLAGS=$CFLAGS    SML=mlton
 CFLAGS="$CFLAGS $CFLAG_M64"  
640    
641  dnl  fi
642  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))  
643    
644  AC_C_BIGENDIAN  #################### end SML configuration ####################
645    
646    #################### Documentation tools configuration ####################
647    
648    dnl check for doxygen
649  dnl  dnl
650  dnl restore CFLAGS  AC_ARG_WITH([doxygen],
651      [AS_HELP_STRING([--with-doxygen=<path>], [specify location of doxygen executable])],
652      [DOXYGEN=$with_doxygen],
653      [DOXYGEN=none])
654    if test x$DOXYGEN = xnone ; then
655      # see if we can find doxygen in the user's path
656      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
657    fi
658    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
659      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
660    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
661      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
662    elif test x$DOXYGEN != xnone ; then
663  dnl  dnl
664  CFLAGS=$save_CFLAGS  dnl verify that $DOXYGEN is an absolute path
   
665  dnl  dnl
666  dnl ******************** config.h stuff ********************    case $DOXYGEN in
667        /*) ;;
668        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
669      esac
670    fi
671    if test $DOXYGEN = xnone ; then
672      DOXYGEN=:
673    fi
674    AC_SUBST(DOXYGEN)
675    
676    dnl check for asciidoctor
677  dnl  dnl
678    AC_PATH_PROGS([ASCIIDOCTOR], [asciidoctor], [none])
679    AC_SUBST(ASCIIDOCTOR)
680    
681    #################### end Documentation tools configuration ####################
682    
683    #################### config.h ####################
684    
685  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])
686    
687  AH_TOP([  AH_TOP([
688  /*  /*
689   * 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)
690   * All rights reserved.   *
691     * COPYRIGHT (c) 2016 The University of Chicago * All rights reserved.
692   */   */
693    
694  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 455  Line 700 
700  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
701  ])  ])
702    
703    #################### end config.h ####################
704    
705    #################### write output ####################
706    
707    dnl The Makefile for the compiler depends on which SML system we are
708    dnl using.
709    if test x"$SML" = xmlton ; then
710      COMPILER_MAKEFILE_IN=":src/compiler/Makefile_mlton.in"
711      FRAG_GEN_MAKEFILE="src/compiler/gen/fragments/Makefile"
712    else
713      COMPILER_MAKEFILE_IN=""
714      FRAG_GEN_MAKEFILE=
715    fi
716    
717    dnl include the debugger Makefile, if it is enabled
718  dnl  dnl
719  dnl ******************** write output ********************  if test x"$DEBUGGER_ENABLED" = xtrue ; then
720  dnl    DEBUGGER_MAKEFILE=src/debugger/build/Makefile
721    else
722      DEBUGGER_MAKEFILE=
723    fi
724    
725  AC_CONFIG_FILES(  AC_CONFIG_FILES(
726  dnl  dnl
727  dnl ***** Makefiles *****  dnl ***** Makefiles *****
728    Makefile    Makefile
729    doc/Makefile  dnl  doc/Makefile
730    src/clinfo/Makefile    doc/src/man/Makefile
731    src/dnorm/Makefile  dnl  src/clinfo/Makefile
732    src/compiler/Makefile    src/compiler/Makefile"$COMPILER_MAKEFILE_IN"
733      $FRAG_GEN_MAKEFILE
734      $DEBUGGER_MAKEFILE
735    src/lib/build/Makefile    src/lib/build/Makefile
736    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  
737  dnl  dnl
738  dnl ***** SML source files *****  dnl ***** SML source files *****
739    src/compiler/nrrd/run-dnorm.sml:src/compiler/nrrd/run-dnorm_sml.in    src/compiler/nrrd/run-dnorm.sml:src/compiler/nrrd/run-dnorm_sml.in
740    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
741      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
742      src/compiler/options/version.sml:src/compiler/options/version_sml.in
743  )  )
744    
745  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)
746    
747  dnl  dnl
748  dnl shell scripts  dnl shell scripts
# Line 489  Line 751 
751    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
752  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
753  AC_CONFIG_FILES([  AC_CONFIG_FILES([
754    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
755  ], [chmod +x src/compiler/gen/file2str/file2str.sh])  ], [chmod +x src/compiler/gen/fragments/mkfrags.sh])
756  AC_CONFIG_FILES([  AC_CONFIG_FILES([
757    rtest/scripts/run.sh:rtest/scripts/run_sh.in    src/compiler/gen/fragments/mkmk.sh:src/compiler/gen/fragments/mkmk_sh.in
758  ], [chmod +x rtest/scripts/run.sh])  ], [chmod +x src/compiler/gen/fragments/mkmk.sh])
759    
760    dnl
761    dnl additional files for logging tools
762    dnl
763    if test x"$LOGGING_ENABLED" = xtrue ; then
764  AC_CONFIG_FILES([  AC_CONFIG_FILES([
765    rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in      src/logging/gen/Makefile
766  ], [chmod +x rtest/scripts/run-one.sh])      src/logging/log-analyze/Makefile
767        src/logging/log-dump/Makefile
768        src/logging/gen/log-gen.sh:src/logging/gen/log-gen_sh.in
769        src/logging/gen/main.sml:src/logging/gen/main_sml.in
770        src/logging/lib/default-log-paths.hxx:src/logging/lib/default-log-paths_hxx.in
771      ], [chmod +x src/logging/gen/log-gen.sh])
772    fi
773    
774  dnl  dnl
775  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
776  dnl  dnl
777  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)  dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
778  dnl  dnl
779    dnl where the options are taken from [debug, parallel]
780    dnl
781  AC_DEFUN([MK_BUILD_DIR], [  AC_DEFUN([MK_BUILD_DIR], [
782      if test ! -d src/lib/build/$1 ; then      if test ! -d src/lib/build/$1 ; then
783        mkdir src/lib/build/$1        mkdir src/lib/build/$1
# Line 515  Line 790 
790      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
791    ])    ])
792    
793  MK_BUILD_DIR(rt-c-f, c, [float])  MK_BUILD_DIR(rt-seq, sequential, [])
794  MK_BUILD_DIR(rt-c-d, c, [double])  MK_BUILD_DIR(rt-seq-debug, sequentiagetcpul, [debug])
795  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])  MK_BUILD_DIR(rt-par, parallel, [parallel])
796  MK_BUILD_DIR(rt-c-d-debug, c, [double debug])  MK_BUILD_DIR(rt-par-debug, parallel, [parallel debug])
797  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  
798  MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])  if test x"$LOGGING_ENABLED" = xtrue ; then
799  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])    MK_BUILD_DIR(rt-par-log, parallel, [parallel logging])
 MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])  
   
 if test x"$CL_ENABLED" = xtrue ; then  
   MK_BUILD_DIR(rt-cl-f, cl, [float])  
   MK_BUILD_DIR(rt-cl-d, cl, [double])  
   MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug])  
   MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug])  
800  fi  fi
801    
802    #if test x"$CL_ENABLED" = xtrue ; then
803    #  MK_BUILD_DIR(rt-cl-f, opencl, [float])
804    #  MK_BUILD_DIR(rt-cl-d, opencl, [double])
805    #  MK_BUILD_DIR(rt-cl-f-debug, opencl, [float debug])
806    #  MK_BUILD_DIR(rt-cl-d-debug, opencl, [double debug])
807    #fi
808    
809  AC_OUTPUT  AC_OUTPUT
810    
811    #################### end write output ####################

Legend:
Removed from v.1997  
changed lines
  Added in v.5267

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