help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] glpk java


From: Chris Wolf
Subject: Re: [Help-glpk] glpk java
Date: Tue, 02 Mar 2010 11:38:41 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.8) Gecko/20100216 Thunderbird/3.0.2

Fabrizio,

First you should make sure you have SWIG itself installed. (forgive 
my stating the obvious, but I'm on MacOS and it does not come
with SWIG) 

http://www.swig.org/download.html

Next, the way you have the SWIG_FLAGS set in the Makefile looks
like you have a line break, which will cause an error (could
be the way my email client is displaying your message)

In any case, I would change:

SWIG_FLAGS := -I/usr/local/include -I/usr/include
-I/usr/lib/jvm/java-6-sun/include

to either:

SWIG_FLAGS := -I/usr/local/include -I/usr/include 
-I/usr/lib/jvm/java-6-sun/include

...or:

SWIG_FLAGS := -I/usr/local/include -I/usr/include \
 -I/usr/lib/jvm/java-6-sun/include

After making these changes, I was able to reproduce your problem
of not finding "jni.h"

The problem is, not only does swig need to know where to search for 
header files, but also the compiler needs this info.  To facilitate 
that, make the following additional change to your "swig/Makefile":

Change:

  libtool --mode=compile gcc -c -fPIC src/java/glpk_wrap.c

...to:

  libtool --mode=compile gcc -c -fPIC $(SWIG_FLAGS) src/java/glpk_wrap.c

Also on MacOS (not Linux) you need to change "libtool" to "glibtool".

After making these changes, it successfully builds, but I didn't actually
try using it.

Hope this helps,

Chris Wolf




On 3/2/10 10:10 AM, Fabrizio Caruso wrote:
> I am trying to install a java interface
> for glpk.
> 
> I first found the one at http://bjoern.dapnet.de/glpk/
> which does not really work: it loads
> the problem and correctly reports the number of rows
> but when asked to solve the problem it says
> the problem has no rows.
> 
> I later found out about the newer interface
> at http://glpk-java.sourceforge.net/ which
> requires compilation but fails to compile:
> 
> I followed the instructions found in the file INSTALL
> (Makefile in the swig directory seemed ok to me and
> therefore I only run makefile in the main directoryB)
> 
> 
> The problem is that "make" produces the following error:
> "
> src/java/glpk_wrap.c:133:17: error: jni.h: No such file or directory
> "
> (despite the fact that jni.h is in my system)
> 
> I have:
> Ubuntu 9.10
> latest glpk (4.43) installed and working 
> java version "1.6.0_0"
> gcc 4.4.1
> 
> 
> I have also tried to include in Makefile
> the directory where jni.h
> is found (/usr/lib/jvm/java-6-sun/include):
> 
> # installation path of the include files
> SWIG_FLAGS := -I/usr/local/include -I/usr/include
> -I/usr/lib/jvm/java-6-sun/include
> # copy version-info from glpk package: src/Makefile.am
> VERSION_INFO := 28:0:28
> # copy revision from glpk package: configure.ac
> REVISION := 4.43
> # installation path for package
> prefix = /usr/local
> ...
> 
> but with the same result.
> 
> 
> Thanks a lot for any help!
> 
> 
>     Fabrizio
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-glpk
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]