heads-up on MacOS X & Java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

heads-up on MacOS X & Java

bpabbott
Administrator
With macOS 10.13, Apple has depreciated Java 1.6 for the Mac.

More recent versions do not work with Octave.

Ben


Reply | Threaded
Open this post in threaded view
|

Re: heads-up on MacOS X & Java

Mike Miller-4
On Fri, Oct 06, 2017 at 13:12:03 -0400, Ben Abbott wrote:
> With macOS 10.13, Apple has depreciated Java 1.6 for the Mac.
>
> More recent versions do not work with Octave.

Can you clarify what you think this means and what Octave should be
doing differently? Or what specific error you have?

My understanding of Java versions is that Java 9 was just released last
month. In Java 9, Java 1.5 code is now an error and Java 1.6 code is
warned as being deprecated but still works. I changed our build system
to compile for the Java 6 target to be as backwards compatible as
possible while still supporting Java 9.

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: heads-up on MacOS X & Java

bpabbott
Administrator
> On Oct 6, 2017, at 2:47 PM, Mike Miller <[hidden email]> wrote:
>
> On Fri, Oct 06, 2017 at 13:12:03 -0400, Ben Abbott wrote:
>> With macOS 10.13, Apple has depreciated Java 1.6 for the Mac.
>>
>> More recent versions do not work with Octave.
>
> Can you clarify what you think this means and what Octave should be
> doing differently? Or what specific error you have?
>
> My understanding of Java versions is that Java 9 was just released last
> month. In Java 9, Java 1.5 code is now an error and Java 1.6 code is
> warned as being deprecated but still works. I changed our build system
> to compile for the Java 6 target to be as backwards compatible as
> possible while still supporting Java 9.
>
> --
> mike

Hi Mike,

I haven’t been keeping up on the state of Java. Perhaps all will work now. I’ll try building against Java 9 and see if that works. If not, I’ll give Java 8 a try.

Ben
Reply | Threaded
Open this post in threaded view
|

Re: heads-up on MacOS X & Java

Marius Schamschula-5

On Oct 6, 2017, at 2:04 PM, Ben Abbott <[hidden email]> wrote:

On Oct 6, 2017, at 2:47 PM, Mike Miller <[hidden email]> wrote:

On Fri, Oct 06, 2017 at 13:12:03 -0400, Ben Abbott wrote:
With macOS 10.13, Apple has depreciated Java 1.6 for the Mac.

More recent versions do not work with Octave.

Can you clarify what you think this means and what Octave should be
doing differently? Or what specific error you have?

My understanding of Java versions is that Java 9 was just released last
month. In Java 9, Java 1.5 code is now an error and Java 1.6 code is
warned as being deprecated but still works. I changed our build system
to compile for the Java 6 target to be as backwards compatible as
possible while still supporting Java 9.

--
mike

Hi Mike,

I haven’t been keeping up on the state of Java. Perhaps all will work now. I’ll try building against Java 9 and see if that works. If not, I’ll give Java 8 a try.

Ben

IIRC Apple’s Java 1.6 is installed into a different file hierarchy as Oracle's 1.7, 1.8, etc. paths may need to be adjusted.

BTW: I managed to build octave 4.2.1 under MacPorts, using gcc 7.2 under High Sierra. No GUI whatsoever:

“octave: no graphical display found”

I have no idea what changed.

Marius
--
Marius Schamschula




Reply | Threaded
Open this post in threaded view
|

Re: heads-up on MacOS X & Java

Sebastian Schöps
In reply to this post by bpabbott
Java 9 works. I have submitted a patch at
http://savannah.gnu.org/patch/index.php?9439. It's already part of homebrew
since a month or so.

Sebastian



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html

Reply | Threaded
Open this post in threaded view
|

Re: heads-up on MacOS X & Java

Sebastian Schöps
In reply to this post by Marius Schamschula-5
Marius Schamschula-5 wrote
> BTW: I managed to build octave 4.2.1 under MacPorts, using gcc 7.2 under
> High Sierra. No GUI whatsoever:
>
> “octave: no graphical display found”
>
> I have no idea what changed.

Did you already try 4.3.0? This works quite nicely on High Sierra (in
particular with the proper patch from Dan:
http://savannah.gnu.org/bugs/?50025). The binary to play with is here

https://www.dropbox.com/s/lzjbykxkqxr402h/octave_gui_430_applebas.dmg?dl=0

Sebastian



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html

Reply | Threaded
Open this post in threaded view
|

Re: heads-up on MacOS X & Java

bpabbott
Administrator
In reply to this post by Sebastian Schöps
> On Oct 6, 2017, at 3:30 PM, Sebastian Schöps <[hidden email]> wrote:
>
> Java 9 works. I have submitted a patch at
> http://savannah.gnu.org/patch/index.php?9439. It's already part of homebrew
> since a month or so.
>
> Sebastian

Hi Sebastian,

The patch doesn’t apply for me. Perhaps because there is no context info and confgure.ac has changed since you attached it.

Even so, configure is happy.

  Build Octave Qt GUI:                  yes
  JIT compiler for loops:               no
  Build Java interface:                 yes
  Build static libraries:               no
  Build shared libraries:               yes
  Dynamic Linking:                      yes (dlopen)
  Include support for GNU readline:     yes
  64-bit array dims and indexing:       no
  64-bit BLAS array dims and indexing:  no
  OpenMP SMP multithreading:            no
  Build cross tools:                    no
  Build docs:                           yes
  Truncate intermediate FP results:     yes

Is there a convenient test for Java?

Ben



Reply | Threaded
Open this post in threaded view
|

Re: heads-up on MacOS X & Java

Sebastian Schöps
> The patch doesn’t apply for me. Perhaps because there is no context info and confgure.ac has changed since you attached it.

Currently java on macOS is differently handled than on other platforms. This was necessary in former times but now it's rather harmful. My patch just disables this if statement.

You can manually change in file "libinterp/octave-value/ov-java.cc" the line
"#if ! defined (__APPLE__) && ! defined (__MACH__)" into "#if 1". Additionally the statement "-framework JavaVM" must be removed from "configure.ac".

> Is there a convenient test for Java?

just calling "javaclasspath" should tell you whether it works. I recommend uninstalling Java 1.6 before these tests to actually see whether it works.

Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: heads-up on MacOS X & Java

bpabbott
Administrator
> On Oct 6, 2017, at 4:35 PM, Sebastian Schöps <[hidden email]> wrote:

>
>> The patch doesn’t apply for me. Perhaps because there is no context info and confgure.ac has changed since you attached it.
>
> Currently java on macOS is differently handled than on other platforms. This was necessary in former times but now it's rather harmful. My patch just disables this if statement.
>
> You can manually change in file "libinterp/octave-value/ov-java.cc" the line
> "#if ! defined (__APPLE__) && ! defined (__MACH__)" into "#if 1". Additionally the statement "-framework JavaVM" must be removed from "configure.ac".
>
>> Is there a convenient test for Java?
>
> just calling "javaclasspath" should tell you whether it works. I recommend uninstalling Java 1.6 before these tests to actually see whether it works.
>
> Sebastian
Hi Sebastian,

The javaclasspath() returned an empty cell, so I expect it wasn’t working. I’ll put in more time debugging.

In the meantime, I’ve attempted to change your changset by manually making the changes and then “hg diff”.

It is attached. Can you verify I got it correct?

Ben


octave_devel_mac_java3.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: heads-up on MacOS X & Java

bpabbott
Administrator
On Oct 6, 2017, at 8:43 PM, Ben Abbott <[hidden email]> wrote:

On Oct 6, 2017, at 4:35 PM, Sebastian Schöps <[hidden email]> wrote:

The patch doesn’t apply for me. Perhaps because there is no context info and confgure.ac has changed since you attached it.

Currently java on macOS is differently handled than on other platforms. This was necessary in former times but now it's rather harmful. My patch just disables this if statement.

You can manually change in file "libinterp/octave-value/ov-java.cc" the line
"#if ! defined (__APPLE__) && ! defined (__MACH__)" into "#if 1". Additionally the statement "-framework JavaVM" must be removed from "configure.ac".

Is there a convenient test for Java?

just calling "javaclasspath" should tell you whether it works. I recommend uninstalling Java 1.6 before these tests to actually see whether it works.

Sebastian

Hi Sebastian,

The javaclasspath() returned an empty cell, so I expect it wasn’t working. I’ll put in more time debugging.

In the meantime, I’ve attempted to change your changset by manually making the changes and then “hg diff”.

It is attached. Can you verify I got it correct?

Ben

<octave_devel_mac_java3.patch>

With High Sierra (10.13) and Java 9 I needed to modify the patch to configure.ac in order to build (patch is attached). The macOS/Darwin JAVA_CPPFLAGS are now consistent with Linux.

Unfortunately, I encountered a seg-fault when trying javaclasspath().  I’ll have some more time to debug

foo = javaclasspath ()
ASAN:DEADLYSIGNAL
=================================================================
==80466==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00012670f4f3 bp 0x00011bbfe06c sp 0x70000ae71398 T5)
    #0 0x12670f4f2  (<unknown module>)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (<unknown module>) 
Thread T5 created by T0 here:
    #0 0x10a963e29 in wrap_pthread_create (libclang_rt.asan_osx_dynamic.dylib+0x41e29)
    #1 0x10600fa25 in QThread::start(QThread::Priority) (QtCore+0x23a25)
    #2 0x10357eb4b in main_window::main_window(QWidget*, octave::gui_application*) main-window.cc:228
    #3 0x1035aa3b1 in octave::gui_application::execute() octave-gui.cc:228
    #4 0x10351361f in main main-gui.cc:104
    #5 0x7fff58c38144 in start (libdyld.dylib+0x1144)
    #6 0x8  (<unknown module>)

==80466==ABORTING
Abort trap: 6

My tip is …

$ hg tip
changeset:   24125:ed746cbfce24
bookmark:    @
tag:         tip
user:        John W. Eaton <[hidden email]>
date:        Thu Oct 05 17:45:58 2017 -0400
summary:     * acinclude.m4: Search for version-specific qscintilla libs first.

Ben



Reply | Threaded
Open this post in threaded view
|

Re: heads-up on MacOS X & Java

Dmitri A. Sergatskov


On Sun, Oct 8, 2017 at 7:25 AM, Ben Abbott <[hidden email]> wrote:
On Oct 6, 2017, at 8:43 PM, Ben Abbott <[hidden email]> wrote:

On Oct 6, 2017, at 4:35 PM, Sebastian Schöps <[hidden email]> wrote:

The patch doesn’t apply for me. Perhaps because there is no context info and confgure.ac has changed since you attached it.

Currently java on macOS is differently handled than on other platforms. This was necessary in former times but now it's rather harmful. My patch just disables this if statement.

You can manually change in file "libinterp/octave-value/ov-java.cc" the line
"#if ! defined (__APPLE__) && ! defined (__MACH__)" into "#if 1". Additionally the statement "-framework JavaVM" must be removed from "configure.ac".

Is there a convenient test for Java?

just calling "javaclasspath" should tell you whether it works. I recommend uninstalling Java 1.6 before these tests to actually see whether it works.

Sebastian

Hi Sebastian,

The javaclasspath() returned an empty cell, so I expect it wasn’t working. I’ll put in more time debugging.

In the meantime, I’ve attempted to change your changset by manually making the changes and then “hg diff”.

It is attached. Can you verify I got it correct?

Ben

<octave_devel_mac_java3.patch>

With High Sierra (10.13) and Java 9 I needed to modify the patch to configure.ac in order to build (patch is attached). The macOS/Darwin JAVA_CPPFLAGS are now consistent with Linux.

Unfortunately, I encountered a seg-fault when trying javaclasspath().  I’ll have some more time to debug

foo = javaclasspath ()
ASAN:DEADLYSIGNAL
=================================================================
==80466==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00012670f4f3 bp 0x00011bbfe06c sp 0x70000ae71398 T5)
    #0 0x12670f4f2  (<unknown module>)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (<unknown module>) 
Thread T5 created by T0 here:
    #0 0x10a963e29 in wrap_pthread_create (libclang_rt.asan_osx_dynamic.dylib+0x41e29)
    #1 0x10600fa25 in QThread::start(QThread::Priority) (QtCore+0x23a25)
    #2 0x10357eb4b in main_window::main_window(QWidget*, octave::gui_application*) main-window.cc:228
    #3 0x1035aa3b1 in octave::gui_application::execute() octave-gui.cc:228
    #4 0x10351361f in main main-gui.cc:104
    #5 0x7fff58c38144 in start (libdyld.dylib+0x1144)
    #6 0x8  (<unknown module>)

==80466==ABORTING
Abort trap: 6


​This looks the same as ​

​i.e. on linux JVM and asan have a problem. I have at least one computer that does not exhibit
it (an old-ish Xeon w/o integrated graphics + Nvidia card), but others do crash
(including an AMD CPU + AMD graphics). So it is complicated...

Dmitri.
--



 

Reply | Threaded
Open this post in threaded view
|

Re: heads-up on MacOS X & Java

bpabbott
Administrator
On Oct 8, 2017, at 12:29 PM, Dmitri A. Sergatskov <[hidden email]> wrote:

On Sun, Oct 8, 2017 at 7:25 AM, Ben Abbott <[hidden email]> wrote:
On Oct 6, 2017, at 8:43 PM, Ben Abbott <[hidden email]> wrote:

On Oct 6, 2017, at 4:35 PM, Sebastian Schöps <[hidden email]> wrote:

The patch doesn’t apply for me. Perhaps because there is no context info and confgure.ac has changed since you attached it.

Currently java on macOS is differently handled than on other platforms. This was necessary in former times but now it's rather harmful. My patch just disables this if statement. 

You can manually change in file "libinterp/octave-value/ov-java.cc" the line
"#if ! defined (__APPLE__) && ! defined (__MACH__)" into "#if 1". Additionally the statement "-framework JavaVM" must be removed from "configure.ac".

Is there a convenient test for Java?

just calling "javaclasspath" should tell you whether it works. I recommend uninstalling Java 1.6 before these tests to actually see whether it works. 

Sebastian

Hi Sebastian,

The javaclasspath() returned an empty cell, so I expect it wasn’t working. I’ll put in more time debugging.

In the meantime, I’ve attempted to change your changset by manually making the changes and then “hg diff”.

It is attached. Can you verify I got it correct?

Ben

<octave_devel_mac_java3.patch>

With High Sierra (10.13) and Java 9 I needed to modify the patch to configure.ac in order to build (patch is attached). The macOS/Darwin JAVA_CPPFLAGS are now consistent with Linux.

Unfortunately, I encountered a seg-fault when trying javaclasspath().  I’ll have some more time to debug

foo = javaclasspath ()
ASAN:DEADLYSIGNAL
=================================================================
==80466==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00012670f4f3 bp 0x00011bbfe06c sp 0x70000ae71398 T5)
    #0 0x12670f4f2  (<unknown module>)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (<unknown module>) 
Thread T5 created by T0 here:
    #0 0x10a963e29 in wrap_pthread_create (libclang_rt.asan_osx_dynamic.dylib+0x41e29)
    #1 0x10600fa25 in QThread::start(QThread::Priority) (QtCore+0x23a25)
    #2 0x10357eb4b in main_window::main_window(QWidget*, octave::gui_application*) main-window.cc:228
    #3 0x1035aa3b1 in octave::gui_application::execute() octave-gui.cc:228
    #4 0x10351361f in main main-gui.cc:104
    #5 0x7fff58c38144 in start (libdyld.dylib+0x1144)
    #6 0x8  (<unknown module>)

==80466==ABORTING
Abort trap: 6


​This looks the same as ​

​i.e. on linux JVM and asan have a problem. I have at least one computer that does not exhibit
it (an old-ish Xeon w/o integrated graphics + Nvidia card), but others do crash 
(including an AMD CPU + AMD graphics). So it is complicated... 

Dmitri.

Thanks for pointing out the bug report.

Ben