Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis12/configure.ac
ViewVC logotype

Diff of /branches/vis12/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/configure.ac revision 1301, Thu Jun 9 23:58:40 2011 UTC branches/vis12/configure.ac revision 3223, Mon Jul 20 22:21:00 2015 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 COPYRIGHT (c) 2014 The Diderot Project
4  dnl All rights reserved.  dnl All rights reserved.
5  dnl  dnl
6    
 dnl NOTE: MANTICORE_DIST_VERSION is an M4 variable defined in config/aclocal.m4  
 dnl  
7  AC_INIT(diderot,0.1,)  AC_INIT(diderot,0.1,)
8    
9  AC_PREREQ(2.60)  AC_PREREQ(2.60)
10  AC_COPYRIGHT([[COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)]])  AC_COPYRIGHT([[COPYRIGHT (c) 2014 The Diderot Project (http://diderot-language.cs.uchicago.edu)]])
11  AC_CONFIG_SRCDIR(src/dnorm/dnorm.c)  AC_CONFIG_SRCDIR(src/compiler/driver/main.sml)
12  AC_CONFIG_AUX_DIR(config)  AC_CONFIG_AUX_DIR(config)
13  AC_CONFIG_MACRO_DIR(config)  AC_CONFIG_MACRO_DIR(config)
14    
# Line 34  Line 32 
32  AC_PROG_INSTALL  AC_PROG_INSTALL
33  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
34    
35    dnl FIXME: this works for now, but we should probably switch to libtool
36    dnl
37    AC_PATH_PROG(LD, [ld], [none])
38    if test x$LD = xnone ; then
39      AC_MSG_ERROR([cannot find ld command])
40    fi
41    AC_SUBST(LD)
42    
43  dnl check for c99 support  dnl check for c99 support
44  dnl  dnl
45  AC_PROG_CC_C99  AC_PROG_CC_C99
# Line 41  Line 47 
47    AC_MSG_ERROR([Diderot requires c99 support])    AC_MSG_ERROR([Diderot requires c99 support])
48  fi  fi
49    
50    AC_ARG_ENABLE([32-bit],
51      AC_HELP_STRING([--enable-32-bit], [configure Diderot to produce 32-bit executables]),
52      [CFLAG_MXX="-m32"],
53      [CFLAG_MXX="-m64"])
54    
55  dnl extra C compiler options  dnl extra C compiler options
56  dnl  dnl
57  CFLAG_M64="-m64"  CFLAGS=""
58  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"
59  AC_SUBST(CFLAG_M64)  AC_SUBST(CFLAG_MXX)
60  AC_SUBST(CFLAGS_BASE)  AC_SUBST(CFLAGS_BASE)
61    
62  dnl  dnl
63    dnl standard headers
64    dnl
65    AC_HEADER_STDBOOL
66    
67    dnl
68  dnl check for pthreads support  dnl check for pthreads support
69  dnl  dnl
70  ACX_PTHREAD()  ACX_PTHREAD
71    
72  dnl  dnl
73  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
# Line 72  Line 88 
88  dnl  dnl
89  dnl check for OpenCL support  dnl check for OpenCL support
90  dnl  dnl
91  CL_LIBS="none"  LIBS_CL="none"
92  case "$host_os" in  case "$host_os" in
93    darwin*) # On Mac OS X we check for installed frameworks    darwin*) # On Mac OS X we check for installed frameworks
94      AX_CHECK_FRAMEWORK([OpenCL], [CL_LIBS="-framework OpenCL"], [])      AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
95    ;;    ;;
96    *)    *)
97      AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[CL_LIBS="-lOpenCL"])      AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
98    ;;    ;;
99  esac  esac
100  if test x"$CL_LIBS" = xnone ; then  if test x"$LIBS_CL" = xnone ; then
101    AC_MSG_WARN([no OpenCL library found])    AC_MSG_WARN([no OpenCL library found])
102    CL_ENABLED=false    CL_ENABLED=false
103    CL_VERSION=0    CL_VERSION=0
104  else  else
105    CL_ENABLED=true    CL_ENABLED=true
106    AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h])    CPPFLAGS_CL=""
107      CL_HEADER=""
108      AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"])
109      if test x"$HAVE_CL_H" = xno ; then
110        # check for AMD's SDK
111        AC_MSG_CHECKING([for cl.h in AMD's SDK])
112        if test -d /opt/AMDAPP/include/CL ; then
113          HAVE_CL_H="yes"
114          CL_HEADER="/opt/AMDAPP/include/CL/cl.h"
115          AC_DEFINE([HAVE_CL_CL_H])
116          CPPFLAGS_CL="-I/opt/AMDAPP/include"
117        fi
118        AC_MSG_RESULT([$HAVE_CL_H])
119      fi
120      if test x"$HAVE_CL_H" = xno ; then
121        # check for NVIDIA's SDK
122        AC_MSG_CHECKING([for NVIDIA's SDK cl.h])
123        CUDA_HOME=none
124        for CUDA in cuda cuda-7.0 cuda-6.5 cuda-6.0 ; do
125          if test -d /usr/local/$CUDA/include/CL ; then
126            CUDA_HOME=/usr/local/$CUDA
127            break
128          fi
129        done
130        if test x"$CUDA" != xnone ; then
131          HAVE_CL_H="yes"
132          CL_HEADER="$CUDA_HOME/include/CL/cl.h"
133          AC_DEFINE([HAVE_CL_CL_H])
134          CPPFLAGS_CL="-I$CUDA_HOME/include"
135        fi
136        AC_MSG_RESULT([$HAVE_CL_H])
137      fi
138      if test x"$HAVE_CL_H" = xno ; then
139        AC_MSG_WARN([no cl.h found])
140        CL_ENABLED=false
141        CL_VERSION=0
142        SIZEOF_CL_INT=0
143        SIZEOF_CL_LONG=0
144        SIZEOF_CL_FLOAT=0
145        SIZEOF_CL_DOUBLE=0
146      else
147    # check the cl.h header for which version of OpenCL is supported    # check the cl.h header for which version of OpenCL is supported
148    AC_LANG([C])    AC_LANG([C])
149        save_CPPFLAGS=$CPPFLAGS
150        CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
151    AC_LINK_IFELSE([AC_LANG_PROGRAM([[    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
152  #include <stdio.h>  #include <stdio.h>
153  # ifdef HAVE_CL_CL_H  # ifdef HAVE_CL_CL_H
# Line 99  Line 157 
157  # else  # else
158  #   error no cl.h  #   error no cl.h
159  # endif]],  # endif]],
160  [[#if defined(CL_VERSION_1_1)  [[#if defined(CL_VERSION_1_2)
161    printf("11000\n");    printf("120\n");
162    #elif defined(CL_VERSION_1_1)
163      printf("110\n");
164  #elif defined(CL_VERSION_1_0)  #elif defined(CL_VERSION_1_0)
165    printf("10000\n");    printf("100\n");
166  #else  #else
167    printf("0\n");    printf("0\n");
168  #endif  #endif
169      ]])],      ]])],
170      [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])      [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
171    dnl
172    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
173    dnl the specification specifies the behavior, but it was unspecified in 1.0.
174    dnl
175        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
176    #include "$CL_HEADER"
177    ]],
178          [[cl_float4 x; x[0] = 0.0;]])],
179          [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
180    dnl
181    dnl not arrays, so try the OpenCL 1.1 structure representation
182    dnl
183          [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
184    #include "$CL_HEADER"
185    ]],
186          [[cl_float4 x; x.s[0] = 0.0;]])],
187          [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
188          [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
189      # restore saved CPPFLAGS
190        CPPFLAGS=$save_CPPFLAGS
191    # substitutions    # substitutions
192    AC_SUBST(CL_LIBS)      AC_SUBST(LIBS_CL)
193        AC_SUBST(CPPFLAGS_CL)
194      #
195      # determine the sizes of the host-side OpenCL types
196      AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
197      SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
198      AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
199      SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
200      AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
201      SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
202      AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
203      SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
204      fi
205  fi  fi
206  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
207  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)
208    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
209    
210    AC_SUBST(SIZEOF_CL_INT)
211    AC_SUBST(SIZEOF_CL_LONG)
212    AC_SUBST(SIZEOF_CL_FLOAT)
213    AC_SUBST(SIZEOF_CL_DOUBLE)
214    
215  dnl  dnl
216  dnl check for various library routines etc.  dnl check for various library routines etc.
# Line 222  Line 320 
320  AC_SUBST(LIBM)  AC_SUBST(LIBM)
321    
322  dnl  dnl
323  dnl get the path to the TEEM installation  dnl get the path to the TEEM installation.  We need this to build the Diderot
324    dnl runtime code and we use the path when searching for teem in the Diderot
325    dnl compiler.
326  dnl  dnl
327  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
328    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
# Line 237  Line 337 
337    esac    esac
338    if test -x $ac_cv_use_teem ; then    if test -x $ac_cv_use_teem ; then
339      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
340      AC_MSG_RESULT([ okay])      # check that TEEM_DIR actually points to something that looks like teem
341        if test -f $TEEM_DIR/include/teem/nrrd.h ; then
342          AC_MSG_RESULT([yes])
343    else    else
344      TEEM_DIR=none      TEEM_DIR=none
345      AC_MSG_RESULT([ invalid])        AC_MSG_RESULT([no])
346        fi
347      else
348        TEEM_DIR=none
349        AC_MSG_RESULT([no])
350    fi    fi
351  fi  fi
352  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
353    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
354    fi
355    dnl
356    dnl check that unu supports the dnorm command
357    dnl
358    if test x"$TEEM_DIR" != xnone ; then
359      AC_MSG_CHECKING([that \"unu dnorm\" works])
360      if test -x $TEEM_DIR/bin/unu ; then
361        $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null
362        if test $? -eq 0 ; then
363          AC_MSG_RESULT([yes])
364        else
365          AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation])
366        fi
367      else
368        AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])
369      fi
370  fi  fi
371  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
372    
# Line 255  Line 377 
377  dnl  dnl
378  CHECK_SMLNJ([AC_MSG_ERROR([unable to find SML/NJ installation; check your PATH or set SMLNJ_CMD])])  CHECK_SMLNJ([AC_MSG_ERROR([unable to find SML/NJ installation; check your PATH or set SMLNJ_CMD])])
379  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
380    -o $SMLNJ_MINOR_VERSION -lt 73    -o $SMLNJ_MINOR_VERSION -lt 77
381  then  then
382    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])    AC_MSG_ERROR([installation requires SML/NJ version 110.77+ (available from smlnj.org)])
383  fi  fi
384  AC_SUBST(SMLNJ_VERSION)  AC_SUBST(SMLNJ_VERSION)
385    
# Line 288  Line 410 
410  fi  fi
411  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
412    
413    dnl ******************** Documentation tools ********************
414    
415    dnl check for doxygen
416    dnl
417    AC_ARG_WITH([doxygen],
418      [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],
419      [DOXYGEN=$with_doxygen],
420      [DOXYGEN=none])
421    if test x$DOXYGEN = xnone ; then
422      # see if we can find doxygen in the user's path
423      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
424    fi
425    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
426      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
427    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
428      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
429    elif test x$DOXYGEN != xnone ; then
430    dnl
431    dnl verify that $DOXYGEN is an absolute path
432    dnl
433      case $DOXYGEN in
434        /*) ;;
435        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
436      esac
437    fi
438    if test $DOXYGEN = xnone ; then
439      DOXYGEN=:
440    fi
441    AC_SUBST(DOXYGEN)
442    
443    dnl check for asciidoc and related tools
444    dnl
445    AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
446    AC_PATH_PROGS([A2X], [a2x], [none])
447    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
448    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
449    
450    dnl
451    dnl get the path to the asciidoc cofiguration files
452    dnl
453    if test x"$ASCIIDOC" != xnone ; then
454      AC_MSG_CHECKING([path to asciidoc configuration files])
455      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
456      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
457    fi
458    AC_SUBST(ASCIIDOC)
459    AC_SUBST(A2X)
460    AC_SUBST(ASCIIDOC_CONF_DIR)
461    AC_SUBST(HIGHLIGHTER)
462    AC_SUBST(DBLATEX)
463    
464    
465  dnl ******************** Paths ********************  dnl ******************** Paths ********************
466    
467  DIDEROT_ROOT=`pwd`  DIDEROT_ROOT=`pwd`
# Line 317  Line 491 
491  dnl run the compiler tests in 64-bit mode  dnl run the compiler tests in 64-bit mode
492  dnl  dnl
493  save_CFLAGS=$CFLAGS  save_CFLAGS=$CFLAGS
494  CFLAGS="$CFLAGS $CFLAG_M64"  CFLAGS="$CFLAGS $CFLAG_MXX"
495    
496  dnl  dnl
497  dnl check for gcc builtin atomic operations  dnl check for gcc builtin atomic operations
# Line 333  Line 507 
507    
508  AC_C_BIGENDIAN  AC_C_BIGENDIAN
509    
510    #
511    # determine the sizes of the standard C types
512    AC_CHECK_SIZEOF([int])
513    SIZEOF_C_INT=$ac_cv_sizeof_int
514    AC_CHECK_SIZEOF([long])
515    SIZEOF_C_LONG=$ac_cv_sizeof_long
516    AC_CHECK_SIZEOF([float])
517    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
518    AC_CHECK_SIZEOF([double])
519    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
520    
521    AC_SUBST(SIZEOF_C_INT)
522    AC_SUBST(SIZEOF_C_LONG)
523    AC_SUBST(SIZEOF_C_FLOAT)
524    AC_SUBST(SIZEOF_C_DOUBLE)
525    
526  dnl  dnl
527  dnl restore CFLAGS  dnl restore CFLAGS
528  dnl  dnl
# Line 346  Line 536 
536    
537  AH_TOP([  AH_TOP([
538  /*  /*
539   * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)   * COPYRIGHT (c) 2014 Diderot project. (http://diderot-language.cs.uchicago.edu)
540   * All rights reserved.   * All rights reserved.
541   */   */
542    
# Line 356  Line 546 
546  ])  ])
547  AH_BOTTOM([  AH_BOTTOM([
548    
549    #ifdef NDEBUG
550    #define STATIC_INLINE   static inline
551    #else
552    #define STATIC_INLINE   static
553    #endif
554    
555  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
556  ])  ])
557    
# Line 367  Line 563 
563  dnl  dnl
564  dnl ***** Makefiles *****  dnl ***** Makefiles *****
565    Makefile    Makefile
566    src/dnorm/Makefile    doc/Makefile
567      doc/man/Makefile
568      src/clinfo/Makefile
569    src/compiler/Makefile    src/compiler/Makefile
570    src/lib/build/Makefile    src/lib/build/Makefile
571    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
572    test/MIP/Makefile    test/MIP/Makefile
573    test/probe/Makefile    test/probe/Makefile
574    test/teem/Makefile    test/iso2d-polyline/Makefile
575  dnl    test/vr-lite-cam/Makefile
576  dnl ***** CM files *****    test/hlic/Makefile
   src/compiler/codegen/sources.cm:src/compiler/codegen/sources_cm.in  
577  dnl  dnl
578  dnl ***** SML source files *****  dnl ***** SML source files *****
579    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
580    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
581      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
582  )  )
583    
584  AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in)  AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in)
# Line 391  Line 589 
589  AC_CONFIG_FILES([  AC_CONFIG_FILES([
590    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
591  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
592    AC_CONFIG_FILES([
593      src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in
594    ], [chmod +x src/compiler/gen/file2str/file2str.sh])
595    AC_CONFIG_FILES([
596      rtest/scripts/run.sh:rtest/scripts/run_sh.in
597    ], [chmod +x rtest/scripts/run.sh])
598    AC_CONFIG_FILES([
599      rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in
600    ], [chmod +x rtest/scripts/run-one.sh])
601    #
602    # more regression tests; should merge with rtest at some point
603    #
604    AC_CONFIG_FILES([
605      rtest2/scripts/run.sh:rtest2/scripts/run_sh.in
606    ], [chmod +x rtest2/scripts/run.sh])
607    AC_CONFIG_FILES([
608      rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in
609    ], [chmod +x rtest2/scripts/run-one.sh])
610    
611  dnl  dnl
612  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
# Line 410  Line 626 
626    ])    ])
627    
628  MK_BUILD_DIR(rt-c-f, c, [float])  MK_BUILD_DIR(rt-c-f, c, [float])
629    MK_BUILD_DIR(rt-c-d, c, [double])
630  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])
631    MK_BUILD_DIR(rt-c-d-debug, c, [double debug])
632  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])
633    MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])
634  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])
635    MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])
636    
637    if test x"$CL_ENABLED" = xtrue ; then
638      MK_BUILD_DIR(rt-cl-f, cl, [float])
639      MK_BUILD_DIR(rt-cl-d, cl, [double])
640      MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug])
641      MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug])
642    fi
643    
644  AC_OUTPUT  AC_OUTPUT

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

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