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

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

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