Source: clsparse
Followup-For: Bug #844008

I have created a patch that basically undefines "bool" and "vector" as
macros, because it is how they come from altivec.h.
I have tested this on ppc64el and amd64.

Regards.
Index: clsparse-0.10.2.0/src/include/clSPARSE.h
===================================================================
--- clsparse-0.10.2.0.orig/src/include/clSPARSE.h
+++ clsparse-0.10.2.0/src/include/clSPARSE.h
@@ -24,6 +24,12 @@
 #ifndef _CL_SPARSE_H_
 #define _CL_SPARSE_H_
 
+#ifdef __ALTIVEC__
+#include <altivec.h>
+#undef bool
+#undef vector
+#endif
+
 // CMake-generated file to define export related preprocessor macros
 #include "clsparse_export.h"
 
Index: clsparse-0.10.2.0/src/library/internal/kernel-cache.hpp
===================================================================
--- clsparse-0.10.2.0.orig/src/library/internal/kernel-cache.hpp
+++ clsparse-0.10.2.0/src/library/internal/kernel-cache.hpp
@@ -23,6 +23,12 @@
 #define CL_HPP_MINIMUM_OPENCL_VERSION BUILD_CLVERSION
 #define CL_HPP_TARGET_OPENCL_VERSION BUILD_CLVERSION
 
+#ifdef __ALTIVEC__
+#include <altivec.h>
+#undef bool
+#undef vector
+#endif
+
 #include <CL/cl2.hpp>
 
 #include <string>
Index: clsparse-0.10.2.0/src/library/internal/kernel-wrap.hpp
===================================================================
--- clsparse-0.10.2.0.orig/src/library/internal/kernel-wrap.hpp
+++ clsparse-0.10.2.0/src/library/internal/kernel-wrap.hpp
@@ -22,6 +22,12 @@
 #define CL_HPP_MINIMUM_OPENCL_VERSION BUILD_CLVERSION
 #define CL_HPP_TARGET_OPENCL_VERSION BUILD_CLVERSION
 
+#ifdef __ALTIVEC__
+#include <altivec.h>
+#undef bool
+#undef vector
+#endif
+
 #include <CL/cl2.hpp>
 
 #include <iostream>
Index: clsparse-0.10.2.0/src/library/internal/ocl-type-traits.hpp
===================================================================
--- clsparse-0.10.2.0.orig/src/library/internal/ocl-type-traits.hpp
+++ clsparse-0.10.2.0/src/library/internal/ocl-type-traits.hpp
@@ -17,6 +17,12 @@
 #ifndef OCL_TYPE_TRAITS_HPP_
 #define OCL_TYPE_TRAITS_HPP_
 
+#ifdef __ALTIVEC__
+#include <altivec.h>
+#undef bool
+#undef vector
+#endif
+
 #include <type_traits>
 
 #if defined(__APPLE__) || defined(__MACOSX)
Index: clsparse-0.10.2.0/src/include/clSPARSE-error.h
===================================================================
--- clsparse-0.10.2.0.orig/src/include/clSPARSE-error.h
+++ clsparse-0.10.2.0/src/include/clSPARSE-error.h
@@ -23,6 +23,11 @@
 #ifndef _CLSPARSE_ERROR_H_
 #define _CLSPARSE_ERROR_H_
 
+#ifdef __ALTIVEC__
+#undef bool
+#undef vector
+#endif
+
 #if defined(__APPLE__) || defined(__MACOSX)
 #   include <OpenCL/cl.h>
 #else
-- 
debian-science-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-science-maintainers

Reply via email to