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

Eclipse for OpenFOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree13Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   May 5, 2010, 10:44
Default Eclipse for OpenFOAM
  #1
New Member
 
Astrid Mahrla
Join Date: May 2010
Location: Munich, Germany
Posts: 22
Rep Power: 7
AMahrla is on a distinguished road
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
anishtain4, Jonathan and menosoft like this.
AMahrla is offline   Reply With Quote

Old   May 5, 2010, 17:47
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,345
Blog Entries: 32
Rep Power: 72
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
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!!
wyldckat is offline   Reply With Quote

Old   May 6, 2010, 03:53
Default
  #3
New Member
 
Astrid Mahrla
Join Date: May 2010
Location: Munich, Germany
Posts: 22
Rep Power: 7
AMahrla is on a distinguished road
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...
AMahrla is offline   Reply With Quote

Old   May 11, 2010, 05:15
Default
  #4
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 367
Rep Power: 13
l_r_mcglashan will become famous soon enough
Good work, I use Eclipse too

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
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   May 12, 2010, 02:28
Default
  #5
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 774
Rep Power: 17
olesen will become famous soon enough
Quote:
Originally Posted by l_r_mcglashan View Post
Good work, I use Eclipse too

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'.
Attached Files
File Type: zip qwmake.zip (1.8 KB, 45 views)
olesen is offline   Reply With Quote

Old   May 13, 2010, 07:18
Default
  #6
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 367
Rep Power: 13
l_r_mcglashan will become famous soon enough
That's really useful, thanks for sharing your script.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   May 26, 2010, 15:58
Default Error with wmake
  #7
New Member
 
yu
Join Date: Nov 2009
Posts: 26
Rep Power: 6
universez is on a distinguished road
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
universez is offline   Reply With Quote

Old   May 26, 2010, 16:10
Default
  #8
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 367
Rep Power: 13
l_r_mcglashan will become famous soon enough
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.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   May 26, 2010, 16:17
Default wmake error
  #9
New Member
 
yu
Join Date: Nov 2009
Posts: 26
Rep Power: 6
universez is on a distinguished road
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 View Post
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.

Last edited by universez; May 26, 2010 at 16:48.
universez is offline   Reply With Quote

Old   May 28, 2010, 05:01
Default
  #10
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 367
Rep Power: 13
l_r_mcglashan will become famous soon enough
Are you able to run wmake in a terminal outside of eclipse? I can't see what would be wrong I'm afraid.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   June 1, 2010, 16:06
Default
  #11
New Member
 
yu
Join Date: Nov 2009
Posts: 26
Rep Power: 6
universez is on a distinguished road
I can run wmake in a terminal. but not in eclipse.

Thanks,
yu

Quote:
Originally Posted by l_r_mcglashan View Post
Are you able to run wmake in a terminal outside of eclipse? I can't see what would be wrong I'm afraid.
universez is offline   Reply With Quote

Old   June 2, 2010, 19:28
Default
  #12
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,345
Blog Entries: 32
Rep Power: 72
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Greetings Yu,

Quote:
Originally Posted by universez View Post
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
bkassar likes this.
wyldckat is offline   Reply With Quote

Old   June 4, 2010, 11:35
Default
  #13
New Member
 
yu
Join Date: Nov 2009
Posts: 26
Rep Power: 6
universez is on a distinguished road
Hi, Bruno,

Thank you, it works fine now.

Yu


Quote:
Originally Posted by wyldckat View Post
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
universez is offline   Reply With Quote

Old   June 9, 2010, 04:44
Default
  #14
Senior Member
 
Join Date: Dec 2009
Posts: 112
Rep Power: 6
heavy_user is on a distinguished road
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!

Last edited by heavy_user; June 9, 2010 at 06:01.
heavy_user is offline   Reply With Quote

Old   June 9, 2010, 10:28
Default
  #15
New Member
 
Astrid Mahrla
Join Date: May 2010
Location: Munich, Germany
Posts: 22
Rep Power: 7
AMahrla is on a distinguished road
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
AMahrla is offline   Reply With Quote

Old   June 9, 2010, 11:40
Default
  #16
Senior Member
 
Join Date: Dec 2009
Posts: 112
Rep Power: 6
heavy_user is on a distinguished road
Hi Astrid,


thanks for your reply!!


Quote:
Originally Posted by AMahrla View Post

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

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 View Post

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 ...he seemed to be loading a while (about 1hour ), can i see the progress somewhere ?


Quote:
Originally Posted by AMahrla View Post

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 View Post
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 is offline   Reply With Quote

Old   June 10, 2010, 09:21
Default
  #17
Senior Member
 
Join Date: Dec 2009
Posts: 112
Rep Power: 6
heavy_user is on a distinguished road
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!
heavy_user is offline   Reply With Quote

Old   January 4, 2011, 04:07
Default
  #18
Senior Member
 
Robert Sawko
Join Date: Mar 2009
Posts: 113
Rep Power: 12
AlmostSurelyRob will become famous soon enough
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?
Attached Files
File Type: txt eclipse-log.txt (7.1 KB, 23 views)

Last edited by AlmostSurelyRob; January 4, 2011 at 04:27.
AlmostSurelyRob is offline   Reply With Quote

Old   January 10, 2011, 05:13
Default
  #19
New Member
 
Astrid Mahrla
Join Date: May 2010
Location: Munich, Germany
Posts: 22
Rep Power: 7
AMahrla is on a distinguished road
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
AMahrla is offline   Reply With Quote

Old   January 10, 2011, 05:21
Default
  #20
Senior Member
 
Robert Sawko
Join Date: Mar 2009
Posts: 113
Rep Power: 12
AlmostSurelyRob will become famous soon enough
Quote:
Originally Posted by AMahrla View Post
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?
AlmostSurelyRob is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:29.