blob: 7e6b84c2f766aab2b3fa0ecc78ddf5449b7e1871 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright (c) 2010 - 2019 TU Wien ACIN, fortiss GmbH
2019 Johannes Kepler University Linz
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.
SPDX-License-Identifier: EPL-2.0
Contributors:
Carolyn Oates, Alois Zoitl, Monika Wenger, Jose Cabral
- initial API and implementation and/or initial documentation
Bianca Wiesmayr
- adapting, restructuring and extending the installation tutorial
-->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Using Eclipse</title>
<link rel="stylesheet" type="text/css" href="../help.css">
</head>
<body>
<h1 id="topOfPage">Compiling and Debugging 4diac FORTE with Eclipse</h1>
<h2>Get C/C++ support for Eclipse</h2>
<ol>
<li>Unless you already use Eclipse, for example to build 4diac IDE from source, download <a href="http://www.eclipse.org/downloads/" target="_blank">Eclipse for C/C++ Developers</a> and unzip the file to a suitable location (e.g., <span class="folderLocation">C:\eclipse</span>).
Otherwise you can integrate C/C++ functionality into your Eclipse installation by <span class="menu4diac">Help &rarr; Install New Software</span>, choosing your Eclipse version (1) and checking <span class="menu4diac">Programming Languages &rarr; C/C++ Development Tools</span> (2).
<div><img src="../../html/installation/img/eclipseInstallNewSoftware.png" alt="Install new software in Eclipse"/></div></li>
<li>Restart <span class="fileLocation">eclipse.exe</span></li>
<li>Choose a workspace directory.
This will be the directory where your C/C++ projects will be located.
It is recommended to set the workspace folder one level above the entire source code folder.
Please avoid any spaces in its names. Otherwise you might get problems when compiling 4diac FORTE.</li>
</ol>
<h2>Compile 4diac FORTE with Eclipse</h2>
<p>The build process is described in the <a href="../../html/installation/install.html#FORTEsteps">installation tutorial</a>.
Perform the steps described there but consider the following adaption:</p>
<ul>
<li>When generating a project with CMake you must choose the correct project type.
You need to direct CMake to creating an Eclipse project.
This depends also on the compiler you installed.
For MinGW and Cygwin, it is Eclipse CDT 4 - Unix Makefiles.</li>
</ul>
Then compile the project as follows:
<ol>
<li>Import 4diac FORTE by <span class="menu4diac">File &rarr; Import... &rarr; General &rarr; Existing Project into Workspace</span>.
If your Workspace is one folder above your source code folder you only have to click on <span class="button4diac">Browse...</span> and <span class="button4diac">OK</span> afterwards to import 4diac FORTE into Eclipse.
Otherwise, select the directory where you have extracted your 4diac FORTE and check <span class="menu4diac">Copy into workspace</span> (otherwise the source will stay at the original place).</li>
<li>Start Make Targets View by <span class="menu4diac">Window &rarr; Show View &rarr; Build Targets</span> unless it is open already.
Double-click the makefile: <span class="fileLocation">bin/[YOUR_SYSTEM]/all</span> to compile 4diac FORTE to an executable application.
If you don't see the targets (all or clean), you can create them in the same window.
Make sure that you create them in the correct folder.
<div><img src="../../html/installation/img/eclipseMakefiles.png" alt="Eclipse C++ with FORTE imported and marked makefiles"></div></li>
</ol>
<h2>Debug FORTE with Eclipse</h2>
<p>For debugging your own Function Blocks, go through the following steps:</p>
<ol>
<li>Set a breakpoint in the source code file of the desired Function Block.</li>
<li>Go to <span class="menu4diac">Run &rarr; Debug Configurations...</span></li>
<li>Right click on <span class="menu4diac">C/C++ Application &rarr; New</span>. In the <span class="tab4diac">Main</span> tab, you should fill the <span class="specificText">C/C++ Application:</span> with the binary file you generated (normally <span class="folderLocation">FORTE_FOLDER_ROOT/bin/[YOUR_SYSTEM]/src/forte[.exe]</span>). In the <span class="tab4diac">Debugger</span> tab, choose your desired debugger. In Windows you normally use Cygwin or MinGW (you have to install them in order for them to appear in the selection box).
<div><img src="../../html/installation/img/eclipseLaunchDebug.png" alt="Eclipse Launch Debug Configuration Selection"></div></li>
<li>Click <span class="button4diac">Debug</span>.</li>
<li>Confirm for changing into the Debug view.</li>
<li>If you don't see the file where the debugger stopped at the beginning, press the <span class="button4diac">Locate File</span> button (1) and navigate to the Eclipse workspace which contains the extracted 4diac FORTE, type <span class="specificText">main</span> into the search field of the Windows Explorer and select <span class="fileLocation">main.cpp</span>. 4diac FORTE is now stopped at the <span class="specificText">main()</span> function.
<div><img src="../../html/installation/img/eclipseDebug.png" alt="Eclipse C++ Debug View"></div></li>
<li>Press the <span class="button4diac">Resume</span> button (2) to run 4diac FORTE and observe the behavior of your application.</li>
<li>Always press the <span class="button4diac">Terminate</span> button for stopping a 4diac FORTE launched within Eclipse.
This avoids 4diac FORTE running in the background (not always shown in Task Manager).</li>
</ol>
<h1 id="whereToGoFromHere">Where to go from here?</h1>
<p>If you want to build a 4diac FORTE, here is a quick link back:</p>
<p><a href="../../html/installation/install.html">Install Eclipse 4diac</a></p>
<p>After you installed all required tools, it's time to start using them. Take a look at the following page:</p>
<p><a href="../../html/4diacIDE/overview.html">Step by step tutorial</a></p>
<p>If you want to go back to the Start Here page, we leave you here a fast access</p>
<p><a href="../../html/startHere/startHere.html">Start Here page</a></p>
<p class="goToTop">Or <a href="#topOfPage">Go to top</a></p>
</body>
</html>