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

revision 1833, Fri Apr 13 15:19:40 2012 UTC revision 1843, Sat Apr 14 00:40:58 2012 UTC
# Line 112  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      AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"], [HAVE_CL_H="no"])
132      if test x"$HAVE_CL_H" = xno ; then
133        # check for AMD's SDK
134        AC_MSG_CHECKING([for cl.h in AMD's SDK])
135        if test -d /opt/AMDAPP/include/CL ; then
136          HAVE_CL_H="yes"
137          AC_DEFINE([HAVE_CL_CL_H])
138          CPPFLAGS_CL="-I/opt/AMDAPP/include"
139        fi
140        AC_MSG_RESULT([$HAVE_CL_H])
141      fi
142      if test x"$HAVE_CL_H" = xno ; then
143        AC_MSG_WARN([no cl.h found])
144        CL_ENABLED=false
145        CL_VERSION=0
146      else
147    # check the cl.h header for which version of OpenCL is supported    # check the cl.h header for which version of OpenCL is supported
148    AC_LANG([C])    AC_LANG([C])
149        save_CPPFLAGS=$CPPFLAGS
150        CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
151    AC_LINK_IFELSE([AC_LANG_PROGRAM([[    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
152  #include <stdio.h>  #include <stdio.h>
153  # ifdef HAVE_CL_CL_H  # ifdef HAVE_CL_CL_H
# Line 176  Line 194 
194      [[cl_float4 x; x.s[0] = 0.0;]])],      [[cl_float4 x; x.s[0] = 0.0;]])],
195      [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])],
196      [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])      [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
197      # restore saved CPPFLAGS
198        CPPFLAGS=$save_CPPFLAGS
199    # substitutions    # substitutions
200    AC_SUBST(CL_LIBS)      AC_SUBST(LIBS_CL)
201        AC_SUBST(CPPFLAGS_CL)
202      fi
203  fi  fi
204  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
205  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)

Legend:
Removed from v.1833  
changed lines
  Added in v.1843

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