Difference: EclipseTutorial (1 vs. 14)

Revision 142012-07-12 - MarcoClemencic

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 114 to 114
  Now we are ready to build: right-click again on the project and select Build Project (you can see the compilation going on in the Console tab at the bottom).
Changed:
<
<
The package Tutorial/EclipseTutorial doesn't compile (on purpouse). You can see the error in the bottom pane in the tab Problems.
>
>
The package Tutorial/EclipseTutorial doesn't compile (on purpose). You can see the error in the bottom pane in the tab Problems.
 Double-clicking on the problem will open the problematic file highlighting the line that caused the error. If you click on the two horizontal arrows at the top of the Project Explorer view (Link with Editor), the project explorer will show where the file you are currently editing is in the project hierarchy. %IMAGE{"snap_08.png" type="frame"
Line: 189 to 189
 

Development of LHCb Plugins

The LHCb Eclipse plug-ins are available for developers to allow for contribution.
Changed:
<
<
To set up the development environment to work on the plugins, you have to install the Plugin Development Environment (PDE) in your Eclipse.
>
>
To set up the development environment to work on the plugins, you have to install the Plugin Development Environment (PDE) in your Eclipse (you can find more informations on the eclipse web site). warning: you cannot use the shared installation on AFS because it doesn't have the PDE plugins.

Start Eclipse. I suggest to start from an empty workspace, at least the first time.

From the File menu, select Import..., then choose Team Project Set as project source in the dialog. Click Next and use this URL: http://cern.ch/lhcbproject/GIT/LHCbEclipsePlugins.psf. When you click Finish, Eclipse will get the sources of all the plugins as projects in your workspace (note that they are GIT repositories).

I cannot explain how to develop Eclipse plugins, for that you have the Eclipse documentation.

 

More Topics (TO-DO list)

  • Interaction with Subversion

Revision 132012-07-11 - MarcoClemencic

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 186 to 186
 

Running Eclipse on lxplus via VNC (for slow connections)

Follow the instructions at RemoteLxplusConsoleHowTo then start Eclipse on the terminal window you get in the virtual display.
Added:
>
>

Development of LHCb Plugins

The LHCb Eclipse plug-ins are available for developers to allow for contribution.

To set up the development environment to work on the plugins, you have to install the Plugin Development Environment (PDE) in your Eclipse.

 

More Topics (TO-DO list)

  • Interaction with Subversion
  • Advanced debugging

Revision 122011-11-10 - ChristopherRJones

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 20 to 20
  This software tutorial concentrates on how to use Eclipse within the LHCb software environment. But first you should know what eclipse actually is, how to use it in general, and what different things it can be used for!
Changed:
<
<
If you're already a user of eclipse, you can skip this part, if not, see the EclipeBasicTutorial.
>
>
If you're already a user of eclipse, you can skip this part, if not, see the EclipseBasicTutorial.
 

Forewords

Before proceeding, you need Eclipse.

Revision 112011-11-10 - RobLambert

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 16 to 16
  You also need the standard LHCb environment when you start Eclipse. So, if you are not running on lxplus, you need to call LbLogin before starting eclipse (at the current state of the local installation, you may need to specify the full path to the eclipse executable).
Changed:
<
<
--++ Basic introductions to Eclipse
>
>

Basic introductions to Eclipse

  This software tutorial concentrates on how to use Eclipse within the LHCb software environment. But first you should know what eclipse actually is, how to use it in general, and what different things it can be used for!

Revision 102011-11-10 - RobLambert

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 16 to 16
  You also need the standard LHCb environment when you start Eclipse. So, if you are not running on lxplus, you need to call LbLogin before starting eclipse (at the current state of the local installation, you may need to specify the full path to the eclipse executable).
Added:
>
>
--++ Basic introductions to Eclipse

This software tutorial concentrates on how to use Eclipse within the LHCb software environment. But first you should know what eclipse actually is, how to use it in general, and what different things it can be used for!

If you're already a user of eclipse, you can skip this part, if not, see the EclipeBasicTutorial.

 

Forewords

Before proceeding, you need Eclipse.

Revision 92011-09-13 - MarcoClemencic

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 178 to 178
 

Other Topics

Running Eclipse on lxplus via VNC (for slow connections)

Changed:
<
<
Most of the steps explained here are not Eclipse specific, so can be used to run any graphical session on lxplus from a remote (thin) client.

VNC is a standard protocol to allow interaction with a graphical session on a remote host. The advantages of VNC with respect to the plain X11 protocol are:

  • performance: VNC sessions are still usable over slow connections
  • portability: VNC server and clients are available for Linux, Mac and Windows

There is an interesting alternative to VNC that is called NoMachine NX, but it's not available on lxplus.

The basic prerequisite is to have a VNC viewer installed on the client machine (desktop, laptop, etc.). Several viewers are available for Linux (e.g. krdc for KDE, gtk-vnc for Gnome, xvncviewer...), Windows (TightVNC...) and Mac. If you do not want to install a viewer, it is enough to have a web browser with Java enabled.

First thing you have to log on lxplus.

Special care is needed the first time you start the vncserver:

  • it will ask you to set a password to access the server, it will be transmitted in clear text so choose a password only for this purpose; it is stored in a file in $HOME/.vnc so vncserver will not ask again
  • it will also create a file called $HOME/.vnc/xstartup which is needed to start the graphical session; the problem with it is that it uses twm as window manager, so probably you want to kill the server after the first start and modify that file replacing twm with icewm and restart

When you start the vncserver, you can specify the size of the virtual screen and the color depth. The best choice for the size is to use the same as the one of the client machine, while the color depth depends on the server memory, so you can safely use the maximum (24). For a screen of 1280x800 pixels, for example, use

vncserver -geometry 1280x800 -depth 24

To connect to the server from within the CERN network, you can start your client and pass the string that the server printed when started, e.g.

xvncviewer lxplus247.cern.ch:2
After giving the password to the client, you can (optionally) switch to full-screen mode (on xvncviewer you have to press F8 to access the menu) and start eclipse.

Once you have finished to use the session (you can decide to disconnect the client and reconnect later on if you need), it is better to kill the server with (e.g.):

vncserver -kill :2

Security

When using VNC over an unsecure network or simply from outside the CERN network, you can use ssh to encrypt/tunnel the communication. Details about how to do it are easy to find on the web and some clients can even do it automatically.
>
>
Follow the instructions at RemoteLxplusConsoleHowTo then start Eclipse on the terminal window you get in the virtual display.
 

More Topics (TO-DO list)

  • Interaction with Subversion

Revision 82011-02-24 - MarcoClemencic

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 14 to 14
 
  • getpack
  • cmt
Added:
>
>
You also need the standard LHCb environment when you start Eclipse. So, if you are not running on lxplus, you need to call LbLogin before starting eclipse (at the current state of the local installation, you may need to specify the full path to the eclipse executable).
 

Forewords

Before proceeding, you need Eclipse.

Revision 72011-01-10 - MarcoClemencic

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 38 to 38
 A dialog will ask you to select your workspace. It will propose you the standard cmtuser directory in your home directory Warning, important %IMAGE{"snap_01.png" type="frame"
Changed:
<
<
align="cernter"
>
>
align="center"
  caption="Workspace selection" }% If you use a different location for your $User_release_area, you have to change the workspace location to point to it.
Line: 47 to 47
  %IMAGE{"snap_02.png" type="frame"
Changed:
<
<
align="cernter"
>
>
align="center"
  caption="First time, welcome view" size="67%" }%
Line: 56 to 56
  %IMAGE{"snap_03.png" type="frame"
Changed:
<
<
align="cernter"
>
>
align="center"
  caption="Project / Build Automatically" size="67%" }%
Line: 76 to 76
  From the command prompt, prepare the local project with
Changed:
<
<
SetupProject --build-env LHCb v31r5
>
>
SetupProject --build-env LHCb v31r8
 getpack Tutorial/EclipseTutorial head

Let's go back to the Eclipse window (restart it if necessary).

Changed:
<
<
From the menu File select New, then C++ Project. In the dialog that appears, set LHCb_v31r5 as the name of the project (ignore the warning, that's exactly what we want), then choose Makefile project/Empty Project in the Project type panel (left) and Linux GCC as toolchain (right). When done, click the button Finish.
>
>
From the menu File select Import, then General/Existing Projects into Workspace. In the dialog that appears, click on Browse... and select the directory of your project (LHCb_v31r8), then click the button Finish.
  %IMAGE{"snap_04.png" type="frame"
Changed:
<
<
align="cernter" caption="New C/C++ Project Wizard"
>
>
align="center" caption="Import Existing Project"
  size="67%" }%
Deleted:
<
<
Click with the right button of the mouse on the project that appeared in the left panel LHCb_v31r5 and select Properties from the contextual menu. From the left panel choose Environment in the C/C++ Build group and unset the variables CWD and PWD selecting them and clicking on Undefine.

Click on the Add... button and insert CMTCONFIG as name and ${CMTOPT} as value, then click OK.

snap 05.png
New environment variable
By default, Eclipse append the value you insert to the current value of a variable, so you have always to edit the just added variable to fix it or simply to tell Eclipse that you want exactly that value.
snap 06.png
Edit an environment variable

Let's add few other variables:

  • CMTPROJECTPATH, mandatory if you want to use the nightlies or $LHCBDEV
  • CMTEXTRATAGS, set it to use-distcc on lxplus
  • GAUDI_QMTEST_HTML_OUTPUT, set it to ${ProjDirPath}/test_results/${CMTOPT} (useful for testing)

We can also add another configuration for debugging: click on the button Manage Configurations... and make a new configuration copying the settings from the existing configuration Default (this is proposed default), calling it Debug.

In the environment editor form, select the new created configuration and replace ${CMTOPT} with ${CMTDEB} in the variables CMTCONFIG and GAUDI_QMTEST_HTML_OUTPUT.

 Optionally (mainly if you want to work with many packages), you can go to the properties of the C/C++ Build group itself and in the Behaviour tab select the "parallel build" and the "optimal number of jobs". %IMAGE{"snap_07.png" type="frame"
Changed:
<
<
align="cernter"
>
>
align="center"
  caption="Parallel build configuration" size="67%" }%
Line: 136 to 110
 Double-clicking on the problem will open the problematic file highlighting the line that caused the error. If you click on the two horizontal arrows at the top of the Project Explorer view (Link with Editor), the project explorer will show where the file you are currently editing is in the project hierarchy. %IMAGE{"snap_08.png" type="frame"
Changed:
<
<
align="cernter"
>
>
align="center"
  caption="Compile error" size="67%" }%
Line: 151 to 125
 Right-click on the cmt directory of the package and, from the menu, select Make Targets -> Create.... Fill the dialog choosing the name TestPackage, uncheck Use builder settings, set the name of the builder to cmt and unckeck Run all project builders. %IMAGE{"snap_09.png" type="frame"
Changed:
<
<
align="cernter"
>
>
align="center"
  caption="Custom make target for the tests" size="67%" }%
Line: 161 to 135
 The summary of the tests is visible in the Console view in the bottom pane, but you can use the internal web browser to display the HTML test summary that you can find in the left pane: test_results/.../index.html. Right-click on the file and select Open With -> Web Browser. %IMAGE{"snap_10.png" type="frame"
Changed:
<
<
align="cernter"
>
>
align="center"
  caption="Result of the tests" size="67%" }%
Line: 179 to 153
 Open the file CounterExampleAlg.cpp from the src directory of the package. Using the Outline view in the right pane, look for CounterExampleAlg::initialize and double-click in the gray bar on the left of the editor window at the level of the function definition to set a breakpoint, a small blue dot will appear. %IMAGE{"snap_11.png" type="frame"
Changed:
<
<
align="cernter"
>
>
align="center"
  caption="Setting a breakpoint" size="67%" }%
Line: 193 to 167
 After some time, the debugger will stop at the breakpoint we defined before. %IMAGE{"snap_12.png" type="frame"
Changed:
<
<
align="cernter"
>
>
align="center"
  caption="Hitting a breakpoint" size="67%" }%
Line: 243 to 217
 
Changed:
<
<
-- MarcoClemencic - 03-Dec-2010
>
>
-- MarcoClemencic - 10-Jan-2011
 
META FILEATTACHMENT attachment="snap_01.png" attr="h" comment="" date="1284469345" name="snap_01.png" path="snap_01.png" size="26440" stream="snap_01.png" tmpFilename="/usr/tmp/CGItemp46079" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_02.png" attr="h" comment="" date="1284470137" name="snap_02.png" path="snap_02.png" size="222903" stream="snap_02.png" tmpFilename="/usr/tmp/CGItemp46219" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_03.png" attr="h" comment="" date="1284470993" name="snap_03.png" path="snap_03.png" size="61024" stream="snap_03.png" tmpFilename="/usr/tmp/CGItemp46201" user="clemenci" version="1"
Changed:
<
<
META FILEATTACHMENT attachment="snap_04.png" attr="h" comment="" date="1284474000" name="snap_04.png" path="snap_04.png" size="66106" stream="snap_04.png" tmpFilename="/usr/tmp/CGItemp46136" user="clemenci" version="1"
>
>
META FILEATTACHMENT attachment="snap_04.png" attr="h" comment="" date="1294686385" name="snap_04.png" path="snap_04.png" size="118170" stream="snap_04.png" tmpFilename="/usr/tmp/CGItemp20523" user="clemenci" version="2"
 
META FILEATTACHMENT attachment="snap_05.png" attr="h" comment="" date="1284476615" name="snap_05.png" path="snap_05.png" size="19019" stream="snap_05.png" tmpFilename="/usr/tmp/CGItemp46137" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_06.png" attr="h" comment="" date="1284476969" name="snap_06.png" path="snap_06.png" size="18981" stream="snap_06.png" tmpFilename="/usr/tmp/CGItemp46158" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_07.png" attr="h" comment="" date="1284478927" name="snap_07.png" path="snap_07.png" size="104957" stream="snap_07.png" tmpFilename="/usr/tmp/CGItemp46130" user="clemenci" version="1"
Line: 258 to 232
 
META FILEATTACHMENT attachment="snap_11.png" attr="h" comment="" date="1284485937" name="snap_11.png" path="snap_11.png" size="162341" stream="snap_11.png" tmpFilename="/usr/tmp/CGItemp46242" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_12.png" attr="h" comment="" date="1284486473" name="snap_12.png" path="snap_12.png" size="159438" stream="snap_12.png" tmpFilename="/usr/tmp/CGItemp46222" user="clemenci" version="1"
META FILEATTACHMENT attachment="01-starting.ogv" attr="" comment="" date="1284538950" name="01-starting.ogv" path="01-starting.ogv" size="6849417" stream="01-starting.ogv" tmpFilename="/usr/tmp/CGItemp47106" user="clemenci" version="1"
Changed:
<
<
META FILEATTACHMENT attachment="02-new_project.ogv" attr="" comment="" date="1284538977" name="02-new_project.ogv" path="02-new_project.ogv" size="18605603" stream="02-new_project.ogv" tmpFilename="/usr/tmp/CGItemp47106" user="clemenci" version="1"
>
>
META FILEATTACHMENT attachment="02-new_project.ogv" attr="" comment="" date="1294686408" name="02-new_project.ogv" path="02-new_project.ogv" size="7809518" stream="02-new_project.ogv" tmpFilename="/usr/tmp/CGItemp21102" user="clemenci" version="2"
 
META FILEATTACHMENT attachment="03-building.ogv" attr="" comment="" date="1284538995" name="03-building.ogv" path="03-building.ogv" size="7605436" stream="03-building.ogv" tmpFilename="/usr/tmp/CGItemp47065" user="clemenci" version="1"
META FILEATTACHMENT attachment="04-testing.ogv" attr="" comment="" date="1284539006" name="04-testing.ogv" path="04-testing.ogv" size="6434163" stream="04-testing.ogv" tmpFilename="/usr/tmp/CGItemp47068" user="clemenci" version="1"
META FILEATTACHMENT attachment="05-debugging.ogv" attr="" comment="" date="1284539030" name="05-debugging.ogv" path="05-debugging.ogv" size="23488501" stream="05-debugging.ogv" tmpFilename="/usr/tmp/CGItemp47093" user="clemenci" version="1"

Revision 62010-12-03 - MarcoClemencic

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 200 to 200
  Now you can follow the what is happening in your code. BTW, did you notice the spell checking in the comments? wink
Added:
>
>

Other Topics

Running Eclipse on lxplus via VNC (for slow connections)

Most of the steps explained here are not Eclipse specific, so can be used to run any graphical session on lxplus from a remote (thin) client.

VNC is a standard protocol to allow interaction with a graphical session on a remote host. The advantages of VNC with respect to the plain X11 protocol are:

  • performance: VNC sessions are still usable over slow connections
  • portability: VNC server and clients are available for Linux, Mac and Windows

There is an interesting alternative to VNC that is called NoMachine NX, but it's not available on lxplus.

The basic prerequisite is to have a VNC viewer installed on the client machine (desktop, laptop, etc.). Several viewers are available for Linux (e.g. krdc for KDE, gtk-vnc for Gnome, xvncviewer...), Windows (TightVNC...) and Mac. If you do not want to install a viewer, it is enough to have a web browser with Java enabled.

First thing you have to log on lxplus.

Special care is needed the first time you start the vncserver:

  • it will ask you to set a password to access the server, it will be transmitted in clear text so choose a password only for this purpose; it is stored in a file in $HOME/.vnc so vncserver will not ask again
  • it will also create a file called $HOME/.vnc/xstartup which is needed to start the graphical session; the problem with it is that it uses twm as window manager, so probably you want to kill the server after the first start and modify that file replacing twm with icewm and restart

When you start the vncserver, you can specify the size of the virtual screen and the color depth. The best choice for the size is to use the same as the one of the client machine, while the color depth depends on the server memory, so you can safely use the maximum (24). For a screen of 1280x800 pixels, for example, use

vncserver -geometry 1280x800 -depth 24

To connect to the server from within the CERN network, you can start your client and pass the string that the server printed when started, e.g.

xvncviewer lxplus247.cern.ch:2
After giving the password to the client, you can (optionally) switch to full-screen mode (on xvncviewer you have to press F8 to access the menu) and start eclipse.

Once you have finished to use the session (you can decide to disconnect the client and reconnect later on if you need), it is better to kill the server with (e.g.):

vncserver -kill :2

Security

When using VNC over an unsecure network or simply from outside the CERN network, you can use ssh to encrypt/tunnel the communication. Details about how to do it are easy to find on the web and some clients can even do it automatically.
 

More Topics (TO-DO list)

  • Interaction with Subversion
  • Advanced debugging
  • Templates
  • PyDev
Changed:
<
<
-- MarcoClemencic - 14-Sep-2010
>
>
-- MarcoClemencic - 03-Dec-2010
 
META FILEATTACHMENT attachment="snap_01.png" attr="h" comment="" date="1284469345" name="snap_01.png" path="snap_01.png" size="26440" stream="snap_01.png" tmpFilename="/usr/tmp/CGItemp46079" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_02.png" attr="h" comment="" date="1284470137" name="snap_02.png" path="snap_02.png" size="222903" stream="snap_02.png" tmpFilename="/usr/tmp/CGItemp46219" user="clemenci" version="1"

Revision 52010-10-27 - RobLambert

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.

Revision 42010-09-15 - MarcoClemencic

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 28 to 28
 

First time

Added:
>
>
screencast
 To start eclipse (requires LbScript >= v5r4), just log on lxplus5 an type
eclipse &
Line: 64 to 66
 Now you that we made Eclipse create the configuration files in the workspace, you can go back to the command line prompt.

Create a User Project (setenv<Project> + getpack)

Added:
>
>
screencast
 If you have followed the LHCbSoftwareTutorials, you know about setenv<Project> (AKA SetupProject --build-env) and getpack. Here we will use them to prepare a local project that we will work on using Eclipse.

In this example, we will work with the package Tutorial/EclipseTutorial using the project LHCb.

Line: 124 to 128
 Exit from the Properties dialog with the OK button.

Building

Added:
>
>
screencast
 Now we are ready to build: right-click again on the project and select Build Project (you can see the compilation going on in the Console tab at the bottom).

The package Tutorial/EclipseTutorial doesn't compile (on purpouse). You can see the error in the bottom pane in the tab Problems.

Line: 138 to 144
 Correct the line (m_freq must be replaced with m_frequency), save the modified file (CTRL+s or File->Save or right-click in the editor) and build again.

Running the Tests

Added:
>
>
screencast
 To run the tests of a package you need to call cmt TestPackage in the cmt directory of the package itself. You can tell Eclipse to do it by creating a custom "make target".

Right-click on the cmt directory of the package and, from the menu, select Make Targets -> Create.... Fill the dialog choosing the name TestPackage, uncheck Use builder settings, set the name of the builder to cmt and unckeck Run all project builders.

Line: 162 to 170
 When you run the tests from within an Eclipse project, the GaudiTestingInfrastructure creates launch configurations that can be use to execute the tests bypassing the QMTest wrapping (useful for debugging). You can access the configured launchers from the Run menu.

Debugging

Added:
>
>
screencast
 Eclipse has got a user-friendly graphical front-end to gdb.

First we need to compile in debug mode (using the Debug configuration we set up), so select Build Configurations -> Set Active -> Debug from the project contestual menu (right-click). Build and run the tests (to regenerate the launcher configurations).

Line: 198 to 208
  -- MarcoClemencic - 14-Sep-2010
Deleted:
<
<
META FILEATTACHMENT attachment="01-workspace_selection.png" attr="h" comment="" date="1284469252" name="01-workspace_selection.png" path="snap_01.png" size="26440" stream="snap_01.png" tmpFilename="/usr/tmp/CGItemp47641" user="clemenci" version="2"
META FILEATTACHMENT attachment="03-first_time.png" attr="h" comment="" date="1280523472" name="03-first_time.png" path="03-first_time.png" size="218703" stream="03-first_time.png" tmpFilename="/usr/tmp/CGItemp12964" user="clemenci" version="1"
META FILEATTACHMENT attachment="04-change_svnkit.png" attr="h" comment="" date="1280523487" name="04-change_svnkit.png" path="04-change_svnkit.png" size="78670" stream="04-change_svnkit.png" tmpFilename="/usr/tmp/CGItemp12827" user="clemenci" version="1"
META FILEATTACHMENT attachment="05-disable_automatic_build.png" attr="h" comment="" date="1280523499" name="05-disable_automatic_build.png" path="05-disable_automatic_build.png" size="25800" stream="05-disable_automatic_build.png" tmpFilename="/usr/tmp/CGItemp12929" user="clemenci" version="1"
META FILEATTACHMENT attachment="07-new_cpp_project.png" attr="h" comment="" date="1280523524" name="07-new_cpp_project.png" path="07-new_cpp_project.png" size="65081" stream="07-new_cpp_project.png" tmpFilename="/usr/tmp/CGItemp12879" user="clemenci" version="1"
META FILEATTACHMENT attachment="08-introduce_an_error.png" attr="h" comment="" date="1280523536" name="08-introduce_an_error.png" path="08-introduce_an_error.png" size="141893" stream="08-introduce_an_error.png" tmpFilename="/usr/tmp/CGItemp12922" user="clemenci" version="1"
META FILEATTACHMENT attachment="09-compile_error.png" attr="h" comment="" date="1280523548" name="09-compile_error.png" path="09-compile_error.png" size="142682" stream="09-compile_error.png" tmpFilename="/usr/tmp/CGItemp12856" user="clemenci" version="1"
 
META FILEATTACHMENT attachment="snap_01.png" attr="h" comment="" date="1284469345" name="snap_01.png" path="snap_01.png" size="26440" stream="snap_01.png" tmpFilename="/usr/tmp/CGItemp46079" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_02.png" attr="h" comment="" date="1284470137" name="snap_02.png" path="snap_02.png" size="222903" stream="snap_02.png" tmpFilename="/usr/tmp/CGItemp46219" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_03.png" attr="h" comment="" date="1284470993" name="snap_03.png" path="snap_03.png" size="61024" stream="snap_03.png" tmpFilename="/usr/tmp/CGItemp46201" user="clemenci" version="1"
Line: 217 to 220
 
META FILEATTACHMENT attachment="snap_10.png" attr="h" comment="" date="1284484328" name="snap_10.png" path="snap_10.png" size="137942" stream="snap_10.png" tmpFilename="/usr/tmp/CGItemp46168" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_11.png" attr="h" comment="" date="1284485937" name="snap_11.png" path="snap_11.png" size="162341" stream="snap_11.png" tmpFilename="/usr/tmp/CGItemp46242" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_12.png" attr="h" comment="" date="1284486473" name="snap_12.png" path="snap_12.png" size="159438" stream="snap_12.png" tmpFilename="/usr/tmp/CGItemp46222" user="clemenci" version="1"
Added:
>
>
META FILEATTACHMENT attachment="01-starting.ogv" attr="" comment="" date="1284538950" name="01-starting.ogv" path="01-starting.ogv" size="6849417" stream="01-starting.ogv" tmpFilename="/usr/tmp/CGItemp47106" user="clemenci" version="1"
META FILEATTACHMENT attachment="02-new_project.ogv" attr="" comment="" date="1284538977" name="02-new_project.ogv" path="02-new_project.ogv" size="18605603" stream="02-new_project.ogv" tmpFilename="/usr/tmp/CGItemp47106" user="clemenci" version="1"
META FILEATTACHMENT attachment="03-building.ogv" attr="" comment="" date="1284538995" name="03-building.ogv" path="03-building.ogv" size="7605436" stream="03-building.ogv" tmpFilename="/usr/tmp/CGItemp47065" user="clemenci" version="1"
META FILEATTACHMENT attachment="04-testing.ogv" attr="" comment="" date="1284539006" name="04-testing.ogv" path="04-testing.ogv" size="6434163" stream="04-testing.ogv" tmpFilename="/usr/tmp/CGItemp47068" user="clemenci" version="1"
META FILEATTACHMENT attachment="05-debugging.ogv" attr="" comment="" date="1284539030" name="05-debugging.ogv" path="05-debugging.ogv" size="23488501" stream="05-debugging.ogv" tmpFilename="/usr/tmp/CGItemp47093" user="clemenci" version="1"

Revision 32010-09-14 - MarcoClemencic

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 7 to 7
 
Changed:
<
<

Initial Setup

A shared installation is available for LHCb users on lxplus, but it can be installed on any desktop.
>
>

Prerequisites

You need to be familiar with few LHCb developments concepts and tools:
 
Changed:
<
<
If you are going to install your own copy, follow the steps described in EclipseConfiguration. In that page contains some advanced and very useful configurations that should be followed also when using the pre-installed copy.
>
>

Forewords

Before proceeding, you need Eclipse.
 
Changed:
<
<
To use the shared installation, just connect to lxplus and call
eclipse
(requires LbScript >= v5r4)

A dialog will ask you to select your workspace. Insert the location of your $User_release_area (cmtuser) or any directory of your choice.

01-workspace_selection.png

The first time you create a workspace, Eclipse will show you a welcome page from which you can explore its features. This time we can close it with the button highlighted in the image. Close the Photran 6.0 (FORTRAN support) welcome page too.

03-first_time.png

First thing, from the menu Window choose Preferences. In the list on the left, expand the group Team (with the small triangle) and select SVN. Switch to the tab SVN Connector and select SVNKit 1.1.7 (or at least the one compatible with the version of SVN you have installed, 1.4 on lxplus).

04-change_svnkit.png

From the menu Project, uncheck the entry Build Automatically.

>
>
You can chose between a custom installation and the shared one
  Pros Cons
Custom you can install the plugins you like most and keep them up-to-date you have to install it yourself and you will be probably limited to a single host
Shared pre-defined set of plugins updated more or less regularly can be run from lxplus, lxbuild or a desktop machine
 
Changed:
<
<
05-disable_automatic_build.png
>
>
This tutorial will make use of the shared installation I set up for LHCb for simplicity. Once you are familiar with Eclipse you can install your own copy (see EclipseConfiguration). I will highlight whenever something is specific to the LHCb installation with the symbol Warning, important.
 
Changed:
<
<
Now you that we made Eclipse create the configuration files in the workspace, you can close the application.
>
>
We will also assume we are starting from an empty cmtuser directory.
 
Deleted:
<
<

Create a User Project (setenv + getpack)

If you have followed the LHCbSoftwareTutorials, you know about setenv and getpack. Here we will use them to prepare a local project that we will work on using Eclipse.
 
Changed:
<
<
In this example, we will compile Kernel/LHCbAlgs.

If you decided not to create your workspace in the directory pointed to by $User_release_area, now you have to set that environment variable to the path you have choosen for your workspace.

From the command prompt, prepare the local project with

>
>

First time

To start eclipse (requires LbScript >= v5r4), just log on lxplus5 an type
 
Changed:
<
<
setenvLHCb v31r4 getpack Kernel/LHCbAlgs v2r34p1
>
>
eclipse &
 
Changed:
<
<
Now you can restart Eclipse:
/afs/cern.ch/lhcb/distribution/eclipse/bin/eclipse
>
>
A dialog will ask you to select your workspace. It will propose you the standard cmtuser directory in your home directory Warning, important
snap 01.png
Workspace selection
If you use a different location for your $User_release_area, you have to change the workspace location to point to it.
 
Changed:
<
<
From the menu File select New, then C++ Project. In the dialog that appears, set LHCb_v31r4 as the name of the project (ignore the warning, that's exactly what we want), then choose Makefile project/Empty Project in the Project type panel (left) and Linux GCC as toolchain (right). When done, click the button Finish.
>
>
The first time you create a workspace, Eclipse will show you a welcome page from which you can explore its features. This time we can close it with the button highlighted in the image. Close the Photran 6.0 (FORTRAN support) welcome page too.
 
Changed:
<
<
07-new_cpp_project.png
>
>
snap 02.png
First time, welcome view
 
Changed:
<
<
Click with the right button of the mouse on the project that appeared in the left panel LHCb_v31r4 and select Properties from the contextual menu. From the left panel choose Environment in the C/C++ Build group and unset the variables CWD and PWD selecting them and clicking on Undefine.
>
>
You should uncheck the entry Build Automatically from the menu Project. It is not needed in general, but we need to have it unchecked for the tutorial.
 
Changed:
<
<
Click on the Add... button and insert CMTPROJECTPATH as name of the variable and press enter, then double-click on the entry that has been atted in the table to edit it and just press OK. It is a bit convoluted, but it is what is needed to fix the current value into the project, which is always useful, and mandatory If you specified that you wanted to use the nightlies or $LHCBDEV.
>
>
snap 03.png
Project / Build Automatically
 
Changed:
<
<
Now right-click again on the project and select Build Project (you can see the compilation going on in the Console tab at the bottom).
>
>
From the Window menu select Preferences. Type "Python" in the filter box at the top of the left pane and select Interpreter - Python. For this tutorial you can click on the Auto Config button and accept the default. In some cases it will be necessary to use the actual Python interpreter (the one in the LCG externals), but for now the system one is enough. Click the OK button to store the changes to the configuration.
 
Changed:
<
<

Editing and Compilation Errors

From the panel on the left, you can navigate the tree of directories and files of your project.
>
>
Now you that we made Eclipse create the configuration files in the workspace, you can go back to the command line prompt.
 
Changed:
<
<
Locate LHCb_v31r4/Kernel/LHCbAlgs/src/EvtCounter.cpp and double-click on it, so that the file is opened into the central panel.
>
>

Create a User Project (setenv<Project> + getpack)

If you have followed the LHCbSoftwareTutorials, you know about setenv<Project> (AKA SetupProject --build-env) and getpack. Here we will use them to prepare a local project that we will work on using Eclipse.
 
Changed:
<
<
Edit it introducing a syntax error. You see immediately that Eclipse warns you about it, but let's ignore it and save the modified file (CTRL+s or File->Save or right-click in the editor) and close it.
>
>
In this example, we will work with the package Tutorial/EclipseTutorial using the project LHCb.
 
Changed:
<
<
08-introduce_an_error.png
>
>
Check that the directory pointed to by $User_release_area is the one you used as workspace. If it is not the case, change the value of $User_release_area.
 
Changed:
<
<
Build again and once completed, you will see red crosses in the navigator view on the left. Select the Problems view at the bottom, expand the list of errors and double-click on the first one. Eclipse will open the file with the error and highlight the problematic line, so that you can fix the problem.
>
>
From the command prompt, prepare the local project with
SetupProject --build-env LHCb v31r5
getpack Tutorial/EclipseTutorial head
 
Changed:
<
<
09-compile_error.png
>
>
Let's go back to the Eclipse window (restart it if necessary).
 
Added:
>
>
From the menu File select New, then C++ Project. In the dialog that appears, set LHCb_v31r5 as the name of the project (ignore the warning, that's exactly what we want), then choose Makefile project/Empty Project in the Project type panel (left) and Linux GCC as toolchain (right). When done, click the button Finish.
 
Changed:
<
<
... to be continued Work in progress, under construction...
>
>
snap 04.png
New C/C++ Project Wizard

Click with the right button of the mouse on the project that appeared in the left panel LHCb_v31r5 and select Properties from the contextual menu. From the left panel choose Environment in the C/C++ Build group and unset the variables CWD and PWD selecting them and clicking on Undefine.

Click on the Add... button and insert CMTCONFIG as name and ${CMTOPT} as value, then click OK.

snap 05.png
New environment variable
By default, Eclipse append the value you insert to the current value of a variable, so you have always to edit the just added variable to fix it or simply to tell Eclipse that you want exactly that value.
snap 06.png
Edit an environment variable

Let's add few other variables:

  • CMTPROJECTPATH, mandatory if you want to use the nightlies or $LHCBDEV
  • CMTEXTRATAGS, set it to use-distcc on lxplus
  • GAUDI_QMTEST_HTML_OUTPUT, set it to ${ProjDirPath}/test_results/${CMTOPT} (useful for testing)

We can also add another configuration for debugging: click on the button Manage Configurations... and make a new configuration copying the settings from the existing configuration Default (this is proposed default), calling it Debug.

In the environment editor form, select the new created configuration and replace ${CMTOPT} with ${CMTDEB} in the variables CMTCONFIG and GAUDI_QMTEST_HTML_OUTPUT.

Optionally (mainly if you want to work with many packages), you can go to the properties of the C/C++ Build group itself and in the Behaviour tab select the "parallel build" and the "optimal number of jobs".

snap 07.png
Parallel build configuration

Exit from the Properties dialog with the OK button.

Building

Now we are ready to build: right-click again on the project and select Build Project (you can see the compilation going on in the Console tab at the bottom).

The package Tutorial/EclipseTutorial doesn't compile (on purpouse). You can see the error in the bottom pane in the tab Problems. Double-clicking on the problem will open the problematic file highlighting the line that caused the error. If you click on the two horizontal arrows at the top of the Project Explorer view (Link with Editor), the project explorer will show where the file you are currently editing is in the project hierarchy.

snap 08.png
Compile error

Correct the line (m_freq must be replaced with m_frequency), save the modified file (CTRL+s or File->Save or right-click in the editor) and build again.

Running the Tests

To run the tests of a package you need to call cmt TestPackage in the cmt directory of the package itself. You can tell Eclipse to do it by creating a custom "make target".

Right-click on the cmt directory of the package and, from the menu, select Make Targets -> Create.... Fill the dialog choosing the name TestPackage, uncheck Use builder settings, set the name of the builder to cmt and unckeck Run all project builders.

snap 09.png
Custom make target for the tests

Now select the Make Target tab in the right pane (may be hidden), look for the directory Tutorial/EclipseTutorial/cmt, which will contain the target TestPackage. Double-click to run it.

The summary of the tests is visible in the Console view in the bottom pane, but you can use the internal web browser to display the HTML test summary that you can find in the left pane: test_results/.../index.html. Right-click on the file and select Open With -> Web Browser.

snap 10.png
Result of the tests
(the HTML summary is available thaks to the environment variable GAUDI_QMTEST_HTML_OUTPUT)

When you run the tests from within an Eclipse project, the GaudiTestingInfrastructure creates launch configurations that can be use to execute the tests bypassing the QMTest wrapping (useful for debugging). You can access the configured launchers from the Run menu.

Debugging

Eclipse has got a user-friendly graphical front-end to gdb.

First we need to compile in debug mode (using the Debug configuration we set up), so select Build Configurations -> Set Active -> Debug from the project contestual menu (right-click). Build and run the tests (to regenerate the launcher configurations).

Open the file CounterExampleAlg.cpp from the src directory of the package. Using the Outline view in the right pane, look for CounterExampleAlg::initialize and double-click in the gray bar on the left of the editor window at the level of the function definition to set a breakpoint, a small blue dot will appear.

snap 11.png
Setting a breakpoint

Unfortunately, there is a problem in the way the current version of Gaudi generates the launchers. To fix it select Debug Configurations... from the Run menu, go to the Debugger tab and close the dialog with the Close button.

From the Run menu select Debug History -> eclipsetutorial.simple_test. A dialog box will ask you if you want to switch to the Debug Perspective, tell it that you want and check the box to make it remember the decision.

The debugger will stop in the Python "main" function, and it will tell you that it doesn't have debug symbols for it. It's OK, let it continue by clicking the Resume (F8) button in the Debug view (top-left), which is a green triangle.

After some time, the debugger will stop at the breakpoint we defined before.

snap 12.png
Hitting a breakpoint

Now you can follow the what is happening in your code. BTW, did you notice the spell checking in the comments? wink

More Topics (TO-DO list)

  • Interaction with Subversion
  • Advanced debugging
  • Templates
  • PyDev
 
Changed:
<
<
-- MarcoClemencic - 30-Jul-2010
>
>
-- MarcoClemencic - 14-Sep-2010
 
Changed:
<
<
META FILEATTACHMENT attachment="01-workspace_selection.png" attr="h" comment="" date="1280523389" name="01-workspace_selection.png" path="01-workspace_selection.png" size="27650" stream="01-workspace_selection.png" tmpFilename="/usr/tmp/CGItemp12966" user="clemenci" version="1"
>
>
META FILEATTACHMENT attachment="01-workspace_selection.png" attr="h" comment="" date="1284469252" name="01-workspace_selection.png" path="snap_01.png" size="26440" stream="snap_01.png" tmpFilename="/usr/tmp/CGItemp47641" user="clemenci" version="2"
 
META FILEATTACHMENT attachment="03-first_time.png" attr="h" comment="" date="1280523472" name="03-first_time.png" path="03-first_time.png" size="218703" stream="03-first_time.png" tmpFilename="/usr/tmp/CGItemp12964" user="clemenci" version="1"
META FILEATTACHMENT attachment="04-change_svnkit.png" attr="h" comment="" date="1280523487" name="04-change_svnkit.png" path="04-change_svnkit.png" size="78670" stream="04-change_svnkit.png" tmpFilename="/usr/tmp/CGItemp12827" user="clemenci" version="1"
META FILEATTACHMENT attachment="05-disable_automatic_build.png" attr="h" comment="" date="1280523499" name="05-disable_automatic_build.png" path="05-disable_automatic_build.png" size="25800" stream="05-disable_automatic_build.png" tmpFilename="/usr/tmp/CGItemp12929" user="clemenci" version="1"
META FILEATTACHMENT attachment="07-new_cpp_project.png" attr="h" comment="" date="1280523524" name="07-new_cpp_project.png" path="07-new_cpp_project.png" size="65081" stream="07-new_cpp_project.png" tmpFilename="/usr/tmp/CGItemp12879" user="clemenci" version="1"
META FILEATTACHMENT attachment="08-introduce_an_error.png" attr="h" comment="" date="1280523536" name="08-introduce_an_error.png" path="08-introduce_an_error.png" size="141893" stream="08-introduce_an_error.png" tmpFilename="/usr/tmp/CGItemp12922" user="clemenci" version="1"
META FILEATTACHMENT attachment="09-compile_error.png" attr="h" comment="" date="1280523548" name="09-compile_error.png" path="09-compile_error.png" size="142682" stream="09-compile_error.png" tmpFilename="/usr/tmp/CGItemp12856" user="clemenci" version="1"
Added:
>
>
META FILEATTACHMENT attachment="snap_01.png" attr="h" comment="" date="1284469345" name="snap_01.png" path="snap_01.png" size="26440" stream="snap_01.png" tmpFilename="/usr/tmp/CGItemp46079" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_02.png" attr="h" comment="" date="1284470137" name="snap_02.png" path="snap_02.png" size="222903" stream="snap_02.png" tmpFilename="/usr/tmp/CGItemp46219" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_03.png" attr="h" comment="" date="1284470993" name="snap_03.png" path="snap_03.png" size="61024" stream="snap_03.png" tmpFilename="/usr/tmp/CGItemp46201" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_04.png" attr="h" comment="" date="1284474000" name="snap_04.png" path="snap_04.png" size="66106" stream="snap_04.png" tmpFilename="/usr/tmp/CGItemp46136" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_05.png" attr="h" comment="" date="1284476615" name="snap_05.png" path="snap_05.png" size="19019" stream="snap_05.png" tmpFilename="/usr/tmp/CGItemp46137" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_06.png" attr="h" comment="" date="1284476969" name="snap_06.png" path="snap_06.png" size="18981" stream="snap_06.png" tmpFilename="/usr/tmp/CGItemp46158" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_07.png" attr="h" comment="" date="1284478927" name="snap_07.png" path="snap_07.png" size="104957" stream="snap_07.png" tmpFilename="/usr/tmp/CGItemp46130" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_08.png" attr="h" comment="" date="1284479628" name="snap_08.png" path="snap_08.png" size="159215" stream="snap_08.png" tmpFilename="/usr/tmp/CGItemp46136" user="clemenci" version="2"
META FILEATTACHMENT attachment="snap_09.png" attr="h" comment="" date="1284482220" name="snap_09.png" path="snap_09.png" size="30361" stream="snap_09.png" tmpFilename="/usr/tmp/CGItemp46092" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_10.png" attr="h" comment="" date="1284484328" name="snap_10.png" path="snap_10.png" size="137942" stream="snap_10.png" tmpFilename="/usr/tmp/CGItemp46168" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_11.png" attr="h" comment="" date="1284485937" name="snap_11.png" path="snap_11.png" size="162341" stream="snap_11.png" tmpFilename="/usr/tmp/CGItemp46242" user="clemenci" version="1"
META FILEATTACHMENT attachment="snap_12.png" attr="h" comment="" date="1284486473" name="snap_12.png" path="snap_12.png" size="159438" stream="snap_12.png" tmpFilename="/usr/tmp/CGItemp46222" user="clemenci" version="1"

Revision 22010-09-03 - MarcoClemencic

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.
Line: 14 to 14
  To use the shared installation, just connect to lxplus and call
Changed:
<
<
/afs/cern.ch/lhcb/distribution/eclipse/bin/eclipse
>
>
eclipse
 
Added:
>
>
(requires LbScript >= v5r4)
  A dialog will ask you to select your workspace. Insert the location of your $User_release_area (cmtuser) or any directory of your choice.

Revision 12010-07-30 - MarcoClemencic

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="LHCbSoftwareTutorials"

Using Eclipse to work with the LHCb software

Eclipse is a multi-platform development environment. Its extreme flexibility makes it possible to use it in a lot of environments, from the Java development to the Web development.

It is possible to use Eclipse also in LHCb, even if with still some rough edges that will be smoothed out if there are enough requests.

Initial Setup

A shared installation is available for LHCb users on lxplus, but it can be installed on any desktop.

If you are going to install your own copy, follow the steps described in EclipseConfiguration. In that page contains some advanced and very useful configurations that should be followed also when using the pre-installed copy.

To use the shared installation, just connect to lxplus and call

/afs/cern.ch/lhcb/distribution/eclipse/bin/eclipse

A dialog will ask you to select your workspace. Insert the location of your $User_release_area (cmtuser) or any directory of your choice.

01-workspace_selection.png

The first time you create a workspace, Eclipse will show you a welcome page from which you can explore its features. This time we can close it with the button highlighted in the image. Close the Photran 6.0 (FORTRAN support) welcome page too.

03-first_time.png

First thing, from the menu Window choose Preferences. In the list on the left, expand the group Team (with the small triangle) and select SVN. Switch to the tab SVN Connector and select SVNKit 1.1.7 (or at least the one compatible with the version of SVN you have installed, 1.4 on lxplus).

04-change_svnkit.png

From the menu Project, uncheck the entry Build Automatically.

05-disable_automatic_build.png

Now you that we made Eclipse create the configuration files in the workspace, you can close the application.

Create a User Project (setenv + getpack)

If you have followed the LHCbSoftwareTutorials, you know about setenv and getpack. Here we will use them to prepare a local project that we will work on using Eclipse.

In this example, we will compile Kernel/LHCbAlgs.

If you decided not to create your workspace in the directory pointed to by $User_release_area, now you have to set that environment variable to the path you have choosen for your workspace.

From the command prompt, prepare the local project with

setenvLHCb v31r4
getpack Kernel/LHCbAlgs v2r34p1

Now you can restart Eclipse:

/afs/cern.ch/lhcb/distribution/eclipse/bin/eclipse

From the menu File select New, then C++ Project. In the dialog that appears, set LHCb_v31r4 as the name of the project (ignore the warning, that's exactly what we want), then choose Makefile project/Empty Project in the Project type panel (left) and Linux GCC as toolchain (right). When done, click the button Finish.

07-new_cpp_project.png

Click with the right button of the mouse on the project that appeared in the left panel LHCb_v31r4 and select Properties from the contextual menu. From the left panel choose Environment in the C/C++ Build group and unset the variables CWD and PWD selecting them and clicking on Undefine.

Click on the Add... button and insert CMTPROJECTPATH as name of the variable and press enter, then double-click on the entry that has been atted in the table to edit it and just press OK. It is a bit convoluted, but it is what is needed to fix the current value into the project, which is always useful, and mandatory If you specified that you wanted to use the nightlies or $LHCBDEV.

Now right-click again on the project and select Build Project (you can see the compilation going on in the Console tab at the bottom).

Editing and Compilation Errors

From the panel on the left, you can navigate the tree of directories and files of your project.

Locate LHCb_v31r4/Kernel/LHCbAlgs/src/EvtCounter.cpp and double-click on it, so that the file is opened into the central panel.

Edit it introducing a syntax error. You see immediately that Eclipse warns you about it, but let's ignore it and save the modified file (CTRL+s or File->Save or right-click in the editor) and close it.

08-introduce_an_error.png

Build again and once completed, you will see red crosses in the navigator view on the left. Select the Problems view at the bottom, expand the list of errors and double-click on the first one. Eclipse will open the file with the error and highlight the problematic line, so that you can fix the problem.

09-compile_error.png

... to be continued Work in progress, under construction...

-- MarcoClemencic - 30-Jul-2010

META FILEATTACHMENT attachment="01-workspace_selection.png" attr="h" comment="" date="1280523389" name="01-workspace_selection.png" path="01-workspace_selection.png" size="27650" stream="01-workspace_selection.png" tmpFilename="/usr/tmp/CGItemp12966" user="clemenci" version="1"
META FILEATTACHMENT attachment="03-first_time.png" attr="h" comment="" date="1280523472" name="03-first_time.png" path="03-first_time.png" size="218703" stream="03-first_time.png" tmpFilename="/usr/tmp/CGItemp12964" user="clemenci" version="1"
META FILEATTACHMENT attachment="04-change_svnkit.png" attr="h" comment="" date="1280523487" name="04-change_svnkit.png" path="04-change_svnkit.png" size="78670" stream="04-change_svnkit.png" tmpFilename="/usr/tmp/CGItemp12827" user="clemenci" version="1"
META FILEATTACHMENT attachment="05-disable_automatic_build.png" attr="h" comment="" date="1280523499" name="05-disable_automatic_build.png" path="05-disable_automatic_build.png" size="25800" stream="05-disable_automatic_build.png" tmpFilename="/usr/tmp/CGItemp12929" user="clemenci" version="1"
META FILEATTACHMENT attachment="07-new_cpp_project.png" attr="h" comment="" date="1280523524" name="07-new_cpp_project.png" path="07-new_cpp_project.png" size="65081" stream="07-new_cpp_project.png" tmpFilename="/usr/tmp/CGItemp12879" user="clemenci" version="1"
META FILEATTACHMENT attachment="08-introduce_an_error.png" attr="h" comment="" date="1280523536" name="08-introduce_an_error.png" path="08-introduce_an_error.png" size="141893" stream="08-introduce_an_error.png" tmpFilename="/usr/tmp/CGItemp12922" user="clemenci" version="1"
META FILEATTACHMENT attachment="09-compile_error.png" attr="h" comment="" date="1280523548" name="09-compile_error.png" path="09-compile_error.png" size="142682" stream="09-compile_error.png" tmpFilename="/usr/tmp/CGItemp12856" user="clemenci" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback