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 202, Tue Aug 3 13:06:03 2010 UTC branches/pure-cfg/configure.ac revision 1196, Thu May 12 04:04:45 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    
157    dnl check for /proc/cpuinfo
158    dnl
159    AC_CHECK_FILES(/proc/cpuinfo)
160    
161    dnl
162    dnl OS-specific linking issues
163    dnl
164    LD_NEEDS_RPATH=false;
165    LIBM=""
166    case "$host_os" in
167      darwin*) # On Mac OS X we check for the presence of macports and/or fink
168      if test -x /opt/local/bin/port ; then      if test -x /opt/local/bin/port ; then
169        HAS_MACPORTS=yes        HAS_MACPORTS=yes
170      else      else
# Line 50  Line 176 
176        HAS_FINK=no        HAS_FINK=no
177      fi      fi
178    ;;    ;;
179      linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
180        LD_NEEDS_RPATH=true
181        LIBM="-lm"
182      ;;
183  esac  esac
184    
185  if test x"$HAS_MACPORTS" = xyes ; then  if test x"$HAS_MACPORTS" = xyes ; then
# Line 60  Line 190 
190    LDPATHS=""    LDPATHS=""
191  fi  fi
192  AC_SUBST(LDPATHS)  AC_SUBST(LDPATHS)
193    AC_SUBST(LD_NEEDS_RPATH)
194    AC_SUBST(LIBM)
195    
196  dnl  dnl
197  dnl get the path to the TEEM installation  dnl get the path to the TEEM installation
# Line 150  Line 282 
282  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
283    
284  dnl  dnl
285    dnl ******************** C compiler properties ********************
286    dnl
287    
288    dnl
289    dnl run the compiler tests in 64-bit mode
290    dnl
291    save_CFLAGS=$CFLAGS
292    CFLAGS="$CFLAGS $CFLAG_M64"
293    
294    dnl
295    dnl check for gcc builtin atomic operations
296    dnl
297    AC_MSG_CHECKING([for builtin atomic operations])
298    AC_LINK_IFELSE(
299       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
300       AC_MSG_RESULT(yes)
301       AC_DEFINE(
302        [HAVE_BUILTIN_ATOMIC_OPS], 1,
303        [Define to 1 if gcc compiler provides atomic operations.]),
304       AC_MSG_RESULT(no))
305    
306    AC_C_BIGENDIAN
307    
308    dnl
309    dnl restore CFLAGS
310    dnl
311    CFLAGS=$save_CFLAGS
312    
313    dnl
314    dnl ******************** config.h stuff ********************
315    dnl
316    AH_TOP([
317    /*
318     * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)
319     * All rights reserved.
320     */
321    
322    #ifndef _DIDEROT_CONFIG_H_
323    #define _DIDEROT_CONFIG_H_
324    
325    ])
326    AH_BOTTOM([
327    
328    #endif /* !_DIDEROT_CONFIG_H_ */
329    ])
330    
331    dnl
332  dnl ******************** write output ********************  dnl ******************** write output ********************
333  dnl  dnl
334    
335  AC_CONFIG_FILES(  AC_CONFIG_FILES(
336  dnl  dnl
337  dnl ***** Makefiles *****  dnl ***** Makefiles *****
338      Makefile
339    src/dnorm/Makefile    src/dnorm/Makefile
340    src/compiler/Makefile    src/compiler/Makefile
341      src/lib/build/Makefile
342      src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in
343      test/MIP/Makefile
344      test/probe/Makefile
345    dnl
346    dnl ***** CM files *****
347      src/compiler/codegen/sources.cm:src/compiler/codegen/sources_cm.in
348  dnl  dnl
349  dnl ***** SML source files *****  dnl ***** SML source files *****
350    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
351      src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
352  )  )
353    
354    AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in)
355    
356  dnl  dnl
357  dnl shell scripts  dnl shell scripts
358  dnl  dnl
# Line 170  Line 360 
360    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
361  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
362    
363    dnl
364    dnl generate makefiles for runtime library builds
365    dnl
366    dnl usage: MK_BUILD_DIR(<build-dir>, <target-platform>, <options>)
367    dnl
368    AC_DEFUN([MK_BUILD_DIR], [
369        if test ! -d src/lib/build/$1 ; then
370          mkdir src/lib/build/$1
371        fi
372        [sed -e 's,@BUILD_TARGET@,$1,g' \
373          -e 's,@TARGET_PLATFORM@,$2,g' \
374          -e 's,@BUILD_OPTIONS@,$3,g' \
375          src/lib/build/mk/Makefile.in \
376            > src/lib/build/$1/Makefile.in]
377        AC_CONFIG_FILES(src/lib/build/$1/Makefile)
378      ])
379    
380    MK_BUILD_DIR(rt-c-f, c-target, [float])
381    MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug])
382    MK_BUILD_DIR(rt-c-f-par, parallel-target, [parallel float])
383    
384  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.202  
changed lines
  Added in v.1196

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