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

SCM Repository

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

Diff of /branches/lamont/configure.ac

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

trunk/configure.ac revision 1200, Thu May 12 12:53:00 2011 UTC branches/vis12/configure.ac revision 1809, Sat Apr 7 14:42:15 2012 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) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)]])
11  AC_CONFIG_SRCDIR(src/dnorm/dnorm.c)  AC_CONFIG_SRCDIR(src/dnorm/dnorm.c)
12  AC_CONFIG_AUX_DIR(config)  AC_CONFIG_AUX_DIR(config)
13  AC_CONFIG_MACRO_DIR(config)  AC_CONFIG_MACRO_DIR(config)
# Line 20  Line 18 
18  sinclude(config/acx_pthread.m4)  sinclude(config/acx_pthread.m4)
19  sinclude(config/check_smlnj.m4)  sinclude(config/check_smlnj.m4)
20  sinclude(config/check_smlnj_heap_suffix.m4)  sinclude(config/check_smlnj_heap_suffix.m4)
21    sinclude(config/ax_check_framework.m4)
22    
23  dnl  dnl
24  dnl get host information  dnl get host information
# Line 28  Line 27 
27    
28  dnl check for standard programs  dnl check for standard programs
29  dnl  dnl
30    AC_PROG_CC([clang gcc cc])
31  AC_PROG_CPP  AC_PROG_CPP
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 49 
49    
50  dnl extra C compiler options  dnl extra C compiler options
51  dnl  dnl
52    CFLAGS=""
53  CFLAG_M64="-m64"  CFLAG_M64="-m64"
54  CFLAGS="$CFLAGS -Wformat -Wreturn-type -Wuninitialized"  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"
55  AC_SUBST(CFLAG_M64)  AC_SUBST(CFLAG_M64)
56    AC_SUBST(CFLAGS_BASE)
57    
58    dnl
59    dnl check for pthreads support
60    dnl
61    ACX_PTHREAD()
62    
63    dnl check for doxygen
64    dnl
65    AC_ARG_WITH([doxygen],
66      [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],
67      [DOXYGEN=$with_doxygen],
68      [DOXYGEN=none])
69    if test x$DOXYGEN = xnone ; then
70      # see if we can find doxygen in the user's path
71      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
72    fi
73    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
74      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
75    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
76      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
77    elif test x$DOXYGEN != xnone ; then
78    dnl
79    dnl verify that $DOXYGEN is an absolute path
80    dnl
81      case $DOXYGEN in
82        /*) ;;
83        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
84      esac
85    fi
86    if test $DOXYGEN = xnone ; then
87      DOXYGEN=:
88    fi
89    AC_SUBST(DOXYGEN)
90    
91  dnl  dnl
92  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
93  dnl  dnl
94  AC_MSG_CHECKING([for CUDA and nvcc])  AC_MSG_NOTICE([checking for CUDA and nvcc])
95  AC_PATH_PROG(NVCC, nvcc, ":", $PATH)  AC_PATH_PROG(NVCC, nvcc, no, $PATH)
96  if test $NVCC = none ; then  if test x"$NVCC" = xno ; then
97    AC_MSG_WARN([nvcc not found])    AC_MSG_WARN([nvcc not found])
98      CUDA_ENABLED=false
99      NVCC=":"
100  else  else
101    AC_MSG_RESULT([$NVCC])    AC_MSG_RESULT([$NVCC])
102      CUDA_ENABLED=true
103  fi  fi
104  AC_SUBST(NVCC)  AC_SUBST(NVCC)
105    AC_SUBST(CUDA_ENABLED)
106    
107  dnl  dnl
108  dnl check for pthreads support  dnl check for OpenCL support
109  dnl  dnl
110  ACX_PTHREAD()  CL_LIBS="none"
111    case "$host_os" in
112      darwin*) # On Mac OS X we check for installed frameworks
113        AX_CHECK_FRAMEWORK([OpenCL], [CL_LIBS="-framework OpenCL"], [])
114      ;;
115      *)
116        AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[CL_LIBS="-lOpenCL"])
117      ;;
118    esac
119    if test x"$CL_LIBS" = xnone ; then
120      AC_MSG_WARN([no OpenCL library found])
121      CL_ENABLED=false
122      CL_VERSION=0
123    else
124      CL_ENABLED=true
125      AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h])
126      # check the cl.h header for which version of OpenCL is supported
127      AC_LANG([C])
128      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
129    #include <stdio.h>
130    # ifdef HAVE_CL_CL_H
131    #   include <CL/cl.h>
132    # elif defined(HAVE_OPENCL_CL_H)
133    #   include <OpenCL/cl.h>
134    # else
135    #   error no cl.h
136    # endif]],
137    [[#if defined(CL_VERSION_1_1)
138      printf("11000\n");
139    #elif defined(CL_VERSION_1_0)
140      printf("10000\n");
141    #else
142      printf("0\n");
143    #endif
144        ]])],
145        [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
146    dnl
147    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
148    dnl the specification specifies the behavior, but it was unspecified in 1.0.
149    dnl
150      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
151    # ifdef HAVE_CL_CL_H
152    #   include <CL/cl.h>
153    # elif defined(HAVE_OPENCL_CL_H)
154    #   include <OpenCL/cl.h>
155    # else
156    #   error no cl.h
157    # endif]],
158        [[cl_float4 x; x[0] = 0.0;]])],
159        [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
160    dnl
161    dnl not arrays, so try the OpenCL 1.1 structure representation
162    dnl
163        [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
164    # ifdef HAVE_CL_CL_H
165    #   include <CL/cl.h>
166    # elif defined(HAVE_OPENCL_CL_H)
167    #   include <OpenCL/cl.h>
168    # else
169    #   error no cl.h
170    # endif]],
171        [[cl_float4 x; x.s[0] = 0.0;]])],
172        [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
173        [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
174      # substitutions
175      AC_SUBST(CL_LIBS)
176    fi
177    AC_SUBST(CL_ENABLED)
178    AC_SUBST(CL_VERSION)
179    
180    dnl
181    dnl check for various library routines etc.
182    dnl
183    AC_CHECK_FUNCS(posix_memalign)
184    if test x"$ac_cv_func_posix_memalign" != xyes ; then
185      AC_CHECK_FUNCS(memalign)
186      if test x"$ac_cv_func_posix_memalign" != xyes ; then
187        AC_CHECK_FUNCS(valloc)
188      fi
189    fi
190    
191    AC_CHECK_FUNCS(mach_absolute_time)
192    AC_CHECK_TYPES([struct timespec])
193    AC_CHECK_FUNCS(pthread_barrier_init)
194    
195    dnl
196    dnl check for clock_gettime.  On Linux, this requires librt.
197    dnl
198    save_LIBS=$LIBS
199    LIBS="-lrt $LIBS"
200    AC_MSG_CHECKING([for clock_gettime])
201    AC_LINK_IFELSE(
202      [AC_LANG_PROGRAM(
203        [[#include <time.h>]],
204        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
205      [ ac_cv_func_clock_gettime=yes;
206        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
207      [ac_cv_func_clock_gettime=no])
208    AC_MSG_RESULT($ac_cv_func_clock_gettime)
209    if test "$ac_cv_func_clock_gettime" = "no" ; then
210      LIBS=$save_LIBS
211    fi
212    
213    AC_CHECK_FUNCS(pthread_getcpuclockid)
214    AC_CHECK_FUNCS(sigtimedwait nanosleep)
215    
216    dnl
217    dnl check for sched_setaffinity
218    dnl
219    AC_CHECK_FUNCS(sched_setaffinity)
220    
221    dnl
222    dnl check for pthread_setaffinity_np
223    dnl
224    save_LIBS=$LIBS
225    save_CFLAGS=$CFLAGS
226    LIBS="$PTHREAD_LIBS $LIBS"
227    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
228    AC_MSG_CHECKING([for pthread_setaffinity_np])
229    AC_LINK_IFELSE(
230      [AC_LANG_PROGRAM(
231        [[#include <pthread.h>]],
232        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
233      [ ac_cv_func_pthread_setaffinity_np=yes;
234        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
235      [ac_cv_func_pthread_setaffinity_np=no])
236    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
237    LIBS=$save_LIBS
238    CFLAGS=$save_CFLAGS
239    
240    dnl
241    dnl check for Linux NUMA support (libnuma)
242    dnl
243    AC_CHECK_LIB(numa,numa_available)
244    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
245      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
246    fi
247    
248    dnl check for /proc/cpuinfo
249    dnl
250    AC_CHECK_FILES(/proc/cpuinfo)
251    
252  dnl  dnl
253  dnl OS-specific linking issues  dnl OS-specific linking issues
# Line 113  Line 300 
300    esac    esac
301    if test -x $ac_cv_use_teem ; then    if test -x $ac_cv_use_teem ; then
302      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
303        # check that TEEM_DIR actually points to something that looks like teem
304        if test -f $TEEM_DIR/include/teem/nrrd.h ; then
305      AC_MSG_RESULT([ okay])      AC_MSG_RESULT([ okay])
306    else    else
307      TEEM_DIR=none      TEEM_DIR=none
308      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([ invalid])
309    fi    fi
310      else
311        TEEM_DIR=none
312        AC_MSG_RESULT([ invalid])
313      fi
314  fi  fi
315  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
316    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem])
# Line 131  Line 324 
324  dnl  dnl
325  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])])
326  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
327    -o $SMLNJ_MINOR_VERSION -lt 72    -o $SMLNJ_MINOR_VERSION -lt 73
328  then  then
329    AC_MSG_ERROR([installation requires SML/NJ version 110.72+])    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])
330  fi  fi
331  AC_SUBST(SMLNJ_VERSION)  AC_SUBST(SMLNJ_VERSION)
332    
# Line 186  Line 379 
379  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
380    
381  dnl  dnl
382    dnl ******************** C compiler properties ********************
383    dnl
384    
385    dnl
386    dnl run the compiler tests in 64-bit mode
387    dnl
388    save_CFLAGS=$CFLAGS
389    CFLAGS="$CFLAGS $CFLAG_M64"
390    
391    dnl
392    dnl check for gcc builtin atomic operations
393    dnl
394    AC_MSG_CHECKING([for builtin atomic operations])
395    AC_LINK_IFELSE(
396       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
397       AC_MSG_RESULT(yes)
398       AC_DEFINE(
399        [HAVE_BUILTIN_ATOMIC_OPS], 1,
400        [Define to 1 if gcc compiler provides atomic operations.]),
401       AC_MSG_RESULT(no))
402    
403    AC_C_BIGENDIAN
404    
405    dnl
406    dnl restore CFLAGS
407    dnl
408    CFLAGS=$save_CFLAGS
409    
410    dnl
411    dnl ******************** config.h stuff ********************
412    dnl
413    
414    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])
415    
416    AH_TOP([
417    /*
418     * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)
419     * All rights reserved.
420     */
421    
422    #ifndef _DIDEROT_CONFIG_H_
423    #define _DIDEROT_CONFIG_H_
424    
425    ])
426    AH_BOTTOM([
427    
428    #endif /* !_DIDEROT_CONFIG_H_ */
429    ])
430    
431    dnl
432  dnl ******************** write output ********************  dnl ******************** write output ********************
433  dnl  dnl
434    
# Line 193  Line 436 
436  dnl  dnl
437  dnl ***** Makefiles *****  dnl ***** Makefiles *****
438    Makefile    Makefile
439      doc/Makefile
440      src/clinfo/Makefile
441    src/dnorm/Makefile    src/dnorm/Makefile
442    src/compiler/Makefile    src/compiler/Makefile
   src/lib/Makefile  
443    src/lib/build/Makefile    src/lib/build/Makefile
444    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/Makefile  
445    test/MIP/Makefile    test/MIP/Makefile
446    test/probe/Makefile    test/probe/Makefile
447      test/iso2d-polyline/Makefile
448      test/vr-lite-cam/Makefile
449      test/hlic/Makefile
450  dnl  dnl
451  dnl ***** SML source files *****  dnl ***** SML source files *****
452    src/compiler/fields/run-dnorm.sml:src/compiler/fields/run-dnorm_sml.in    src/compiler/fields/run-dnorm.sml:src/compiler/fields/run-dnorm_sml.in
453    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
454  )  )
455    
456    AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in)
457    
458  dnl  dnl
459  dnl shell scripts  dnl shell scripts
460  dnl  dnl
# Line 214  Line 462 
462    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
463  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
464  AC_CONFIG_FILES([  AC_CONFIG_FILES([
465    rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in    src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in
466  ], [chmod +x rtest/scripts/run-one.sh])  ], [chmod +x src/compiler/gen/file2str/file2str.sh])
467  AC_CONFIG_FILES([  AC_CONFIG_FILES([
468    rtest/scripts/run.sh:rtest/scripts/run_sh.in    rtest/scripts/run.sh:rtest/scripts/run_sh.in
469  ], [chmod +x rtest/scripts/run.sh])  ], [chmod +x rtest/scripts/run.sh])
470    AC_CONFIG_FILES([
471      rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in
472    ], [chmod +x rtest/scripts/run-one.sh])
473    
474  dnl  dnl
475  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
# Line 237  Line 488 
488      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
489    ])    ])
490    
491  MK_BUILD_DIR(rt-c-f, c-target, [float])  MK_BUILD_DIR(rt-c-f, c, [float])
492  MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug])  MK_BUILD_DIR(rt-c-d, c, [double])
493    MK_BUILD_DIR(rt-c-f-debug, c, [float debug])
494    MK_BUILD_DIR(rt-c-d-debug, c, [double debug])
495    MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])
496    MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])
497    MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])
498    MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])
499    
500    if test x"$CL_ENABLED" = xtrue ; then
501      MK_BUILD_DIR(rt-cl-f, cl, [float])
502      MK_BUILD_DIR(rt-cl-d, cl, [double])
503      MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug])
504      MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug])
505    fi
506    
507  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.1200  
changed lines
  Added in v.1809

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