How to install PowerPack on mono for Linux?

366 views
Skip to first unread message

let rec

unread,
Dec 2, 2012, 10:52:12 AM12/2/12
to fsharp-o...@googlegroups.com
I managed to build it, but not sure how to install.
There's no script provided in the repo.

Don Syme

unread,
Dec 2, 2012, 12:57:46 PM12/2/12
to fsharp-o...@googlegroups.com
There's no real installation - just reference the built DLLs directly and copy them locally.

To enable MSBuild support for FsLex and FsYacc if using .fsproj files, I believe you do this:
  - put all the FsLex.exe, FsYacc.exe, FSharp.PowerPack.Build.dll and FSharp.PowerPack.targets files in one directory
  - reference the FSharp.PowerPack.targets file explicitly from your .fsproj
  - add the settings here https://github.com/fsharp/fsharp/blob/master/src/FSharpSource.targets#L479 to your .fsproj to indicate the location of FsYacc and FsLex.

Kind regards
Don



From: fsharp-o...@googlegroups.com [fsharp-o...@googlegroups.com] on behalf of let rec [shwe...@gmail.com]
Sent: 02 December 2012 16:52
To: fsharp-o...@googlegroups.com
Subject: How to install PowerPack on mono for Linux?

I managed to build it, but not sure how to install.
There's no script provided in the repo.

--
--
You received this message because you are subscribed to the Google
Groups "FSharp Open Source Community" group.
To post to this group, send email to fsharp-o...@googlegroups.com
To unsubscribe from this group, send email to
fsharp-opensou...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/fsharp-opensource?hl=en
 
 
 

let rec

unread,
Dec 4, 2012, 11:09:47 AM12/4/12
to fsharp-o...@googlegroups.com
Hi Don,

I followed the steps you recommended:
copied all PowerPack related files, which I built from sources into one directory

% ls ../../../powerpack
FSharp.Compiler.CodeDom.dll
FSharp.Compiler.CodeDom.dll.mdb
FSharp.PowerPack.Build.Tasks.dll
FSharp.PowerPack.Build.Tasks.dll.mdb
FSharp.PowerPack.Compatibility.dll
FSharp.PowerPack.Compatibility.dll.mdb
FSharp.PowerPack.dll
FSharp.PowerPack.dll.mdb
FSharp.PowerPack.Linq.dll
FSharp.PowerPack.Linq.dll.mdb
FSharp.PowerPack.Metadata.dll
FSharp.PowerPack.Metadata.dll.mdb
FSharp.PowerPack.Parallel.Seq.dll
FSharp.PowerPack.Parallel.Seq.dll.mdb
FSharp.PowerPack.targets
fslex.exe
fslex.exe.mdb
FsLex.xml
fsyacc.exe
fsyacc.exe.mdb
FsYacc.xml

and put the following lines into my fsproj
  </PropertyGroup>
  <PropertyGroup>
    <FsSrGenToolPath>..\..\..\powerpack</FsSrGenToolPath>
    <FsLexToolPath>..\..\..\powerpack</FsLexToolPath>
    <FsYaccToolPath>..\..\..\powerpack</FsYaccToolPath>
    <FsLexToolExe>fslex.exe</FsLexToolExe>
    <FsYaccToolExe>fsyacc.exe</FsYaccToolExe>
  </PropertyGroup> 
  <PropertyGroup>
    <FsLexOutputFolder>$(IntermediateOutputPath)</FsLexOutputFolder>
    <FsYaccOutputFolder>$(IntermediateOutputPath)</FsYaccOutputFolder>
  </PropertyGroup>
  <Import Project="$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets" Condition="!Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll')" />
  <Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets" Condition="Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll')" />
  <Import Project="..\..\..\powerpack\FSharp.PowerPack.targets" />

but it fails to build with the following error
        No input files were specified for target GenerateSatelliteAssemblies, skipping.
        Target CallFsLex:
                Tool ../../../powerpack/fslex.exe execution started with arguments: -o Lexer.fs --unicode  Lexer.fsl
                compiling to dfas (can take a while...)
FSLEX: error FSL000: The macro difit is not defined
        Task "FsLex" execution -- FAILED

This is how I refer to my source files
  <ItemGroup>
    <FsLex Include="Lexer.fsl">
      <OtherFlags>--unicode</OtherFlags>
    </FsLex>
    <FsYacc Include="Parser.fsy">
      <OtherFlags>--module Parser</OtherFlags>
    </FsYacc>
    <Compile Include="$(IntermediateOutputPath)Parser.fs">
      <Visible>false</Visible>
      <Link>Parser.fs</Link>
    </Compile>
    <Compile Include="$(IntermediateOutputPath)Lexer.fs">
      <Visible>false</Visible>
      <Link>Lexer.fs</Link>
    </Compile>
    <Compile Include="Ast.fs" />
    <Compile Include="Program.fs" />
  </ItemGroup>

Are there any other steps required?

Thanks,
Andrew

Jack Pappas

unread,
Dec 4, 2012, 1:54:40 PM12/4/12
to fsharp-o...@googlegroups.com
Andrew,

Did you see the error message hidden in there?


FSLEX: error FSL000: The macro difit is not defined
        Task "FsLex" execution -- FAILED

Cheers,
Jack

Don Syme

unread,
Dec 4, 2012, 4:07:24 PM12/4/12
to fsharp-o...@googlegroups.com

I believe your .fsproj is set up correctly.

 

As Jack says it looks like you have a mistake in your Lexer.fsl file.  Does this succeed when you run it from the appropriate directory?

 

mono ../../../powerpack/fslex.exe -o Lexer.fs --unicode  Lexer.fsl

Cheers!

Don

let rec

unread,
Dec 5, 2012, 9:08:46 AM12/5/12
to fsharp-o...@googlegroups.com
It was indeed a typo in my lexer. Thanks for the hint!
Having got it fixed I came across another one in FsYacc:
FSYACC: error FSY000: Method not found: 'System.Type.op_Equality'.
I recompiled it against v4.0 and the issue got resolved and my project builds fine.
But now I'm getting
Missing method Microsoft.FSharp.Text.Parsing.Tables<Parser.token>::Interpret<[1]>(FSharpFunc`2<LexBuffer`1<!!0>, !0>,LexBuffer`1<!!0>,int)
when I run my exe.

Regards,
Andrew

Jack Pappas

unread,
Dec 6, 2012, 8:17:02 AM12/6/12
to fsharp-o...@googlegroups.com
When you say "I recompiled it against v4.0" -- what is it that you recompiled? Your project? fsyacc?

Did you also recompile/retarget the FSharp.PowerPack assembly? FSharp.PowerPack contains the interpreters for the lexer and parser tables, and if you haven't recompiled it for .NET 4.0 then the metadata won't quite match up so -- causing your .exe to crash at run-time because it can't resolve the method reference.

Cheers,
Jack

let rec

unread,
Dec 6, 2012, 12:07:26 PM12/6/12
to fsharp-o...@googlegroups.com
I recompiled the FsYacc project against 4.0 to get FsYacc.exe working.
Doing the same for FSharp.PowerPack.dll resolves the issue with my exe.
See https://github.com/fsharp/powerpack/pull/16 for the details.
Finally everything seems to work for me, using the whole stack (mono, F#, PowerPack) built on my machine.
Should other PowerPack dlls, which depend on FSharp.PowerPack.dll target 4.0 as well?

Regards,
Andrew

Jack Pappas

unread,
Dec 6, 2012, 4:21:43 PM12/6/12
to fsharp-o...@googlegroups.com
You only need to retarget the other DLLs to .NET 4.0 if you're planning to use them. If you're only using the Powerpack for fslex/fsyacc, then you already have everything you need.

-- Jack
Reply all
Reply to author
Forward
0 new messages