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

SCM Repository

[diderot] Diff of /branches/pure-cfg/configure.ac
ViewVC logotype

Diff of /branches/pure-cfg/configure.ac

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

trunk/configure.ac revision 126, Tue Jun 29 16:16:27 2010 UTC branches/pure-cfg/configure.ac revision 1217, Sat May 14 06:14:31 2011 UTC
# Line 9  Line 9 
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]])  AC_COPYRIGHT([[COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)]])
13  AC_CONFIG_SRCDIR(src/dnorm/dnorm.c)  AC_CONFIG_SRCDIR(src/dnorm/dnorm.c)
14  AC_CONFIG_AUX_DIR(config)  AC_CONFIG_AUX_DIR(config)
15  AC_CONFIG_MACRO_DIR(config)  AC_CONFIG_MACRO_DIR(config)
# Line 20  Line 20 
20  sinclude(config/acx_pthread.m4)  sinclude(config/acx_pthread.m4)
21  sinclude(config/check_smlnj.m4)  sinclude(config/check_smlnj.m4)
22  sinclude(config/check_smlnj_heap_suffix.m4)  sinclude(config/check_smlnj_heap_suffix.m4)
23    sinclude(config/ax_check_framework.m4)
24    
25  dnl  dnl
26  dnl get host information  dnl get host information
# Line 29  Line 29 
29    
30  dnl check for standard programs  dnl check for standard programs
31  dnl  dnl
32  AC_PROG_CC_C99  AC_PROG_CC([clang gcc cc])
33  AC_PROG_CPP  AC_PROG_CPP
34  AC_PROG_INSTALL  AC_PROG_INSTALL
35  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
36    
37    dnl check for c99 support
38    dnl
39    AC_PROG_CC_C99
40    if test x"$ac_cv_prog_cc_c99" = xno ; then
41      AC_MSG_ERROR([Diderot requires c99 support])
42    fi
43    
44    dnl extra C compiler options
45    dnl
46    CFLAG_M64="-m64"
47    CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"
48    AC_SUBST(CFLAG_M64)
49    AC_SUBST(CFLAGS_BASE)
50    
51    dnl
52    dnl Look for NVIDIA's nvcc compiler
53    dnl
54    AC_MSG_NOTICE([checking for CUDA and nvcc])
55    AC_PATH_PROG(NVCC, nvcc, no, $PATH)
56    if test x"$NVCC" = xno ; then
57      AC_MSG_WARN([nvcc not found])
58      CUDA_ENABLED=false
59      NVCC=":"
60    else
61      AC_MSG_RESULT([$NVCC])
62      CUDA_ENABLED=true
63    fi
64    AC_SUBST(NVCC)
65    AC_SUBST(CUDA_ENABLED)
66    
67  dnl  dnl
68  dnl If we are on Mac OS X, check for the presence of macports and/or fink  dnl check for OpenCL support
69  dnl  dnl
70    OPENCL_LIBS="none"
71  case "$host_os" in  case "$host_os" in
72    darwin*) # On Mac OS X we check for installed frameworks    darwin*) # On Mac OS X we check for installed frameworks
73        AX_CHECK_FRAMEWORK([OpenCL], [OPENCL_LIBS="-framework OpenCL"], [])
74      ;;
75      *)
76        AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[OPENCL_LIBS="-lOpenCL"])
77      ;;
78    esac
79    if test x"$OPENCL_LIBS" = xnone ; then
80      AC_MSG_WARN([no OpenCL library found])
81      OPENCL_ENABLED=false
82    else
83      OPENCL_ENABLED=true
84      AC_SUBST(OPENCL_LIBS)
85    fi
86    AC_SUBST(OPENCL_ENABLED)
87    
88    dnl
89    dnl check for pthreads support
90    dnl
91    ACX_PTHREAD()
92    
93    dnl
94    dnl check for various library routines etc.
95    dnl
96    AC_CHECK_FUNCS(posix_memalign)
97    if test x"$ac_cv_func_posix_memalign" != xyes ; then
98      AC_CHECK_FUNCS(memalign)
99      if test x"$ac_cv_func_posix_memalign" != xyes ; then
100        AC_CHECK_FUNCS(valloc)
101      fi
102    fi
103    
104    AC_CHECK_FUNCS(mach_absolute_time)
105    AC_CHECK_TYPES([struct timespec])
106    
107    dnl
108    dnl check for clock_gettime.  On Linux, this requires librt.
109    dnl
110    save_LIBS=$LIBS
111    LIBS="-lrt $LIBS"
112    AC_MSG_CHECKING([for clock_gettime])
113    AC_LINK_IFELSE(
114      [AC_LANG_PROGRAM(
115        [[#include <time.h>]],
116        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
117      [ ac_cv_func_clock_gettime=yes;
118        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
119      [ac_cv_func_clock_gettime=no])
120    AC_MSG_RESULT($ac_cv_func_clock_gettime)
121    if test "$ac_cv_func_clock_gettime" = "no" ; then
122      LIBS=$save_LIBS
123    fi
124    
125    AC_CHECK_FUNCS(pthread_getcpuclockid)
126    AC_CHECK_FUNCS(sigtimedwait nanosleep)
127    
128    dnl
129    dnl check for sched_setaffinity
130    dnl
131    AC_CHECK_FUNCS(sched_setaffinity)
132    
133    dnl
134    dnl check for pthread_setaffinity_np
135    dnl
136    save_LIBS=$LIBS
137    save_CFLAGS=$CFLAGS
138    LIBS="$PTHREAD_LIBS $LIBS"
139    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
140    AC_MSG_CHECKING([for pthread_setaffinity_np])
141    AC_LINK_IFELSE(
142      [AC_LANG_PROGRAM(
143        [[#include <pthread.h>]],
144        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
145      [ ac_cv_func_pthread_setaffinity_np=yes;
146        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
147      [ac_cv_func_pthread_setaffinity_np=no])
148    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
149    LIBS=$save_LIBS
150    CFLAGS=$save_CFLAGS
151    
152    dnl
153    dnl check for Linux NUMA support (libnuma)
154    dnl
155    AC_CHECK_LIB(numa,numa_available)
156    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
157      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
158    fi
159    
160    dnl check for /proc/cpuinfo
161    dnl
162    AC_CHECK_FILES(/proc/cpuinfo)
163    
164    dnl
165    dnl OS-specific linking issues
166    dnl
167    LD_NEEDS_RPATH=false;
168    LIBM=""
169    case "$host_os" in
170      darwin*) # On Mac OS X we check for the presence of macports and/or fink
171      if test -x /opt/local/bin/port ; then      if test -x /opt/local/bin/port ; then
172        HAS_MACPORTS=yes        HAS_MACPORTS=yes
173      else      else
# Line 50  Line 179 
179        HAS_FINK=no        HAS_FINK=no
180      fi      fi
181    ;;    ;;
182      linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
183        LD_NEEDS_RPATH=true
184        LIBM="-lm"
185      ;;
186  esac  esac
187    
188  if test x"$HAS_MACPORTS" = xyes ; then  if test x"$HAS_MACPORTS" = xyes ; then
# Line 60  Line 193 
193    LDPATHS=""    LDPATHS=""
194  fi  fi
195  AC_SUBST(LDPATHS)  AC_SUBST(LDPATHS)
196    AC_SUBST(LD_NEEDS_RPATH)
197    AC_SUBST(LIBM)
198    
199  dnl  dnl
200  dnl get the path to the TEEM installation  dnl get the path to the TEEM installation
# Line 95  Line 230 
230  dnl  dnl
231  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])])
232  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
233    -o $SMLNJ_MINOR_VERSION -lt 72    -o $SMLNJ_MINOR_VERSION -lt 73
234  then  then
235    AC_MSG_ERROR([installation requires SML/NJ version 110.72+])    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])
236  fi  fi
237  AC_SUBST(SMLNJ_VERSION)  AC_SUBST(SMLNJ_VERSION)
238    
# Line 150  Line 285 
285  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
286    
287  dnl  dnl
288    dnl ******************** C compiler properties ********************
289    dnl
290    
291    dnl
292    dnl run the compiler tests in 64-bit mode
293    dnl
294    save_CFLAGS=$CFLAGS
295    CFLAGS="$CFLAGS $CFLAG_M64"
296    
297    dnl
298    dnl check for gcc builtin atomic operations
299    dnl
300    AC_MSG_CHECKING([for builtin atomic operations])
301    AC_LINK_IFELSE(
302       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
303       AC_MSG_RESULT(yes)
304       AC_DEFINE(
305        [HAVE_BUILTIN_ATOMIC_OPS], 1,
306        [Define to 1 if gcc compiler provides atomic operations.]),
307       AC_MSG_RESULT(no))
308    
309    AC_C_BIGENDIAN
310    
311    dnl
312    dnl restore CFLAGS
313    dnl
314    CFLAGS=$save_CFLAGS
315    
316    dnl
317    dnl ******************** config.h stuff ********************
318    dnl
319    AH_TOP([
320    /*
321     * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)
322     * All rights reserved.
323     */
324    
325    #ifndef _DIDEROT_CONFIG_H_
326    #define _DIDEROT_CONFIG_H_
327    
328    ])
329    AH_BOTTOM([
330    
331    #endif /* !_DIDEROT_CONFIG_H_ */
332    ])
333    
334    dnl
335  dnl ******************** write output ********************  dnl ******************** write output ********************
336  dnl  dnl
337    
 dnl ***** Makefiles *****  
338  AC_CONFIG_FILES(  AC_CONFIG_FILES(
339    dnl
340    dnl ***** Makefiles *****
341      Makefile
342    src/dnorm/Makefile    src/dnorm/Makefile
343    src/compiler/Makefile    src/compiler/Makefile
344      src/lib/build/Makefile
345      src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in
346      test/MIP/Makefile
347      test/probe/Makefile
348    dnl
349    dnl ***** CM files *****
350      src/compiler/codegen/sources.cm:src/compiler/codegen/sources_cm.in
351    dnl
352    dnl ***** SML source files *****
353      src/compiler/fields/run-dnorm.sml:src/compiler/fields/run-dnorm_sml.in
354      src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
355  )  )
356    
357    AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in)
358    
359  dnl  dnl
360  dnl shell scripts  dnl shell scripts
361  dnl  dnl
# Line 166  Line 363 
363    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
364  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
365    
366    dnl
367    dnl generate makefiles for runtime library builds
368    dnl
369    dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
370    dnl
371    AC_DEFUN([MK_BUILD_DIR], [
372        if test ! -d src/lib/build/$1 ; then
373          mkdir src/lib/build/$1
374        fi
375        [sed -e 's,@BUILD_TARGET@,$1,g' \
376          -e 's,@TARGET_PLATFORM@,$2,g' \
377          -e 's,@BUILD_OPTIONS@,$3,g' \
378          src/lib/build/mk/Makefile.in \
379            > src/lib/build/$1/Makefile.in]
380        AC_CONFIG_FILES(src/lib/build/$1/Makefile)
381      ])
382    
383    MK_BUILD_DIR(rt-c-f, c-target, [float])
384    MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug])
385    MK_BUILD_DIR(rt-c-f-par, parallel-target, [parallel float])
386    MK_BUILD_DIR(rt-c-f-par-debug, parallel-target, [parallel float debug])
387    
388  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.126  
changed lines
  Added in v.1217

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