Eclipse for OpenFOAM
Dear FOAMers,
a new tutorial how to use the IDE Eclipse for OpenFOAM development is now available in the OpenFoam Wiki: http://openfoamwiki.net/index.php/Ho...M_with_Eclipse Best, Astrid |
Hi Astrid,
Great post!! Many thanks! The only thing I can't figure out is if it's possible to use the same instructions to also debug OpenFOAM's libraries... you know, just in case we want to add something to the core of OpenFOAM, or to verify where things are going through. Best regards, Bruno PS: 2h20m to write a whole wiki page... that is wicked fast! I probably would take a whole day to do the same!! |
Hi Bruno!
You should be able to import every piece of OpenFOAM-code into eclipse and everything should be linked by setting the wmake build command. For debugging you'll have to provide a test case and a solver. But keep in mind that the indexer only works for those parts that imported in your eclipse workspace, but stepping through the code while debugging should be possible. Best, Astrid P.S. Actually, I had prepared something for the wiki entry in advance... |
Good work, I use Eclipse too :D
Do you know if it's possible to "ssh" to a server and run wmake? I find IDEs quicker if I run them on my desktop instead of on another file server/node. But I'm not sure how to ssh to the file server and run wmake. Does that make sense? I would guess that you'd add it to make target: http://openfoamwiki.net/index.php/File:Eclipse05.png |
1 Attachment(s)
Quote:
For your reference (and without any guarantees, warranties etc.) I've attached an example of running wmake as a parallel job with GridEngine. The script is both a submission script and a job script rolled into one. See the usage with '-help'. |
That's really useful, thanks for sharing your script.
|
Error with wmake
Hi, i got this error with Eclipse and openfoam
could anyone tell me why. Thanks **** Build of configuration Default for project simpleFoam **** (Cannot run program "wmake": Unknown reason) Yu |
Are you building on your own machine or on another? Either it can't find wmake, or you've run out of memory from the few hits google gives for that issue with eclipse.
|
wmake error
I used my own machine. I never used eclipse before and have no idea about it. I just try to follow the tutorial. but can not make it work.
It that possible because the I use ubuntu? Yu Quote:
|
Are you able to run wmake in a terminal outside of eclipse? I can't see what would be wrong I'm afraid.
|
I can run wmake in a terminal. but not in eclipse.
Thanks, yu Quote:
|
Greetings Yu,
Quote:
If you wish to always start eclipse from the menu, you have various solutions, some of which are:
Best regards, Bruno |
Hi, Bruno,
Thank you, it works fine now. ;) Yu Quote:
|
Hi There,
great Post, sounds promising...i have been locking for something like this ! I managed to reproduce the "tutorial" on the wiki-page.. but there are still some major concerns of mine. 1. When I run the debug, i have the very same output in the console window I am used to see running it "as usual". In the debug window I see some storage adresses(eg ...::correct @someaddres) I was hoping to see what happens behind the scene... so to see which operation he uses on which object and what values are returned...and so on.. Did I overlook it, or how can I achieve this? 2. I have been trying to understand a certain solver. Loading the solver like in the tutorial leaves me with "selected name can not be mapped to a symbol name" once I ask for the source code or something else. So I added the whole FOAM folder as a project. But I still have some trouble with it. For example: He Includes UEqn.H. I can open the sourcecode of this now, but trying to find out what he does when he calles "UEqn.relax();" is not possible with this tool..he says: "selected name can not be mapped to a symbol name". ".relax" happens to be NOT declared in UEqn.H and i dont know (yet) where UEqn.H is inherited from. So do I have to go DOXYGEN again or is there a way to make him answer ;) ? 3. Also the auto completion does not work :-( .. I have "runTime.write" in the code...so when I write "runTime." right below the "runTime.write" and press crt+space he says "no proposals..." so what did I do wrong. It does neither work with the only the solver importet nor with the whole OpenFoam-Folder. thx & best regards! |
Hi heavy_user!
Concerning your questions.. 1. During running the debug, the console output stays the same, but you have the possibility to watch the variables and the current position in the source code in the debug view. If your variables are pointers or references the storage adresses will be shown. 2. If you want to have a look into a function as .relax(); just go into the function using F5. This should open the file where the function is executed. 3. Sorry - no idea.. maybe this depends on the files you imported in your workspace.. Hope this could help you a little bit.. Best, Astrid |
Hi Astrid,
thanks for your reply!! Quote:
Or is there already a good video to it, which i didnt find yet? ----------------------------------------------------------------- In the "DSF-Dissasembly" I have stuff like: 00416be8: mov $0x1,%ecx 00416bed: push %r14 which tells me nothing. "debug" shows stuff like : main() at 0x00000andsuchstuff "variables" is empty. ---------------------------------------------> :confused: :confused: :confused: is there a view where i can see e.g. which values/objects "turbulence->correct" uses and which values it gives back ?? Quote:
I use "open declaration" (F3) (F5 is refresh in my version). .....UPDATE !! : now most of the "open declaration"-calls work :eek: ...he seemed to be loading a while (about 1hour ), can i see the progress somewhere ? Quote:
Quote:
"Du bisch gut, kommst ind Supp. " thx again! |
Hi There,
i found great tutorial videos for eclipse here: http://eclipsetutorial.sourceforge.net/ but it is for java which is gonna mess with my shaki c++ . Does anyone know videos like this for c++ ? (I found some, but they are only covering the very basics or seem not to be working) THX! |
1 Attachment(s)
Hello and thanks for the tutorial!
The tutorial was really helpful and it's great to be able to run OF under a proper IDE. I was wondering if you could give me a hand with configuration since I have run into some little difficulties. On my laptop with OpenSUSE 11.2 everything went smoothly and I can debug my OF applications under Eclipse. On my desktop with OpenSUSE 11.3 I can't seem to get it right. Please, let me summarise what is happening. - OF is compiled in Debug mode. It was compiled in an Opt mode previously on the same machine. - I can add solver/cases to Eclipse project view. - I can compile my projects in Eclipse. - I can run Eclipse cases with an output to Eclipse console. - I can debug my applications with gdb However when I run Debug under eclipse it stops without any apparent reason. I get a set of runtime error messages (see log attached). GDB also informs me about missing debuginfo for libutil but it does not hinder the further debugging process and does not result in any errors. None of these problems appear on my laptop... Could you please advise? |
It seems that there is a bug in gdb 7.x - as it runs with gdb 6.x versions.. I wrote something about that in the IDE forum on extend-project.de..
http://www.extend-project.de/component/kunena/35-integrated-development-environment-ide-for-openfoam-group-forum/13-graphical-variable-visualisation-while-debugging Best, Astrid Mahrla |
Quote:
Anyway, many thanks for your reply. I will keep that in mind. Now it works very well. Also, thanks for the link! Just one thing that occurs to me... If this is a GDB bug, why does it work from a command line? |
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 |
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 |
Luther,
did you also compile the OpenFOAM sources after changing the value of the environmental variable? |
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 |
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.
|
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. |
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 |
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 |
Thanks for the reply.
Quote:
Quote:
Yes, I can compile from Eclipse. Quote:
|
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 |
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 |
Greetings yingkun,
Quote:
Best regards, Bruno |
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? |
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:
Bruno |
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. |
Hi yingkun,
Quote:
Use the same foamExec script, including its path, for launching the solver! In other words:
Bruno |
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:
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 |
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 |
Yup, that definitely makes sense! Shame on me... That must be the muggy weather.
|
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:
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 23:15. |