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

SCM Repository

[diderot] Diff of /branches/vis12-cl/configure.ac
ViewVC logotype

Diff of /branches/vis12-cl/configure.ac

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

trunk/configure.ac revision 1232, Mon May 16 23:37:52 2011 UTC branches/vis12/configure.ac revision 2111, Mon Dec 17 16:55:33 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 (http://diderot-language.cs.uchicago.edu)]])  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 34  Line 32 
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
37    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  dnl check for c99 support
44  dnl  dnl
45  AC_PROG_CC_C99  AC_PROG_CC_C99
# Line 43  Line 49 
49    
50  dnl extra C compiler options  dnl extra C compiler options
51  dnl  dnl
52    CFLAGS=""
53  CFLAG_M64="-m64"  CFLAG_M64="-m64"
54  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"  CFLAGS_BASE="-Wformat -Wreturn-type -Wuninitialized"
55  AC_SUBST(CFLAG_M64)  AC_SUBST(CFLAG_M64)
56  AC_SUBST(CFLAGS_BASE)  AC_SUBST(CFLAGS_BASE)
57    
58  dnl  dnl
59    dnl standard headers
60    dnl
61    AC_HEADER_STDBOOL
62    
63    dnl
64  dnl check for pthreads support  dnl check for pthreads support
65  dnl  dnl
66  ACX_PTHREAD()  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  dnl
97  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
# Line 72  Line 112 
112  dnl  dnl
113  dnl check for OpenCL support  dnl check for OpenCL support
114  dnl  dnl
115  CL_LIBS="none"  LIBS_CL="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"], [])      AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
119    ;;    ;;
120    *)    *)
121      AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[CL_LIBS="-lOpenCL"])      AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
122    ;;    ;;
123  esac  esac
124  if test x"$CL_LIBS" = xnone ; then  if test x"$LIBS_CL" = xnone ; then
125    AC_MSG_WARN([no OpenCL library found])    AC_MSG_WARN([no OpenCL library found])
126    CL_ENABLED=false    CL_ENABLED=false
127    CL_VERSION=0    CL_VERSION=0
128  else  else
129    CL_ENABLED=true    CL_ENABLED=true
130    AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h])    CPPFLAGS_CL=""
131      CL_HEADER=""
132      AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; CL_HEADER="$ac_header"; break], [HAVE_CL_H="no"])
133      if test x"$HAVE_CL_H" = xno ; then
134        # check for AMD's SDK
135        AC_MSG_CHECKING([for cl.h in AMD's SDK])
136        if test -d /opt/AMDAPP/include/CL ; then
137          HAVE_CL_H="yes"
138          CL_HEADER="/opt/AMDAPP/include/CL/cl.h"
139          AC_DEFINE([HAVE_CL_CL_H])
140          CPPFLAGS_CL="-I/opt/AMDAPP/include"
141        fi
142        AC_MSG_RESULT([$HAVE_CL_H])
143      fi
144      if test x"$HAVE_CL_H" = xno ; then
145        AC_MSG_WARN([no cl.h found])
146        CL_ENABLED=false
147        CL_VERSION=0
148        SIZEOF_CL_INT=0
149        SIZEOF_CL_LONG=0
150        SIZEOF_CL_FLOAT=0
151        SIZEOF_CL_DOUBLE=0
152      else
153    # check the cl.h header for which version of OpenCL is supported    # check the cl.h header for which version of OpenCL is supported
154    AC_LANG([C])    AC_LANG([C])
155        save_CPPFLAGS=$CPPFLAGS
156        CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
157    AC_LINK_IFELSE([AC_LANG_PROGRAM([[    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
158  #include <stdio.h>  #include <stdio.h>
159  # ifdef HAVE_CL_CL_H  # ifdef HAVE_CL_CL_H
# Line 108  Line 172 
172  #endif  #endif
173      ]])],      ]])],
174      [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])      [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
175    dnl
176    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
177    dnl the specification specifies the behavior, but it was unspecified in 1.0.
178    dnl
179        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
180    #include "$CL_HEADER"
181    ]],
182          [[cl_float4 x; x[0] = 0.0;]])],
183          [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
184    dnl
185    dnl not arrays, so try the OpenCL 1.1 structure representation
186    dnl
187          [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
188    #include "$CL_HEADER"
189    ]],
190          [[cl_float4 x; x.s[0] = 0.0;]])],
191          [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
192          [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
193      # restore saved CPPFLAGS
194        CPPFLAGS=$save_CPPFLAGS
195    # substitutions    # substitutions
196    AC_SUBST(CL_LIBS)      AC_SUBST(LIBS_CL)
197        AC_SUBST(CPPFLAGS_CL)
198      #
199      # determine the sizes of the host-side OpenCL types
200      AC_CHECK_SIZEOF([cl_int], [], [#include "$CL_HEADER"])
201      SIZEOF_CL_INT=$ac_cv_sizeof_cl_int
202      AC_CHECK_SIZEOF([cl_long], [], [#include "$CL_HEADER"])
203      SIZEOF_CL_LONG=$ac_cv_sizeof_cl_long
204      AC_CHECK_SIZEOF([cl_float], [], [#include "$CL_HEADER"])
205      SIZEOF_CL_FLOAT=$ac_cv_sizeof_cl_float
206      AC_CHECK_SIZEOF([cl_double], [], [#include "$CL_HEADER"])
207      SIZEOF_CL_DOUBLE=$ac_cv_sizeof_cl_double
208      fi
209  fi  fi
210  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
211  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)
212    
213    AC_SUBST(SIZEOF_CL_INT)
214    AC_SUBST(SIZEOF_CL_LONG)
215    AC_SUBST(SIZEOF_CL_FLOAT)
216    AC_SUBST(SIZEOF_CL_DOUBLE)
217    
218  dnl  dnl
219  dnl check for various library routines etc.  dnl check for various library routines etc.
220  dnl  dnl
# Line 127  Line 228 
228    
229  AC_CHECK_FUNCS(mach_absolute_time)  AC_CHECK_FUNCS(mach_absolute_time)
230  AC_CHECK_TYPES([struct timespec])  AC_CHECK_TYPES([struct timespec])
231    AC_CHECK_FUNCS(pthread_barrier_init)
232    
233  dnl  dnl
234  dnl check for clock_gettime.  On Linux, this requires librt.  dnl check for clock_gettime.  On Linux, this requires librt.
# Line 236  Line 338 
338    esac    esac
339    if test -x $ac_cv_use_teem ; then    if test -x $ac_cv_use_teem ; then
340      TEEM_DIR=$ac_cv_use_teem      TEEM_DIR=$ac_cv_use_teem
341        # check that TEEM_DIR actually points to something that looks like teem
342        if test -f $TEEM_DIR/include/teem/nrrd.h ; then
343      AC_MSG_RESULT([ okay])      AC_MSG_RESULT([ okay])
344    else    else
345      TEEM_DIR=none      TEEM_DIR=none
346      AC_MSG_RESULT([ invalid])      AC_MSG_RESULT([ invalid])
347    fi    fi
348      else
349        TEEM_DIR=none
350        AC_MSG_RESULT([ invalid])
351      fi
352  fi  fi
353  if test x"$TEEM_DIR" = xnone ; then  if test x"$TEEM_DIR" = xnone ; then
354    AC_MSG_ERROR([unable to find teem])    AC_MSG_ERROR([unable to find teem; use --with-teem option to specify location])
355  fi  fi
356  AC_SUBST(TEEM_DIR)  AC_SUBST(TEEM_DIR)
357    
# Line 332  Line 440 
440    
441  AC_C_BIGENDIAN  AC_C_BIGENDIAN
442    
443    #
444    # determine the sizes of the standard C types
445    AC_CHECK_SIZEOF([int])
446    SIZEOF_C_INT=$ac_cv_sizeof_int
447    AC_CHECK_SIZEOF([long])
448    SIZEOF_C_LONG=$ac_cv_sizeof_long
449    AC_CHECK_SIZEOF([float])
450    SIZEOF_C_FLOAT=$ac_cv_sizeof_float
451    AC_CHECK_SIZEOF([double])
452    SIZEOF_C_DOUBLE=$ac_cv_sizeof_double
453    
454    AC_SUBST(SIZEOF_C_INT)
455    AC_SUBST(SIZEOF_C_LONG)
456    AC_SUBST(SIZEOF_C_FLOAT)
457    AC_SUBST(SIZEOF_C_DOUBLE)
458    
459  dnl  dnl
460  dnl restore CFLAGS  dnl restore CFLAGS
461  dnl  dnl
# Line 340  Line 464 
464  dnl  dnl
465  dnl ******************** config.h stuff ********************  dnl ******************** config.h stuff ********************
466  dnl  dnl
467    
468    AC_DEFINE_UNQUOTED(DIDEROT_INCLUDE_PATH,["$DIDEROT_SRCDIR/include"], [path for Diderot header files])
469    
470  AH_TOP([  AH_TOP([
471  /*  /*
472   * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)   * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)
# Line 352  Line 479 
479  ])  ])
480  AH_BOTTOM([  AH_BOTTOM([
481    
482    #ifdef NDEBUG
483    #define STATIC_INLINE   static inline
484    #else
485    #define STATIC_INLINE   static
486    #endif
487    
488  #endif /* !_DIDEROT_CONFIG_H_ */  #endif /* !_DIDEROT_CONFIG_H_ */
489  ])  ])
490    
# Line 363  Line 496 
496  dnl  dnl
497  dnl ***** Makefiles *****  dnl ***** Makefiles *****
498    Makefile    Makefile
499      doc/Makefile
500      src/clinfo/Makefile
501    src/dnorm/Makefile    src/dnorm/Makefile
502    src/compiler/Makefile    src/compiler/Makefile
503    src/lib/build/Makefile    src/lib/build/Makefile
504    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
505    test/MIP/Makefile    test/MIP/Makefile
506    test/probe/Makefile    test/probe/Makefile
507  dnl    test/iso2d-polyline/Makefile
508  dnl ***** CM files *****    test/vr-lite-cam/Makefile
509    src/compiler/codegen/sources.cm:src/compiler/codegen/sources_cm.in    test/hlic/Makefile
510  dnl  dnl
511  dnl ***** SML source files *****  dnl ***** SML source files *****
512    src/compiler/fields/run-dnorm.sml:src/compiler/fields/run-dnorm_sml.in    src/compiler/nrrd/run-dnorm.sml:src/compiler/nrrd/run-dnorm_sml.in
513    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in    src/compiler/common/paths.sml:src/compiler/common/paths_sml.in
514      src/compiler/common/size-of.sml:src/compiler/common/size-of_sml.in
515  )  )
516    
517  AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in)  AC_CONFIG_HEADERS(src/include/Diderot/config.h:config/config_h.in)
# Line 386  Line 522 
522  AC_CONFIG_FILES([  AC_CONFIG_FILES([
523    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
524  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
525    AC_CONFIG_FILES([
526      src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in
527    ], [chmod +x src/compiler/gen/file2str/file2str.sh])
528    AC_CONFIG_FILES([
529      rtest/scripts/run.sh:rtest/scripts/run_sh.in
530    ], [chmod +x rtest/scripts/run.sh])
531    AC_CONFIG_FILES([
532      rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in
533    ], [chmod +x rtest/scripts/run-one.sh])
534    
535  dnl  dnl
536  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
# Line 404  Line 549 
549      AC_CONFIG_FILES(src/lib/build/$1/Makefile)      AC_CONFIG_FILES(src/lib/build/$1/Makefile)
550    ])    ])
551    
552  MK_BUILD_DIR(rt-c-f, c-target, [float])  MK_BUILD_DIR(rt-c-f, c, [float])
553  MK_BUILD_DIR(rt-c-f-debug, c-target, [float debug])  MK_BUILD_DIR(rt-c-d, c, [double])
554  MK_BUILD_DIR(rt-c-f-par, parallel-target, [parallel float])  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])
555  MK_BUILD_DIR(rt-c-f-par-debug, parallel-target, [parallel float debug])  MK_BUILD_DIR(rt-c-d-debug, c, [double debug])
556    MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])
557    MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])
558    MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])
559    MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])
560    
561    if test x"$CL_ENABLED" = xtrue ; then
562      MK_BUILD_DIR(rt-cl-f, cl, [float])
563      MK_BUILD_DIR(rt-cl-d, cl, [double])
564      MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug])
565      MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug])
566    fi
567    
568  AC_OUTPUT  AC_OUTPUT

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

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