CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Eclipse for OpenFOAM (https://www.cfd-online.com/Forums/openfoam-programming-development/75800-eclipse-openfoam.html)

AMahrla January 10, 2011 07:39

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

luther May 7, 2011 08:49

Debugging problem in Eclipse
 
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

AlmostSurelyRob May 7, 2011 08:59

Luther,

did you also compile the OpenFOAM sources after changing the value of the environmental variable?

luther May 7, 2011 09:07

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

AlmostSurelyRob May 7, 2011 09:14

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.

luther May 7, 2011 09:20

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.

AlmostSurelyRob May 17, 2011 06:47

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

AMahrla May 17, 2011 07:59

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

AlmostSurelyRob May 17, 2011 08:41

Thanks for the reply.

Quote:

Originally Posted by AMahrla (Post 307950)
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 (Post 307950)
- 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 (Post 307950)
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.

AMahrla May 17, 2011 09:12

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

yingkun June 8, 2011 21:56

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

wyldckat June 9, 2011 16:31

Greetings yingkun,
Quote:

Originally Posted by yingkun (Post 311161)
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

yingkun June 9, 2011 22:49

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?

wyldckat June 10, 2011 13:43

4 Attachment(s)
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

yingkun June 11, 2011 23:22

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.

wyldckat June 12, 2011 12:19

Hi yingkun,
Quote:

Originally Posted by yingkun (Post 311629)
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.

:eek: 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

Arnoldinho July 13, 2011 10:56

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

AMahrla July 13, 2011 11:45

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

Arnoldinho July 13, 2011 12:01

Yup, that definitely makes sense! Shame on me... That must be the muggy weather.

Arnoldinho July 14, 2011 08:24

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?


All times are GMT -4. The time now is 18:33.