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

SCM Repository

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

Diff of /branches/charisee_dev/configure.ac

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

revision 1810, Sat Apr 7 14:50:03 2012 UTC revision 1838, Fri Apr 13 23:08:07 2012 UTC
# Line 99  Line 99 
99  dnl  dnl
100  dnl check for OpenCL support  dnl check for OpenCL support
101  dnl  dnl
102  CL_LIBS="none"  LIBS_CL="none"
103  case "$host_os" in  case "$host_os" in
104    darwin*) # On Mac OS X we check for installed frameworks    darwin*) # On Mac OS X we check for installed frameworks
105      AX_CHECK_FRAMEWORK([OpenCL], [CL_LIBS="-framework OpenCL"], [])      AX_CHECK_FRAMEWORK([OpenCL], [LIBS_CL="-framework OpenCL"], [])
106    ;;    ;;
107    *)    *)
108      AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[CL_LIBS="-lOpenCL"])      AC_CHECK_LIB([OpenCL],[clGetPlatformIDs],[LIBS_CL="-lOpenCL"])
109    ;;    ;;
110  esac  esac
111  if test x"$CL_LIBS" = xnone ; then  if test x"$LIBS_CL" = xnone ; then
112    AC_MSG_WARN([no OpenCL library found])    AC_MSG_WARN([no OpenCL library found])
113    CL_ENABLED=false    CL_ENABLED=false
114    CL_VERSION=0    CL_VERSION=0
115  else  else
116    CL_ENABLED=true    CL_ENABLED=true
117    AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h])    CPPFLAGS_CL=""
118      AC_CHECK_HEADERS([CL/cl.h OpenCL/cl.h], [HAVE_CL_H="yes"], [HAVE_CL_H="no"])
119      if test x"$HAVE_CL_H" = xno ; then
120        # check for AMD's SDK
121        if test -d /opt/AMDAPP/include/CL ; then
122          HAVE_CL_H="yes"
123          AC_DEFINE([HAVE_CL_CL_H])
124          CPPFLAGS_CL="-I/opt/AMDAPP/include"
125        fi
126      fi
127      if test x"$HAVE_CL_H" = xno ; then
128        AC_MSG_WARN([no cl.h found])
129        CL_ENABLED=false
130        CL_VERSION=0
131      else
132    # check the cl.h header for which version of OpenCL is supported    # check the cl.h header for which version of OpenCL is supported
133    AC_LANG([C])    AC_LANG([C])
134        save_CPPFLAGS=$CPPFLAGS
135        CPPFLAGS="$CPPFLAGS_CL $CPPFLAGS"
136    AC_LINK_IFELSE([AC_LANG_PROGRAM([[    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
137  #include <stdio.h>  #include <stdio.h>
138  # ifdef HAVE_CL_CL_H  # ifdef HAVE_CL_CL_H
# Line 163  Line 179 
179      [[cl_float4 x; x.s[0] = 0.0;]])],      [[cl_float4 x; x.s[0] = 0.0;]])],
180      [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])],
181      [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])      [AC_MSG_ERROR([unable to figure out host types for OpenCL vectors])])])
182      # restore saved CPPFLAGS
183        CPPFLAGS=$save_CPPFLAGS
184    # substitutions    # substitutions
185    AC_SUBST(CL_LIBS)      AC_SUBST(LIBS_CL)
186        AC_SUBST(CPPFLAGS_CL)
187      fi
188  fi  fi
189  AC_SUBST(CL_ENABLED)  AC_SUBST(CL_ENABLED)
190  AC_SUBST(CL_VERSION)  AC_SUBST(CL_VERSION)

Legend:
Removed from v.1810  
changed lines
  Added in v.1838

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