ports/129388: FreeImage builds with memalign

Jacob Atzen jatzen at gmail.com
Wed Dec 3 10:20:03 UTC 2008

>Number:         129388
>Category:       ports
>Synopsis:       FreeImage builds with memalign
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 03 10:20:03 UTC 2008
>Originator:     Jacob Atzen
>Release:        6.3-RELEASE
FreeBSD asmussen.crd.dk 6.3-RELEASE FreeBSD 6.3-RELEASE #0: Wed Jan 16 04:45:45 UTC 2008     root at dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  i386
FreeImage builds with a dependency on memalign which is not present on FreeBSD. This leads to problems with other programs linking to FreeImage. In this case it is the image_science rubygem that fails to work with the following message:

/usr/local/lib/libfreeimage.so.3: Undefined symbol "memalign" - /home/cruise/.ruby_inline/Inline_ImageScience_aa58.so

Build FreeImage, try to use it from Ruby with image_science
The problem lies in the LibOpenJPEG/opj_malloc.h file where HAVE_MEMALIGN is defined except for OS X and linux_x64. Removing the #define HAVE_MEMALIGN from that file cures the problem. A patch is supplied.

Patch attached with submission follows:

diff --git a/Source/LibOpenJPEG/opj_malloc.h b/Source/LibOpenJPEG/opj_malloc.h
index 6787aed..8ea2c51 100644
--- a/Source/LibOpenJPEG/opj_malloc.h
+++ b/Source/LibOpenJPEG/opj_malloc.h
@@ -76,8 +76,7 @@ Allocate memory aligned to a 16 byte boundry
 	#if defined(__sun)
 		#define HAVE_MEMALIGN
 	/* Linux x86_64 and OSX always align allocations to 16 bytes */
-	#elif !defined(__amd64__) && !defined(__APPLE__)	
-		#define HAVE_MEMALIGN
+	#elif !defined(__amd64__) && !defined(__APPLE__)
 		#include <stdlib.h>			


More information about the freebsd-ports-bugs mailing list