X10DT development setup

The following describes the procedure for setting up an Eclipse development environment to build and debug the X10DT.

Part 0 : Set up your Eclipse workbench

Note that this is starting with an entirely new Eclipse installation and workspace.

  1. Make sure you have at least Java 1.6.
  2. Install Eclipse 4.4.2 Luna IDE for Java Developers
  3. Install the Eclipse PDE (Plugin Development Environment) via Eclipse Update
  4. Install SWTBot (an Eclipse UI testing framework) via Eclipse Update.
  5. Finish the install as above, and restart Eclipse when asked.

Part 1: Install the X10DT prereqs

Really, the easiest way to get all the prereqs is to install the X10DT itself into your development workbench. However, this might possibly interfere with normal workbench operation, so instead, we opt to install just the prerequisites.

  1. Download the latest X10DT update site zip from  our file downloads. Select the most recent release, and download x10dt-update-site-VERSION.zip.
  2. As above, go to "Help" -> "Install New Software".
  3. Click on the "Add..." button next to the "Work with:" field.
  4. Click on "Archive..." and find the update site zip you just downloaded. Give the location any name you wish, and click "Ok".
  5. Install the following features from this update site zip. To see these individual features, uncheck the "Group items by category" box in the "Install New Software" dialog.
    1. IMP Runtime
    2. IMP Support for Java-Hosted Languages
    3. IMP Program Analysis
    4. LPG Runtime
    5. ANTLR Runtime
    6. X10 WALA
  6. Finish the install and restart Eclipse when asked.
  7. Install PTP (Eclipse Parallel Tools Platforms) via Eclipse Software Update

Part 2: Get the source code for X10 and the X10DT

Our goal is to checkout pretty much all the projects from the X10 and X10DT git repositories and get them into our Eclipse workspace.

If you are most comfortable using command line tools, clone the X10 GitHub git repository at https://github.com/x10-lang/x10.git and the X10DT GitHub git repository at https://github.com/x10-lang/x10dt.git. Then import all of the Eclipse projects found in the two repositories into your workspace using the "Import existing projects into the workspace" wizard.

If you are most comfortable doing things in Eclipse, do the following steps

  1. Go back to the Plug-in Development or JDT perspective.
  2. Checkout the x10dt_project_sets project from X10DT git at https://github.com/x10-lang/x10dt.git
  3. Right click on x10core-25.psf and select "Import Project Set..."
  4. Right click on x10dt-25.psf and select "Import Project Set..."

Part 3: Build the X10 Runtime

  1. Go to a console window, cd to the x10.dist project directory in your workspace. (Note: this step requires Internet access, as it pulls down jars for its dependencies from the web.)
    1. ant dist update-host-fragment
  2. Note: This will take a few minutes. This includes building the X10 runtime for both the Java and C++ back-ends. It also copies certain key bits from the x10.dist project that you just built (like the "include" and "lib" folders that contain the X10 runtime's platform-specific headers and libraries) to the right spot in the platform fragment project. This is necessary to run the X10DT and perform local C++ back-end builds and launches.
  3. Once this is done, select the "x10.runtime", "x10.compiler", and "x10.dist" projects in the Package Explorer and invoke "Refresh" from the context menu. This gets Eclipse to "notice" a few .java files in the X10 runtime that got generated from .x10 source files.
  4. Go to Preferences -> Plugin Development -> API Baselines. Change the options for Missing API Baselines to Ignore.
  5. Your workspace projects should now all be compiling cleanly.
If you update the X10 core projects, you need to rebuild it from the console and refresh the workspace so eclipse will see the new versions
  1. In a console do: ant squeakyclean dist update-host-fragment
  2. Refresh your workspace in Eclipse (so it sees the new generated artifacts) and let it build.

Launching a runtime workbench (testing X10DT from your development workbench)

  • If all is well, everything should now be building and not bleeding red
    • if there are still any (red) compile errors, go back and fix them ...
  • Run
    • Open run launch config dialog (Run > Run Configurations...)
    • Make a new "Eclipse Application" configuration; call it e.g. "x10dt"
      • Give it a clean (new) workspace location
      • More heap space recommended: On the Arguments tab, add this to VM Arguments: -Xmx512m
    • Click Run
    • In the new Eclipse workbench that launches
      • Open the X10 Perspective
      • "New" > "X10 project (Java back-end)"; give it a name e.g. "Hello"
      • Source file Hello.x10 opens in an editor
      • Saving it starts a build.
      • To see any errors that we log (for the brave), Open Error Log view: Window > Show View > Other... and under General (or, in older Eclipses, "PDE runtime"), select "Error Log"
        • Most are not fatal
      • To Run, Open Run Dialog... and create a new config for "X10 Application"
        • On Main tab, fill in"Project:" (use Browse...) ; fill in "Main Class:" (use Search... should find e.g. Hello$Main ... just Hello will work too)
        • Click 'Run' and the program should execute and print output in the Console view

Reference

IMP instructions - somewhat outdated but may still be useful