bugGNU Octave - Bugs: bug #47606, mxe-octave installer for 64 bit...

 
 

bug #47606: mxe-octave installer for 64 bit seems not check 64 bit JRE but 32 bit JRE

Submitter:  Tatsuro MATSUOKA <tmacchant>
Submitted:  Sat 02 Apr 2016 01:56:15 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  lostbard
Originator Name:  Tatsuro MATSUOKA Open/Closed:  * Closed
Release:  * 4.0.1 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 17 Apr 2016 08:20:54 PM UTC, comment #19: 

Closing as fixed

John Donoghue <lostbard>
Group Member
Sat 09 Apr 2016 07:14:47 AM UTC, comment #18: 

I have confirmed on stable-octave (4.0.1) configured with
--enable-windows64 correctly detected 64 bit JRE.
Thanks!

Tatsuro MATSUOKA <tmacchant>
Fri 08 Apr 2016 09:28:15 PM UTC, comment #17: 

At least it didn't break the --enable-windows-64 cross-builds I usually make. Octave-4.1.0+ on Windy correctly invoked the 64-bit JRE.

Hopefully this weekend I can try a 32-bit build.

Philip Nienhuis <philipnienhuis>
Group Member
Thu 07 Apr 2016 05:06:05 PM UTC, comment #16: 

Anyone else get a chance to see if this worked for them?

John Donoghue <lostbard>
Group Member
Tue 05 Apr 2016 09:20:39 PM UTC, comment #15: 

You will need to rerun autoconf/configure in order to rebuild correctly

John Donoghue <lostbard>
Group Member
Tue 05 Apr 2016 09:19:47 PM UTC, comment #14: 

Pushed change to detect win32/64 java

http://hg.octave.org/mxe-octave/rev/5ae69991eaa1


John Donoghue <lostbard>
Group Member
Tue 05 Apr 2016 09:12:42 PM UTC, comment #13: 

Results with formatting:


>> javamem

error: unable to find Java Runtime Environment: software\javasoft\java runtime environment::Currentversion
error: called from
    javamem at line 68 column 6
>> pkg load io

>> chk_spreadsheet_support ('', 3)


(OCT interface... OK, included in io package)

Checking Excel/ActiveX/COM... not working.
1. Checking Octave's Java support... OK.
2. Checking Java dependencies...
  Checking Java JRE presence.... OK, found one.
No Java support found.
No Java support found.
Only ODS 1.2 (.ods) & OOXML (.xlsx) r/w support & .gnumeric read support present
ans = 0
>>


John Donoghue <lostbard>
Group Member
Tue 05 Apr 2016 09:12:00 PM UTC, comment #12: 

On my system, which only contains the 32bit java, when I try using java:

>> javamem

error: unable to find Java Runtime Environment: software\javasoft\java runtime environment::Currentversion
error: called from
    javamem at line 68 column 6
>> pkg load io

>> chk_spreadsheet_support ('', 3)


(OCT interface... OK, included in io package)

Checking Excel/ActiveX/COM... not working.
1. Checking Octave's Java support... OK.
2. Checking Java dependencies...
  Checking Java JRE presence.... OK, found one.
No Java support found.
No Java support found.
Only ODS 1.2 (.ods) & OOXML (.xlsx) r/w support & .gnumeric read support present
ans = 0
>>
+verbatim+

John Donoghue <lostbard>
Group Member
Tue 05 Apr 2016 05:57:59 PM UTC, comment #11: 

I suppose 32-bit Octave should primarily invoke 32-bit JRE, 64-bit Octave should primarily invoke 64-bit JRE; maybe warn if the preferred one isn't found before invoking the other.

The reason is that I think it is not only Libre/OpenOffice that connects to a JRE using compiled (C++, whatever) modules.

Philip Nienhuis <philipnienhuis>
Group Member
Mon 04 Apr 2016 11:10:55 PM UTC, comment #10: 

I have  change that should work then - i will attach after I have tested it.


John Donoghue <lostbard>
Group Member
Mon 04 Apr 2016 09:39:42 PM UTC, comment #9: 

Or check for a 64 bit java when using octave 64 bit mode.

I prefer this because 64bit octave should use 64bit Java.

Tatsuro MATSUOKA <tmacchant>
Mon 04 Apr 2016 07:55:02 PM UTC, comment #8: 

So only issue really is that the installer doesn't detect the installed java if its 64 windows, and a java 32 is not also installed?

So we can change that to check for any 32 or 64 bit java.

Or check for a 64 bit java when using octave 64 bit mode.

mxe-octave downloads the java headers it should be using for the mingw build and overrides the detected java flags in the build.




John Donoghue <lostbard>
Group Member
Mon 04 Apr 2016 04:39:58 PM UTC, comment #7: 

Answer 1:
32-bit Octave (based on comparing octave-4.0.1-cli.exe's time stamps in the installer and in OCTAVE_HOME/bin I think the existing one from ftp.gnu.org):

>> strsplit (getenv ("PATH"), pathsep)
ans =
{
  [1,1] = C:\Programs\Octave\Octave32-4.0.1\bin
  [1,2] = C:\ProgramData\Oracle\Java\javapath
  [1,3] = C:\Program Files (x86)\Intel\iCLS Client\
  [1,4] = C:\Program Files\Intel\iCLS Client\
  [1,5] = C:\Windows\system32
  [1,6] = C:\Windows
  [1,7] = C:\Windows\System32\Wbem
  [1,8] = C:\Windows\System32\WindowsPowerShell\v1.0\
  [1,9] = C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
  [1,10] = C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
  [1,11] = C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
  [1,12] = C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
  [1,13] = C:\Program Files\TortoiseHg\
  [1,14] = C:\Program Files (x86)\Skype\Phone\
  [1,15] = C:\Programs\Octave\Octave32-4.0.1\bin
  [1,16] = C:\Programs\Octave\Octave32-4.0.1\notepad++
  [1,17] = C:\Programs\Octave\Octave32-4.0.1\libexec\octave\4.0.1\site\exec\i686-w64-mingw32
  [1,18] = C:\Programs\Octave\Octave32-4.0.1\libexec\octave\api-v50+\site\exec\i686-w64-mingw32
  [1,19] = C:\Programs\Octave\Octave32-4.0.1\libexec\octave\site\exec\i686-w64-mingw32
  [1,20] = C:\Programs\Octave\Octave32-4.0.1\libexec\octave\4.0.1\exec\i686-w64-mingw32
  [1,21] = C:\Programs\Octave\Octave32-4.0.1\bin
}


Octave-4.1.0+ (64bit) shows the same PATH with "Octave32-4.0.1" replaced by "Octave-4.1.0+_w64VEtst"

============================================
Answer 2:
Using the io package's scripts:

octave-4.0.1 32-bit does this:

>> chk_spreadsheet_support ('', 3)
:
:
1. Checking Octave's Java support... OK.
2. Checking Java dependencies...
  Checking Java JRE presence.... OK, found one.
  Java seems to work OK.
  Java (version 1.8.0_77) seems OK.
  Maximum JVM memory:   248 MiB; should better be at least 400 MB!
    Hint: adapt setting -Xmx in file 'java.opts' (supposed to be here:)
    C:\Programs\Octave\Octave32-4.0.1\share\octave\packages\java-<version>\java.opts


and

>> io_xls_testscript ("uno")
:
:
Oops, Octave hit an error.
Maybe you have 64-bit Libre/OpenOffice installed?
32-bit Octave requires 32-bit L.O. / OOo.


The LibreOffice UNO-Java bridge (belonging to LO, not stuff in the io package!) contains several compiled procedures so LO just doesn't work if Octave has a different "bit width", even if the io package finds the LO java parts and added them to the javaclasspath.
Octave can only find out if it "matches" by trying.

Now, with 64-bit Octave-4.1.0+

>> io_xls_testscript ("uno")

Testing .xls interface UNO using file io-test.xls...
:
:
10. Cleaning up..... OK
ans =
{
  [1,1] = UNO
  [1,2] = +
:


(so runs fine) and

>> chk_spreadsheet_support ('', 3)
:
:
1. Checking Octave's Java support... OK.
2. Checking Java dependencies...
  Checking Java JRE presence.... OK, found one.
  Java seems to work OK.
  Java (version 1.8.0_77) seems OK.
  Maximum JVM memory:  1812 MiB; sufficient.
:


so each version (32bit and 64bit) of Octave picks up the matching Java version.


One question now is: did JWE build the 32-bit installer with a 32-bit or a 64-bit JDK on his Linux box?

AFAICS 32-bit or 64-bit Octave doesn't make a difference as regards 32-bit or 64-bit Java JRE when just invoking methods from ready-baked Java class libs . jar files) in the javaclasspath.
Admittedly a 32-bit Java JRE implies a smaller JVM heap than that of a 64-bit Java JRE, as shown above in the verbatim blocks.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 03 Apr 2016 10:59:29 PM UTC, comment #6: 

So from comment #5, for you it is showing both versions.

What does your path env show?

If you have octave 32bit installed, does it use the correct java?


John Donoghue <lostbard>
Group Member
Sun 03 Apr 2016 07:37:50 PM UTC, comment #5: 

Running the installer from comment #2, I get

Step 1:
java_home =
jre_home=C:\Program Files (x86)\Java\jre1.8.0_77
sdk_home=<not set>

Step 2:
java_home =
jre_home=C:\Program Files\Java\jre1.8.0_77
sdk_home=<not set>

Step 3:
java_home =
jre_home=C:\Program Files (x86)\Java\jre1.8.0_77
sdk_home=<not set>

Philip Nienhuis <philipnienhuis>
Group Member
Sun 03 Apr 2016 07:30:37 PM UTC, comment #4: 

Answering myself: from Tatsuro's experience it is not the last Java JRE that determines what Octave wants to attach to.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 03 Apr 2016 05:06:39 PM UTC, comment #3: 

FWIW:

On my 64-bit Windows 7 system I have both 32 and 64 bit Java installed.

My 64-bit mxe-octave builds apparently pick the 64-bit Java JRE:

>> system ("java -version")
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
ans = 0


and

>> chk_spreadsheet_support ("", 3)  ## in io package)
<snip>
1. Checking Octave's Java support... OK.
2. Checking Java dependencies...
  Checking Java JRE presence.... OK, found one.
  Java seems to work OK.
  Java (version 1.8.0_77) seems OK.
  Maximum JVM memory:  1812 MiB; sufficient.


1812 MB jvm heap isn't easily accomplished with 32-bit Java.

Finally, on my Win 7 box the io package UNO scripts will attach to the 64-bit LibreOffice (they won't work with 32-bit LO).

Maybe it is a matter of which Java got installed as the last one?
Java JREs come with a Java console where (maybe, apparently) a Java version can be selected.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 03 Apr 2016 02:08:23 PM UTC, comment #2: 

I wrote a fake installer (attached)

Try running it and provide the results from the message boxes that are displayed.

There should be 3 messageboxes that appear sequenctionally.

The 1st, is the default read settings from the registry.

The 2nd, the read settings after setting SetRegView 64

The 3rd, the read settings after setting SetRegView 32

Running on my win7, 64 bit machine, it appears that the settings we read are the 32 bit registry values

So it if is the same on yours, we probally need to use SetRegView 64 in the installer if it is for the the w64 octave.




(file #36827)

John Donoghue <lostbard>
Group Member
Sun 03 Apr 2016 12:21:18 PM UTC, comment #1: 

Also, looking on an example on the nsis website [1], most times they also check the following if not found elsewhere.

HKLM\Software\JavaSoft\Java Development Kit\Current Version

and

HKLM\Software\JavaSoft\ava Development Kit\XXXX\JavaHome


so what is the key value of them as well.


[1] http://nsis.sourceforge.net/Simple_installer_with_JRE_check


John Donoghue <lostbard>
Group Member
Sat 02 Apr 2016 01:56:15 PM UTC, original submission:  

This was posted to the octave maintainers mailing list and it is moved to the bug tracker.

http://octave.1599824.n4.nabble.com/mxe-octave-installer-for-64-bit-seems-not-check-64-bit-JRE-but-32-bit-JRE-td4676038.html

http://octave.1599824.n4.nabble.com/Re-mxe-octave-installer-for-64-bit-seems-not-check-64-bit-JRE-but-32-bit-JRE-td4676041.html

The original post:


I have installed 64 bit octave for windows wit installer
built and generated using mxe-octave --enable-windows64.

At trying install to PC which has only the 64 bit JRE from the Oracle site,
the Octave installer generated by mxe-octave claimed that the Java is not installed.
The warning is disappeared after I install the 32 bit Oracle JRE.

The installer generated by the mxe-octave seems to tries to check 32 bit JRE
regardless octave binary is 32 bit or 64 bit.

For 64 bit binary, the installer should check the 64 bit instead of the 32 bit JRE.


Reply from John Donoghue:
Can we verify manually from the registry what the installer is reading?
1. attempts to read JAVA_HOME environment variable - so within octave
getenv('JAVA_HOME')
2. reads registry value from HKLM\Software\JavaSoft\Java Runtime
Environment\Current Version"
3. reads registry value from HKLM\Software\JavaSoft\Java Runtime
Environment\XXXX\JavaHome"  (where XXXX was the version from 2.)
-verbatim-
 

Tatsuro MATSUOKA <tmacchant>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #36827:  JVMTest-Setup.exe added by lostbard (131KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by tmacchant (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-04-17 lostbard Open/ClosedOpen Closed
    2016-04-17 lostbard StatusReady For Test Fixed
    2016-04-05 lostbard StatusIn Progress Ready For Test
    2016-04-04 lostbard StatusNeed Info In Progress
        Assigned toNone lostbard
    2016-04-03 lostbard Attached File- Added JVMTest-Setup.exe, #36827
    2016-04-03 lostbard StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code