Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 May 2009 19:20:57 +0400 (MSD)
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        kde@FreeBSD.org
Subject:   ports/134863: [PATCH] math/eigen: use malloc instead of posix_memalign, fix on 6.x
Message-ID:  <20090522152057.AB3DA108839@hades.panopticon>
Resent-Message-ID: <200905221530.n4MFU42O009471@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         134863
>Category:       ports
>Synopsis:       [PATCH] math/eigen: use malloc instead of posix_memalign, fix on 6.x
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 22 15:30:04 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
>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@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 ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090522152057.AB3DA108839>