Compiling Leon using Eclipse
If you wish to use eclipse (against all our recommendations), we provide you with a project configuration that should help you get started.
Downloading Eclipse
You will need Eclipse 4.2 Juno:
http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/junosr1
Installing the Scala IDE
You should install the 2.9.* version of the Scala plugin.
Go to Help > Install new software and use this URL:
http://download.scala-ide.org/sdk/e38/scala29/dev/site/
Select Scala IDE for Eclipse and install.
Importing the predefined Eclipse project configuration
The eclipse project files are located inside the sav2013-main repository to which you should have access. This configuration is contained in two files: .project and .classpath
Option 1)
To merge the files automatically, you can use it as an additional remote to your sav2013-groupXX repository:
cd path/to/sav2013-groupXX git remote add upstream git@larasrv05.epfl.ch:sav2013-main git pull upstream master
Note: if you already have .project and .classpath files in your repository, this will most likely conflict.
Option 2)
Clone the main repository on the side and copy the files manually:
git clone git@larasrv05.epfl.ch:sav2013-main cp sav2013-main/.project ... cp sav2013-main/.classpath ...
Option 3)
Copy the files manually:
.project:
<?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>Leon</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.scala-ide.sdt.core.scalabuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.scala-ide.sdt.core.scalanature</nature> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription>
.classpath:
<?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" output="library/target/scala-2.9.2/classes" path="library/src/main/scala/leon"/> <classpathentry kind="src" path="src/main/java"/> <classpathentry kind="src" path="src/main/scala/leon"/> <classpathentry kind="lib" path="unmanaged/64/cafebabe_2.9.2-1.2.jar"/> <classpathentry kind="lib" path="unmanaged/64/scalaz3.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/> <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_COMPILER_CONTAINER"/> <classpathentry kind="output" path="target/scala-2.9.2/classes"/> </classpath>
This project was configured for 64b, for Mac OSX users, you need to replace those 64 by 64-osx.
Importing this project
In Eclipse, go to: File > Import…
Select General > Existing Projects into Workspace, click continue.
Select the path to your sav2013-groupXX directory as “Root directory”, and then select the Leon project. click Finish.
Your newly created Eclipse project should compile.
Running Leon
In order to run Leon within Eclipse, you will need to create a run configuration. Go to Run > Run configurations…
Right-click on Scala Application and select new. Name it “Leon”.
On the Main tab, select leon.Main
as main class.
On the Arguments tab, use one example as ““Program Arguments”, e.g. examples/01_Introduction.scala
On the Environment tab, you will need to create a few environment variables. First, go with a terminal to your project root, and do
$ sbt script $ cat setupenv
You will see a list of 4 environment variables, looking like:
export LD_LIBRARY_PATH="/home/ekneuss/git/sav2/./lib-bin/64" export DYLD_LIBRARY_PATH="/home/ekneuss/git/sav2/./lib-bin/64" export LEON_LIBRARY_PATH="/home/ekneuss/git/sav2/library/target/scala-2.9.2/classes" export SCALA_HOME="/home/ekneuss/.sbt/0.12.1/boot/scala-2.9.2/"
You need to replicate those 4 environment variables in Eclipse with YOUR values. i.e.
LD_LIBRARY_PATH
⇒lib-bin/64
DYLD_LIBRARY_PATH
⇒lib-bin/64
LEON_LIBRARY_PATH
⇒library/target/scala-2.9.2/classes
SCALA_HOME
⇒/path/to/SCALA_HOME/