[libvoikko] Libvoikko build issues on MacOSX Tiger

Sjur Moshagen sjurnm at mac.com
Tue May 28 13:37:28 EEST 2013

Hello list,

I'm trying to build the LibreOffice Voikko plugin with hfst support for Mac users, and after some initial hurdles, I have been able to get to the libvoikko code, where the compilation stops with the following message:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -L/Users/adminis/alibs -arch i386 -arch ppc -fvisibility=hidden -I/usr/local/include -Wall -Werror -pedantic -c fst/Transducer.cpp -o fst/Transducer.o
/usr/include/c++/4.0.0/cstdlib:110: error: '::malloc' has not been declared
/usr/include/c++/4.0.0/cstdlib:118: error: '::realloc' has not been declared
/usr/include/c++/4.0.0/cstdlib:110: error: '::malloc' has not been declared
/usr/include/c++/4.0.0/cstdlib:118: error: '::realloc' has not been declared

This is pretty low level and basic, so I am a bit stumbled. Here's the configuration and make command that I used:

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure \
	CXXFLAGS=" -arch i386 -arch ppc" \
	CPPFLAGS="-I/usr/local/include -L/Users/adminis/alibs" \
	CFLAGS="-I/usr/local/include -L/Users/adminis/alibs -isysroot \
	/Developer/SDKs/MacOSX10.4.sdk -arch i386 -arch ppc -mmacosx-version-min=10.4" \
	LDFLAGS=" -arch i386 -arch ppc" \
	--enable-static --disable-dependency-tracking --enable-hfst --disable-shared

make CFLAGS="-I/usr/local/include -L/Users/adminis/alibs -isysroot \
	/Developer/SDKs/MacOSX10.4.sdk -arch i386 -arch ppc -mmacosx-version-min=10.4" \
	LINK="gcc -framework CoreFoundation -framework Cocoa  -arch i386 -arch ppc" \
	LDFLAGS="-framework CoreFoundation -framework Cocoa"

What I am trying to achieve is this:
* universal binary with i386 and ppc, because these are the available versions of LibreOffice (one plugin for both versions)
* I'm building on Tiger, since this is the oldest system supported by LibreOffice (and hoping that the plugin will still work on newer systems instead of the other way around, which is known to *not* work)

I have had no major problems building the prerequisites for hfst-ospell (built and installed using MacPorts), and no issues with building hfst-ospell itself.

The linking option -L/Users/adminis/alibs is used to force MacOSX to link statically - if both a dynamic and a static version of a library is available in the same dir, it will always pick the dynamic one. So in the given dir, I only have the static libraries.

But the error message above is connected to the standard C++ library, which I find very strange. There is probably something I am missing in the configure or make commands.

Grateful for any advice.


More information about the Libvoikko mailing list