octave-maintainers
[Top][All Lists]
Advanced

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

Re: java package and MacOS


From: Ben Abbott
Subject: Re: java package and MacOS
Date: Tue, 27 Nov 2012 21:45:46 -0500

On Nov 27, 2012, at 6:14 PM, Daniel J Sebald wrote:

> On 11/27/2012 04:55 PM, Ben Abbott wrote:
>> 
>> On Nov 27, 2012, at 4:30 PM, Daniel J Sebald wrote:
>> 
>>> On 11/27/2012 02:58 PM, Ben Abbott wrote:
>>>> On Nov 25, 2012, at 6:27 PM, Ben Abbott wrote:
>>>> 
>>>>> On Nov 25, 2012, at 3:29 PM, Alexander Hansen wrote:
>>>>> 
>>>>>> On 11/25/12 12:37 PM, Ben Abbott wrote:
>>>>>>> Adding the Octave Forge java package to core Octave breaks building 
>>>>>>> Octave on MacOS X.
>>>>>>> 
>>>>>>>         http://hg.savannah.gnu.org/hgweb/octave/rev/acf0addfc610
>>>>>>> 
>>>>>>> libtool: link: /opt/local/bin/g++-mp-4.5  -o dldfcn/.libs/__java__.so 
>>>>>>> -bundle  dldfcn/.libs/dldfcn___java___la-__java__.o   -L/opt/local/lib 
>>>>>>> ./.libs/liboctinterp.dylib -L/opt/local/libexec/llvm-3.1/lib 
>>>>>>> -L/opt/local/lib/gcc45/gcc/x86_64-apple-darwin11/4.5.4 
>>>>>>> -L/opt/local/lib/gcc45/gcc/x86_64-apple-darwin11/4.5.4/../../.. 
>>>>>>> -L/opt/local/lib/gcc45 
>>>>>>> /Users/bpabbott/Development/mercurial/default/sources/liboctave/.libs/liboctave.dylib
>>>>>>>  -lfltk_gl -lfltk -lpthread /opt/local/lib/libhdf5.dylib 
>>>>>>> /opt/local/lib/libfontconfig.dylib /opt/local/lib/libiconv.dylib 
>>>>>>> /opt/local/lib/libfreetype.dylib -lz -lbz2 
>>>>>>> /opt/local/lib/libexpat.dylib /opt/local/lib/libX11.dylib 
>>>>>>> /opt/local/lib/libxcb.dylib /opt/local/lib/libXau.dylib 
>>>>>>> /opt/local/lib/libXdmcp.dylib -lLLVMAsmParser -lLLVMInstrumentation 
>>>>>>> -lLLVMLinker -lLLVMArchive -lLLVMBitReader -lLLVMDebugInfo -lLLVMJIT 
>>>>>>> -lLLVMipo -lLLVMVectorize -lLLVMBitWriter -lLLVMTableGen 
>>>>>>> -lLLVMHexagonCodeGen -lLLVMHexagonAsmPrinter -lLLVMHexagonDesc 
>>>>>>> -lLLVMHexagonInfo
> 
>>>>>> -lLLVMPTXCodeG
>>>>>> en -lLLVMPTXDesc -lLLVMPTXInfo -lLLVMPTXAsmPrinter 
>>>>>> -lLLVMMBlazeDisassembler -lLLVMMBlazeAsmParser -lLLVMMBlazeCodeGen 
>>>>>> -lLLVMMBlazeDesc -lLLVMMBlazeInfo -lLLVMMBlazeAsmPrinter 
>>>>>> -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo -lLLVMMSP430CodeGen 
>>>>>> -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter 
>>>>>> -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMCellSPUCodeGen 
>>>>>> -lLLVMCellSPUDesc -lLLVMCellSPUInfo -lLLVMMipsDisassembler 
>>>>>> -lLLVMMipsAsmParser -lLLVMMipsCodeGen -lLLVMMipsDesc -lLLVMMipsInfo 
>>>>>> -lLLVMMipsAsmPrinter -lLLVMARMDisassembler -lLLVMARMAsmParser 
>>>>>> -lLLVMARMCodeGen -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter 
>>>>>> -lLLVMPowerPCCodeGen -lLLVMPowerPCDesc -lLLVMPowerPCAsmPrinter 
>>>>>> -lLLVMPowerPCInfo -lLLVMSparcCodeGen -lLLVMSparcDesc -lLLVMSparcInfo 
>>>>>> -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86AsmParser 
>>>>>> -lLLVMX86Disassembler -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter 
>>>>>> -lLLVMX86Utils -lLLVMMCDisassembler -lLLVMMCParser -lLLVMInterpreter 
>>>>>> -lLLVMCodeGen -l!
 LL
> !
>>  VM
>>> ScalarOpts
>>>>>> -l
>>>>>> LLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis 
>>>>>> -lLLVMMCJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget 
>>>>>> -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport 
>>>>>> ../liboctave/.libs/liboctave.dylib -lstdc++ -lcholmod -lmetis -lumfpack 
>>>>>> -lsuitesparseconfig -lamd -lcamd -lcolamd -lccolamd -lcxsparse 
>>>>>> /opt/local/lib/libarpack.dylib -ltatlas -lqrupdate 
>>>>>> /opt/local/lib/libfftw3.dylib /opt/local/lib/libfftw3f.dylib -llapack 
>>>>>> -lcblas -lf77blas -latlas -lreadline -lncurses 
>>>>>> /opt/local/lib/libpcre.dylib -ldl /opt/local/lib/gcc45/libgfortran.dylib 
>>>>>> -lm  -O0 -m64 -pthread -Wl,-dylib_file 
>>>>>> -Wl,/usr/fubar/lib/octave/3.7.0+/liboctave.1.dylib:/Users/bpabbott/Development/mercurial/default/sources/liboctave/.libs/liboctave.dylib
>>>>>>    -pthread -framework AGL -framework OpenGL -framework 
>>>>>> ApplicationServices -framework Cocoa
>>>>>>> Undefined symbols for architecture x86_64:
>>>>>>> "_JNI_CreateJavaVM", referenced from:
>>>>>>>     initialize_jvm()      in dldfcn___java___la-__java__.o
>>>>>>> "_JNI_GetCreatedJavaVMs", referenced from:
>>>>>>>     initialize_jvm()      in dldfcn___java___la-__java__.o
>>>>>>> ld: symbol(s) not found for architecture x86_64
>>>>>>> collect2: ld returned 1 exit status
>>>>>>> make[3]: *** [dldfcn/__java__.la] Error 1
>>>>>>> make[2]: *** [all] Error 2
>>>>>>> make[1]: *** [all-recursive] Error 1
>>>>>>> make: *** [all] Error 2
>>>>>>> 
>>>>>>> Looking at config.log, I have the follow defined.
>>>>>>> 
>>>>>>> #define JAVA_ARCH ""
>>>>>>> #define JAVA_HOME ""
>>>>>>> ac_cv_prog_JAVA=java
>>>>>>> ac_cv_prog_JAVAC=javac
>>>>>>> JAVA='java'
>>>>>>> JAVAC='javac'
>>>>>>> JAVA_CPPFLAGS=''
>>>>>>> JAVA_LIBS=''
>>>>>>> 
>>>>>>> Ben
>>>>>>> 
>>>>>> 
>>>>>> Unless I missed seeing it, I didn't notice anything referencing a Java
>>>>>> library in that linker line, so that would indeed result in missing
>>>>>> symbols. :-)
>>>>>> 
>>>>>> What happens if you set JAVA_HOME before configuring, e.g. by
>>>>>> 
>>>>>> export JAVA_HOME=`/usr/libexec/java_home`
>>>>>> 
>>>>>> ?
>>>>> 
>>>>> I haven't tried JAVA_HOME, but setting JAVA_LIBS allowed the build to 
>>>>> complete.
>>>>> 
>>>>>   export JAVA_LIBS="-framework JavaVM"
>>>>> 
>>>>> Maybe this should be set in configure.ac for MacOS?
>>>>> 
>>>>> Ben
>>>> 
>>>> Carlo's change to configure.ac works for me.
>>>> 
>>>> http://octave.1599824.n4.nabble.com/changeset-for-configuring-with-Java-on-OSX-tt4647251.html
>>>> 
>>>> When I try "dlgtest(0)" I get ...
>>>> 
>>>>    Java JDK home directory  does not exist.
>>>>    Please adapt java_home in dlgtest.m.
>>>> 
>>>> Setting JAVA_HOME to that used during the build gives ...
>>>> 
>>>>    setenv JAVA_HOME "/System/Library/Frameworks/JavaVM.framework/Home"
>>>> 
>>>> Now "dlgtest(0)" results in ...
>>>> 
>>>>    0 ... STOP
>>>>    1 ... listdlg tests
>>>>    2 ... errordlg tests
>>>>    3 ... warndlg tests
>>>>    4 ... helpdlg tests
>>>>    5 ... inputdlg tests
>>>>    6 ... TeX code tests
>>>>    Run which test?   [0]>
>>>> 
>>>> Is this the expected result?
>>>> 
>>>> Ben
>>> 
>>> Yes.  When you run one of those tests there should be some dialog boxes 
>>> appear on the screen if Java is working properly.
>>> 
>>> BTW, I've just altered dlgtest on my local copy so that it doesn't return 
>>> if the JAVA_HOME variable isn't defined.  Instead, it issues the current 
>>> warning and continues on.  When unsetting the JAVA_HOME variable with
>>> 
>>> export -n JAVA_HOME
>>> 
>>> the Java demo seems to still work properly.  I think this conditional can 
>>> be removed.  It isn't clear to me where/why JAVA_HOME definition is 
>>> required.  I'm guessing it is interior to Octave java support somewhere and 
>>> dlgtest() is assuming something about its requirement, but I keep thinking 
>>> Octave should just fall back on "java" and "javac" as set up by the shell 
>>> if nothing else.
>>> 
>>> As an aside, the function "getenv" doesn't seem to make a distinction 
>>> between an environment variable not being set and an environment variable 
>>> set to nothing.  Both those cases result in an empty string. Is it worth 
>>> making a distinction here, either returning a different result or a new 
>>> routine "isenv()"?
>>> 
>>> Dan
>> 
>> No dialog boxes appear for me.  I assume that is a confirmation that the 
>> Java stuff doesn't work on OSX.
>> 
>> Ben
> 
> Well, if you have Java on your system (which I assume is the case if you do 
> any web browsing...type "java" or "javac" at a shell command line to confirm) 
> then this should be a configuration issue (emphasis "should").  Java is 
> supposed to be a very portable environment.
> 
> Perhaps your definition of JAVA_HOME is wrong, but in my case I can set 
> JAVA_HOME to any valid directory and "dlgtest(0)" functions properly.
> 
> Dan

MacOS X has Java.  If I understand the problem correctly ,.. the problem is 
that for MacOS X, the GUI loop must be in the main program thread.  What I'm 
not sure of is if the GUI loop  can support both a Qt and Java (I suspect it 
can not, but don't know).

Ben




reply via email to

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