CogComp / lbjava

Learning Based Java (LBJava)
http://cogcomp.cs.illinois.edu/page/software_view/LBJava
Other
13 stars 17 forks source link

Generate source files from .lbj during compile phase. #42

Closed bhargav closed 8 years ago

bhargav commented 8 years ago

mvn compile at root-level builds all three projects and generates sources for the examples project using the latest LBJava code.

Pending: lbjava:generate and lbjava:compile commands do not work currently as the plugin is never installed or fetched from repo. Investigating if we can do this as part of build process itself.

bhargav commented 8 years ago

So the workflow would look like this:

To compile the super project, from the root directory: mvn compile -> This will build LBJava, Lbjava-Maven-Plugin and then use the plugin to generate lbj source. After this, the lbjava-examples project is compiled with the generated code.

To do a lbjava:compile for the lbjava-examples, you'll have to install the plugin locally first using mvn -pllbjava-maven-plugin -am install in the root directory. This will build the plugin and install that to the local m2 repo.

After this, you can do a mvn lbjava:compile inside the lbjava-examples directory to compile lbjava plugins.

yj14n9xyz commented 8 years ago

@danyaljj @bhargav @christos-c Maybe we can keep the compiling script, as it can compile examples individually.

christos-c commented 8 years ago

@yimingjiang I don't mind compiling all the examples at once, since at this phase it will only generate the sources and not retrain. @bhargav So there is no way to install the plugin from the main build script and add the lbjava:generate goal to the generate-sources phase?

danyaljj commented 8 years ago

@bhargav @christos-c is there any unresolved discussion in this PR?

christos-c commented 8 years ago

I think I discussed this with @bhargav and it looked like it was a good solution. However, I would like to see the complete sequence of steps before I accept this. @bhargav do you mind changing the README to reflect these changes?

bhargav commented 8 years ago

Yes. I'll update the readme. I am currently struck at the compile script. Removing the "lib/" folder and using maven exec:java or something equivalent.

bhargav commented 8 years ago

This is ready now. All lbjava-examples related commands need to run from the root directory now.

At the root directory, mvn compile => Generate all .lbj and compile all projects

mvn compile -P generate-train-examples => Generate all .lbj, train all classifiers and compile all projects

mvn compile -P generate-train-examples,spam => Generate all .lbj, train the spam classifier only and compile all projects.

Defined profiles for all examples that we currently have. This removes the lbjava-examples/libs folder and compile script. 💯

bhargav commented 8 years ago

Semaphore currently fails during test with a gurobi/GRBException Will have a look at it later today.

danyaljj commented 8 years ago

Rather than then Gurobi hook (which needs license) you can use OjAlgoHook: https://github.com/IllinoisCogComp/lbjava/blob/master/lbjava-examples/src/main/lbj/SetCover.lbj#L19

And I don't know what this wasn't failing before...

danyaljj commented 8 years ago

And you should update Semaphore commands according to your changes:

screen shot 2016-04-11 at 4 50 43 pm
bhargav commented 8 years ago

So the fix doesn't work with older versions of maven (I tried 3.2.3) due to the String[] representation in a pom file.

danyaljj commented 8 years ago

Looking good to me. Merge call with @christos-c !

christos-c commented 8 years ago

I get an java.lang.UnsupportedClassVersionError: edu/illinois/cs/cogcomp/lbjava/frontend/GenerateParserAndSymbols : Unsupported major.minor version 52.0 when I run mvn clean compile