octave-maintainers
[Top][All Lists]
Advanced

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

Re: Java support in MXE build


From: PhilipNienhuis
Subject: Re: Java support in MXE build
Date: Sat, 18 May 2013 04:32:35 -0700 (PDT)

John W. Eaton wrote
> On 05/15/2013 05:55 PM, PhilipNienhuis wrote:
>> Until now the MXE building process fails to include Java support. Looking
>> at
>> the log from a freshly checked out MXE build I see:
>>
>> configure: WARNING: JAVA_HOME environment variable not initialized.
>> configure: WARNING: Auto-detection will proceed but is unreliable.
>> checking for java... /usr/bin/java
>> /home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/configure:
>> line
>> 66352: pwd: -W: invalid option
>> pwd: usage: pwd [-LP]
>> checking for javac... /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/bin/javac
>> checking for jar... /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/bin/jar
>> checking for Java version... 1.7.0_19
>> checking for jvm.dll... not found
>> configure: WARNING: Library jvm.dll not found.  Octave will not be able
>> to
>> call Java methods.
>>
>> So the configure script defaults to the Linux Java system on the box
>> where
>> MXE is run.
>>
>> I then tried to configure with the Windows Java system, installed on
>> another
>> (windows 7) partition, by adding a few configure options in
>> ./mxe-octave/src/octave.mk   (symlink /mnt/jhm points to
>> /mnt/win7/Program
>> Files/Java/jdk1.7.0_21):
>>
>> :
>>          JAVA_HOME="/mnt/jhm" \
>>          --with-java-homedir="/mnt/jhm" \
>>          --with-java-libdir="/mnt/jhm/jre/bin/server" \
>>
>> --with-java-includedir="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/include"
>> \
>> :
>>
>> I had to make the symlink as configure hickups on spaces in path names.
>> This
>> trick seemed to work, but then I got other errors:
>>
>> :
>> - checking for java... /usr/bin/java
>> /home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/configure:
>> line
>> 66352: pwd: -W: invalid option
>> pwd: usage: pwd [-LP]
>> checking for javac... /usr/bin/javac
>> checking for jar... /usr/bin/jar
>> checking for Java version... 1.7.0_19
>> checking for jvm.dll... /mnt/jhm/jre/bin/server
>> checking for include file
> <jni.h>
> ... not found
>> configure: WARNING: Include file
> <jni.h>
>   not found.  Octave will not be able
>> to call Java methods.
>> :
>>
>> Setting JAVA_HOME to the Java installation on the Windows partition
>> doesn't
>> help in any way.
>>
>> So it seems the configure script consistently picks up the native (Linux)
>> Java version and seems to largely ignore the --with-java-* configure
>> options. It does find the jvm.dll (that configure option works) but not
>> jni.h while the latter does live in the "java-includedir" indicated in
>> the
>> configure options.
>>
>> Obvious question: how can we proceed with getting Java support included
>> in
>> MXE builds?
> 
> I think we need tools like javac and jar that can run on the build 
> system.  We need a jni.h file that can be compiled for MinGW.  And then 
> we need to be able to have a jvm.dll file that can be loaded on the his is 
> Windows system at run time.  I don't think we really even need to check 
> for that when building.  We just need to be able to locate one that we 
> can use when Octave runs.  So part of the problem is that the configure 
> tests are wrong, and part of it is that we probably don't have the right 
> jni.h on the build system.

The last days I had time to experiment a bit more. So here's an update:

1. jni.h:  AFAICS this file seems identical across OSes, but there are
platform-dependent subdirs in the JDK include subdir.

2. It seems that:
- either I didn't properly understand the required configure options for
Java
- or the configure script has a glitch,
but it turned out that the "--with-java-includedir" option requires to NOT
mention the "include" subdir in the end (so it should be e.g. , /mnt/jhm 
rather  than  /mnt/jhm/include )


After (quite) a bit of experimenting I got configure to properly recognize
Java as follows:

A. (usually needed for Windows) make a symlink somewhere in the Linux
partition to "<windows_partiton>/Program Files/Java/jdk<version>", to avoid
problems with configure etc not accepting spaces in path names

B. In octave.mk, add the configure option 
"--with-java-libdir=/<symlink/to/Windows/jdk/jre/bin/client&quot;  (or
.../server for 64 bit systems) to help configure find jvm.dll

C.  Copy the  jdk/include/win32/  subdir  to (in my case) 
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/include   (next to the ./linux
subdir)

and then run ./mk-dist

Step C is admittedly brute force; I did that because the 
--with-java-includedir  configure option didn't work with the symlink in
step A.
Later on (if I get Java support to build this way) I'll investigate how to
do it more properly.

So far, so good, but after a while I ran into the same problem as I
mentioned in January (for a native MinGW build) in post
http://octave.1599824.n4.nabble.com/MinGW-build-failure-quot-undefined-reference-to-vtable-for-octave-base-value-quot-td4648700.html
In that post reference was made to the build targets, but since then
Octave's source tree has been reshuffled quite a bit.
I have copied the errors below this mail.

So currently I'm stuck with compile errors that seem MinGW specific. Any
suggestion how I can get past those errors?

Philip

:
libtool: link: i686-pc-mingw32-g++ &lt;snip long list of options>
--out-implib -Xlinker dldfcn/.libs/__glpk__.dll.a
dldfcn/.libs/__dsearchn__.o: In function `~octave_base_value':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/octave-value/ov-base.h:211:
undefined reference to `vtable for octave_base_value'
dldfcn/.libs/__dsearchn__.o: In function `G__dsearchn__':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__dsearchn__.cc:37:
undefined reference to `check_version(std::string const&, std::string
const&)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__dsearchn__.cc:37:
undefined reference to `error_state'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__dsearchn__.cc:37:
undefined reference to `octave_dld_function::create(octave_value_list
(*)(octave_value_list const&, int), octave_shlib const&, std::string const&,
std::string const&)'
dldfcn/.libs/__dsearchn__.o: In function
`Z13F__dsearchn__RK17octave_value_listi':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__dsearchn__.cc:48:
undefined reference to `print_usage()'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__dsearchn__.cc:55:
undefined reference to `error_state'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__dsearchn__.cc:58:
undefined reference to `error(char const*, ...)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__dsearchn__.cc:104:
undefined reference to `octave_value::octave_value(ColumnVector const&)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__dsearchn__.cc:105:
undefined reference to `octave_value::octave_value(ColumnVector const&)'
dldfcn/.libs/__dsearchn__.o: In function
`ZN17octave_value_list6resizeEiRK12octa
ve_value':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/interp-co
re/oct-obj.h:96: undefined reference to
`Array<octave_value>::resize(dim_vector const&, octave_value const&)'
dldfcn/.libs/__dsearchn__.o: In function `octave_base_value':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/octave-value/ov-base.h:207:
undefined reference to `vtable for octave_base_value'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/octave-value/ov-base.h:207:
undefined reference to `vtable for octave_base_value'
dldfcn/.libs/__dsearchn__.o:__dsearchn__.cc:(.rdata$_ZTV5ArrayI12octave_valueE[__ZTV5ArrayI12octave_valueE]+0x10):
undefined reference to `Array<octave_value>::resize_fill_value() const'
collect2: error: ld returned 1 exit status
make[5]: *** [dldfcn/__dsearchn__.la] Error 1
make[5]: *** Waiting for unfinished jobs....
dldfcn/.libs/dldfcn___delaunayn___la-__delaunayn__.o: In function
`~octave_base_value':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/octave-value/ov-base.h:211:
undefined reference to `vtable for octave_base_value'
dldfcn/.libs/dldfcn___delaunayn___la-__delaunayn__.o: In function
`G__delaunayn__':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:67:
undefined reference to `check_version(std::string const&, std::string
const&)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:67:
undefined reference to `error_state'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:67:
undefined reference to `octave_dld_function::create(octave_value_list
(*)(octave_value_list const&, int), octave_shlib const&, std::string const&,
std::string const&)'
dldfcn/.libs/dldfcn___delaunayn___la-__delaunayn__.o: In function
`Z14F__delaunayn__RK17octave_value_listi':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:79:
undefined reference to `octave_value::octave_value(double)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:84:
undefined reference to `print_usage()'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:196:
undefined reference to `error(char const*, ...)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:206:
undefined reference to `warning(char const*, ...)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:192:
undefined reference to `octave_value::octave_value(Matrix const&, MatrixType
const&)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:216:
undefined reference to `octave_value::octave_value(RowVector const&)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:168:
undefined reference to `error(char const*, ...)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:145:
undefined reference to `error(char const*, ...)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__delaunayn__.cc:115:
undefined reference to `error(char const*, ...)'
dldfcn/.libs/dldfcn___delaunayn___la-__delaunayn__.o: In function
`ZN17octave_value_list6resizeEiRK12octave_value':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/interp-core/oct-obj.h:96:
undefined reference to `Array<octave_value>::resize(dim_vector const&,
octave_value const&)'
dldfcn/.libs/dldfcn___delaunayn___la-__delaunayn__.o: In function
`octave_base_value':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/octave-value/ov-base.h:207:
undefined reference to `vtable for octave_base_value'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/octave-value/ov-base.h:207:
undefined reference to `vtable for octave_base_value'
dldfcn/.libs/dldfcn___delaunayn___la-__delaunayn__.o:__delaunayn__.cc:(.rdata$_ZTV5ArrayI12octave_valueE[__ZTV5ArrayI12octave_valueE]+0x10):
undefined reference to `Array<octave_value>::resize_fill_value() const'
collect2: error: ld returned 1 exit status
make[5]: *** [dldfcn/__delaunayn__.la] Error 1
dldfcn/.libs/dldfcn___glpk___la-__glpk__.o: In function
`~octave_base_value':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/octave-value/ov-base.h:211:
undefined reference to `vtable for octave_base_value'
dldfcn/.libs/dldfcn___glpk___la-__glpk__.o: In function
`Z4glpkiiiPdiPiS0_S_S_PcS0_S_S0_S_S0_iiiS_S_S_S_S_S_S_':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__glpk__.cc:279:
undefined reference to `error(char const*, ...)'
dldfcn/.libs/dldfcn___glpk___la-__glpk__.o: In function `G__glpk__':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__glpk__.cc:470:
undefined reference to `check_version(std::string const&, std::string
const&)'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__glpk__.cc:470:
undefined reference to `error_state'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__glpk__.cc:470:
undefined reference to `octave_dld_function::create(octave_value_list
(*)(octave_value_list const&, int), octave_shlib const&, std::string const&,
std::string const&)'
dldfcn/.libs/dldfcn___glpk___la-__glpk__.o: In function
`Z9F__glpk__RK17octave_value_listi':
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__glpk__.cc:485:
undefined reference to `print_usage()'
/home/philip/devel/octdev/mxe-octave/tmp-octave/octave-3.7.5/libinterp/dldfcn/__glpk__.cc:495:
undefined reference to `error_state'

<+ a hundred or more lines with errors>
i






--
View this message in context: 
http://octave.1599824.n4.nabble.com/Java-support-in-MXE-build-tp4652996p4653106.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

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