Can fsi work with runtime 4.0 in the MAC OS, and if so, how to configure it

Own explanatory ...

I get many errors when trying to access 4.0 dll in FSI. Therefore, instead of going through each, I think this question is correct.

This is a reposition of more or less my question here in F # on MAC OSX and Ubuntu. I get an error when starting FSI in 4.0

thanks

Gary

Change I am trying to run the following in a demo on my MacBook with Mono 2.8 and fsharp. (The code was chosen by someone else)

open System.Numerics open System let maxIteration = 100 let modSquared (c : Complex) = c.Real * c.Real + c.Imaginary * c.Imaginary type MandelbrotResult = | DidNotEscape | Escaped of int let mandelbrot c = let rec mandelbrotInner z iterations = if(modSquared z >= 4.0) then Escaped iterations elif iterations = maxIteration then DidNotEscape else mandelbrotInner ((z * z) + c) (iterations + 1) mandelbrotInner c 0 for y in [-1.0..0.1..1.0] do for x in [-2.0..0.05..1.0] do match mandelbrot (Complex(x, y)) with | DidNotEscape -> Console.Write "#" | Escaped _ -> Console.Write " " Console.WriteLine () 
+4
source share
2 answers

I downloaded the zip binaries and tried to run version 4.0 on macOS. Initially, I get the same error as you (could not find BigInteger ). This can be fixed by adding the -I command line argument, but then I got another error, and I'm still not sure what to do about it:

 fsmac:fsharp4 tomas$ mono Fsi.exe -I:/Library/Frameworks/Mono.framework/Versions/2.8/lib/mono/4.0/ Microsoft (R) F# 2.0 Interactive build 4.0.30319.1 Copyright (c) Microsoft Corporation. All Rights Reserved. For help type #help;; > error FS0192: internal error: unreachable: GetGlobals 

EDIT Here is another attempt (failed attempt). This looks like a Mono error, because the UnsafeLoadFrom method does not seem to exist in Mono (runtime 4.0). At least I don't see this in the MonoDevelop IDE in C # projects (when changing the runtime to 4.0)

 fsmac:fsharp4 tomas$ mono --runtime=v4.0.30319 Fsi.exe --noframework -r:/Library/Frameworks/Mono.framework/Versions/2.8/lib/mono/4.0/mscorlib.dll -r:FSharp.Core.dll Microsoft (R) F# 2.0 Interactive build 4.0.30319.1 Copyright (c) Microsoft Corporation. All Rights Reserved. For help type #help;; > Missing method System.Reflection.Assembly::UnsafeLoadFrom(string) in assembly /Library/Frameworks/Mono.framework/Versions/2.8/lib/mono/4.0/ mscorlib.dll, referenced in assembly /Users/tomas/Programs/fsharp4/ FSharp.Compiler.dll 
+2
source

You should try installing F # assemblies in the GAC. For this:

  • Open terminal
  • Change to the directory where you downloaded the F # distribution, and then cd to bin/
  • Install each dll in gacutil using gacutil

$ cd FSharp-2.0.0.0/bin/; for a in *.dll; do sudo gacutil -i $a; done

You might want to do the same with PowerPack.

Good luck.

0
source

All Articles