fslaborg / FSharp.Charting

Charting library suitable for interactive F# scripting
http://fslab.org/FSharp.Charting/
Other
212 stars 67 forks source link

Unable to find the file 'OxyPlot.dll' on OS X #52

Open jmchapman opened 10 years ago

jmchapman commented 10 years ago

I have mono 3.8, I am running F# interactive from within emacs on OS X mavericks.

I downloaded FSharp.Charting.Gtk.0.90.7 from nuget. I put it in ~/Desktop/packages/. I have a script containing the following at ~/Desktop/test.fsx:

load "packages/FSharp.Charting.Gtk.0.90.7/FSharp.Charting.Gtk.fsx"

open FSharp.Charting Chart.Line [ for x in 0 .. 10 -> x, x*x ]

Trying to run the three lines above gives the following error:

"> [Loading /Users/james/Desktop/packages/FSharp.Charting.Gtk.0.90.7/FSharp.Charting.Gtk.fsx]

/Users/james/Desktop/packages/FSharp.Charting.Gtk.0.90.7/FSharp.Charting.Gtk.fsx(28,1): warning FS0211: The search directory '/usr/lib/mono/gtk-sharp-2.0' could not be found 2014-09-05 12:49:13.471 mono[7211:d07] *\ WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.

namespace FSI_0002.FSharp.Charting val verifyMac : unit -> bool val isMac : bool module FsiAutoShow = begin end

/Users/james/Desktop/stdin(0,1): error FS0078: Unable to find the file 'OxyPlot.dll' in any of /Library/Frameworks/Mono.framework/Versions/3.8.0/lib/mono/4.5 /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gtk-sharp-2.0 /Users/james/Desktop/packages/FSharp.Charting.Gtk.0.90.7/. /Users/james/Desktop/ /Library/Frameworks/Mono.framework/Versions/3.8.0/lib/mono/4.0/ Stopped due to error"

I created symbolic links to OxyPlot.dll and OxyPlot.GtkSharp.dll in /Users/james/Desktop/packages/FSharp.Charting.Gtk.0.90.7/. I then get the following error and and a something called mono-sgen appeared in my dock:

"> [Loading /Users/james/Desktop/packages/FSharp.Charting.Gtk.0.90.7/FSharp.Charting.Gtk.fsx]

/Users/james/Desktop/packages/FSharp.Charting.Gtk.0.90.7/FSharp.Charting.Gtk.fsx(28,1): warning FS0211: The search directory '/usr/lib/mono/gtk-sharp-2.0' could not be found 2014-09-05 14:24:36.773 mono[7551:d07] *\ WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.

namespace FSI_0002.FSharp.Charting val verifyMac : unit -> bool val isMac : bool module FsiAutoShow = begin end

Binding session to '/Users/james/Desktop/packages/FSharp.Charting.Gtk.0.90.7/./OxyPlot.dll'... Binding session to '/Users/james/Desktop/packages/FSharp.Charting.Gtk.0.90.7/./OxyPlot.GtkSharp.dll'...

val it : FSharp.Charting.ChartTypes.GenericChart = Error: An exception was thrown by the type initializer for Gtk.Widget

"

rneatherway commented 10 years ago

There is some inconsistency between script resolution rules on Mono and .NET. Could you try opening FSharp.Charting.Gtk.0.90.7/FSharp.Charting.Gtk.fsx, sending the whole lot to FSI and then going back to your chart file and sending that without the initial #load?

This is not a good workaround, but I want to check that it works ok in that case.

haf commented 10 years ago

Doing that gives you:

> Chart.Line [ for x in 0 .. 10 -> x, x*x ];;
val it : ChartTypes.GenericChart =
  Error: An exception was thrown by the type initializer for Gtk.Widget
essenciary commented 9 years ago

Problem still persists - been trying everything, can't get it to run, hanging on mono-sgen

evolvedmicrobe commented 9 years ago

The Gtk.Widget issue looks like a duplicate of issue #29