Setting up an IDE under Linux and OS X

When Ulambator is being adapted or configured a Development Environment is useful. Apart from text editing it provides highlighting, autocompletion and debugging capabilities.

During development we used Xcode, which is an optional part of Apples OS X system. We recommend to configure your case with Xcode. Once the case works well the code can be compiled and executed from the command line.

A Linux alternative is Eclipse, where we will try to sketch the basic steps. Under Windows you can run Xcode with an OS X virtual machine or Eclipse.

Xcode configuration

Create a Project:

     – Start Xcode and click “Create a new Xcode project”.
     – Under OS X Application, chose “Command Line Tool”.
     – Name the Product “Ulambator” and set the Language to C++.
     – Place it in a convenient spot.

Adding files:

     – Copy the files from source, except combase_cote.cpp, into your Xcode Ulambator folder.
     – Drag and drop those files into the Project Navigator (left side).
     – Copy the tutorial files into the Xcode Ulambator folder (no drag and drop into Xcode).

Setting up the project:

     – In the left menu; Right-click on main.cpp and chose “Show File Inspector”.
     – In the top-right menu (File Inspector); click on the folder sign below “Location Relative to …” and specify a tutorial file from the Ulambator source.
     – Click on the blue Ulambator icon in the Project Navigator (left side). Go to “Build Setting” and set the “C++ Standard Library” to “libstdc++ GNU C++”.
     – Toggle from Basic to All (top-left) and add to “Other Linker Flags” the line “-llapack -lblas”. You have to click on the plus and write for Debug and Release.

If you specify relative paths in Ulambator (e.g.  “~/output”) you may go to the menu bar, click File -> Project Setting and specify a costom location. The executable and output will be created at the specified location in the subfolder “Ulambator…/Build/Project/Debug”.
Alternatively you can provide an absolute path in Ulambator (e.g. “/home/genghis/output”). Be aware that absolue path may cause problems when you execute your code on a different computer.

Running the project:

In the menu bar View -> Debug Area, click Show Debug Area.
In the menu bar, Product -> Build compiles the program and Product -> Run executes the program.
You can now pause the execution with the pause buttom in the debug area (bottom-left) or set break points by clicking on the line numbers next to the source code. This allows to check what part of the code is being executed and to see the value of the variables.

Eclipse Configuration

Make sure you installed Eclipse for C++ and not for Java.
In the menu bar click File -> Import… And chose under C/C++, “Existing Code as Makefile Project”.
Name the project Ulambator, provide the code location and set the language to C++.

According to our humble experience this allows to compile and run the tutorials. However the question how to select a specific main file and how to create break points is at this point not clear.

This part still needs improvement.