CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Eclipse for OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree18Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2011, 08:39
Default
  #21
New Member
 
Astrid Mahrla
Join Date: May 2010
Location: Munich, Germany
Posts: 22
Rep Power: 17
AMahrla is on a distinguished road
Hi!

I think it's a bug in the machine interface gdb/mi .. If I remember correctly I was able to reproduce the bug with another IDE in same manner..

Best,

Astrid
AMahrla is offline   Reply With Quote

Old   May 7, 2011, 09:49
Default Debugging problem in Eclipse
  #22
New Member
 
Luther Terblanche
Join Date: May 2009
Posts: 15
Rep Power: 17
luther is on a distinguished road
Hi All,

I have managed to successfully import a solver to an eclipse helios project. I can also run it applied to a test case thanks to the tutorial on how to use eclipse with openfoam.

My problem is that when I insert breakpoints, the debugger does not stop at them. It only stops at entry into main(). Also it does not display any code information. It only says " No source available for "main() at 0x8055df0" ".

Can anyone help me please. I have changed the option in the ./etc/bashrc file to Debug instead op Opt. What else should I do to be able to see the code and walk through it?

Regards
Luther
luther is offline   Reply With Quote

Old   May 7, 2011, 09:59
Default
  #23
Senior Member
 
Robert Sawko
Join Date: Mar 2009
Posts: 117
Rep Power: 22
AlmostSurelyRob will become famous soon enough
Luther,

did you also compile the OpenFOAM sources after changing the value of the environmental variable?
AlmostSurelyRob is offline   Reply With Quote

Old   May 7, 2011, 10:07
Default
  #24
New Member
 
Luther Terblanche
Join Date: May 2009
Posts: 15
Rep Power: 17
luther is on a distinguished road
Hi Robert,

I have only compiled the solver that I have imported. In this test case it is a local copy of simpleFoam located in my /home/ directory. The binary that gets created are located $FOAM_USER_APPBIN. This is also the binary I point to in the run and debug configurations of Eclipse. I hope this info helps.

Thanks

Regards
Luther
luther is offline   Reply With Quote

Old   May 7, 2011, 10:14
Default
  #25
Senior Member
 
Robert Sawko
Join Date: Mar 2009
Posts: 117
Rep Power: 22
AlmostSurelyRob will become famous soon enough
I can't think of anything else, but to compile the main sources as well so if you have a possibility to do that it shouldn't hurt to try. I am not myself an expert on debugging OpenFOAM but the fact that you didn't recompile the main sources seems to explain why you enter the main of your solver, but can't get any other info.
AlmostSurelyRob is offline   Reply With Quote

Old   May 7, 2011, 10:20
Default
  #26
New Member
 
Luther Terblanche
Join Date: May 2009
Posts: 15
Rep Power: 17
luther is on a distinguished road
I would expect not to get any information on all of the other sources, such as createMesh for example, since they are release builds, but i would expect to get information on the main() subroutine of the solver I have just compiled and imported into eclipse.

Thank you for your help. I will fiddle some more with the options in eclipse.
luther is offline   Reply With Quote

Old   May 17, 2011, 07:47
Default
  #27
Senior Member
 
Robert Sawko
Join Date: Mar 2009
Posts: 117
Rep Power: 22
AlmostSurelyRob will become famous soon enough
Dear Astrid,

could I ask for advice again? I've been running the Eclipse debugging smoothly for quite some time. Recently I've changed to openSUSE 11.4. According to your advice I compiled gdb 6.8 but still, I cannot install breakpoints.

It either replies with:

No source file named ...
or
No line ... in file ...

Neither of these problems appear in gdb run from the command line. I've already tried adding my code to Source in Eclipse/Debug configuration, but no change.

I'm afraid that my problem might be specific to configuration, but if you have encountered a problem of this kind and know a workaround please let me know.

Many thanks,
Robert
AlmostSurelyRob is offline   Reply With Quote

Old   May 17, 2011, 08:59
Default
  #28
New Member
 
Astrid Mahrla
Join Date: May 2010
Location: Munich, Germany
Posts: 22
Rep Power: 17
AMahrla is on a distinguished road
Hi Robert!

Remote diagnostics always makes things a little bit difficult, but of course I can try some standard guesses..
- I assume that you've recompiled OpenFOAM in debug mode..?
- Are you sure that eclipse starts with correct environment variables for OpenFOAM (check this starting eclipse from console, in case you haven't already done so...)?
- Can you compile from eclipse? If not, this is a hint for wrong environment variables..

By the way... Suse 11.4 uses gdb 7.2, isn't it? Is the bug still present?

Best, Astrid
AMahrla is offline   Reply With Quote

Old   May 17, 2011, 09:41
Default
  #29
Senior Member
 
Robert Sawko
Join Date: Mar 2009
Posts: 117
Rep Power: 22
AlmostSurelyRob will become famous soon enough
Thanks for the reply.

Quote:
Originally Posted by AMahrla View Post
Hi Robert!
- I assume that you've recompiled OpenFOAM in debug mode..?
Yes. Also, I can run debug with full functionality when I run GDB (without Eclipse) from commandline.

Quote:
Originally Posted by AMahrla View Post
- Are you sure that eclipse starts with correct environment variables for OpenFOAM (check this starting eclipse from console, in case you haven't already done so...)?
What output should I expect? I run Eclipse from the commandline than go to debug mode but nothing happens. The only output is on Eclipse console.

Yes, I can compile from Eclipse.

Quote:
Originally Posted by AMahrla View Post
By the way... Suse 11.4 uses gdb 7.2, isn't it? Is the bug still present?
I am afraid so. On 7.2 it simply freezes. With 6.8 I just can't install breakpoints, but again it might be specific to my system configuration.
AlmostSurelyRob is offline   Reply With Quote

Old   May 17, 2011, 10:12
Default
  #30
New Member
 
Astrid Mahrla
Join Date: May 2010
Location: Munich, Germany
Posts: 22
Rep Power: 17
AMahrla is on a distinguished road
Hi Robert!

Sorry, that I can't help you. Haven't encountered that kind of problem - possibly as I'm not using openSUSE 11.4 ... But please let me know if you've found out what's wrong.. I'm still interested...

Astrid
AMahrla is offline   Reply With Quote

Old   June 8, 2011, 22:56
Default
  #31
Member
 
桂莹
Join Date: Apr 2011
Posts: 36
Rep Power: 15
yingkun is on a distinguished road
hi,Bruno
I had the same problem,and I try to do what you said "edit the menu, then edit the Eclipse menu item and switch to "Type: Application in Terminal" ",where is the Eclipse menu item?I'm sorry,I'm a newer
yingkun is offline   Reply With Quote

Old   June 9, 2011, 17:31
Default
  #32
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings yingkun,
Quote:
Originally Posted by yingkun View Post
hi,Bruno
I had the same problem,and I try to do what you said "edit the menu, then edit the Eclipse menu item and switch to "Type: Application in Terminal" ",where is the Eclipse menu item?I'm sorry,I'm a newer
OK, I can provide some screen shots, but I'll need to know which Ubuntu version or Linux distribution are you using?! Because this look very differently between Ubuntu versions (10.10 vs 11.04) and other Linux distributions, such as openSUSE and Fedora.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   June 9, 2011, 23:49
Default
  #33
Member
 
桂莹
Join Date: Apr 2011
Posts: 36
Rep Power: 15
yingkun is on a distinguished road
Thank you for the reply.
my Ubuntu version is 10.04,and now I can build project,but when running,it shows:
/home/ying/eclipsework/coalChemistryFoam /coalChemistryFoam:error while loading shared libraries:libfiniteVolume.so:cannot open shared object file:No such file or directory.
what's the problem?
yingkun is offline   Reply With Quote

Old   June 10, 2011, 14:43
Default
  #34
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi yingkun,

It seems like you didn't manage to get things set-up properly. To answer your previous question and hopefully this will fix the current problem, attached are a few images:
  1. On Screenshot01.png it shows you where to right click to get that menu that shows up.
  2. On Screenshot02.png shows where Eclipse is located. After selecting it, click on the button Properties.
  3. On Screenshot03.png shows what the properties window looks like and where to click next. Clicking there will show you Screenshot04.png.
  4. Apply that chosen option of "Application in Terminal" and it should now work as intended.
Best regards,
Bruno
Attached Images
File Type: png Screenshot01.png (36.1 KB, 121 views)
File Type: png Screenshot02.png (92.0 KB, 122 views)
File Type: png Screenshot03.png (28.6 KB, 116 views)
File Type: png Screenshot04.png (27.6 KB, 108 views)
__________________
wyldckat is offline   Reply With Quote

Old   June 12, 2011, 00:22
Default
  #35
Member
 
桂莹
Join Date: Apr 2011
Posts: 36
Rep Power: 15
yingkun is on a distinguished road
Hi,Bruno
I follow you with the code

HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec wmake instesd of wmake,
and I can build project,but I still can't run,it shows:
/home/ying/eclipsework/coalChemistryFoam /coalChemistryFoam:error while
loading shared libraries:libfiniteVolume.so:cannot open shared object
file:No such file or directory.
yingkun is offline   Reply With Quote

Old   June 12, 2011, 13:19
Default
  #36
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi yingkun,
Quote:
Originally Posted by yingkun View Post
and I can build project,but I still can't run,it shows:
/home/ying/eclipsework/coalChemistryFoam /coalChemistryFoam:error while
loading shared libraries:libfiniteVolume.so:cannot open shared object
file:No such file or directory.
OK ok, now I finally understand what you mean... On weekends I'm really slooow to understand some things...
Use the same foamExec script, including its path, for launching the solver!

In other words:
  • To launch wmake, use:
    Code:
    $HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec wmake
    Update OpenFOAM version/path accordingly to your installation.
  • Likewise for launching the built solver; for example, to run icoFoam:
    Code:
    $HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec icoFoam
    Or even for extended completeness:
    Code:
    $HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec icoFoam -case $HOME/OpenFOAM/$USER-1.6/mytestcase
    This way it will run on the case "$HOME/OpenFOAM/$USER-1.6/mytestcase".
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 13, 2011, 11:56
Default
  #37
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18
Arnoldinho is on a distinguished road
Hi there,

I have a problem running point 7 from the wiki "Running applications and debugging". Up to this point, everything works. I could load the whole OF package into the workspace, and could compile a test-solver.

Running an imported application ramp (from /tutorials/surfaceTracking/interTrackFoam), I get the following error: In Run -> Run Configurations I chose "ramp" as Project and "/opt/OpenFOAM/OpenFOAM-1.6-ext/applications/solvers/surfaceTracking/interTrackFoam" as Application (from the Browse... menue). But I can't run it as I get
Quote:
Program is not a recognized executable.
Same with Debug Configuration.

I'm using OF 1.6-ext compiled in debug mode on Ubuntu 10.04 64bit. Eclipse is 3.5.2 installed via apt-get.

Arne
Arnoldinho is offline   Reply With Quote

Old   July 13, 2011, 12:45
Default
  #38
New Member
 
Astrid Mahrla
Join Date: May 2010
Location: Munich, Germany
Posts: 22
Rep Power: 17
AMahrla is on a distinguished road
Hi Arne,

you should look for the compiled binary instead of the source code. Have look in "/opt/OpenFOAM/OpenFOAM-1.6-ext/applications/bin".

Hope, that helps.

Best,

Astrid
AMahrla is offline   Reply With Quote

Old   July 13, 2011, 13:01
Default
  #39
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18
Arnoldinho is on a distinguished road
Yup, that definitely makes sense! Shame on me... That must be the muggy weather.
Arnoldinho is offline   Reply With Quote

Old   July 14, 2011, 09:24
Default
  #40
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18
Arnoldinho is on a distinguished road
Like already posted in #16, I also have a problem including paths to be able to jump trough the source code.

A copied a solver (interDyMFoam) to FOAM_USER_APPBIN, renamed (solver01) and compiled it. In solver01.C, when e.g. pointing to #include "fvCFD.H" and pressing F3, I only get
Quote:
Could not find include file 'fvCFD.H' on include paths
although I already included '/opt/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/cfdTools/general/include' (where fvCFD.H is located) and before already tried the whole OpenFOAM-1.6-ext folder in solver01 -> Properties -> Inludes + Library Paths.

Only those files that are directly included in the solver01 folder can be displayed/pointed to.

Any hints?
Arnoldinho is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:59.