problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

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

problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

Kostas Oikonomou
I am using Julia 0.5.0 on FreeBSD 11.  I've had a few problems trying to install the Plots and PlotlyJS packages:

1. Just after installing Plots, I had to make this fix in
~/.julia/v0.5/Plots/src/backends/web.jl, function open_browser_window:

   @static if is_linux() || is_bsd()
        return run(`xdg-open $(filename)`)
   end

2. Now trying to install PlotlyJS.  HttpParser doesn't build, because in
BinDeps.jl, function unpack_cmd(...), says

   elseif extension == ".zip"
       return (`unzip -x $file -d $directory`)

The /usr/bin/unzip on FreeBSD doesn't understand "-x" (more precisely, it thinks
it means "exclude").  GNU gunzip doesn't understand it either.  What "unzip" is
this supposed to be?  I made an ugly hack to work around this.


3. In ~/.julia/v0.5/Blink/src/AtomShell/process.jl: I had to add is_bsd() to

@static if is_apple()
  const _electron = resolve("Blink", "deps/Julia.app/Contents/MacOS/Electron")
elseif is_linux() || is_bsd()
  const _electron = resolve("Blink", "deps/atom/electron")
elseif is_windows()
  const _electron = resolve("Blink", "deps", "atom", "electron.exe")
end

4. After all this, I still get the error:

julia> using Plots
julia> plotlyjs()
julia> plot(x -> x^2, rand(10))
Error showing value of type Plots.Plot{Plots.PlotlyJSBackend}:
ERROR: Cannot find Electron. Try `Blink.AtomShell.install()`.
 in electron() at /usr/home/ko/.julia/v0.5/Blink/src/AtomShell/process.jl:53


Thanks for any help.

                Kostas
Reply | Threaded
Open this post in threaded view
|

Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

Tom Breloff
I'll ask the obvious question... did you try "Blink.AtomShell.install()"?  Nice work getting as far as you did.

On Mon, Nov 7, 2016 at 3:35 PM, Kostas Oikonomou <[hidden email]> wrote:
I am using Julia 0.5.0 on FreeBSD 11.  I've had a few problems trying to install the Plots and PlotlyJS packages:

1. Just after installing Plots, I had to make this fix in
~/.julia/v0.5/Plots/src/backends/web.jl, function open_browser_window:

   @static if is_linux() || is_bsd()
        return run(`xdg-open $(filename)`)
   end

2. Now trying to install PlotlyJS.  HttpParser doesn't build, because in
BinDeps.jl, function unpack_cmd(...), says

   elseif extension == ".zip"
       return (`unzip -x $file -d $directory`)

The /usr/bin/unzip on FreeBSD doesn't understand "-x" (more precisely, it thinks
it means "exclude").  GNU gunzip doesn't understand it either.  What "unzip" is
this supposed to be?  I made an ugly hack to work around this.


3. In ~/.julia/v0.5/Blink/src/AtomShell/process.jl: I had to add is_bsd() to

@static if is_apple()
  const _electron = resolve("Blink", "deps/Julia.app/Contents/MacOS/Electron")
elseif is_linux() || is_bsd()
  const _electron = resolve("Blink", "deps/atom/electron")
elseif is_windows()
  const _electron = resolve("Blink", "deps", "atom", "electron.exe")
end

4. After all this, I still get the error:

julia> using Plots
julia> plotlyjs()
julia> plot(x -> x^2, rand(10))
Error showing value of type Plots.Plot{Plots.PlotlyJSBackend}:
ERROR: Cannot find Electron. Try `Blink.AtomShell.install()`.
 in electron() at /usr/home/ko/.julia/v0.5/Blink/src/AtomShell/process.jl:53


Thanks for any help.

                Kostas

Reply | Threaded
Open this post in threaded view
|

Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

Kostas Oikonomou
Yes, I did.  Unfortunately it didn't help.

On Monday, November 7, 2016 at 3:44:29 PM UTC-5, Tom Breloff wrote:
I'll ask the obvious question... did you try "Blink.AtomShell.install()"?  Nice work getting as far as you did.


Reply | Threaded
Open this post in threaded view
|

Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

Tom Breloff
You should probably open issues/PRs in the individual packages then... this sounds like a Blink issue.

On Mon, Nov 7, 2016 at 5:09 PM, Kostas Oikonomou <[hidden email]> wrote:
Yes, I did.  Unfortunately it didn't help.

On Monday, November 7, 2016 at 3:44:29 PM UTC-5, Tom Breloff wrote:
I'll ask the obvious question... did you try "Blink.AtomShell.install()"?  Nice work getting as far as you did.



Reply | Threaded
Open this post in threaded view
|

Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

Kostas Oikonomou
I'm just beginning with Julia, so I don't really know how to go about doing this.

On Monday, November 7, 2016 at 5:14:21 PM UTC-5, Tom Breloff wrote:
You should probably open issues/PRs in the individual packages then... this sounds like a Blink issue.

On Mon, Nov 7, 2016 at 5:09 PM, Kostas Oikonomou <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="m25Zd_qHBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">kostas.oi...@...> wrote:
Yes, I did.  Unfortunately it didn't help.

On Monday, November 7, 2016 at 3:44:29 PM UTC-5, Tom Breloff wrote:
I'll ask the obvious question... did you try "Blink.AtomShell.install()"?  Nice work getting as far as you did.



Reply | Threaded
Open this post in threaded view
|

Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

Kostas Oikonomou
On 2nd thought, here is more of the (long) error message:

ERROR: Cannot find Electron. Try `Blink.AtomShell.install()`.
 in electron() at /usr/home/ko/.julia/v0.5/Blink/src/AtomShell/process.jl:53
 in #init#5(::Bool, ::Function) at /usr/home/ko/.julia/v0.5/Blink/src/AtomShell/process.jl:71
 in (::Blink.AtomShell.#kw##init)(::Array{Any,1}, ::Blink.AtomShell.#init) at ./<missing>:0
 in #shell#8(::Bool, ::Function) at /usr/home/ko/.julia/v0.5/Blink/src/AtomShell/process.jl:114

The <missing> in line 4 looks suspicious.  Does it give you any clue?

On Monday, November 7, 2016 at 5:27:34 PM UTC-5, Kostas Oikonomou wrote:
I'm just beginning with Julia, so I don't really know how to go about doing this.


Reply | Threaded
Open this post in threaded view
|

Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

Tony Kelman
Most likely there are various platform-checking if statements that don't properly handle the freebsd situation of being not linux and not macos and not windows. Does Atom support FreeBSD, do they have binaries available? If so, a few more careful fallbacks might be able to fix this?
Reply | Threaded
Open this post in threaded view
|

Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

randmstring
In reply to this post by Kostas Oikonomou
I don't think Electron works on FreeBSD (see here), but Blink requires it. You could try using the Linux binaries by changing this line to be is_linux() || is_bsd()and call Blink.AtomShell.install() again, but I'm not sure that'll work.

Am Montag, 7. November 2016 21:35:30 UTC+1 schrieb Kostas Oikonomou:
I am using Julia 0.5.0 on FreeBSD 11.  I've had a few problems trying to install the Plots and PlotlyJS packages:

1. Just after installing Plots, I had to make this fix in
~/.julia/v0.5/Plots/src/backends/web.jl, function open_browser_window:

   @static if is_linux() || is_bsd()
        return run(`xdg-open $(filename)`)
   end

2. Now trying to install PlotlyJS.  HttpParser doesn't build, because in
BinDeps.jl, function unpack_cmd(...), says

   elseif extension == ".zip"
       return (`unzip -x $file -d $directory`)

The /usr/bin/unzip on FreeBSD doesn't understand "-x" (more precisely, it thinks
it means "exclude").  GNU gunzip doesn't understand it either.  What "unzip" is
this supposed to be?  I made an ugly hack to work around this.


3. In ~/.julia/v0.5/Blink/src/AtomShell/process.jl: I had to add is_bsd() to

@static if is_apple()
  const _electron = resolve("Blink", "deps/Julia.app/Contents/MacOS/Electron")
elseif is_linux() || is_bsd()
  const _electron = resolve("Blink", "deps/atom/electron")
elseif is_windows()
  const _electron = resolve("Blink", "deps", "atom", "electron.exe")
end

4. After all this, I still get the error:

julia> using Plots
julia> plotlyjs()
julia> plot(x -> x^2, rand(10))
Error showing value of type Plots.Plot{Plots.PlotlyJSBackend}:
ERROR: Cannot find Electron. Try `Blink.AtomShell.install()`.
 in electron() at /usr/home/ko/.julia/v0.5/Blink/src/AtomShell/process.jl:53


Thanks for any help.

                Kostas
Reply | Threaded
Open this post in threaded view
|

Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

Kostas Oikonomou
Thanks.  Before reading your post, I had added an "if is_bsd()" statement to Blink/src/AtomShell/install.jl, and I set arch to "ia32" as FreeBSD has default support for 32-bit Linux. 

The result is that when I redo AtomBlink.AtomShell.install(), the 32-bit Linux binary is installed.
However, when I do plotlyjs() and then try to plot something, there is an error:

ERROR: connect: connection refused (ECONNREFUSED)
 in yieldto at ./event.jl:136
 in _init at /opt/julia/0.5.0/lib/julia/sys.so:?
 in wait at ./event.jl:169
 in wait at ./event.jl:27
 in _init at /opt/julia/0.5.0/lib/julia/sys.so:?
 in stream_wait at ./stream.jl:44
 in wait_connected at ./stream.jl:265
...


On Tuesday, November 8, 2016 at 11:32:42 AM UTC-5, [hidden email] wrote:
I don't think Electron works on FreeBSD (see <a href="https://github.com/electron/electron/issues/3797" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Felectron%2Felectron%2Fissues%2F3797\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH1giCDHsGmB5WZEo-fNJeEvxJcfw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Felectron%2Felectron%2Fissues%2F3797\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH1giCDHsGmB5WZEo-fNJeEvxJcfw&#39;;return true;">here), but Blink requires it. You could try using the Linux binaries by changing <a href="https://github.com/JunoLab/Blink.jl/blob/v0.4.3/src/AtomShell/install.jl#L32" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FJunoLab%2FBlink.jl%2Fblob%2Fv0.4.3%2Fsrc%2FAtomShell%2Finstall.jl%23L32\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEu9JFnSEEnUIDkMD4d4fLv0rViCg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FJunoLab%2FBlink.jl%2Fblob%2Fv0.4.3%2Fsrc%2FAtomShell%2Finstall.jl%23L32\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEu9JFnSEEnUIDkMD4d4fLv0rViCg&#39;;return true;">this line to be is_linux() || is_bsd()and call Blink.AtomShell.install() again, but I'm not sure that'll work.

A
Reply | Threaded
Open this post in threaded view
|

Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

Tom Breloff
Sounds like progress.  You might try restarting Julia, and also try the plotting command a few times.  Blink is known to have a race condition on startup that sometimes produces this sort of error.

On Tue, Nov 8, 2016 at 1:02 PM, Kostas Oikonomou <[hidden email]> wrote:
Thanks.  Before reading your post, I had added an "if is_bsd()" statement to Blink/src/AtomShell/install.jl, and I set arch to "ia32" as FreeBSD has default support for 32-bit Linux. 

The result is that when I redo AtomBlink.AtomShell.install(), the 32-bit Linux binary is installed.
However, when I do plotlyjs() and then try to plot something, there is an error:

ERROR: connect: connection refused (ECONNREFUSED)
 in yieldto at ./event.jl:136
 in _init at /opt/julia/0.5.0/lib/julia/sys.so:?
 in wait at ./event.jl:169
 in wait at ./event.jl:27
 in _init at /opt/julia/0.5.0/lib/julia/sys.so:?
 in stream_wait at ./stream.jl:44
 in wait_connected at ./stream.jl:265
...


On Tuesday, November 8, 2016 at 11:32:42 AM UTC-5, [hidden email] wrote:
I don't think Electron works on FreeBSD (see here), but Blink requires it. You could try using the Linux binaries by changing this line to be is_linux() || is_bsd()and call Blink.AtomShell.install() again, but I'm not sure that'll work.

A

Reply | Threaded
Open this post in threaded view
|

Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

Kostas Oikonomou
It seems that the problem is in Blink/src/AtomShell/process.jl.   The error report indicates line 62 there.
So I tried running some lines by hand:

julia> port() = rand(2_000:10_000)       # line 57
port (generic function with 1 method)

julia> p = port()                                      # line 72
5287

julia> connect(ip"127.0.0.1", p)              # line 76
ERROR: connect: connection refused (ECONNREFUSED)
 in yieldto at ./event.jl:136
 in _init at /opt/julia/0.5.0/lib/julia/sys.so:?
 in wait at ./event.jl:169
 in wait at ./event.jl:27
 in _init at /opt/julia/0.5.0/lib/julia/sys.so:?
 in stream_wait at ./stream.jl:44
 in wait_connected at ./stream.jl:265
 in connect at ./stream.jl:960 [inlined]
 in connect(::IPv4, ::Int64) at ./socket.jl:677

julia>


On Tuesday, November 8, 2016 at 1:07:23 PM UTC-5, Tom Breloff wrote:
Sounds like progress.  You might try restarting Julia, and also try the plotting command a few times.  Blink is known to have a race condition on startup that sometimes produces this sort of error.

On Tue, Nov 8, 2016 at 1:02 PM, Kostas Oikonomou <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="UjSo4xTJBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">kostas.oi...@...> wrote:

Thanks.  Before reading your post, I had added an "if is_bsd()" statement to Blink/src/AtomShell/install.jl, and I set arch to "ia32" as FreeBSD has default support for 32-bit Linux.