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 260, Tue Aug 10 15:34:34 2010 UTC branches/vis12/configure.ac revision 1833, Fri Apr 13 15:19:40 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]])  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 29  Line 27 
27    
28  dnl check for standard programs  dnl check for standard programs
29  dnl  dnl
30  AC_PROG_CC_C99  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  dnl
37  dnl If we are on Mac OS X, check for the presence of macports and/or fink  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
44  dnl  dnl
45    AC_PROG_CC_C99
46    if test x"$ac_cv_prog_cc_c99" = xno ; then
47      AC_MSG_ERROR([Diderot requires c99 support])
48    fi
49    
50    dnl extra C compiler options
51    dnl
52    CFLAGS=""
53    CFLAG_M64="-m64"
54    CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"
55    AC_SUBST(CFLAG_M64)
56    AC_SUBST(CFLAGS_BASE)
57    
58    dnl
59    dnl standard headers
60    dnl
61    AC_HEADER_STDBOOL
62    
63    dnl
64    dnl check for pthreads support
65    dnl
66    ACX_PTHREAD
67    
68    dnl check for doxygen
69    dnl
70    AC_ARG_WITH([doxygen],
71      [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],
72      [DOXYGEN=$with_doxygen],
73      [DOXYGEN=none])
74    if test x$DOXYGEN = xnone ; then
75      # see if we can find doxygen in the user's path
76      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
77    fi
78    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
79      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
80    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
81      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
82    elif test x$DOXYGEN != xnone ; then
83    dnl
84    dnl verify that $DOXYGEN is an absolute path
85    dnl
86      case $DOXYGEN in
87        /*) ;;
88        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
89      esac
90    fi
91    if test $DOXYGEN = xnone ; then
92      DOXYGEN=:
93    fi
94    AC_SUBST(DOXYGEN)
95    
96    dnl
97    dnl Look for NVIDIA's nvcc compiler
98    dnl
99    AC_MSG_NOTICE([checking for CUDA and nvcc])
100    AC_PATH_PROG(NVCC, nvcc, no, $PATH)
101    if test x"$NVCC" = xno ; then
102      AC_MSG_WARN([nvcc not found])
103      CUDA_ENABLED=false
104      NVCC=":"
105    else
106      AC_MSG_RESULT([$NVCC])
107      CUDA_ENABLED=true
108    fi
109    AC_SUBST(NVCC)
110    AC_SUBST(CUDA_ENABLED)
111    
112    dnl
113    dnl check for OpenCL support
114    dnl
115    CL_LIBS="none"
116  case "$host_os" in  case "$host_os" in
117    darwin*) # On Mac OS X we check for installed frameworks    darwin*) # On Mac OS X we check for installed frameworks
118        AX_CHECK_FRAMEWORK([OpenCL], [CL_LIBS="-framework OpenCL"], [])
119      ;;
120      *)
121        AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[CL_LIBS="-lOpenCL"])
122      ;;
123    esac
124    if test x"$CL_LIBS" = xnone ; then
125      AC_MSG_WARN([no OpenCL library found])
126      CL_ENABLED=false
127      CL_VERSION=0
128    else
129      CL_ENABLED=true
130      AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h])
131      # check the cl.h header for which version of OpenCL is supported
132      AC_LANG([C])
133      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
134    #include <stdio.h>
135    # ifdef HAVE_CL_CL_H
136    #   include <CL/cl.h>
137    # elif defined(HAVE_OPENCL_CL_H)
138    #   include <OpenCL/cl.h>
139    # else
140    #   error no cl.h
141    # endif]],
142    [[#if defined(CL_VERSION_1_1)
143      printf("11000\n");
144    #elif defined(CL_VERSION_1_0)
145      printf("10000\n");
146    #else
147      printf("0\n");
148    #endif
149        ]])],
150        [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
151    dnl
152    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
153    dnl the specification specifies the behavior, but it was unspecified in 1.0.
154    dnl
155      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
156    # ifdef HAVE_CL_CL_H
157    #   include <CL/cl.h>
158    # elif defined(HAVE_OPENCL_CL_H)
159    #   include <OpenCL/cl.h>
160    # else
161    #   error no cl.h
162    # endif]],
163        [[cl_float4 x; x[0] = 0.0;]])],
164        [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
165    dnl
166    dnl not arrays, so try the OpenCL 1.1 structure representation
167    dnl
168        [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
169    # ifdef HAVE_CL_CL_H
170    #   include <CL/cl.h>
171    # elif defined(HAVE_OPENCL_CL_H)
172    #   include <OpenCL/cl.h>
173    # else
174    #   error no cl.h
175    # endif]],
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      # substitutions
180      AC_SUBST(CL_LIBS)
181    fi
182    AC_SUBST(CL_ENABLED)
183    AC_SUBST(CL_VERSION)
184    
185    dnl
186    dnl check for various library routines etc.
187    dnl
188    AC_CHECK_FUNCS(posix_memalign)
189    if test x"$ac_cv_func_posix_memalign" != xyes ; then
190      AC_CHECK_FUNCS(memalign)
191      if test x"$ac_cv_func_posix_memalign" != xyes ; then
192        AC_CHECK_FUNCS(valloc)
193      fi
194    fi
195    
196    AC_CHECK_FUNCS(mach_absolute_time)
197    AC_CHECK_TYPES([struct timespec])
198    AC_CHECK_FUNCS(pthread_barrier_init)
199    
200    dnl
201    dnl check for clock_gettime.  On Linux, this requires librt.
202    dnl
203    save_LIBS=$LIBS
204    LIBS="-lrt $LIBS"
205    AC_MSG_CHECKING([for clock_gettime])
206    AC_LINK_IFELSE(
207      [AC_LANG_PROGRAM(
208        [[#include <time.h>]],
209        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
210      [ ac_cv_func_clock_gettime=yes;
211        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
212      [ac_cv_func_clock_gettime=no])
213    AC_MSG_RESULT($ac_cv_func_clock_gettime)
214    if test "$ac_cv_func_clock_gettime" = "no" ; then
215      LIBS=$save_LIBS
216    fi
217    
218    AC_CHECK_FUNCS(pthread_getcpuclockid)
219    AC_CHECK_FUNCS(sigtimedwait nanosleep)
220    
221    dnl
222    dnl check for sched_setaffinity
223    dnl
224    AC_CHECK_FUNCS(sched_setaffinity)
225    
226    dnl
227    dnl check for pthread_setaffinity_np
228    dnl
229    save_LIBS=$LIBS
230    save_CFLAGS=$CFLAGS
231    LIBS="$PTHREAD_LIBS $LIBS"
232    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
233    AC_MSG_CHECKING([for pthread_setaffinity_np])
234    AC_LINK_IFELSE(
235      [AC_LANG_PROGRAM(
236        [[#include <pthread.h>]],
237        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
238      [ ac_cv_func_pthread_setaffinity_np=yes;
239        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
240      [ac_cv_func_pthread_setaffinity_np=no])
241    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
242    LIBS=$save_LIBS
243    CFLAGS=$save_CFLAGS
244    
245    dnl
246    dnl check for Linux NUMA support (libnuma)
247    dnl
248    AC_CHECK_LIB(numa,numa_available)
249    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
250      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
251    fi
252    
253    dnl check for /proc/cpuinfo
254    dnl
255    AC_CHECK_FILES(/proc/cpuinfo)
256    
257    dnl
258    dnl OS-specific linking issues
259    dnl
260    LD_NEEDS_RPATH=false;
261    LIBM=""
262    case "$host_os" in
263      darwin*) # On Mac OS X we check for the presence of macports and/or fink
264      if test -x /opt/local/bin/port ; then      if test -x /opt/local/bin/port ; then
265        HAS_MACPORTS=yes        HAS_MACPORTS=yes
266      else      else
# Line 50  Line 272 
272        HAS_FINK=no        HAS_FINK=no
273      fi      fi
274    ;;    ;;
275      linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
276        LD_NEEDS_RPATH=true
277        LIBM="-lm"
278      ;;
279  esac  esac
280    
281  if test x"$HAS_MACPORTS" = xyes ; then  if test x"$HAS_MACPORTS" = xyes ; then
# Line 60  Line 286 
286    LDPATHS=""    LDPATHS=""
287  fi  fi
288  AC_SUBST(LDPATHS)  AC_SUBST(LDPATHS)
289    AC_SUBST(LD_NEEDS_RPATH)
290    AC_SUBST(LIBM)
291    
292  dnl  dnl
293  dnl get the path to the TEEM installation  dnl get the path to the TEEM installation
# Line 77  Line 305 
305    esac    esac
306    if test -x $ac_cv_use_teem ; then    if test -x $ac_cv_use_teem ; then
307      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
308        # check that TEEM_DIR actually points to something that looks like teem
309        if test -f $TEEM_DIR/include/teem/nrrd.h ; then
310      AC_MSG_RESULT([ okay])      AC_MSG_RESULT([ okay])
311    else    else
312      TEEM_DIR=none      TEEM_DIR=none
313      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([ invalid])
314    fi    fi
315      else
316        TEEM_DIR=none
317        AC_MSG_RESULT([ invalid])
318      fi
319  fi  fi
320  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
321    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem])
# Line 95  Line 329 
329  dnl  dnl
330  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])])
331  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
332    -o $SMLNJ_MINOR_VERSION -lt 72    -o $SMLNJ_MINOR_VERSION -lt 73
333  then  then
334    AC_MSG_ERROR([installation requires SML/NJ version 110.72+])    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])
335  fi  fi
336  AC_SUBST(SMLNJ_VERSION)  AC_SUBST(SMLNJ_VERSION)
337    
# Line 150  Line 384 
384  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
385    
386  dnl  dnl
387    dnl ******************** C compiler properties ********************
388    dnl
389    
390    dnl
391    dnl run the compiler tests in 64-bit mode
392    dnl
393    save_CFLAGS=$CFLAGS
394    CFLAGS="$CFLAGS $CFLAG_M64"
395    
396    dnl
397    dnl check for gcc builtin atomic operations
398    dnl
399    AC_MSG_CHECKING([for builtin atomic operations])
400    AC_LINK_IFELSE(
401       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
402       AC_MSG_RESULT(yes)
403       AC_DEFINE(
404        [HAVE_BUILTIN_ATOMIC_OPS], 1,
405        [Define to 1 if gcc compiler provides atomic operations.]),
406       AC_MSG_RESULT(no))
407    
408    AC_C_BIGENDIAN
409    
410    dnl
411    dnl restore CFLAGS
412    dnl
413    CFLAGS=$save_CFLAGS
414    
415    dnl
416    dnl ******************** config.h stuff ********************
417    dnl
418    
419    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])
420    
421    AH_TOP([
422    /*
423     * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)
424     * All rights reserved.
425     */
426    
427    #ifndef _DIDEROT_CONFIG_H_
428    #define _DIDEROT_CONFIG_H_
429    
430    ])
431    AH_BOTTOM([
432    
433    #endif /* !_DIDEROT_CONFIG_H_ */
434    ])
435    
436    dnl
437  dnl ******************** write output ********************  dnl ******************** write output ********************
438  dnl  dnl
439    
440  AC_CONFIG_FILES(  AC_CONFIG_FILES(
441  dnl  dnl
442  dnl ***** Makefiles *****  dnl ***** Makefiles *****
443      Makefile
444      doc/Makefile
445      src/clinfo/Makefile
446    src/dnorm/Makefile    src/dnorm/Makefile
447    src/compiler/Makefile    src/compiler/Makefile
448      src/lib/build/Makefile
449      src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in
450    test/MIP/Makefile    test/MIP/Makefile
451    test/probe/Makefile    test/probe/Makefile
452      test/iso2d-polyline/Makefile
453      test/vr-lite-cam/Makefile
454      test/hlic/Makefile
455  dnl  dnl
456  dnl ***** SML source files *****  dnl ***** SML source files *****
457    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
458      src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
459  )  )
460    
461    AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in)
462    
463  dnl  dnl
464  dnl shell scripts  dnl shell scripts
465  dnl  dnl
466  AC_CONFIG_FILES([  AC_CONFIG_FILES([
467    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
468  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
469    AC_CONFIG_FILES([
470      src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in
471    ], [chmod +x src/compiler/gen/file2str/file2str.sh])
472    AC_CONFIG_FILES([
473      rtest/scripts/run.sh:rtest/scripts/run_sh.in
474    ], [chmod +x rtest/scripts/run.sh])
475    AC_CONFIG_FILES([
476      rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in
477    ], [chmod +x rtest/scripts/run-one.sh])
478    
479    dnl
480    dnl generate makefiles for runtime library builds
481    dnl
482    dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
483    dnl
484    AC_DEFUN([MK_BUILD_DIR], [
485        if test ! -d src/lib/build/$1 ; then
486          mkdir src/lib/build/$1
487        fi
488        [sed -e 's,@BUILD_TARGET@,$1,g' \
489          -e 's,@TARGET_PLATFORM@,$2,g' \
490          -e 's,@BUILD_OPTIONS@,$3,g' \
491          src/lib/build/mk/Makefile.in \
492            > src/lib/build/$1/Makefile.in]
493        AC_CONFIG_FILES(src/lib/build/$1/Makefile)
494      ])
495    
496    MK_BUILD_DIR(rt-c-f, c, [float])
497    MK_BUILD_DIR(rt-c-d, c, [double])
498    MK_BUILD_DIR(rt-c-f-debug, c, [float debug])
499    MK_BUILD_DIR(rt-c-d-debug, c, [double debug])
500    MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])
501    MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])
502    MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])
503    MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])
504    
505    if test x"$CL_ENABLED" = xtrue ; then
506      MK_BUILD_DIR(rt-cl-f, cl, [float])
507      MK_BUILD_DIR(rt-cl-d, cl, [double])
508      MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug])
509      MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug])
510    fi
511    
512  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.260  
changed lines
  Added in v.1833

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