How to use Eclipse with Hyrax Source Code

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽

This presents one way to set up Eclipse to build, edit, debug, etc., the Hyrax source code. It's based on our previous how to documents, but is updated for (and maybe specific to) OSX 10.10, Eclipse 4.4 (Luna) and CDT 8.5. There are many things about Eclipse that can be pretty obscure, not the least of which is that Eclipse & CDT are not really 'just Eclipse' but may have specific configuration nuances. This is almost certainly not the only way to set this tool up to build the Hyrax code, just one way.

The set up assumes that you have already cloned the hyrax repo from GitHub (https://github.com/opendap/hyrax.git) and have run source spath.sh and ./hyrax_clone.sh so that the $PATH and $prefix environment variables are set and the libdap, bes and olfs repos have all been cloned. For most development, it's a good idea to clone hyrax-dependencies too.

General Eclipse configurations

These are not specific to our project, but they are very useful and somewhat hard to sort out.

  • How to set up PATH so the CDT build (which uses an external program) reads from the PATH you want instead of the default PATH
  • How to get the editor in CDT to save before building code

The git perspective

What I've done to make projects that use the existing C++ code repos cloned from GitHub was to first use the git perspective to add the repo to Eclipse.

Switch to the git perspective using either the icon/toll-bar item on the right side of the main window or by going to the Window -> Open Perspective menu item.

Perspective views are accessed using either the rightmost set of icons or the Window menu

Once the Eclipse window is showing the git perspective, you'll see something like the following: Git Repo Perspective.png

Use the Add existing git repository icon to add an existing git repo.

Add Existing Repo.png

The result looks like:

Once Added.png

Make the projects

Follow theses steps to make a new project using the repo you just added to the git perspective.