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

SCM Repository

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

Diff of /branches/ein16/configure.ac

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

trunk/configure.ac revision 1299, Thu Jun 9 17:24:26 2011 UTC branches/charisee/configure.ac revision 2490, Mon Oct 21 21:17:25 2013 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) 2012 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) 2013 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 87  Line 103 
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          AC_DEFINE([HAVE_CL_CL_H])
126          CPPFLAGS_CL="-I/usr/local/cuda/include"
127        fi
128        AC_MSG_RESULT([$HAVE_CL_H])
129      fi
130      if test x"$HAVE_CL_H" = xno ; then
131        AC_MSG_WARN([no cl.h found])
132        CL_ENABLED=false
133        CL_VERSION=0
134        SIZEOF_CL_INT=0
135        SIZEOF_CL_LONG=0
136        SIZEOF_CL_FLOAT=0
137        SIZEOF_CL_DOUBLE=0
138      else
139    # check the cl.h header for which version of OpenCL is supported    # check the cl.h header for which version of OpenCL is supported
140    AC_LANG([C])    AC_LANG([C])
141        save_CPPFLAGS=$CPPFLAGS
142        CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
143    AC_LINK_IFELSE([AC_LANG_PROGRAM([[    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
144  #include <stdio.h>  #include <stdio.h>
145  # ifdef HAVE_CL_CL_H  # ifdef HAVE_CL_CL_H
# Line 108  Line 158 
158  #endif  #endif
159      ]])],      ]])],
160      [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])      [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
161    dnl
162    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
163    dnl the specification specifies the behavior, but it was unspecified in 1.0.
164    dnl
165        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
166    #include "$CL_HEADER"
167    ]],
168          [[cl_float4 x; x[0] = 0.0;]])],
169          [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
170    dnl
171    dnl not arrays, so try the OpenCL 1.1 structure representation
172    dnl
173          [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
174    #include "$CL_HEADER"
175    ]],
176          [[cl_float4 x; x.s[0] = 0.0;]])],
177          [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
178          [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
179      # restore saved CPPFLAGS
180        CPPFLAGS=$save_CPPFLAGS
181    # substitutions    # substitutions
182    AC_SUBST(CL_LIBS)    AC_SUBST(CL_LIBS)
183        AC_SUBST(CPPFLAGS_CL)
184      #
185      # determine the sizes of the host-side OpenCL types
186      AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
187      SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
188      AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
189      SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
190      AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
191      SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
192      AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
193      SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
194      fi
195  fi  fi
196  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
197  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)
198    
199    AC_SUBST(SIZEOF_CL_INT)
200    AC_SUBST(SIZEOF_CL_LONG)
201    AC_SUBST(SIZEOF_CL_FLOAT)
202    AC_SUBST(SIZEOF_CL_DOUBLE)
203    
204  dnl  dnl
205  dnl check for various library routines etc.  dnl check for various library routines etc.
206  dnl  dnl
# Line 127  Line 214 
214    
215  AC_CHECK_FUNCS(mach_absolute_time)  AC_CHECK_FUNCS(mach_absolute_time)
216  AC_CHECK_TYPES([struct timespec])  AC_CHECK_TYPES([struct timespec])
217    AC_CHECK_FUNCS(pthread_barrier_init)
218    
219  dnl  dnl
220  dnl check for clock_gettime.  On Linux, this requires librt.  dnl check for clock_gettime.  On Linux, this requires librt.
# Line 221  Line 309 
309  AC_SUBST(LIBM)  AC_SUBST(LIBM)
310    
311  dnl  dnl
312  dnl get the path to the TEEM installation  dnl get the path to the TEEM installation.  We need this to build the Diderot
313    dnl runtime code and we use the path when searching for teem in the Diderot
314    dnl compiler.
315  dnl  dnl
316  AC_ARG_WITH(teem,  AC_ARG_WITH(teem,
317    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),    AC_HELP_STRING([--with-teem=<path>], [specify path to teem installation]),
# Line 236  Line 326 
326    esac    esac
327    if test -x $ac_cv_use_teem ; then    if test -x $ac_cv_use_teem ; then
328      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
329        # check that TEEM_DIR actually points to something that looks like teem
330        if test -f $TEEM_DIR/include/teem/nrrd.h ; then
331      AC_MSG_RESULT([ okay])      AC_MSG_RESULT([ okay])
332    else    else
333      TEEM_DIR=none      TEEM_DIR=none
334      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([ invalid])
335    fi    fi
336      else
337        TEEM_DIR=none
338        AC_MSG_RESULT([ invalid])
339      fi
340  fi  fi
341  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
342    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
343  fi  fi
344  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
345    
# Line 254  Line 350 
350  dnl  dnl
351  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])])
352  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
353    -o $SMLNJ_MINOR_VERSION -lt 73    -o $SMLNJ_MINOR_VERSION -lt 74
354  then  then
355    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])    AC_MSG_ERROR([installation requires SML/NJ version 110.74+])
356  fi  fi
357  AC_SUBST(SMLNJ_VERSION)  AC_SUBST(SMLNJ_VERSION)
358    
# Line 287  Line 383 
383  fi  fi
384  AC_SUBST(ML_BUILD)  AC_SUBST(ML_BUILD)
385    
386    dnl ******************** Documentation tools ********************
387    
388    dnl check for doxygen
389    dnl
390    AC_ARG_WITH([doxygen],
391      [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],
392      [DOXYGEN=$with_doxygen],
393      [DOXYGEN=none])
394    if test x$DOXYGEN = xnone ; then
395      # see if we can find doxygen in the user's path
396      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
397    fi
398    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
399      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
400    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
401      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
402    elif test x$DOXYGEN != xnone ; then
403    dnl
404    dnl verify that $DOXYGEN is an absolute path
405    dnl
406      case $DOXYGEN in
407        /*) ;;
408        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
409      esac
410    fi
411    if test $DOXYGEN = xnone ; then
412      DOXYGEN=:
413    fi
414    AC_SUBST(DOXYGEN)
415    
416    dnl check for asciidoc and related tools
417    dnl
418    AC_PATH_PROGS([ASCIIDOC], [asciidoc], [none])
419    AC_PATH_PROGS([A2X], [a2x], [none])
420    AC_PATH_PROGS([HIGHLIGHTER], [pygmentize], [none])
421    AC_PATH_PROGS([DBLATEX], [dblatex], [none])
422    
423    dnl
424    dnl get the path to the asciidoc cofiguration files
425    dnl
426    if test x"$ASCIIDOC" != xnone ; then
427      AC_MSG_CHECKING([path to asciidoc configuration files])
428      ASCIIDOC_CONF_DIR=`$ASCIIDOC -v /dev/null 2>&1 | head -n 1 | sed 's|.*reading: \(.*\)/asciidoc.conf|\1|'`
429      AC_MSG_RESULT([$ASCIIDOC_CONF_DIR])
430    fi
431    AC_SUBST(ASCIIDOC)
432    AC_SUBST(A2X)
433    AC_SUBST(ASCIIDOC_CONF_DIR)
434    AC_SUBST(HIGHLIGHTER)
435    AC_SUBST(DBLATEX)
436    
437    
438  dnl ******************** Paths ********************  dnl ******************** Paths ********************
439    
440  DIDEROT_ROOT=`pwd`  DIDEROT_ROOT=`pwd`
# Line 316  Line 464 
464  dnl run the compiler tests in 64-bit mode  dnl run the compiler tests in 64-bit mode
465  dnl  dnl
466  save_CFLAGS=$CFLAGS  save_CFLAGS=$CFLAGS
467  CFLAGS="$CFLAGS $CFLAG_M64"  CFLAGS="$CFLAGS $CFLAG_MXX"
468    
469  dnl  dnl
470  dnl check for gcc builtin atomic operations  dnl check for gcc builtin atomic operations
# Line 332  Line 480 
480    
481  AC_C_BIGENDIAN  AC_C_BIGENDIAN
482    
483    #
484    # determine the sizes of the standard C types
485    AC_CHECK_SIZEOF([int])
486    SIZEOF_C_INT=$ac_cv_sizeof_int
487    AC_CHECK_SIZEOF([long])
488    SIZEOF_C_LONG=$ac_cv_sizeof_long
489    AC_CHECK_SIZEOF([float])
490    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
491    AC_CHECK_SIZEOF([double])
492    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
493    
494    AC_SUBST(SIZEOF_C_INT)
495    AC_SUBST(SIZEOF_C_LONG)
496    AC_SUBST(SIZEOF_C_FLOAT)
497    AC_SUBST(SIZEOF_C_DOUBLE)
498    
499  dnl  dnl
500  dnl restore CFLAGS  dnl restore CFLAGS
501  dnl  dnl
# Line 340  Line 504 
504  dnl  dnl
505  dnl ******************** config.h stuff ********************  dnl ******************** config.h stuff ********************
506  dnl  dnl
507    
508    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])
509    
510  AH_TOP([  AH_TOP([
511  /*  /*
512   * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)   * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)
# Line 352  Line 519 
519  ])  ])
520  AH_BOTTOM([  AH_BOTTOM([
521    
522    #ifdef NDEBUG
523    #define STATIC_INLINE   static inline
524    #else
525    #define STATIC_INLINE   static
526    #endif
527    
528  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
529  ])  ])
530    
# Line 363  Line 536 
536  dnl  dnl
537  dnl ***** Makefiles *****  dnl ***** Makefiles *****
538    Makefile    Makefile
539    src/dnorm/Makefile    doc/Makefile
540      doc/man/Makefile
541      src/clinfo/Makefile
542    src/compiler/Makefile    src/compiler/Makefile
543    src/lib/build/Makefile    src/lib/build/Makefile
544    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
545    test/MIP/Makefile    test/MIP/Makefile
546    test/probe/Makefile    test/probe/Makefile
   test/teem/Makefile  
 dnl  
 dnl ***** CM files *****  
   src/compiler/codegen/sources.cm:src/compiler/codegen/sources_cm.in  
547  dnl  dnl
548  dnl ***** SML source files *****  dnl ***** SML source files *****
549    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
550    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
551      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
552  )  )
553    
554  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 387  Line 559 
559  AC_CONFIG_FILES([  AC_CONFIG_FILES([
560    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
561  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
562    AC_CONFIG_FILES([
563      src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in
564    ], [chmod +x src/compiler/gen/file2str/file2str.sh])
565    AC_CONFIG_FILES([
566      rtest/scripts/run.sh:rtest/scripts/run_sh.in
567    ], [chmod +x rtest/scripts/run.sh])
568    AC_CONFIG_FILES([
569      rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in
570    ], [chmod +x rtest/scripts/run-one.sh])
571    
572  dnl  dnl
573  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
# Line 405  Line 586 
586      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
587    ])    ])
588    
589  MK_BUILD_DIR(rt-c-f, c-target, [float])  MK_BUILD_DIR(rt-c-f, c, [float])
590  MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug])  MK_BUILD_DIR(rt-c-d, c, [double])
591  MK_BUILD_DIR(rt-c-f-par, parallel-target, [parallel float])  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])
592  MK_BUILD_DIR(rt-c-f-par-debug, parallel-target, [parallel float debug])  MK_BUILD_DIR(rt-c-d-debug, c, [double debug])
593    MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])
594    MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])
595    MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])
596    MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])
597    
598    if test x"$CL_ENABLED" = xtrue ; then
599      MK_BUILD_DIR(rt-cl-f, cl, [float])
600      MK_BUILD_DIR(rt-cl-d, cl, [double])
601      MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug])
602      MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug])
603    fi
604    
605  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.1299  
changed lines
  Added in v.2490

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