How to use Eclipse with Hyrax Source Code: Difference between revisions

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
Line 26: Line 26:
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.  
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.  


[[File:Perspective Menu.png|frameless|Perspective views are accessed using either the rightmost set of icons or the Window menu]]
[[File:Perspective Menu.png|frame|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: [[File:Git Repo Perspective.png]]
Once the Eclipse window is showing the ''git'' perspective, you'll see something like the following: [[File:Git Repo Perspective.png]]

Revision as of 05:36, 12 January 2015

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.

Configure your mac

Assuming you've used our other instructions to configure a machine to build our source (mostly OS/X and Linux just build it, but there are some wrinkles like using really recent versions of auto{conf,make} and libtool and bison 3), you will need to configure your machine to find these new tools. By default they install in /usr/local/bin, so this needs to be on the PATH used by Eclipse.

OS/X

Unfortunately, Apple has changed how to modify the PATH passed to GUI applications that are not started from a terminal window with each of the last several OS releases. I have only OS/X Yosemite (10.10) to test on; information about other versions will be based on techniques I remember (but without any testing).

Yosemite (10.10)

You can use launchctl setenv variablename value to set a variable so that is picked up by all applications (graphical applications started via the Dock or Spotlight, in addition to those started via the terminal).

Obviously you will not want to do this every time you login. To avoid this, launch Script Editor (the AppleScript editor; in Utilities), enter a command like this (Use multiple lines if you want to set multiple variables):

do shell script "launchctl setenv variablename value"

Now save (⌘+s) as File format: Application. Finally open System Settings → Users & Groups → Login Items and add your new application. (Answer courtesy of StackFrame)

Global Eclipse configurations

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