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

SCM Repository

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

Diff of /branches/charisee/configure.ac

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

revision 1231, Mon May 16 13:49:17 2011 UTC revision 1232, Mon May 16 23:37:52 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 42  Line 44 
44  dnl extra C compiler options  dnl extra C compiler options
45  dnl  dnl
46  CFLAG_M64="-m64"  CFLAG_M64="-m64"
47  CFLAGS="$CFLAGS -Wformat -Wreturn-type -Wuninitialized"  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"
48  AC_SUBST(CFLAG_M64)  AC_SUBST(CFLAG_M64)
49    AC_SUBST(CFLAGS_BASE)
50    
51    dnl
52    dnl check for pthreads support
53    dnl
54    ACX_PTHREAD()
55    
56  dnl  dnl
57  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
58  dnl  dnl
59  AC_MSG_CHECKING([for CUDA and nvcc])  AC_MSG_NOTICE([checking for CUDA and nvcc])
60  AC_PATH_PROG(NVCC, nvcc, ":", $PATH)  AC_PATH_PROG(NVCC, nvcc, no, $PATH)
61  if test $NVCC = none ; then  if test x"$NVCC" = xno ; then
62    AC_MSG_WARN([nvcc not found])    AC_MSG_WARN([nvcc not found])
63      CUDA_ENABLED=false
64      NVCC=":"
65  else  else
66    AC_MSG_RESULT([$NVCC])    AC_MSG_RESULT([$NVCC])
67      CUDA_ENABLED=true
68  fi  fi
69  AC_SUBST(NVCC)  AC_SUBST(NVCC)
70    AC_SUBST(CUDA_ENABLED)
71    
72  dnl  dnl
73  dnl check for pthreads support  dnl check for OpenCL support
74  dnl  dnl
75  ACX_PTHREAD()  CL_LIBS="none"
76    case "$host_os" in
77      darwin*) # On Mac OS X we check for installed frameworks
78        AX_CHECK_FRAMEWORK([OpenCL], [CL_LIBS="-framework OpenCL"], [])
79      ;;
80      *)
81        AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[CL_LIBS="-lOpenCL"])
82      ;;
83    esac
84    if test x"$CL_LIBS" = xnone ; then
85      AC_MSG_WARN([no OpenCL library found])
86      CL_ENABLED=false
87      CL_VERSION=0
88    else
89      CL_ENABLED=true
90      AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h])
91      # check the cl.h header for which version of OpenCL is supported
92      AC_LANG([C])
93      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
94    #include <stdio.h>
95    # ifdef HAVE_CL_CL_H
96    #   include <CL/cl.h>
97    # elif defined(HAVE_OPENCL_CL_H)
98    #   include <OpenCL/cl.h>
99    # else
100    #   error no cl.h
101    # endif]],
102    [[#if defined(CL_VERSION_1_1)
103      printf("11000\n");
104    #elif defined(CL_VERSION_1_0)
105      printf("10000\n");
106    #else
107      printf("0\n");
108    #endif
109        ]])],
110        [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
111      # substitutions
112      AC_SUBST(CL_LIBS)
113    fi
114    AC_SUBST(CL_ENABLED)
115    AC_SUBST(CL_VERSION)
116    
117    dnl
118    dnl check for various library routines etc.
119    dnl
120    AC_CHECK_FUNCS(posix_memalign)
121    if test x"$ac_cv_func_posix_memalign" != xyes ; then
122      AC_CHECK_FUNCS(memalign)
123      if test x"$ac_cv_func_posix_memalign" != xyes ; then
124        AC_CHECK_FUNCS(valloc)
125      fi
126    fi
127    
128    AC_CHECK_FUNCS(mach_absolute_time)
129    AC_CHECK_TYPES([struct timespec])
130    
131    dnl
132    dnl check for clock_gettime.  On Linux, this requires librt.
133    dnl
134    save_LIBS=$LIBS
135    LIBS="-lrt $LIBS"
136    AC_MSG_CHECKING([for clock_gettime])
137    AC_LINK_IFELSE(
138      [AC_LANG_PROGRAM(
139        [[#include <time.h>]],
140        [[struct timespec t; clock_gettime(CLOCK_REALTIME, &t); ]])],
141      [ ac_cv_func_clock_gettime=yes;
142        AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [is clock_gettime available?])],
143      [ac_cv_func_clock_gettime=no])
144    AC_MSG_RESULT($ac_cv_func_clock_gettime)
145    if test "$ac_cv_func_clock_gettime" = "no" ; then
146      LIBS=$save_LIBS
147    fi
148    
149    AC_CHECK_FUNCS(pthread_getcpuclockid)
150    AC_CHECK_FUNCS(sigtimedwait nanosleep)
151    
152    dnl
153    dnl check for sched_setaffinity
154    dnl
155    AC_CHECK_FUNCS(sched_setaffinity)
156    
157    dnl
158    dnl check for pthread_setaffinity_np
159    dnl
160    save_LIBS=$LIBS
161    save_CFLAGS=$CFLAGS
162    LIBS="$PTHREAD_LIBS $LIBS"
163    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
164    AC_MSG_CHECKING([for pthread_setaffinity_np])
165    AC_LINK_IFELSE(
166      [AC_LANG_PROGRAM(
167        [[#include <pthread.h>]],
168        [[cpu_set_t s; pthread_setaffinity_np(pthread_self(), sizeof(s), &s); ]])],
169      [ ac_cv_func_pthread_setaffinity_np=yes;
170        AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [is pthread_setaffinity_np available?])],
171      [ac_cv_func_pthread_setaffinity_np=no])
172    AC_MSG_RESULT($ac_cv_func_pthread_setaffinity_np)
173    LIBS=$save_LIBS
174    CFLAGS=$save_CFLAGS
175    
176    dnl
177    dnl check for Linux NUMA support (libnuma)
178    dnl
179    AC_CHECK_LIB(numa,numa_available)
180    if test "$ac_cv_lib_numa_numa_available" = "yes" ; then
181      PTHREAD_LIBS="$PTHREAD_LIBS -lnuma"
182    fi
183    
184    dnl check for /proc/cpuinfo
185    dnl
186    AC_CHECK_FILES(/proc/cpuinfo)
187    
188  dnl  dnl
189  dnl OS-specific linking issues  dnl OS-specific linking issues
# Line 131  Line 254 
254  dnl  dnl
255  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])])
256  if test $SMLNJ_MAJOR_VERSION -lt 110 \  if test $SMLNJ_MAJOR_VERSION -lt 110 \
257    -o $SMLNJ_MINOR_VERSION -lt 72    -o $SMLNJ_MINOR_VERSION -lt 73
258  then  then
259    AC_MSG_ERROR([installation requires SML/NJ version 110.72+])    AC_MSG_ERROR([installation requires SML/NJ version 110.73+])
260  fi  fi
261  AC_SUBST(SMLNJ_VERSION)  AC_SUBST(SMLNJ_VERSION)
262    
# Line 186  Line 309 
309  AC_SUBST(INSTALL_SMLNJ_WRAPPER)  AC_SUBST(INSTALL_SMLNJ_WRAPPER)
310    
311  dnl  dnl
312    dnl ******************** C compiler properties ********************
313    dnl
314    
315    dnl
316    dnl run the compiler tests in 64-bit mode
317    dnl
318    save_CFLAGS=$CFLAGS
319    CFLAGS="$CFLAGS $CFLAG_M64"
320    
321    dnl
322    dnl check for gcc builtin atomic operations
323    dnl
324    AC_MSG_CHECKING([for builtin atomic operations])
325    AC_LINK_IFELSE(
326       [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
327       AC_MSG_RESULT(yes)
328       AC_DEFINE(
329        [HAVE_BUILTIN_ATOMIC_OPS], 1,
330        [Define to 1 if gcc compiler provides atomic operations.]),
331       AC_MSG_RESULT(no))
332    
333    AC_C_BIGENDIAN
334    
335    dnl
336    dnl restore CFLAGS
337    dnl
338    CFLAGS=$save_CFLAGS
339    
340    dnl
341    dnl ******************** config.h stuff ********************
342    dnl
343    AH_TOP([
344    /*
345     * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)
346     * All rights reserved.
347     */
348    
349    #ifndef _DIDEROT_CONFIG_H_
350    #define _DIDEROT_CONFIG_H_
351    
352    ])
353    AH_BOTTOM([
354    
355    #endif /* !_DIDEROT_CONFIG_H_ */
356    ])
357    
358    dnl
359  dnl ******************** write output ********************  dnl ******************** write output ********************
360  dnl  dnl
361    
# Line 195  Line 365 
365    Makefile    Makefile
366    src/dnorm/Makefile    src/dnorm/Makefile
367    src/compiler/Makefile    src/compiler/Makefile
   src/lib/Makefile  
368    src/lib/build/Makefile    src/lib/build/Makefile
369    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  
370    test/MIP/Makefile    test/MIP/Makefile
371    test/probe/Makefile    test/probe/Makefile
372  dnl  dnl
373    dnl ***** CM files *****
374      src/compiler/codegen/sources.cm:src/compiler/codegen/sources_cm.in
375    dnl
376  dnl ***** SML source files *****  dnl ***** SML source files *****
377    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
378    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
379  )  )
380    
381    AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in)
382    
383  dnl  dnl
384  dnl shell scripts  dnl shell scripts
385  dnl  dnl
386  AC_CONFIG_FILES([  AC_CONFIG_FILES([
387    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
388  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
 AC_CONFIG_FILES([  
   rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in  
 ], [chmod +x rtest/scripts/run-one.sh])  
 AC_CONFIG_FILES([  
   rtest/scripts/run.sh:rtest/scripts/run_sh.in  
 ], [chmod +x rtest/scripts/run.sh])  
389    
390  dnl  dnl
391  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
# Line 239  Line 406 
406    
407  MK_BUILD_DIR(rt-c-f, c-target, [float])  MK_BUILD_DIR(rt-c-f, c-target, [float])
408  MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug])  MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug])
409    MK_BUILD_DIR(rt-c-f-par, parallel-target, [parallel float])
410    MK_BUILD_DIR(rt-c-f-par-debug, parallel-target, [parallel float debug])
411    
412  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.1231  
changed lines
  Added in v.1232

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