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

revision 997, Wed Apr 27 17:33:05 2011 UTC revision 1215, Sat May 14 05:54:07 2011 UTC
# 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 28  Line 29 
29    
30  dnl check for standard programs  dnl check for standard programs
31  dnl  dnl
32    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
# Line 41  Line 43 
43    
44  dnl extra C compiler options  dnl extra C compiler options
45  dnl  dnl
46  CC="$CC -m64"  CFLAG_M64="-m64"
47  CFLAGS="$CFLAGS -Wformat -Wreturn-type -Wuninitialized"  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"
48    AC_SUBST(CFLAG_M64)
49    AC_SUBST(CFLAGS_BASE)
50    
51  dnl  dnl
52  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
53  dnl  dnl
54  AC_MSG_CHECKING([for CUDA and nvcc])  AC_MSG_NOTICE([checking for CUDA and nvcc])
55  AC_PATH_PROG(NVCC, nvcc, ":", $PATH)  AC_PATH_PROG(NVCC, nvcc, no, $PATH)
56  if test $NVCC = none ; then  if test x"$NVCC" = xno ; then
57    AC_MSG_WARN([nvcc not found])    AC_MSG_WARN([nvcc not found])
58      CUDA_ENABLED=false
59      NVCC=":"
60  else  else
61    AC_MSG_RESULT([$NVCC])    AC_MSG_RESULT([$NVCC])
62      CUDA_ENABLED=true
63  fi  fi
64  AC_SUBST(NVCC)  AC_SUBST(NVCC)
65    AC_SUBST(CUDA_ENABLED)
66    
67    dnl
68    dnl check for OpenCL support
69    dnl
70    OPENCL_LIBS="none"
71    case "$host_os" in
72      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  dnl
89  dnl check for pthreads support  dnl check for pthreads support
# Line 62  Line 91 
91  ACX_PTHREAD()  ACX_PTHREAD()
92    
93  dnl  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  dnl OS-specific linking issues
163  dnl  dnl
164  LD_NEEDS_RPATH=false;  LD_NEEDS_RPATH=false;
# Line 79  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    linux*) # On Linux we include the -rpath option to pick up dynamically-loaded libraries
180      LD_NEEDS_RPATH=true      LD_NEEDS_RPATH=true
181      LIBM="-lm"      LIBM="-lm"
182    ;;    ;;
# Line 130  Line 227 
227  dnl  dnl
228  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])])
229  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
230    -o $SMLNJ_MINOR_VERSION -lt 72    -o $SMLNJ_MINOR_VERSION -lt 73
231  then  then
232    AC_MSG_ERROR([installation requires SML/NJ version 110.72+])    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])
233  fi  fi
234  AC_SUBST(SMLNJ_VERSION)  AC_SUBST(SMLNJ_VERSION)
235    
# Line 185  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    
# Line 194  Line 338 
338    Makefile    Makefile
339    src/dnorm/Makefile    src/dnorm/Makefile
340    src/compiler/Makefile    src/compiler/Makefile
341    src/lib/Makefile    src/lib/build/Makefile
342    test/Makefile    src/lib/build/mk/build.gmk:src/lib/build/mk/build_gmk.in
343    test/MIP/Makefile    test/MIP/Makefile
344    test/probe/Makefile    test/probe/Makefile
345  dnl  dnl
346    dnl ***** CM files *****
347      src/compiler/codegen/sources.cm:src/compiler/codegen/sources_cm.in
348    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    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 211  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    MK_BUILD_DIR(rt-c-f-par-debug, parallel-target, [parallel float debug])
384    
385  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.997  
changed lines
  Added in v.1215

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