[SCM] OCE packaging branch, debian, updated. debian/0.11-2
Denis Barbier
bouzim at gmail.com
Sun Dec 16 00:05:56 UTC 2012
The following commit has been merged in the debian branch:
commit 3b2c194ed8492550b48c6efe8a1901a8e0cee2d0
Author: Denis Barbier <bouzim at gmail.com>
Date: Sat Dec 15 21:07:29 2012 +0100
New patch: debian/patches/port-memalign.patch
Fix build failures on architectures, mm_malloc.h is
available only on x86 and amd64.
diff --git a/debian/patches/port-memalign.patch b/debian/patches/port-memalign.patch
new file mode 100644
index 0000000..11c2a80
--- /dev/null
+++ b/debian/patches/port-memalign.patch
@@ -0,0 +1,78 @@
+Description: Fix memory aligned allocation
+ The _mm_malloc function is defined by GCC only for
+ x86 and amd64 architectures. See build failures on
+ https://buildd.debian.org/status/package.php?p=oce&suite=experimental&ver=0.11-1
+ .
+ Call _mm_malloc if mm_malloc.h header is found, otherwise call
+ posix_memalign if this function was found, otherwise call malloc.
+Author: Denis Barbier <bouzim at gmail.com>
+Origin: Debian
+Forwarded: no
+Last-Update: 2012-12-15
+
+Index: oce/CMakeLists.txt
+===================================================================
+--- oce.orig/CMakeLists.txt
++++ oce/CMakeLists.txt
+@@ -554,6 +554,7 @@ IF (NOT WIN32)
+ CHECK_INCLUDE_FILE_CXX(sys/filio.h HAVE_SYS_FILIO_H)
+ CHECK_INCLUDE_FILE_CXX(sys/mman.h HAVE_SYS_MMAN_H)
+ CHECK_INCLUDE_FILE_CXX(libc.h HAVE_LIBC_H)
++ CHECK_INCLUDE_FILE_CXX(mm_malloc.h HAVE_MM_MALLOC_H)
+ # Check library functions
+ INCLUDE(CheckFunctionExists)
+ CHECK_FUNCTION_EXISTS(alloca HAVE_ALLOCA)
+@@ -563,6 +564,7 @@ IF (NOT WIN32)
+ CHECK_FUNCTION_EXISTS(statvfs HAVE_STATVFS)
+ CHECK_FUNCTION_EXISTS(finite HAVE_FINITE)
+ CHECK_FUNCTION_EXISTS(localtime_r HAVE_LOCALTIME_R)
++ CHECK_FUNCTION_EXISTS(posix_memalign HAVE_POSIX_MEMALIGN)
+ SET(CMAKE_REQUIRED_LIBRARIES sunmath)
+ CHECK_FUNCTION_EXISTS(ieee_handler HAVE_SUNMATH)
+ SET(CMAKE_REQUIRED_LIBRARIES)
+Index: oce/src/Image/Image_PixMap.cxx
+===================================================================
+--- oce.orig/src/Image/Image_PixMap.cxx
++++ oce/src/Image/Image_PixMap.cxx
+@@ -21,10 +21,10 @@
+
+ #ifdef _MSC_VER
+ //
+-#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
++#elif defined(HAVE_MM_MALLOC_H)
+ #include <mm_malloc.h>
+ #else
+- extern "C" int posix_memalign (void** thePtr, size_t theAlign, size_t theBytesCount);
++ #include <stdlib.h>
+ #endif
+
+ template<typename TypePtr>
+@@ -33,15 +33,17 @@ inline TypePtr MemAllocAligned (const St
+ {
+ #if defined(_MSC_VER)
+ return (TypePtr )_aligned_malloc (theBytesCount, theAlign);
+-#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
++#elif defined(HAVE_MM_MALLOC_H)
+ return (TypePtr ) _mm_malloc (theBytesCount, theAlign);
+-#else
++#elif defined(HAVE_POSIX_MEMALIGN)
+ void* aPtr;
+ if (posix_memalign (&aPtr, theAlign, theBytesCount))
+ {
+ aPtr = NULL;
+ }
+ return (TypePtr )aPtr;
++#else
++ return (TypePtr ) malloc (theBytesCount);
+ #endif
+ }
+
+@@ -49,7 +51,7 @@ inline void MemFreeAligned (void* thePtr
+ {
+ #if defined(_MSC_VER)
+ _aligned_free (thePtrAligned);
+-#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
++#elif defined(HAVE_MM_MALLOC_H)
+ _mm_free (thePtrAligned);
+ #else
+ free (thePtrAligned);
diff --git a/debian/patches/series b/debian/patches/series
index 1122866..a0a0e7e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
split-export.patch
+port-memalign.patch
--
OCE packaging
More information about the debian-science-commits
mailing list