Fsharp.Charts.Gtk on ubuntu?

148 views
Skip to first unread message

Greg Young

unread,
Mar 2, 2016, 1:04:11 PM3/2/16
to F# Discussions
Has anyone successfully gotten FSharp.Charts working on ubuntu?

stock mono (xamarin package)

needs gtk-sharp so installed gtk-sharp2 package.

have FSharp.Charts.Gtk from nuget package.

/home/greg/src/chart-example/FSharp.Charting.Gtk.0.90.12/FSharp.Charting.Gtk.fsx(33,1):
error FS0078: Unable to find the file 'glib-sharp.dll' in any of
 /usr/lib/mono/4.5
 /home/greg/src/chart-example/FSharp.Charting.Gtk.0.90.12
 /home/greg/src/chart-example
 /usr/lib/cli/fsharp/


glib-sharp.dll is in the gac. copying the .dll to any of these paths is apparently not enough.

Greg

Gauthier Segay

unread,
Mar 2, 2016, 1:19:09 PM3/2/16
to fsharp-o...@googlegroups.com
Greg, I haven't had chance to try it, but you should give a shot at
adding #I "path/with/glib-sharp.dll"

Also, maybe messing with System.Environment.CurrentDirectory if #I
doesn't work, just to help identify the issue.
> --
> --
> To post, send email to fsharp-o...@googlegroups.com
> To unsubscribe, send email to
> fsharp-opensou...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/fsharp-opensource
> ---
> You received this message because you are subscribed to the Google Groups
> "F# Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fsharp-opensou...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jason Imison

unread,
Mar 2, 2016, 1:22:14 PM3/2/16
to fsharp-o...@googlegroups.com

Greg Young

unread,
Mar 2, 2016, 1:50:45 PM3/2/16
to fsharp-o...@googlegroups.com
As I am sure people will come across this in the future:

#I "/usr/lib/cli/glib-sharp-2.0/";;
#I "/usr/lib/cli/atk-sharp-2.0/";;
#I "/usr/lib/cli/gdk-sharp-2.0";;

(I just picked random locations where they were, I have plenty and
these were shorter than going into the gac)

I am guessing then the .fsx does some "magic" to try to find things ...

> #load "FSharp.Charting.Gtk.0.90.12/FSharp.Charting.Gtk.fsx";;
[Loading /home/greg/src/chart-example/FSharp.Charting.Gtk.0.90.12/FSharp.Charting.Gtk.fsx]


/home/greg/src/chart-example/FSharp.Charting.Gtk.0.90.12/FSharp.Charting.Gtk.fsx(28,1):
warning FS0211: The search directory '/usr/lib/mono/gtk-sharp-2.0'
could not be found


/home/greg/src/chart-example/FSharp.Charting.Gtk.0.90.12/FSharp.Charting.Gtk.fsx(27,1):
warning FS0211: The search directory
'/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gtk-sharp-2.0'
could not be found
Binding session to '/usr/lib/cli/glib-sharp-2.0/glib-sharp.dll'...



After it works (sort of). My first chart came up quite different than
what the docs say it should:

> let data =
[ "foo", 1024;
"bar", 1234;
"baz", 1456;
"fud", 1777 ];;

Note in chart it uses 1,23,4 on Y axis not the data as in the example:
http://fslab.org/FSharp.Charting/BarAndColumnCharts.html is this a
change in the charting library?

But otherwise it seems to work.

Greg
Studying for the Turing test
Screenshot from 2016-03-02 20-47-17.png

Gauthier Segay

unread,
Mar 2, 2016, 2:16:39 PM3/2/16
to fsharp-o...@googlegroups.com
It seems this should be adjusted/extended:

https://github.com/fslaborg/FSharp.Charting/blob/master/src/FSharp.Charting.Gtk.fsx#L28

apparently, mono changed location of assemblies to /usr/lib/cli/

Greg Young

unread,
Mar 2, 2016, 5:55:29 PM3/2/16
to fsharp-o...@googlegroups.com
I must still be missing something here (perhaps its a very old version
of something?) because the charts don't act like in the examples eg:

> let data =
- [("foo", 1234);
- ("bar", 1543);
- ("baz", 3251);
- ("boo", 1523)];;

or

> let data =
- ["foo", 1234;
- "bar", 1543;
- "baz", 3251;
- "boo", 1523];;

Still result in numbers being drawn for the X/Y axis in Column/Bar
chart. According to docs its should the the first value.

Do I have something out of date or are the docs out of date and there
is a new way?

Jacqueline Homan

unread,
Mar 2, 2016, 6:22:31 PM3/2/16
to F# Discussions
Hi Greg,

I loaned my Ubuntu laptop (which has Monodevelop on it for F#)  out to a mentee of mine who had no computer for learning programming, and am now down to my Debian-Linux desktop and my Macbook Pro laptop. I have not yet gotten around to test driving FSharp.Charts on my Linux desktop, but since Ubuntu is actually a Debian flavor of Linux, this is something we might be able to accomplish if you want to take a crack at it over a Google video chat/screen-sharing session. 
Reply all
Reply to author
Forward
0 new messages