Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IMP » LPG and building IMP from source
LPG and building IMP from source [message #690953] Thu, 30 June 2011 13:13 Go to next message
Tero HasuFriend
Messages: 2
Registered: June 2011
Junior Member
I'm trying to build IMP from SVN trunk source, but I'm having some problems with getting LPG to generate compatible ASTs. Which version of the LPG generator executable are you using for IMP development, and with what command-line options?
Re: LPG and building IMP from source [message #691577 is a reply to message #690953] Fri, 01 July 2011 18:56 Go to previous messageGo to next message
Robert M. Fuhrer is currently offline Robert M. FuhrerFriend
Messages: 294
Registered: July 2009
Senior Member
I'm traveling right now, so I can't check easily, but I *think* the latest LPG on SourceForge (2.0.22) should work with the latest LPG tooling that comes with IMP (org.eclipse.imp.lpg.ide) and should generate reasonable ASTs.

Can you give more details on the problems you're having?

BTW, there's a new release of LPG (2.0.23) imminent with a couple more bug fixes. There's also some work afoot to generate better AST classes (e.g., with a better API for things like boolean-, integer-, and enum-valued non-terminals) which we hope to get out in the next couple of months or so.
Re: LPG and building IMP from source [message #695357 is a reply to message #691577] Mon, 11 July 2011 15:15 Go to previous messageGo to next message
Tero HasuFriend
Messages: 2
Registered: June 2011
Junior Member
I tried using LPG 2.0.22 but as the compiler binary of that one is giving

  *** glibc detected *** lpg-linux_x86_64: double free or corruption (!prev): 0x00000000019b7ce0 ***


I'm instead using the latest LPG straight from CVS. I've built the binary, and have the lpg.runtime and lpg.runtime.java packages in my workspace.

Also, I've checked out wala 1.2.2 from SVN, and have com.ibm.wala.shrike in my workspace. In addition I've installed Polyglot and SDF/BOX tools from the IMP update site. With these I'm hoping I have all the IMP dependencies.

After having brought IMP code into my workspace straight from SVN there are errors say in org.eclipse.imp.box, such as

  Description	Resource	Path	Location	Type
The return type is incompatible with List<ASTNode>.add(ASTNode)	AbstractASTNodeList.java	/org.eclipse.imp.box/src/org/eclipse/imp/box/parser/Ast	line 29	Java Problem


and I might assume that these are due to an incompatibility with lpg.runtime. So if I then try recompiling all the IMP .g files using a matching version of the LPG compiler

  for f in `find -type d -name .svn -prune -o -type d -name bin -prune -o -type f -name '*.g' -print`; do (cd `dirname $f` && lpg-run `basename $f`); done


where lpg-run runs

  lpg-linux_x86_64 -rule_classnames=stable "-include-directory=.;..;$HOME/bin/lpg-templates;$HOME/bin/lpg-include" $*


where lpg-templates and lpg-include points to the LPG CVS head templates and includes respectively. This results in a rather lengthy 'svn diff' but more or less the same set of files, and there are still some errors, although far fewer than before, errors such as

  Description	Resource	Path	Location	Type
The method add(ASTNode) in the type AbstractASTNodeList is not applicable for the arguments (IBox)	BoxInterpreter.java	/org.eclipse.imp.box/src/org/eclipse/imp/box/interpreter	line 459	Java Problem


which I'm guessing is an IMP incompatibility with lpg.runtime.

But after this experiment I've learned that the IMP packages that are building should be enough to build Rascal from SVN (which is what I actually want to do), so all is well enough.
Re: LPG and building IMP from source [message #695547 is a reply to message #695357] Tue, 12 July 2011 00:43 Go to previous message
Robert M. Fuhrer is currently offline Robert M. FuhrerFriend
Messages: 294
Registered: July 2009
Senior Member
First off, thanks for the bug reports!

On 7/11/11 11:15 AM, Tero Hasu wrote:
> I tried using LPG 2.0.22 but as the compiler binary of that one is giving
>
>
> *** glibc detected *** lpg-linux_x86_64: double free or corruption (!prev): 0x00000000019b7ce0 ***

Ah, yes, sorry about that -- there was indeed a latent bug that resulted from
attempting to use an already-closed file handle, which could cause symptoms
like the one you encountered. It's been fixed in CVS HEAD, and today I released
LPG 2.0.23, which includes the fix.

> I'm instead using the latest LPG straight from CVS. I've built the binary, and have the lpg.runtime and lpg.runtime.java
> packages in my workspace.
>
> Also, I've checked out wala 1.2.2 from SVN, and have com.ibm.wala.shrike in my workspace. In addition I've installed
> Polyglot and SDF/BOX tools from the IMP update site. With these I'm hoping I have all the IMP dependencies.
>
> After having brought IMP code into my workspace straight from SVN there are errors say in org.eclipse.imp.box, such as
>
>
> Description Resource Path Location Type
> The return type is incompatible with List<ASTNode>.add(ASTNode) AbstractASTNodeList.java
> /org.eclipse.imp.box/src/org/eclipse/imp/box/parser/Ast line 29 Java Problem
>
>
> and I might assume that these are due to an incompatibility with lpg.runtime. So if I then try recompiling all the IMP
> .g files using a matching version of the LPG compiler

Yes, it's entirely possible that the IMP Box plugin isn't quite up to date wrt
the LPG runtime. It just needs to have the parser re-generated from the grammar
file. I'll fix that ASAP.

> for f in `find -type d -name .svn -prune -o -type d -name bin -prune -o -type f -name '*.g' -print`; do (cd `dirname $f`
> && lpg-run `basename $f`); done
>
>
> where lpg-run runs
>
>
> lpg-linux_x86_64 -rule_classnames=stable "-include-directory=.;..;$HOME/bin/lpg-templates;$HOME/bin/lpg-include" $*
>
>
> where lpg-templates and lpg-include points to the LPG CVS head templates and includes respectively. This results in a
> rather lengthy 'svn diff' but more or less the same set of files, and there are still some errors, although far fewer
> than before, errors such as
>
>
> Description Resource Path Location Type
> The method add(ASTNode) in the type AbstractASTNodeList is not applicable for the arguments (IBox) BoxInterpreter.java
> /org.eclipse.imp.box/src/org/eclipse/imp/box/interpreter line 459 Java Problem
>
>
> which I'm guessing is an IMP incompatibility with lpg.runtime.
>
> But after this experiment I've learned that the IMP packages that are building should be enough to build Rascal from SVN
> (which is what I actually want to do), so all is well enough.

--
Cheers,
-- Bob

--------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center

IDE Meta-tooling Platform Project Lead (http://www.eclipse.org/imp)
X10: Productive High-Performance Parallel Programming (http://x10-lang.org)
Previous Topic:LPG editor text coloring
Next Topic:Using JavaCC with IMP?
Goto Forum:
  


Current Time: Mon Dec 22 18:36:23 GMT 2014

Powered by FUDForum. Page generated in 0.02113 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software