Open sdmcallister opened 2 years ago
Ouch, this is the downside of adding geom_smooth
(#127). geom_smooth
internally uses BLAS to solve a linear least squares problem for the Savitzky-Golay filters.
I didn't quite realize that dead code elimination wouldn't actually eliminate the dependency, as long as geom_smooth
is not used. :/ Especially for Windows is a bit of a pain.
The "solution" for you would be to get BLAS & LAPACK running on Windows... But that's not really a good solution as the dependency really shouldn't be there unless the relevant functionalities are used. The offending code is here:
https://github.com/Vindaar/ggplotnim/blob/master/src/ggplotnim/postprocess_scales.nim#L505-L533
(and the filledSmoothGeom
below that calling it of course).
I will try to come up with a solution somehow.
edit:
In the CI I use msys2
to install the dependencies, see here:
https://github.com/Vindaar/ggplotnim/blob/master/.github/workflows/ci.yml#L65-L71
I'm not sure if using msys2
could be a (temporary?) solution for you.
edit 2: Curiously though, compiling this example on my linux machine does not lead to a blas or lapack dependence. Not sure if this is Windows fault?
@Vindaar
Just flagging mainly to help target issues that may impact new users, and I appreciate the suggestions. Cairo is a pain on windows, as you warn in the Readme, so I thought I might try it with the vega-lite backend.
Is using Pixie instead of Cairo possible/desirable?
Yes, that was indeed a good idea. In the CI I also use msys2
to install cairo, but there we have at least a few known options so far.
At the moment the Vega-Lite backend is not quite intended as an independent backend to avoid the Cairo dependency. While that would be possible, I simply didn't have that in mind when writing the code. So currently you'll still end up with a libcairo dependency even if you only call the Vega-Lite backend (at least I think so).
However, you can already achieve Cairo less compilation, if you compile with -d:noCairo
, which replaces the actual ginger
Cairo backend with a dummy backend. But since it's not needed for the Vega-Lite backend that should just work.
Confusingly I just checked whether compilation with -d:noCairo
does indeed get rid of the cairo dependency, but for some reason it still shows up via objdump
/ ldd
and I have no clue why right now. I'm a bit stumped. (see edit below)
On another note, I just realized (from looking at the Nimble file) that for the Windows CI I also compile with -d:lapack=liblapack
because apparently the naming is different (at least for the msys2
lapack).
And regarding a Pixie backend: this is in the works by @zetashift. An example plot using that backend can be found here: https://github.com/Vindaar/ginger/pull/28#issuecomment-929948989
edit: Just dug into the spurious cairo appearance. Yeah, the reason for suddenly depending on cairo even if compiling with -d:noCairo
is simply because we use the webview
library. It uses gtk on linux, which depends on cairo.
It's very simple to just offer a pure JSON / HTML based output version of the Vega-Lite backend, if so desired (that already exists using ggvegaCreate
which returns a JsonNode
, but not in such a way to avoid a webview
dependency).
PR #143 adds a -d:nolapack
option to disable geom_smooth
and with it the LAPACK dependency. This isn't a perfect solution, but it's at least a workaround.
PR #143 adds a
-d:nolapack
option to disablegeom_smooth
and with it the LAPACK dependency. This isn't a perfect solution, but it's at least a workaround.
PR #143 is now merged and v0.5.0
tagged. Hopefully compiling with -d:nolapack
should yield no lapack dependency anymore.
Running windows 10, Nim 1.6
Successfully installed ggplotnim:
Tried to run:
got: