Hi Luis,

I think this is just a problem of types moving places between last release and the new CTP. FortranMatrix is now defined the namespace "Microsoft.FSharp.NativeInterop" which is in "FSharp.PowerPack.dll". So changing the namespaces and reference should fix this.

By on 9/10/2008 1:34 AM ()

Hi Robert,

Thanks for your reply. I am new to F#, so I wonder if I am overlooking something simple.

Looking at the code in this example (with your comments in mind) it all seems correct, but I still get the same error. Here is what I see:
- I get the error when I send the contents of examples.fsx to F# interactive from within VS2008. In particular, it occurs when #load "library.fs" is executed. In library.fs I see an "open Microsoft.FSharp.NativeInterop" (as you suggested).
- The project has a reference to FSharp.PowerPack. When I view it in the Object Browser I see (as expected) a type called "FortranMatrix<A>" - In spite of this I still get "The type 'FortranMatrix' is not defined." when I send #load "library.fs" to F# interactive. Any ideas? Thanks, Luis

By on 9/10/2008 6:57 AM ()

You need to send

#r "FSharp.PowerPack.dll"

to FSI, or start FSI with the arguments

fsi -r FSharp.PowerPack.dll

Your project has a reference to FSharp.PowerPack, but your FSI session doesn't. FSI doesn't pick up any project settings (except resolving references w.r.t. the current file where the text is being sent from)

Thanks

Don

By on 9/10/2008 8:08 AM ()

Thanks Don.

Referencing the PowerPack DLL from FSI eliminated the original errors -- thanks! Now, as soon as I get to the first line of LAPACK code:

time "500x500 Matrix-Matrix Multiplication using LAPACK.dll: Random *. Random" (fun () -> Random *. Random )

I get the following error:

System.MissingMethodException: Method not found: '!0[,] Microsoft.FSharp.Math.DenseMatrix`1.get_arrDM()'.
at FSI_0002.Microsoft.FSharp.Math.Bindings.LAPACK.NativeUtilities.pinM[T](Matrix`1 m)
at FSI_0002.Microsoft.FSharp.Math.Bindings.LAPACK.MutableMatrixRoutines.mulMM(Matrix`1 A, Matrix`1 B, Matrix`1 C) in C:\Program Files\FSharp-1.9.6.2\FSharpSamples\Math\NativeCodeBindingTutorial\library.fs:line 355
at FSI_0002.Microsoft.FSharp.Math.Bindings.LAPACK.ImmutableMatrixRoutines.mulMM(Matrix`1 A, Matrix`1 B) in C:\Program Files\FSharp-1.9.6.2\FSharpSamples\Math\NativeCodeBindingTutorial\library.fs:line 408
at FSI_0012.time[T,U](T s, FastFunc`2 f) in C:\Program Files\FSharp-1.9.6.2\FSharpSamples\Math\NativeCodeBindingTutorial\examples.fsx:line 62
at <StartupCode$FSI_0014>.$FSI_0014._main()

I assume that now I need to find a native LAPACK.dll (and a BLAS.dll), right? Assuming this is the problem, I'm not sure what would be a good place to get these DLLs. As I mentioned earlier, the University of Tennessee offers some precompiled libraries but they are not DLLs.

Apologies for these very basic questions.

Thanks again,

Luis

By on 9/10/2008 10:59 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper