my steps to build graal in eclipse
Doug Simon @ Oracle
doug.simon at oracle.com
Thu Mar 7 10:35:56 PST 2013
On Mar 7, 2013, at 5:58 PM, "Venkatachalam, Vasanth" <Vasanth.Venkatachalam at amd.com> wrote:
> I am able to successfully build the Graal Java sources in Eclipse. Below are the steps I followed.
> There are slight differences from the wiki instructions at https://wikis.oracle.com/display/OpenJDK/Eclipse
> In the Eclipse import step, I actually did Import->Existing Projects Into Workspace instead of Import->Mercurial->Projects from Local Repository.
Yes, that's a better alternative as it avoids a bug in the import functionality of MercurialEclipse where it doesn't recognize projects that have already been imported. At the same time, it still recognizes that the imported projects are in a Mercurial repository.
> Also I’ve indicated below which directory to select as the root directory for the import, and what projects appear in the Eclipse window when you select this.
> I think it would be useful to mention these details on the wiki. One of the steps that confused me was the one that said “Click theBrowse... button to choose the $GRAAL directory”.
The $GRAAL directory (as stated at the top of the wiki page) is the top level one.
> There are two graal/ directories, a top level one which contains agent/, hotspot, visualizer., etc. and a subfolder within it also called graal/, containing just the Graal api packages. I was initially unsure which of these should be the root directory for the import, but finally selected the latter one graal/graal/ and everything worked.
If you select the top level directory (i.e. $GRAAL), you'll also import the Eclipse projects configurations for the C++ code (i.e. $GRAAL/hotspot/.project) and those for the Python projects (i.e. mxtool/.project and mx/.project). Importing these is not necessary if you are not going to edit anything in these projects - the 'mx build' command builds the C++ sources anyway.
> Doug, I would be happy to update your wiki instructions with additional clarifying details based on my approach . I think this will be helpful for others.
> Let me know if I may go ahead and do so.
Fine by me.
> 1Create a folder “mygraal” and into it a do a fresh clone. This could be anywhere on your disk.
> At the end of the clone you should see the subdirectory mygraal/graal/ which contains the folders agent/, graal/, hotspot/ etc.
> 2) cd into mygraal/graal/ directory and run ./mx.sh ideinit.
> 3) Install Eclipse and edit eclipse.ini to specify the JVM version that Eclipse will be run with.
> 4) Start Eclipse and create an eclipse workspace in a directory of your choice. I did this in a different directory graalworkspace/.separate from the folder where I’ve checked out graal.
> 5) Install the Eclipse-CS, CDT and MercurialEclipse plugins if you have not done so.
> 5) In the Eclipse file menu, Import->Existing Projects Into Graal.
> Eclipse will ask to select the root directory of the projects to import.
> Select the directory, mygraal/graal/graal/. Note: this is the subfolder within the top level graal/ directory which contains only the Graal related APIs such as com.oracle.graal.alloc, com.oracle.graal.compiler.amd64, etc.
> After you have selected this as the root directory, in the eclipse window you should see all the folders within mygraal/graal/graal/ appear as separate projects. Deselect the com.oracle.truffle.* projects as they are not needed for the build, but make sure everything else is selected. Hit finish.
> 6) Eclipse will automatically build the Graal Java sources with no further configuration needed.
More information about the graal-dev