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: CdeMills
Subject: Re: java package - Mac Os X
Date: Wed, 17 Jul 2013 03:07:45 -0700 (PDT)

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







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


reply via email to

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