CFD Online Discussion Forums

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

AMahrla May 5, 2010 10:44

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

wyldckat May 5, 2010 17:47

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!!

AMahrla May 6, 2010 03:53

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...

l_r_mcglashan May 11, 2010 05:15

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

olesen May 12, 2010 02:28

1 Attachment(s)
Quote:

Originally Posted by l_r_mcglashan (Post 258289)
Good work, I use Eclipse too :D

Do you know if it's possible to "ssh" to a server and run wmake?

No real problem, but you probably want to use the wmakeScheduler mechanism for doing this. A common slip-up is not having the correct OpenFOAM environment defined on the remote server, but the wmakeScheduler usually gets it right for you.

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'.

l_r_mcglashan May 13, 2010 07:18

That's really useful, thanks for sharing your script.

universez May 26, 2010 15:58

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

l_r_mcglashan May 26, 2010 16:10

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.

universez May 26, 2010 16:17

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:

Originally Posted by l_r_mcglashan (Post 260408)
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.


l_r_mcglashan May 28, 2010 05:01

Are you able to run wmake in a terminal outside of eclipse? I can't see what would be wrong I'm afraid.

universez June 1, 2010 16:06

I can run wmake in a terminal. but not in eclipse.

Thanks,
yu

Quote:

Originally Posted by l_r_mcglashan (Post 260630)
Are you able to run wmake in a terminal outside of eclipse? I can't see what would be wrong I'm afraid.


wyldckat June 2, 2010 19:28

Greetings Yu,

Quote:

Originally Posted by universez (Post 261245)
I can run wmake in a terminal. but not in eclipse.

Are you running Eclipse from the terminal or from the application menu? The terminal calls ~/.bashrc by itself, but starting an application from the "Applications" menu usually doesn't call the terminal first!

If you wish to always start eclipse from the menu, you have various solutions, some of which are:
  • edit the menu, then edit the Eclipse menu item and switch to "Type: Application in Terminal".
  • or, in Eclipse, instead of just using to wmake, also use the auxiliary OpenFOAM script to start up the environment for running OpenFOAM applications, like so:
    Code:

    $HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec wmake
    You might want to replace "$HOME" for your actual home folder, just in case ;) Also, use that foamExec script for starting your custom solver or utility in Eclipse.
  • or, to simplify the previous possibility, add a new entry to the "Applications" menu, where you have the Eclipse item, clone it, and change the cloned version to run foamExec prior to eclipse.
Mmmm... I thought I would have more possible solutions, but I'm already all out of possibilities for now :(

Best regards,
Bruno

universez June 4, 2010 11:35

Hi, Bruno,

Thank you, it works fine now. ;)

Yu


Quote:

Originally Posted by wyldckat (Post 261470)
Greetings Yu,


Are you running Eclipse from the terminal or from the application menu? The terminal calls ~/.bashrc by itself, but starting an application from the "Applications" menu usually doesn't call the terminal first!

If you wish to always start eclipse from the menu, you have various solutions, some of which are:
  • edit the menu, then edit the Eclipse menu item and switch to "Type: Application in Terminal".
  • or, in Eclipse, instead of just using to wmake, also use the auxiliary OpenFOAM script to start up the environment for running OpenFOAM applications, like so:
    Code:

    $HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec wmake
    You might want to replace "$HOME" for your actual home folder, just in case ;) Also, use that foamExec script for starting your custom solver or utility in Eclipse.
  • or, to simplify the previous possibility, add a new entry to the "Applications" menu, where you have the Eclipse item, clone it, and change the cloned version to run foamExec prior to eclipse.
Mmmm... I thought I would have more possible solutions, but I'm already all out of possibilities for now :(

Best regards,
Bruno


heavy_user June 9, 2010 04:44

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!

AMahrla June 9, 2010 10:28

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

heavy_user June 9, 2010 11:40

Hi Astrid,


thanks for your reply!!


Quote:

Originally Posted by AMahrla (Post 262303)

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.
Astrid

....wow :confused: ...if you want to make a video one day "how to use the debugger properly" i will be glad to assist watching the outcome ;) !

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:

Originally Posted by AMahrla (Post 262303)

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.
Astrid

I did some playing arround and with the "open declaration" option I get a result for ".write" and "turbulence" now...but still no luck with "correct" or "runTime"...or such things..does everyone work for you ?
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:

Originally Posted by AMahrla (Post 262303)

3. Sorry - no idea.. maybe this depends on the files you imported in your workspace..
Astrid

The autocompletion does not work at all, also for the things where he finds the declaration. Is there a way to check on it - to figure out why it does not work?

Quote:

Originally Posted by AMahrla (Post 262303)
Hope this could help you a little bit..
Astrid

YEA, great WORK... here we would say :
"Du bisch gut, kommst ind Supp. "


thx again!

heavy_user June 10, 2010 09:21

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!

AlmostSurelyRob January 4, 2011 05:07

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?

AMahrla January 10, 2011 06:13

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

AlmostSurelyRob January 10, 2011 06:21

Quote:

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

Good grief... and I have made a downgrade of the whole system to OpenSUSE 11.2 because of this issue. I knew it's an overkill...

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?


All times are GMT -4. The time now is 05:40.