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 1640, Wed Nov 16 02:19:51 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) 2011 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 99  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 163  Line 191 
191      [[cl_float4 x; x.s[0] = 0.0;]])],      [[cl_float4 x; x.s[0] = 0.0;]])],
192      [AC_DEFINE([CL_HOST_VECTORS_ARE_STRUCTS],[1],[host vector types are structs])],      [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])])])      [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 407  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 453  Line 486 
486  AC_CONFIG_FILES([  AC_CONFIG_FILES([
487    src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in    src/compiler/gen/file2str/file2str.sh:src/compiler/gen/file2str/file2str_sh.in
488  ], [chmod +x src/compiler/gen/file2str/file2str.sh])  ], [chmod +x src/compiler/gen/file2str/file2str.sh])
489    AC_CONFIG_FILES([
490      rtest/scripts/run.sh:rtest/scripts/run_sh.in
491    ], [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 480  Line 519 
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])  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.1640  
changed lines
  Added in v.3349

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