Using Merlin with ECLIPSE
As many developers and script writers alike prefer using an IDE rather than the bare command line, this page details how to get Merlin++ up and running within the Eclipse CDT IDE.NOTE: The following assumes you have followed through the Installation guide, i.e. you have installed all prerequisites and have had Merlin++ successfully installed and tested via make test.
Install ECLIPSE
If your system already has ECLIPSE installed you can skip this step.- Download .tar.gzi Eclipse IDE for C/C++ Developers from here
-
Uncompress and then remove the .tar.gz file with
sudo tar -xvf eclipse.cpp...tar.gz
sudo rm eclipse.cpp...tar.gz -
Move the eclipse file to your prefered install location, (default is /opt/) with
sudo mv -r ./eclipse /opt -
Configure the eclipse launch command
sudo cd /usr/local/bin
sudo ln -s /opt/eclipse/eclipse
Set up MERLIN as a Project
You just do this once-
Launch eclipse
eclipse
and provide an appropriate workspace name -
Install cmake4eclipse plugin through the Eclipse Marketplace
- Go to > Help > Eclipse Marketplace
- search for and install cmake4eclipse
- agree to licence and select ’Install Anyway’ if prompted
- Configure Eclipse Console
While on ‘Console’ tab, click on the drop down menu at far right > select ‘1 C\C++ Build Console’ to display all make outputs -
Configure the Merlin++ Project
- > File > New > C/C++ project
- Select ‘All’ > ‘C++ Managed Build’
- Enter a suitable Project name, such as ‘Merlin++’
- Uncheck ‘Use default location’ and enter Merlin++ source directory > /home/username/git/Merlin++
- Select ‘Executable > Empty Project’ and ‘Linux GCC’
- Click ‘Finish’
- Your should now have a project ‘Merlin++ [Merlin++ Release-5.02]’
- Right-click project, select Properties
- Go to ‘C/C++ Build’
- IMPORTANT: For all of the following you must do for both Debug and Release configurations seperately (drop down menu at the top) - [All configurations] options is not supported.
- Select the behaviour tab and check ‘Enable parallel build’
- Go to ‘C/C++ Build > Tool Chain Editor’ and set ‘Current builder:’ to ‘CMake Builder (portable)’, click ‘Apply’
- Click ‘Apply and Close’
- Click ‘Apply and Close’
- Build Merlin++ using the hammer icon on the main workspace toolbar
-
Configure and run the Merlin++ test suite within Eclipse CDT
- Open, by double-clicking, the new ‘build > Release > Makefile’ in the project directory
- From the ‘Outline’ tab on the far right of your workspace, scroll down to find ‘test’. Right-click ‘test’ and select ‘Add build Target’, click ‘Apply’ on pop-up (keep defaults). You may close ‘Makefile’
- A new ‘build > Release > Build Targets > test’ file should now be available in your project directory. Double-click ‘test’ to run the test suite.
- If configuration was successful, all tests should pass as before