[kde-freebsd] [PATCH] math/eigen: use malloc instead of posix_memalign, fix on 6.x

Dmitry Marakasov amdmi3 at amdmi3.ru
Fri May 22 17:20:57 CEST 2009


>Submitter-Id:	current-users
>Originator:	Dmitry Marakasov
>Organization:	
>Confidential:	no 
>Synopsis:	[PATCH] math/eigen: use malloc instead of posix_memalign, fix on 6.x
>Severity:	non-critical
>Priority:	low
>Category:	ports 
>Class:		sw-bug
>Release:	FreeBSD 8.0-CURRENT i386
>Environment:
System: FreeBSD hades.panopticon 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Thu Apr 30 06:41:20 MSD 2009
>Description:
eigen2 uses aligned malloc routine (ei_aligned_malloc), which currently relies on posix_memalign. The latter is not available on 6.x, so dependent ports may fail to build (example is upcoming science/avogadro, ports/134710).

FreeBSD malloc, however, is guaranteed to return 16-byte aligned pointers, so it may safely br used instead of posix_memalign, on 6.x as well.

The patch mekes EIGEN_MALLOC_ALREADY_ALIGNED defined on FreeBSD, so malloc is used.

Added file(s):
- files/patch-Eigen-src-Core-util-Memory.h

Port maintainer (kde at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- eigen-2.0.0_3.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/math/eigen2/Makefile,v
retrieving revision 1.7
diff -u -u -r1.7 Makefile
--- Makefile	20 May 2009 23:09:32 -0000	1.7
+++ Makefile	22 May 2009 14:23:17 -0000
@@ -6,7 +6,7 @@
 
 PORTNAME=	eigen
 DISTVERSION=	2.0.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	math
 MASTER_SITES=	http://download.tuxfamily.org/eigen/
 
Index: files/patch-Eigen-src-Core-util-Memory.h
===================================================================
RCS file: files/patch-Eigen-src-Core-util-Memory.h
diff -N files/patch-Eigen-src-Core-util-Memory.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-Eigen-src-Core-util-Memory.h	22 May 2009 15:12:28 -0000
@@ -0,0 +1,11 @@
+--- Eigen/src/Core/util/Memory.h.orig	2009-02-02 16:24:17.000000000 +0300
++++ Eigen/src/Core/util/Memory.h	2009-05-22 18:19:51.000000000 +0400
+@@ -27,7 +27,7 @@
+ #ifndef EIGEN_MEMORY_H
+ #define EIGEN_MEMORY_H
+ 
+-#if defined(__APPLE__) || defined(_WIN64)
++#if defined(__APPLE__) || defined(_WIN64) || defined (__FreeBSD__)
+   #define EIGEN_MALLOC_ALREADY_ALIGNED 1
+ #else
+   #define EIGEN_MALLOC_ALREADY_ALIGNED 0
--- eigen-2.0.0_3.patch ends here ---



More information about the kde-freebsd mailing list