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

SCM Repository

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

Diff of /branches/opencl/configure.ac

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

trunk/configure.ac revision 1531, Fri Oct 14 18:45:50 2011 UTC branches/opencl/configure.ac revision 3349, Tue Oct 27 15:16:36 2015 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 This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4    dnl
5    dnl COPYRIGHT (c) 2015 The University of Chicago
6  dnl All rights reserved.  dnl All rights reserved.
7  dnl  dnl
8    
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 (http://diderot-language.cs.uchicago.edu)]])  AC_COPYRIGHT([[COPYRIGHT (c) 2015 The University of Chicago]])
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 32  Line 34 
34  AC_PROG_INSTALL  AC_PROG_INSTALL
35  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
36    
37    dnl FIXME: this works for now, but we should probably switch to libtool
38    dnl
39    AC_PATH_PROG(LD, [ld], [none])
40    if test x$LD = xnone ; then
41      AC_MSG_ERROR([cannot find ld command])
42    fi
43    AC_SUBST(LD)
44    
45  dnl check for c99 support  dnl check for c99 support
46  dnl  dnl
47  AC_PROG_CC_C99  AC_PROG_CC_C99
# Line 52  Line 62 
62  dnl  dnl
63  ACX_PTHREAD()  ACX_PTHREAD()
64    
65    dnl check for doxygen
66    dnl
67    AC_ARG_WITH([doxygen],
68      [AS_HELP_STRING([--with-doxygen=PATH], [specify location of doxygen executable])],
69      [DOXYGEN=$with_doxygen],
70      [DOXYGEN=none])
71    if test x$DOXYGEN = xnone ; then
72      # see if we can find doxygen in the user's path
73      AC_PATH_PROG(DOXYGEN, [doxygen], [none])
74    fi
75    if test x$with_doxygen = xyes -o x$with_doxygen = xno ; then
76      AC_MSG_ERROR([--with-doxygen option must specify directory argument])
77    elif test x$DOXYGEN != xnone -a ! -x $DOXYGEN ; then
78      AC_MSG_ERROR([doxygen not found at $DOXYGEN])
79    elif test x$DOXYGEN != xnone ; then
80    dnl
81    dnl verify that $DOXYGEN is an absolute path
82    dnl
83      case $DOXYGEN in
84        /*) ;;
85        *) AC_MSG_ERROR([--with-doxygen path must be absolute]) ;;
86      esac
87    fi
88    if test $DOXYGEN = xnone ; then
89      DOXYGEN=:
90    fi
91    AC_SUBST(DOXYGEN)
92    
93  dnl  dnl
94  dnl Look for NVIDIA's nvcc compiler  dnl Look for NVIDIA's nvcc compiler
95  dnl  dnl
# Line 71  Line 109 
109  dnl  dnl
110  dnl check for OpenCL support  dnl check for OpenCL support
111  dnl  dnl
112  CL_LIBS="none"  LIBS_CL="none"
113  case "$host_os" in  case "$host_os" in
114    darwin*) # On Mac OS X we check for installed frameworks    darwin*) # On Mac OS X we check for installed frameworks
115      AX_CHECK_FRAMEWORK([OpenCL], [CL_LIBS="-framework OpenCL"], [])      AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
116    ;;    ;;
117    *)    *)
118      AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[CL_LIBS="-lOpenCL"])      AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
119    ;;    ;;
120  esac  esac
121  if test x"$CL_LIBS" = xnone ; then  if test x"$LIBS_CL" = xnone ; then
122    AC_MSG_WARN([no OpenCL library found])    AC_MSG_WARN([no OpenCL library found])
123    CL_ENABLED=false    CL_ENABLED=false
124    CL_VERSION=0    CL_VERSION=0
125  else  else
126    CL_ENABLED=true    CL_ENABLED=true
127    AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h])    CPPFLAGS_CL=""
128      AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"; break], [HAVE_CL_H="no"])
129      if test x"$HAVE_CL_H" = xno ; then
130        # check for AMD's SDK
131        AC_MSG_CHECKING([for cl.h in AMD's SDK])
132        if test -d /opt/AMDAPP/include/CL ; then
133          HAVE_CL_H="yes"
134          AC_DEFINE([HAVE_CL_CL_H])
135          CPPFLAGS_CL="-I/opt/AMDAPP/include"
136        fi
137        AC_MSG_RESULT([$HAVE_CL_H])
138      fi
139      if test x"$HAVE_CL_H" = xno ; then
140        AC_MSG_WARN([no cl.h found])
141        CL_ENABLED=false
142        CL_VERSION=0
143      else
144    # check the cl.h header for which version of OpenCL is supported    # check the cl.h header for which version of OpenCL is supported
145    AC_LANG([C])    AC_LANG([C])
146        save_CPPFLAGS=$CPPFLAGS
147        CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
148    AC_LINK_IFELSE([AC_LANG_PROGRAM([[    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
149  #include <stdio.h>  #include <stdio.h>
150  # ifdef HAVE_CL_CL_H  # ifdef HAVE_CL_CL_H
# Line 107  Line 163 
163  #endif  #endif
164      ]])],      ]])],
165      [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])      [CL_VERSION=`./conftest$EXEEXT`], [CL_VERSION=0])
166    dnl
167    dnl check to see how we access the host-side vector types.  For OpenCL 1.1,
168    dnl the specification specifies the behavior, but it was unspecified in 1.0.
169    dnl
170        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
171    # ifdef HAVE_CL_CL_H
172    #   include <CL/cl.h>
173    # elif defined(HAVE_OPENCL_CL_H)
174    #   include <OpenCL/cl.h>
175    # else
176    #   error no cl.h
177    # endif]],
178          [[cl_float4 x; x[0] = 0.0;]])],
179          [AC_DEFINE([CL_HOST_VECTORS_ARE_ARRAYS],[1],[host vector types are arrays])],
180    dnl
181    dnl not arrays, so try the OpenCL 1.1 structure representation
182    dnl
183          [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
184    # ifdef HAVE_CL_CL_H
185    #   include <CL/cl.h>
186    # elif defined(HAVE_OPENCL_CL_H)
187    #   include <OpenCL/cl.h>
188    # else
189    #   error no cl.h
190    # endif]],
191          [[cl_float4 x; x.s[0] = 0.0;]])],
192          [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],
193          [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
194      # restore saved CPPFLAGS
195        CPPFLAGS=$save_CPPFLAGS
196    # substitutions    # substitutions
197    AC_SUBST(CL_LIBS)      AC_SUBST(LIBS_CL)
198        AC_SUBST(CPPFLAGS_CL)
199      fi
200  fi  fi
201  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
202  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)
# Line 351  Line 439 
439    
440  AH_TOP([  AH_TOP([
441  /*  /*
442   * COPYRIGHT (c) 2011 Diderot project. (http://diderot-language.cs.uchicago.edu)   * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
443   * All rights reserved.   *
444     * COPYRIGHT (c) 2015 The University of Chicago * All rights reserved.
445   */   */
446    
447  #ifndef _DIDEROT_CONFIG_H_  #ifndef _DIDEROT_CONFIG_H_
# Line 372  Line 461 
461  dnl  dnl
462  dnl ***** Makefiles *****  dnl ***** Makefiles *****
463    Makefile    Makefile
464      doc/Makefile
465      src/clinfo/Makefile
466    src/dnorm/Makefile    src/dnorm/Makefile
467    src/compiler/Makefile    src/compiler/Makefile
468    src/lib/build/Makefile    src/lib/build/Makefile
469    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
470    test/MIP/Makefile    test/MIP/Makefile
471    test/probe/Makefile    test/probe/Makefile
   test/teem/Makefile  
 dnl  
 dnl ***** CM files *****  
   src/compiler/codegen/sources.cm:src/compiler/codegen/sources_cm.in  
472  dnl  dnl
473  dnl ***** SML source files *****  dnl ***** SML source files *****
474    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
# Line 397  Line 484 
484    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in    bin/install-sml-wrapper.sh:config/install-sml-wrapper_sh.in
485  ], [chmod +x bin/install-sml-wrapper.sh])  ], [chmod +x bin/install-sml-wrapper.sh])
486  AC_CONFIG_FILES([  AC_CONFIG_FILES([
487    rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in    src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in
488  ], [chmod +x rtest/scripts/run-one.sh])  ], [chmod +x src/compiler/gen/file2str/file2str.sh])
489  AC_CONFIG_FILES([  AC_CONFIG_FILES([
490    rtest/scripts/run.sh:rtest/scripts/run_sh.in    rtest/scripts/run.sh:rtest/scripts/run_sh.in
491  ], [chmod +x rtest/scripts/run.sh])  ], [chmod +x rtest/scripts/run.sh])
492    AC_CONFIG_FILES([
493      rtest/scripts/run-one.sh:rtest/scripts/run-one_sh.in
494    ], [chmod +x rtest/scripts/run-one.sh])
495    
496  dnl  dnl
497  dnl generate makefiles for runtime library builds  dnl generate makefiles for runtime library builds
# Line 421  Line 511 
511    ])    ])
512    
513  MK_BUILD_DIR(rt-c-f, c, [float])  MK_BUILD_DIR(rt-c-f, c, [float])
514    MK_BUILD_DIR(rt-c-d, c, [double])
515  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])  MK_BUILD_DIR(rt-c-f-debug, c, [float debug])
516    MK_BUILD_DIR(rt-c-d-debug, c, [double debug])
517  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])  MK_BUILD_DIR(rt-c-f-par, parallel, [parallel float])
518    MK_BUILD_DIR(rt-c-d-par, parallel, [parallel double])
519  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])  MK_BUILD_DIR(rt-c-f-par-debug, parallel, [parallel float debug])
520    MK_BUILD_DIR(rt-c-d-par-debug, parallel, [parallel double debug])
521    
522    if test x"$CL_ENABLED" = xtrue ; then
523      MK_BUILD_DIR(rt-cl-f, cl, [float])
524      MK_BUILD_DIR(rt-cl-d, cl, [double])
525      MK_BUILD_DIR(rt-cl-f-debug, cl, [float debug])
526      MK_BUILD_DIR(rt-cl-d-debug, cl, [double debug])
527    fi
528    
529  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.1531  
changed lines
  Added in v.3349

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