octave-maintainers
[Top][All Lists]
Advanced

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

Re: java package - Mac Os X


From: PhilipNienhuis
Subject: Re: java package - Mac Os X
Date: Wed, 17 Jul 2013 06:36:32 -0700 (PDT)

bpabbott wrote
> On Jul 17, 2013, at 6:07 AM, CdeMills wrote:
> 
>> OK, finally got the thing working, by tweaking the compile commands.
>> 
>> Running 'make build' in src generates a rather obfuscated command:
>> if [
>> "X/System/Library/Frameworks/JavaVM.framework/Libraries/libjvm_compat.dylibX"
>> = "XX" ]; then \
>>              mkoctfile -DHAVE_OCTAVE_36 -v -DJAVAPKG_BUILD -I-n
>> /System/Library/Frameworks/JavaVM.framework/Home/include -I-n
>> /System/Library/Frameworks/JavaVM.framework/Home/include/linux -o
>> __java__.oct __java__.cc ; \
>>      else \
>>              mkoctfile -DHAVE_OCTAVE_36 -v -DJAVAPKG_BUILD
>> -DJAVA_ARCH=\\\"/System/Library/Frameworks/JavaVM.framework/Libraries/libjvm_compat.dylib\\\"
>> -DJAVA_HOME=\\\"-n /System/Library/Frameworks/JavaVM.framework/Home\\\"
>> -I-n
>> /System/Library/Frameworks/JavaVM.framework/Home/include -I-n
>> /System/Library/Frameworks/JavaVM.framework/Home/include/linux -o
>> __java__.oct __java__.cc ; \
>>      fi
>> mkoctfile: unrecognized argument
>> /System/Library/Frameworks/JavaVM.framework/Home\" 
>> 
>> I simplified it as:
>> 
>> mkoctfile -DHAVE_OCTAVE_36 -v -DJAVAPKG_BUILD
>> -DJAVA_ARCH="/System/Library/Frameworks/JavaVM.framework/Libraries/libjvm_compat.dylib"
>> -DJAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home"
>> -I/System/Library/Frameworks/JavaVM.framework/Home/include
>> -I/opt/local/include  -o __java__.oct __java__.cc
>> 
>> 
>> The second step fails:
>> /opt/local/bin/g++-mp-4.7 -bundle -bundle_loader
>> /opt/local/bin/octave-3.6.4
>> -o __java__.oct __java__.o -L/opt/local/lib/octave/3.6.4 -L/opt/local/lib
>> -loctinterp -loctave -lcruft -L/opt/local/lib/gcc47 -lstdc++ -lgfortran
>> Undefined symbols for architecture x86_64:
>>  "_JNI_CreateJavaVM", referenced from:
>>      initialize_java()      in __java__.o
>>  "_JNI_GetCreatedJavaVMs", referenced from:
>>      initialize_java()      in __java__.o
>> ld: symbol(s) not found for architecture x86_64
>> collect2: error: ld returned 1 exit status
>> 
>> The option '-framework JavaVM' must be added:
>> /opt/local/bin/g++-mp-4.7 -bundle -bundle_loader
>> /opt/local/bin/octave-3.6.4
>> -o __java__.oct __java__.o -framework JavaVM
>> -L/opt/local/lib/octave/3.6.4
>> -L/opt/local/lib -loctinterp -loctave -lcruft -L/opt/local/lib/gcc47
>> -lstdc++ -lgfortran
>> 
>> This way, the files __java__.o and __java__.oct are correctly generated.
>> 
>> Regards
>> 
>> Pascal
> 
> Pascal,
> 
> If you'll provide a patch/diff for the java package and instructions for
> compiling Java n Mac OSX, I'll give it a try.  If all works, I can add an
> entry to the macports tracker.


@Pascal: 
1. Very good on you that you got it to build. Thanks for that.
Next question: does the Java package really work? You could try by loading
the package and issueing the command:
javamem
in the Octave terminal. If you get no complaints about java_invoke or
javaMethod I suppose it's all OK.
If you get errors about Java framework or so not being found, chances are
that mixing 32 and 64 bit SW just doesn't work. 
E.g., on Windows 7 (64 bit) I cannot get 64 bit Java JRE to work with 32-bit
Octave, in spite of ov_java.oct and octave.jar being built correctly (they
do work with a 32 bit JRE). Hopefully on Mac OSX this works better.

2. Did you check with the Java stuff in core Octave? Rik has added various
mods to the files there that have been inherited from the Java package. IIRC
there is some mention of "Framework" in the sources.
Anyway I suppose your solution is also very worthwile for the development
version of Octave as Java support has been integrated in core. AFAIK it
never worked on OSX (is that right Ben?)

3. Alexander Hansen mentioned that the locations of various parts of the OSX
Java Framework seem to be moved around with every new OSX release. Is there
a robust method to detect where they are located, so that installing the
Java package (and core Octave Java support) on OSX gets a bit more reliable?

Because there are a few more patches to the Java package lying around in the
bug & patch trackers, perhaps it makes sense to make a new Java package
release - which may be a bit tricky as the sources have been removed from
Sourceforge SVN (a bit prematurely IMO).
(but I still got them on my local repos, as I've made the last few java
package releases).

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/java-package-Mac-Os-X-tp4655701p4655771.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

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