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

revision 1685, Sun Jan 22 15:23:36 2012 UTC revision 3199, Thu Jun 25 11:20:03 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    
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) 2011 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 32  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 39  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  CFLAGS=""  CFLAGS=""
 CFLAG_M64="-m64"  
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 check for pthreads support  dnl standard headers
64  dnl  dnl
65  ACX_PTHREAD()  AC_HEADER_STDBOOL
66    
 dnl check for doxygen  
67  dnl  dnl
68  AC_ARG_WITH([doxygen],  dnl check for pthreads support
   [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],  
   [DOXYGEN=$with_doxygen],  
   [DOXYGEN=none])  
 if test x$DOXYGEN = xnone ; then  
   # see if we can find doxygen in the user's path  
   AC_PATH_PROG(DOXYGEN, [doxygen], [none])  
 fi  
 if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then  
   AC_MSG_ERROR([--with-doxygen option must specify directory argument])  
 elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then  
   AC_MSG_ERROR([doxygen not found at $DOXYGEN])  
 elif test x$DOXYGEN != xnone ; then  
 dnl  
 dnl verify that $DOXYGEN is an absolute path  
69  dnl  dnl
70    case $DOXYGEN in  ACX_PTHREAD
     /*) ;;  
     *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;  
   esac  
 fi  
 if test $DOXYGEN = xnone ; then  
   DOXYGEN=:  
 fi  
 AC_SUBST(DOXYGEN)  
71    
72  dnl  dnl
73  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
# Line 99  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        if test -d /usr/local/cuda/include/CL ; then
124          HAVE_CL_H="yes"
125          CL_HEADER="/usr/local/cuda/include/CL/cl.h"
126          AC_DEFINE([HAVE_CL_CL_H])
127          CPPFLAGS_CL="-I/usr/local/cuda/include"
128        fi
129        AC_MSG_RESULT([$HAVE_CL_H])
130      fi
131      if test x"$HAVE_CL_H" = xno ; then
132        AC_MSG_WARN([no cl.h found])
133        CL_ENABLED=false
134        CL_VERSION=0
135        SIZEOF_CL_INT=0
136        SIZEOF_CL_LONG=0
137        SIZEOF_CL_FLOAT=0
138        SIZEOF_CL_DOUBLE=0
139      else
140    # check the cl.h header for which version of OpenCL is supported    # check the cl.h header for which version of OpenCL is supported
141    AC_LANG([C])    AC_LANG([C])
142        save_CPPFLAGS=$CPPFLAGS
143        CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
144    AC_LINK_IFELSE([AC_LANG_PROGRAM([[    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
145  #include <stdio.h>  #include <stdio.h>
146  # ifdef HAVE_CL_CL_H  # ifdef HAVE_CL_CL_H
# Line 126  Line 150 
150  # else  # else
151  #   error no cl.h  #   error no cl.h
152  # endif]],  # endif]],
153  [[#if defined(CL_VERSION_1_1)  [[#if defined(CL_VERSION_1_2)
154    printf("11000\n");    printf("120\n");
155    #elif defined(CL_VERSION_1_1)
156      printf("110\n");
157  #elif defined(CL_VERSION_1_0)  #elif defined(CL_VERSION_1_0)
158    printf("10000\n");    printf("100\n");
159  #else  #else
160    printf("0\n");    printf("0\n");
161  #endif  #endif
# Line 140  Line 166 
166  dnl the specification specifies the behavior, but it was unspecified in 1.0.  dnl the specification specifies the behavior, but it was unspecified in 1.0.
167  dnl  dnl
168    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
169  # ifdef HAVE_CL_CL_H  #include "$CL_HEADER"
170  #   include <CL/cl.h>  ]],
 # elif defined(HAVE_OPENCL_CL_H)  
 #   include <OpenCL/cl.h>  
 # else  
 #   error no cl.h  
 # endif]],  
171      [[cl_float4 x; x[0] = 0.0;]])],      [[cl_float4 x; x[0] = 0.0;]])],
172      [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],      [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
173  dnl  dnl
174  dnl not arrays, so try the OpenCL 1.1 structure representation  dnl not arrays, so try the OpenCL 1.1 structure representation
175  dnl  dnl
176      [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[      [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
177  # ifdef HAVE_CL_CL_H  #include "$CL_HEADER"
178  #   include <CL/cl.h>  ]],
 # elif defined(HAVE_OPENCL_CL_H)  
 #   include <OpenCL/cl.h>  
 # else  
 #   error no cl.h  
 # endif]],  
179      [[cl_float4 x; x.s[0] = 0.0;]])],      [[cl_float4 x; x.s[0] = 0.0;]])],
180      [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],      [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
181      [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])      [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
182      # restore saved CPPFLAGS
183        CPPFLAGS=$save_CPPFLAGS
184    # substitutions    # substitutions
185    AC_SUBST(CL_LIBS)      AC_SUBST(LIBS_CL)
186        AC_SUBST(CPPFLAGS_CL)
187      #
188      # determine the sizes of the host-side OpenCL types
189      AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
190      SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
191      AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
192      SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
193      AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
194      SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
195      AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
196      SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
197      fi
198  fi  fi
199  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
200  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)
201    AC_DEFINE_UNQUOTED(DIDEROT_CL_VERSION,[$CL_VERSION],[version of OpenCL supported by system])
202    
203    AC_SUBST(SIZEOF_CL_INT)
204    AC_SUBST(SIZEOF_CL_LONG)
205    AC_SUBST(SIZEOF_CL_FLOAT)
206    AC_SUBST(SIZEOF_CL_DOUBLE)
207    
208  dnl  dnl
209  dnl check for various library routines etc.  dnl check for various library routines etc.
# Line 277  Line 313 
313  AC_SUBST(LIBM)  AC_SUBST(LIBM)
314    
315  dnl  dnl
316  dnl get the path to the TEEM installation  dnl get the path to the TEEM installation.  We need this to build the Diderot
317    dnl runtime code and we use the path when searching for teem in the Diderot
318    dnl compiler.
319  dnl  dnl
320  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
321    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
# Line 294  Line 332 
332      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
333      # check that TEEM_DIR actually points to something that looks like teem      # check that TEEM_DIR actually points to something that looks like teem
334      if test -f $TEEM_DIR/include/teem/nrrd.h ; then      if test -f $TEEM_DIR/include/teem/nrrd.h ; then
335        AC_MSG_RESULT([ okay])        AC_MSG_RESULT([yes])
336      else      else
337        TEEM_DIR=none        TEEM_DIR=none
338        AC_MSG_RESULT([ invalid])        AC_MSG_RESULT([no])
339      fi      fi
340    else    else
341      TEEM_DIR=none      TEEM_DIR=none
342      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([no])
343    fi    fi
344  fi  fi
345  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
346    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
347    fi
348    dnl
349    dnl check that unu supports the dnorm command
350    dnl
351    if test x"$TEEM_DIR" != xnone ; then
352      AC_MSG_CHECKING([that \"unu dnorm\" works])
353      if test -x $TEEM_DIR/bin/unu ; then
354        $TEEM_DIR/bin/unu dnorm > /dev/null 2> /dev/null
355        if test $? -eq 0 ; then
356          AC_MSG_RESULT([yes])
357        else
358          AC_MSG_ERROR([\"unu dnorm\" is not supported; please update your teem installation])
359        fi
360      else
361        AC_MSG_ERROR([unable to find unu executable in $TEEM_DIR/bin"])
362      fi
363  fi  fi
364  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
365    
# Line 316  Line 370 
370  dnl  dnl
371  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])])
372  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
373    -o $SMLNJ_MINOR_VERSION -lt 73    -o $SMLNJ_MINOR_VERSION -lt 77
374  then  then
375    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])    AC_MSG_ERROR([installation requires SML/NJ version 110.77+ (available from smlnj.org)])
376  fi  fi
377  AC_SUBST(SMLNJ_VERSION)  AC_SUBST(SMLNJ_VERSION)
378    
# Line 349  Line 403 
403  fi  fi
404  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
405    
406    dnl ******************** Documentation tools ********************
407    
408    dnl check for doxygen
409    dnl
410    AC_ARG_WITH([doxygen],
411      [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],
412      [DOXYGEN=$with_doxygen],
413      [DOXYGEN=none])
414    if test x$DOXYGEN = xnone ; then
415      # see if we can find doxygen in the user's path
416      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
417    fi
418    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
419      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
420    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
421      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
422    elif test x$DOXYGEN != xnone ; then
423    dnl
424    dnl verify that $DOXYGEN is an absolute path
425    dnl
426      case $DOXYGEN in
427        /*) ;;
428        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
429      esac
430    fi
431    if test $DOXYGEN = xnone ; then
432      DOXYGEN=:
433    fi
434    AC_SUBST(DOXYGEN)
435    
436    dnl check for asciidoc and related tools
437    dnl
438    AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
439    AC_PATH_PROGS([A2X], [a2x], [none])
440    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
441    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
442    
443    dnl
444    dnl get the path to the asciidoc cofiguration files
445    dnl
446    if test x"$ASCIIDOC" != xnone ; then
447      AC_MSG_CHECKING([path to asciidoc configuration files])
448      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
449      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
450    fi
451    AC_SUBST(ASCIIDOC)
452    AC_SUBST(A2X)
453    AC_SUBST(ASCIIDOC_CONF_DIR)
454    AC_SUBST(HIGHLIGHTER)
455    AC_SUBST(DBLATEX)
456    
457    
458  dnl ******************** Paths ********************  dnl ******************** Paths ********************
459    
460  DIDEROT_ROOT=`pwd`  DIDEROT_ROOT=`pwd`
# Line 378  Line 484 
484  dnl run the compiler tests in 64-bit mode  dnl run the compiler tests in 64-bit mode
485  dnl  dnl
486  save_CFLAGS=$CFLAGS  save_CFLAGS=$CFLAGS
487  CFLAGS="$CFLAGS $CFLAG_M64"  CFLAGS="$CFLAGS $CFLAG_MXX"
488    
489  dnl  dnl
490  dnl check for gcc builtin atomic operations  dnl check for gcc builtin atomic operations
# Line 394  Line 500 
500    
501  AC_C_BIGENDIAN  AC_C_BIGENDIAN
502    
503    #
504    # determine the sizes of the standard C types
505    AC_CHECK_SIZEOF([int])
506    SIZEOF_C_INT=$ac_cv_sizeof_int
507    AC_CHECK_SIZEOF([long])
508    SIZEOF_C_LONG=$ac_cv_sizeof_long
509    AC_CHECK_SIZEOF([float])
510    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
511    AC_CHECK_SIZEOF([double])
512    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
513    
514    AC_SUBST(SIZEOF_C_INT)
515    AC_SUBST(SIZEOF_C_LONG)
516    AC_SUBST(SIZEOF_C_FLOAT)
517    AC_SUBST(SIZEOF_C_DOUBLE)
518    
519  dnl  dnl
520  dnl restore CFLAGS  dnl restore CFLAGS
521  dnl  dnl
# Line 407  Line 529 
529    
530  AH_TOP([  AH_TOP([
531  /*  /*
532   * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)   * COPYRIGHT (c) 2014 Diderot project. (http://diderot-language.cs.uchicago.edu)
533   * All rights reserved.   * All rights reserved.
534   */   */
535    
# Line 417  Line 539 
539  ])  ])
540  AH_BOTTOM([  AH_BOTTOM([
541    
542    #ifdef NDEBUG
543    #define STATIC_INLINE   static inline
544    #else
545    #define STATIC_INLINE   static
546    #endif
547    
548  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
549  ])  ])
550    
# Line 429  Line 557 
557  dnl ***** Makefiles *****  dnl ***** Makefiles *****
558    Makefile    Makefile
559    doc/Makefile    doc/Makefile
560      doc/man/Makefile
561    src/clinfo/Makefile    src/clinfo/Makefile
   src/dnorm/Makefile  
562    src/compiler/Makefile    src/compiler/Makefile
563    src/lib/build/Makefile    src/lib/build/Makefile
564    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
565    test/MIP/Makefile    test/MIP/Makefile
566    test/probe/Makefile    test/probe/Makefile
567      test/iso2d-polyline/Makefile
568      test/vr-lite-cam/Makefile
569      test/hlic/Makefile
570  dnl  dnl
571  dnl ***** SML source files *****  dnl ***** SML source files *****
572    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
573    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
574      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
575  )  )
576    
577  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 453  Line 585 
585  AC_CONFIG_FILES([  AC_CONFIG_FILES([
586    src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in    src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in
587  ], [chmod +x src/compiler/gen/file2str/file2str.sh])  ], [chmod +x src/compiler/gen/file2str/file2str.sh])
588    AC_CONFIG_FILES([
589      rtest/scripts/run.sh:rtest/scripts/run_sh.in
590    ], [chmod +x rtest/scripts/run.sh])
591    AC_CONFIG_FILES([
592      rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in
593    ], [chmod +x rtest/scripts/run-one.sh])
594    #
595    # more regression tests; should merge with rtest at some point
596    #
597    AC_CONFIG_FILES([
598      rtest2/scripts/run.sh:rtest2/scripts/run_sh.in
599    ], [chmod +x rtest2/scripts/run.sh])
600    AC_CONFIG_FILES([
601      rtest2/scripts/run-one.sh:rtest2/scripts/run-one_sh.in
602    ], [chmod +x rtest2/scripts/run-one.sh])
603    
604  dnl  dnl
605  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds

Legend:
Removed from v.1685  
changed lines
  Added in v.3199

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