[PPL-devel] Windows, Java interface

Krzysztof Jakubczyk kjk at mimuw.edu.pl
Mon Nov 30 12:57:34 CET 2009


Hi,
I've managed to compile PPL to a windows dll along with java interface 
using MinGW. I will describe how I achieved this step by step. First 
thing was to build the ppl library (not java interface) to a dll. I 
found out that to do this AC_LIBTOOL_WIN32_DLL must be added to autoconf 
along with '-no-undefined' to LDFLAGS (see 
http://sourceware.org/autobook/autobook/autobook_254.html ). I also 
based this on gmp's autoconf file. Patch is available in attached 
patch.configure.ac file (running autoconf is needed to create configure 
file). To compile ppl to a dll you need to run configure with 
parameters: "--disable-static --enable-shared".

I didn't manage to compile ppl dll to use static gmp library version. I 
compiled gmp as a shared library (configure --enable-cxx 
--disable-static --enable-shared). Unfortunately make check fails when 
gmp is compiled like this - but it seems the library works ok. After 
compiling gmp I made copy of libgmp.dll.a as libgmp.a and libgmpxx.dll.a 
to libgmpxx.a so that PPL can be linked to it (possibly there is another 
solution).

Later I had to compile the Java library (add --enable-interfaces=java, 
to configure arguments). I had some problems with configuring java path 
(--with-java=DIR) this is because I use the 64 bit windows system - java 
is installed in "C:\Program Files (x86)\Java\jdk1.6.0_17".  (i passed 
--with-java="/c/Program Files (x86)/Java/jdk1.6.0_17") I had to manually 
update makefiles for java interface because javah was not properly 
found, includes were not properly generated (there was "-I/c/Program 
Files (x86)/Java/jdk1.6.0_17/include/mingw" instead of "-I/c/Program 
Files (x86)/Java/jdk1.6.0_17/include/win32") and had manually fix java 
directory issues (add "'s).
Another important thing was to modify Makefile for the jni dll file 
(interfaces/Java/jni) (see http://www.mingw.org/node/41 ) - add " 
-D_JNI_IMPLEMENTATION_ -Wl,--kill-at" flags to libppl_java_la_LDFLAGS. 
After these modifications the dll was successfully build.

PS.
Also I'm not sure when the jni compilation flags should be added (gcc 
and windows machines?) and I'm not autoconf expert - this hopefully 
could be automatized.

regards,
Krzysztof Jakubczyk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cs.unipr.it/pipermail/ppl-devel/attachments/20091130/777f9e41/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.configure.ac
URL: <http://www.cs.unipr.it/pipermail/ppl-devel/attachments/20091130/777f9e41/attachment.ksh>


More information about the PPL-devel mailing list