Eclipse completions

152 views
Skip to first unread message

Michał Wichrowski

unread,
Dec 17, 2013, 7:26:29 AM12/17/13
to dea...@googlegroups.com
Thanks to Wolfgan's lectures I've switched from Code::Blocks to Eclipse (btw. It has great parallel tool kit including parallel debugger, it would be good to mention this in lectures).
I've installed Eclipse+CDT from Ubuntu repositories, it works well. I would like to use Eclipse 4.3 with PTP and CDT packages for writing and debugging MPI applications (4.3 version have some useful features in PTP ). I've downloaded it, unpacked, run and configured my project.
I've got some problems with code completions inside class templates. For example:
----- -----------
template<int dim>
class problem<dim>
{
private:
  Triangulation<dim> tria;
  void do_something();
}

template<int dim>
void problem<dim>::do_something() {
tria. ..... /here completions doesn't work!
}
int main(){
Triangulation<3> tria;
tria. ... //Here it works!
}
--------------
I've tried also Eclipse +cdt without ptp and eclipse juno with same result.
I'm using Ubuntu 12.04, I have Ubuntu 12.10 with eclipse juno from repositories on other computer and it also works well.


I've posted it on Eclipse forums, but no one answered.

I suppose that installation from Ubuntu repository has some packages that are missing in downloaded versions.

Wolfgang Bangerth

unread,
Dec 17, 2013, 9:26:45 AM12/17/13
to dea...@googlegroups.com

> It has great parallel tool kit including parallel debugger, it would be good
> to mention this in lectures).
> I've installed Eclipse+CDT from Ubuntu repositories, it works well. I would
> like to use Eclipse 4.3 with PTP and CDT packages for writing and debugging
> MPI applications (4.3 version have some useful features in PTP ). I've
> downloaded it, unpacked, run and configured my project.

We've tried PTP as well, but we could never get it to work properly, at least
when installing it from scratch or using the packages you can get from
eclipse.org. We've never tried downloading an Ubuntu package because we're
running different flavors of linux.

Would you be interested in updating the wiki page on Eclipse and discuss how
to use PTP?


> I've got some problems with code completions inside class templates. For example:
> ----- -----------
> template<int dim>
> class problem<dim>
> {
> private:
> Triangulation<dim> tria;
> void do_something();
> }
> template<int dim>
> void problem<dim>::do_something() {
> tria. ..... /here completions doesn't work!
> }
> int main(){
> Triangulation<3> tria;
> tria. ... //Here it works!
> }
> --------------

I have the same problem here. I suppose this is a problem in the Eclipse C++
parser. I'm afraid there is little that can be done about it...

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Michał Wichrowski

unread,
Dec 17, 2013, 10:25:45 AM12/17/13
to dea...@googlegroups.com

We've tried PTP as well, but we could never get it to work properly, at least
when installing it from scratch or using the packages you can get from
eclipse.org. We've never tried downloading an Ubuntu package because we're
running different flavors of linux.

What exactly did not worked? Were you able to run Eclipse+PTP ?

Would you be interested in updating the wiki page on Eclipse and discuss how
to use PTP?
I don't know if my settings are correct (I've made some workarounds for my MPI configuration), but when I get to my computer I will post settings.
 
I have the same problem here. I suppose this is a problem in the Eclipse C++
parser. I'm afraid there is little that can be done about it...  

Eclipse parser sometimes fails even for my "good" instalation, but in downloaded packages I have much less completions (in the same and newer version of eclipse). Code::blocks handled completions quite well, only eclipse has parallel debugger.

Best
  W.

--
------------------------------------------------------------------------
Wolfgang Bangerth               email:            bang...@math.tamu.edu
                                 www: http://www.math.tamu.edu/~

Anyway it's nice to know that it's not only mine problem.

Michał

Michał Wichrowski

unread,
Dec 17, 2013, 5:04:34 PM12/17/13
to dea...@googlegroups.com
I only tried it with local project yet.
I've checked my configuration. I've got eclipse from here: http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/kepler/SR1/eclipse-parallel-kepler-SR1-linux-gtk-x86_64.tar.gz
untar, run eclipse/eclipse from terminal (it is important - eclipse may not see environmental variables like $LD_LIBRARY_PATH ,causing strange crashes while initializing MPI. This especially happens when you have more than one installation of MPI )
Set up project the same way as in video tutorial.
Compile  and install  SDM - Scalable Debug Manager - you can find it in included archive.  I do not remeber where I found it, but according to manual it should be somewhere in eclipse/plugins (I didn't  find it there).
untar include package, go to sdm/org.eclipse.ptp.debug.sdm_7.0.3.201308151438/ run: ./configure && make -j4 && sudo make install

In eclipse open project->debug configurations , create a new launch configuration, select your MPI version, select local in connection type (it will ask you for confirmation and then connect), it should look like that on include image. Go to application in application, specify application program that will be launched (in remote projects "browse" will open remote file system explorer ). In debugger tab you don't have to change anything if you have configured sdm without specifying prefix. I should be:
debugger: SDM
debugger backend: gdb-mi
Path: /usr/local/bin/sdm  (or your own path to sdm)

Make same configuration for run and test it.

Configuration can be time-consuming but I think it is worth it. Be careful with the number of MPI processes - parallel debug is expensive.

sdm.tar.gz

Wolfgang Bangerth

unread,
Dec 19, 2013, 3:08:11 PM12/19/13
to dea...@googlegroups.com
On 12/17/2013 09:25 AM, Michał Wichrowski wrote:
>
> We've tried PTP as well, but we could never get it to work properly, at least
> when installing it from scratch or using the packages you can get from
> eclipse.org <http://eclipse.org>. We've never tried downloading an Ubuntu
> package because we're
> running different flavors of linux.
>
>
> What exactly did not worked? Were you able to run Eclipse+PTP ?

I had great trouble compiling those parts that weren't in Java. When we
downloaded a package, we simply couldn't figure out how to configure it
properly. It may just have been that I wasn't patient enough, but it
definitely wasn't as easy as the rest of Eclipse either.


> I have the same problem here. I suppose this is a problem in the Eclipse C++
> parser. I'm afraid there is little that can be done about it...
>
>
> Eclipse parser sometimes fails even for my "good" instalation, but in
> downloaded packages I have much less completions (in the same and newer
> version of eclipse). Code::blocks handled completions quite well, only eclipse
> has parallel debugger.

C++ is a complex language. I'm not surprised that IDEs fall on their face
every once in a while with templates (because compilers do as well). The rules
for templates are complex, and it's oftentimes impossible to get an
understanding of the code if you can't actually compile it.

I do get annoyed as well at times when Eclipse doesn't want to autocomplete
something. But it can do it 95% of the time, and that's already a good step
forward.

Cheers
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Michał Wichrowski

unread,
Dec 20, 2013, 4:59:27 AM12/20/13
to dea...@googlegroups.com


W dniu czwartek, 19 grudnia 2013 21:08:11 UTC+1 użytkownik Wolfgang Bangerth napisał:

I had great trouble compiling those parts that weren't in Java. When we
downloaded a package, we simply couldn't figure out how to configure it
properly. It may just have been that I wasn't patient enough, but it
definitely wasn't as easy as the rest of Eclipse either.

That's strange, I didn't have to compile anything, I've searched eclipse dir, and find nothing that would need compilation. Maybe I missed something.

I can also download PTP plug-in into existing Eclipse, instructions are here: http://www.eclipse.org/ptp/downloads.php

Best regards,
Michał

Wolfgang Bangerth

unread,
Dec 20, 2013, 4:24:55 PM12/20/13
to dea...@googlegroups.com

> That's strange, I didn't have to compile anything, I've searched eclipse dir,
> and find nothing that would need compilation. Maybe I missed something.
>
> I can also download PTP plug-in into existing Eclipse, instructions are here:
> http://www.eclipse.org/ptp/downloads.php

It's probably been a year already since we tried. Maybe their newest version
works better and doesn't need the compilation any more. In any case, I think
it was the SDM part of the package that you also reference in a previous email.

Best
Wolfgang

Wolfgang Bangerth

unread,
Dec 20, 2013, 4:28:56 PM12/20/13
to dea...@googlegroups.com

Michal,
if I gave you write access to the deal.II wiki, would you be willing to work
your text below into a 2-sentence introduction into what PTP is and a brief
description how to (i) install/configure, (ii) use it? I think if one can make
it work, PTP is a really important piece in the collection of tools one can
use to make life more productive.

On 12/17/2013 04:04 PM, Michał Wichrowski wrote:
> I only tried it with local project yet.
> I've checked my configuration. I've got eclipse from here:
> http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/kepler/SR1/eclipse-parallel-kepler-SR1-linux-gtk-x86_64.tar.gz
> untar, run eclipse/eclipse from terminal (it is important - eclipse may not
> see environmental variables like $LD_LIBRARY_PATH ,causing strange crashes
> while initializing MPI. This especially happens when you have more than one
> installation of MPI )
> Set up project the same way as in video tutorial.
> Compile and install SDM - Scalable Debug Manager - you can find it in
> included archive. I do not remeber where I found it, but according to manual
> it should be somewhere in eclipse/plugins (I didn't find it there).
> untar include package, go to sdm/org.eclipse.ptp.debug.sdm_7.0.3.201308151438/
> run: ./configure && make -j4 && sudo make install

This was the step that gave me trouble.


> In eclipse open project->debug configurations , create a new launch
> configuration, select your MPI version, select local in connection type (it
> will ask you for confirmation and then connect), it should look like that on
> include image. Go to application in application, specify application program
> that will be launched (in remote projects "browse" will open remote file
> system explorer ). In debugger tab you don't have to change anything if you
> have configured sdm without specifying prefix. I should be:
> debugger: SDM
> debugger backend: gdb-mi
> Path: /usr/local/bin/sdm (or your own path to sdm)
>
> Make same configuration for run and test it.
>
> Configuration can be time-consuming but I think it is worth it. Be careful
> with the number of MPI processes - parallel debug is expensive.
>
> <https://lh5.googleusercontent.com/-Tc4eSGUnGvI/UrC7g5O9lLI/AAAAAAAAAC8/atAokpTNcJ4/s1600/ptp-run.jpg>


Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Michał Wichrowski

unread,
Dec 21, 2013, 12:37:26 PM12/21/13
to dea...@googlegroups.com


W dniu piątek, 20 grudnia 2013 22:28:56 UTC+1 użytkownik Wolfgang Bangerth napisał:

Michal,
if I gave you write access to the deal.II wiki, would you be willing to work
your text below into a 2-sentence introduction into what PTP is and a brief
description how to (i) install/configure, (ii) use it? I think if one can make
it work, PTP is a really important piece in the collection of tools one can
use to make life more productive.


I'm using PTP not for long time so I have little experience with it, but I can write something on wiki.


This was the step that gave me trouble.
Try this:  http://wiki.eclipse.org/PTP/release_notes/7.0#Install_optional_PTP_debugger_component
I've checked this instructions and it compiles. Previously I didn't remember where I get SDM so I cleaned (propably not good enough) my SDM source and included it.
I can also post compiled SDM on ubuntu 12.04 amd64 but I don't know if it will work.

Michał
 

Michał Wichrowski

unread,
Jan 16, 2014, 10:33:46 AM1/16/14
to dea...@googlegroups.com

I've wrote some basic informations about PTP and SDM in Wiki. However I didn't figured out how to upload pictures (propably I don't have rights to do it). Please inserd included pictures to Wiki.
I've only wrote about local configurations, I don't know how to configure PTP with remote project (especially to run applications with PBS on cluster).

Could you test if my instructions are working for you?


Michał

pictures.tar.gz
Reply all
Reply to author
Forward
0 new messages