/* StarPU --- Runtime system for heterogeneous multicore architectures.
 *
 * Copyright (C) 2021       Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
 *
 * StarPU is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or (at
 * your option) any later version.
 *
 * StarPU is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * See the GNU Lesser General Public License in COPYING.LGPL for more details.
 */

/*! \page EclipsePlugin Eclipse Plugin

The StarPU Eclipse Plugin provides the ability to visualise traces directly from the Eclipse IDE.

\section EclipseInstallation Eclipse Installation

Download the Eclipse installer from
https://www.eclipse.org/downloads/packages/installer. When you run the
installer, click on <em>Eclipse IDE for Java Developers</em> to start
the installation process.

\image html eclipse_installer.png
\image latex eclipse_installer.png "" width=10cm

To be able to develop C/C++ applications, you need to install the CDT
plugin. To do so, go to the <em>Help</em> dropdown menu at the top of the
Eclipse window, choose <em>Install New Software ...</em>. In the new
window, enter the URL
http://download.eclipse.org/tools/cdt/releases/9.10
into the box <em>Work with</em> and press the return key.

\image html eclipse_install_cdt.png
\image latex eclipse_install_cdt.png "" width=10cm

You need then to select <em>CDT Main Features</em>, then click the
button <em>Next</em> twice, accept the terms of the license, and click
the button <em>Finish</em>. Eclipse will ask you to restart.

To be able to compile the plugin, you need to install the plugin
development environnement (PDE). To do so, go to the menu
<em>Help</em>, choose <em>Eclipse Marketplace...</em>. In the new
window, enter <em>PDE</em> into the box <em>Find</em> and press the
return key.

\image html eclipse_install_pde.png
\image latex eclipse_install_pde.png "" width=10cm

You can then click on the button <em>Install</em> of the <em>Eclipse
PDE latest</em>. You may need to confirm the installation, then accept
the terms of the license, and finally restart the Eclipse IDE.

The installation is now done.

\section PluginInstallation StarPU Eclipse Plugin Compilation and Installation

StarPU can now be compiled and installed with its Eclipse plugin. To
do so, you first need to configure StarPU with the option \ref
enable-eclipse-plugin "--enable-eclipse-plugin". The Eclipse IDE
executable \c eclipse must be in your \c PATH.

\verbatim
export PATH=$HOME/usr/local/eclipse/java-2021-03/eclipse:$PATH
mkdir build
cd build
../configure --prefix=$HOME/usr/local/starpu --enable-eclipse-plugin
make
make install
\endverbatim

The StarPU Eclipse plugin is installed in the directory \c dropins.

\verbatim
$ ls $HOME/usr/local/eclipse/java-2021-03/eclipse/dropins
StarPU_1.0.0.202105272056.jar
\endverbatim

\section PluginUsage Using The StarPU Eclipse Plugin

You first need to set up your environment for StarPU.

\verbatim
cd $HOME/usr/local/starpu
source ./bin/starpu_env
\endverbatim

The eclipse workspace together with an example is available in \c lib/starpu/eclipse-plugin.

\verbatim
cd ./lib/starpu/eclipse-plugin
eclipse -data workspace
\endverbatim

You can then open the file \c hello/hello.c, and build the application by pressing \c Ctrl-B.

\image html eclipse_hello_build.png
\image latex eclipse_hello_build.png "" width=10cm

The application can now be executed.

\image html eclipse_hello_run.png
\image latex eclipse_hello_run.png "" width=10cm

The StarPU plugin eclipse is either available through the icons in the upper toolbar, or from the dropdown menu \c StarPU.

You first need to run the StarPU FxT tool, either through the \c FxT icon, or from the menu \c StarPU / \c StarPU Fxt Tool.
This will call the tool \c starpu_fxt_tool to generate traces for your application execution.

\image html eclipse_hello_fxt.png
\image latex eclipse_hello_fxt.png "" width=10cm

You can then visualise the Paje trace with the tool \c vite, or display the graph task directly from eclipse.

\image html eclipse_hello_graph.png
\image latex eclipse_hello_graph.png "" width=10cm

or through a web browser. From the HTML file, you can see the graph
task, and by clicking on a task name, it will open the C file in which
the task submission was called (if you have an editor which
understands the syntax \c href="file.c#123").

*/
