Plot libraries for Julia Error.

Installing the "plot" library works fine.
Code:
using Pkg
Pkg.update()
Pkg.add("FFMPEG")
Pkg.add("Plots")
Running the plot library gives errors:
Code:
using Plots
x = range(0, 10, length=100)
y1 = sin.(x)
y2 = cos.(x)
p=plot(x, [y1,y2],title="Tutorial",xlabel="x",ylabel="y")
savefig(p,"p.png")
display(p)
sleep(10)
Error:
Code:
ERROR: LoadError: InitError: could not load library "/home/x/.julia/artifacts/ce9ecc22b48f5833c1b89a75263d1d57ab64585a/lib/libfreetype.so"
Shared object "libz.so.1" not found, required by "libfreetype.so"
ERROR: LoadError: Failed to precompile libass_jll
ERROR: LoadError: Failed to precompile FFMPEG_jll
ERROR: LoadError: Failed to precompile FFMPEG
ERROR: LoadError: Failed to precompile FFMPEG
Note this works fine on Artix-linux.

Installing "plotly" library works fine.
Code:
using Pkg
Pkg.add("PlotlyJS")

Running plotly library gives errors
Code:
using PlotlyJS
p=plot(rand(10,4))
display(p)
sleep(20)
Errors:
Code:
ERROR: LoadError: Cannot locate artifact 'electronjs_app' for x86_64-unknown-freebsd-libgfortran5-cxx11-julia_version+1.9.4
ERROR: LoadError: Cannot locate artifact 'electronjs_app' for x86_64-unknown-freebsd-libgfortran5-cxx11-julia_version+1.9.4
ERROR: LoadError: Failed to precompile PlotlyJS
Note : this works fine on artix linux.

Should i enter a PR ? Where ?
 
Julia is interesting to do math & work on large datasets, to do statistics.
But nothing functional , nor object-oriented.
To plot there is gadlfly,makie,pyplot.
 
Julia can do far more than plots :) It's a really good match for low-level programming of graphic cards outside the CUDA hell.

> But nothing functional , nor object-oriented.

Julia is extremely expressive. Julia is homoiconic, with full lisp-style macros. It also has multiple dispatch, which is a far more general technique that OO single-dispatch.
 
Installing the "plot" library works fine.
Code:
using Pkg
Pkg.update()
Pkg.add("FFMPEG")
Pkg.add("Plots")
Running the plot library gives errors:
Code:
using Plots
x = range(0, 10, length=100)
y1 = sin.(x)
y2 = cos.(x)
p=plot(x, [y1,y2],title="Tutorial",xlabel="x",ylabel="y")
savefig(p,"p.png")
display(p)
sleep(10)
Error:
Code:
ERROR: LoadError: InitError: could not load library "/home/x/.julia/artifacts/ce9ecc22b48f5833c1b89a75263d1d57ab64585a/lib/libfreetype.so"
Shared object "libz.so.1" not found, required by "libfreetype.so"
ERROR: LoadError: Failed to precompile libass_jll
ERROR: LoadError: Failed to precompile FFMPEG_jll
ERROR: LoadError: Failed to precompile FFMPEG
ERROR: LoadError: Failed to precompile FFMPEG
Note this works fine on Artix-linux.

It is because julia from packages is built to use system zlib, which is libz.so.6, while the libraries in the artifacts are built against zlib shipped with julia, which is libz.so.1. Using patchelf to use libz.so.6 instead of libz.so.1 makes some libraries in the artifacts work, but some libraries demand zlib version not wrapped in the system zlib and do not work. You could either
  • Install matplotlib and use PyPlot.jl. (it works)
  • Install julia officially distributed from julialang.org.
 
I have submitted lang/julia update to 1.10.3 and it is now committed. I have addressed this problem with zlib in this update. So, when 1.10.3 package comes, you will be able to use Plots.jl.
I am using Julia 1.10.2 from the Julia website. One problem that I have with Plots.jl is that when you try installing it, Julia's pkg system insists on downloading an entire X server and a big set of supporting libraries, to ensure version compatibility. So it is almost duplicating your entire X window system. I find this entirely unacceptable.
(This is a more general issue with system libraries.)

Does your 1.10.3 version do anything about this issue?
 
No, as long as you install precompiled library from julia's package system, it will install all the "artifacts" (binary libraries) it depends on. If you want to avoid this, you should get the source code of Plots.jl and install dependencies from FreeBSD's packages and build Plots.jl by yourself.
 
No, as long as you install precompiled library from julia's package system, it will install all the "artifacts" (binary libraries) it depends on. If you want to avoid this, you should get the source code of Plots.jl and install dependencies from FreeBSD's packages and build Plots.jl by yourself.
Hmm, thanks. I was afraid of that. I've also tried Overrides.toml, but couldn't get it to work.
 
Back
Top