Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alea GPU Tutorial not compiling on VS 2015 Update 2 with FSharp.Core 4.4.0.0

Tags:

c#

f#

aleagpu

I am getting error while compiling Alea GPU Tutorial: https://github.com/quantalea/AleaGPUTutorial in Visual Studio 2015 Community Update 2 with FSharp.Core version 4.4.0.0 on a .Net 4.5 runtime.

Fody: An unhandled exception occurred: Exception: Could not load file or assembly 'FSharp.Core, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

StackTrace:

at Alea.CUDA.AOTCompileLogger..ctor(List`1 logs, Int32 warningCount, Int32 errorCount)
at Alea.CUDA.AOTCompileLogger..ctor()
at Alea.CUDA.AOTCompiler..ctor()
at Alea.CUDA.Fody.ModuleWeaver.Execute()
at lambda_method(Closure , Object )
at InnerWeaver.ExecuteWeavers() in c:\Code\Fody\FodyIsolated\InnerWeaver.cs:line 164
at InnerWeaver.Execute() in c:\Code\Fody\FodyIsolated\InnerWeaver.cs:line 82
Source:
Alea.CUDA
TargetSite:
Void .ctor(System.Collections.Generic.List`1[Alea.CUDA.AOTCompileLogEntry], Int32, Int32)   

It happens both in Tutorial.Cs and Tutorial.Fs project, no matter how I set up the bindingRedirect option in all possible .config files. It looks like those redirects are ignored by Fody reference loading mechanism.

However, even setting the tutorial solution to FSharp.Core 4.3.1.0 does not allow me to compile it. The error is the same.

Do you have any ideas on how to fix it?

like image 811
TermoTux Avatar asked Apr 02 '16 11:04

TermoTux


1 Answers

I've built it successfully few times but they were completely random and I could not figured out what caused error disappearing.

Perhaps it was some combination of restarting Visual Studio as administrator many times.

Also I've tried FSharp.Core.dll from different sources with random results too:

  • http://www.nuget.org/packages/FSharp.Core/
  • Visual F# Tools 4.0 RTM
  • ./packages/Alea.CUDA/tools/

Official

In AleaGPUTutorial it is written:

Before building within Visual Studio, it is recommended that you restore the packages prior to opening the solution. This is due to a known issue of using Fody with F# projects. You can find further details about this issue in the installation manual (especially the Remarks section)).

From the Manual:

Alea GPU is implemented with F#, so it uses the F# runtime. If you use Alea GPU from C# or VB, you also need version 3.1 or higher of FSharp.Core.dll assembly. If you use Visual Studio, you can locate that assembly by navigating to Add Reference -> Assemblies -> Extensions -> FSharp.Core 4.3.1.0. Alternatively, you can add FSharp.Core NuGet package to your project.

I did exactly what is written but got only random build success again.

Last Hope

How to use FSharp.Core 4.3.0 when all you have is 4.3.1

I had lived with the naïve assumption that when you install F# 3.1, it would automatically add redirects from FSharp.Core 4.3.0.0 to 4.3.1.0, or perhaps make sure that FSharp.Core 4.3.0.0 was also available. Apparently, I've become too used to Semantic Versioning, which is definitely not the versioning scheme used for F#

like image 73
Brains Avatar answered Oct 27 '22 13:10

Brains