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   April 12, 2012, 13:10
Default
  #61
Member
 
Join Date: Feb 2012
Posts: 35
Rep Power: 14
Matt_B is on a distinguished road
Thank you, Bruno! It worked finally!
Now I just have to understand well how to manage the debugging in a proper way...but, anyway, the most difficult part hope to have left behind.

Bye for now!

Matteo
Matt_B is offline   Reply With Quote

Old   April 28, 2012, 17:56
Default
  #62
Member
 
Santiago
Join Date: Dec 2009
Posts: 85
Rep Power: 16
gascortado is on a distinguished road
Bruno you may know the answer to my problem:

I have OF-1.6-ext in my system after installing it using the Synaptic manager so I guess this is a precompiled version. Now, I need to use Eclipse for debugging of some of my applications and for that reason I need to have OF-1.6-ext in debug mode. At least that is what I understood from the tutorial. So it seems to me that I need to recompile OF-1.6-ext. Is it possible to do this using the installed version that I mentioned before??

When I run my case form eclipse I see the progress of the simulation but I cannot see any of the variable or insert any breakpoints and for what I understand that is due to the fact that my version of OF is not compiled in debug mode...


Any suggestions will be appreciated. Thanks
gascortado is offline   Reply With Quote

Old   April 28, 2012, 18:11
Default
  #63
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
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 Santiago,

Whether you like it or not, you better install 1.6-ext from source and then switch to debug mode.
I'm advising you this because I suspect that the packages supplied in deb format don't fully provide everything necessary for building it in debug mode

Good luck!
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   April 28, 2012, 22:57
Default
  #64
Member
 
Santiago
Join Date: Dec 2009
Posts: 85
Rep Power: 16
gascortado is on a distinguished road
Thanks Bruno. I will try that. Where can I download the sources to build 1.6-ext.? I just want to make sure that I have the correct source files before I try to build this. Thanks
gascortado is offline   Reply With Quote

Old   April 29, 2012, 06:53
Default
  #65
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
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 Santiago,

I wish you very good luck... the instructions I know of, but never have used myself, are these: http://www.extend-project.de/user-fo...n-openfoam#276

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 9, 2012, 13:11
Default
  #66
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19
benk is on a distinguished road
Hi, I just got Eclipse mostly working on my mac and I think it is very helpful.

There were a couple of things that I had to do to get it working on my macbook though because eclipse was having problems finding wclean/wmake. Instructions to fix it can be found here, but basically what you have to do is:

1. (Note: I'm using the binary version of OpenFOAM 1.6-ext on my mac) Make a shell script called eclipse.sh that sources the bashrc script and then starts eclipse. Something like this (the locations of the .dmg file and bashrc are specific to my system):
Code:
#!/bin/sh

hdiutil mount ~/OpenFOAM-1.6-ext-swak-Feb4.dmg
source ~/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc

logger "`dirname \"$0\"`/eclipse"

exec "`dirname \"$0\"`/eclipse" $@
2. Move this script to: /Applications/eclipse/Eclipse.app/Contents/MacOS/
3. Edit the file /Applications/eclipse/Eclipse.app/Contents/Info.plist and underneath "CFBundleExecutable" replace "eclipse" with "eclipse.sh"
4. Now you can just launch eclipse from the Finder the normal way.


So, now on to my problem :

My solvers compile without any problem and eclipse can find all of the included files, but I'm getting a lot of flags warning of problems like "Type 'scalar' could not be resolved" and "Symbol 'runTime' could not be resolved". An example of what I mean is in the screen shot that I attached.

This is more of an annoyance since the compile still works but is there a way to fix these things?
Attached Images
File Type: jpg Screen Shot 2012-05-09 at 12.03.28 PM.jpg (43.5 KB, 79 views)
benk is offline   Reply With Quote

Old   June 1, 2012, 06:55
Default
  #67
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
hi all,

i set up my eclipse for development.
I did everything mentioned in the wiki but there is still one problem:

If I have a library and added a header-file of an other library there is the message
Code:
unresolved inclusion
well I added the lnInclude directory to the symbols and links in the project.
I can compile the library without a error and everything works very fine but at least I wanna have a code without a underlined line

Hope that you understand my question.
tobi


FIXED

Last edited by Tobi; June 1, 2012 at 08:00.
Tobi is offline   Reply With Quote

Old   June 1, 2012, 08:15
Default
  #68
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
romant is on a distinguished road
Quote:
Originally Posted by Tobi View Post
FIXED
how did you fix it?
__________________
~roman
romant is offline   Reply With Quote

Old   June 1, 2012, 09:28
Default
  #69
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Well,

I looked into the project folders in eclipse. There is the folder called lnInclude with all included links. I saw that my include file was not correct written and one of the c++ project I renamed from "common" to "libCommon". So the path was wrong to. After delete it and recreate the link everything works fine.



Tobi
Tobi is offline   Reply With Quote

Old   June 2, 2012, 11:39
Default
  #70
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
hi,

well i have a question to you!
I imported icoFoam but eclipse do not know what the functions are!

Included /src/OpenFOAM/lnInclude and /src/finiteVolume/lnInclude

What do i wrong?

Do I use OF in Debugversion? for that

Tobi
Attached Images
File Type: jpg Bildschirmfoto vom 2012-06-02 16:36:50.jpg (50.9 KB, 124 views)

Last edited by Tobi; June 2, 2012 at 12:10.
Tobi is offline   Reply With Quote

Old   June 2, 2012, 18:47
Default
  #71
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
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 Tobi,

By what I can read from the error message on the picture you attached, you forgot to configure the project to use wmake instead of make.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   June 2, 2012, 18:55
Default
  #72
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by wyldckat View Post
Hi Tobi,

By what I can read from the error message on the picture you attached, you forgot to configure the project to use wmake instead of make.

Best regards,
Bruno
Hi, not really that 's couse I am to fast with my fingers and always clicking on "RUN" instead on the wmake.

The only thing is the underlinded funktions like .time() or so on. Eclipse don't know those functions so i thought there is a lnInclude folder missing?
Tobi is offline   Reply With Quote

Old   July 10, 2012, 05:59
Question Symbols in header files cannot be resolved
  #73
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18
fabian_roesler is on a distinguished road
Hi Tobi

Did you succeed with this annoying include problem? With Ubuntu 10.04 everything was fine. Now I switched to Ununtu 12.04 and Eclipse Indigo and I face the same problem you did before. With a clean install of Eclipse and OF-2.1.x all symbols in header files cannot be resolved. However, compilation works fluently. Any solution?

Thanks and best wishes

Fabian
fabian_roesler is offline   Reply With Quote

Old   July 10, 2012, 13:55
Default
  #74
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
No sorry, I didn `t manage it
Tobi is offline   Reply With Quote

Old   July 30, 2012, 06:28
Default GDB version used
  #75
New Member
 
Krendel's Avatar
 
Victor
Join Date: Jul 2012
Location: Moscow
Posts: 2
Rep Power: 0
Krendel is on a distinguished road
Does anybody use GDB-7.x ?
Or GBD-6.8 is the right version only?
Krendel is offline   Reply With Quote

Old   August 1, 2012, 07:43
Default About lnInclude and #includes
  #76
New Member
 
Ivo
Join Date: Feb 2012
Posts: 26
Rep Power: 14
Ivooo is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi, not really that 's couse I am to fast with my fingers and always clicking on "RUN" instead on the wmake.

The only thing is the underlinded funktions like .time() or so on. Eclipse don't know those functions so i thought there is a lnInclude folder missing?
I've had the problem with Eclipse giving errors on 'runtime.run' or 'mesh', and many other parts of the code. It is caused by the way the '#includes' of .H files is used in OF, many being parts of code rather than actual header files; if you copy the contents of, for instance, createTime.H (just 2 lines) to the location where #include createTime.H is (and comment out the #include line), the 'runtime.run' does not give an error anymore. The same goes for createMesh.H and so on... Apparently, Eclipse does not index these code snippets in editor mode. For the same reason, editing these non-header .H files does not give you the benefits of an IDE such as code completion or even highlighting. I'm not really comfortable with replacing in all these parts of the code, since it may need much maintenance in the future...

Something I noticed to be missing on the OpenFOAM-Eclipse-wiki is that you should also include any lnInclude directories in the Make/options file (just to make sure that each _real_ header file is actually found, not just those in src/finiteVolume/lnInclude and src/OpenFOAM/lnInclude. For instance, if you're using interFoam, you want to include
OpenFOAM/OpenFOAM-2.1.0/src/transportModels/incompressible/lnInclude
OpenFOAM/OpenFOAM-2.1.0/src/transportModels/interfaceProperties/lnInclude
OpenFOAM/OpenFOAM-2.1.0/src/turbulenceModels/incompressible/turbulenceModel
(perhaps obvious, I'm mentioning it anyway )

Now I have another problem; I followed the OF-into-Eclipse wiki but it doesn't compile my interFoam-like solver in Eclipse Juno (latest version as of now). Instead, it gives me some error messages about 'Invoking autoreconf in build directory' and so on, but I couldn't figure out how to disable autoreconf - it seems to be an integral part of the IDE. Apparently, it stops when it encounters the autoconf errors and doesn't even start with invoking wmake.
apple-tree and DheepanPillai like this.
Ivooo is offline   Reply With Quote

Old   October 23, 2012, 12:35
Default Underlined classes and methods?
  #77
Member
 
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16
gary7 is on a distinguished road
Hi all,

I did include the other lninclude directories as in the Make/options of the solver (e.g. simpleFoam) in Path and Symbols but I still get underlined functions and "Symbol ... could not be resolved" when I hover mouse on a function like runtime.
I can compile and build the project with no problem though.
gary7 is offline   Reply With Quote

Old   October 24, 2012, 07:48
Default
  #78
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
In a few weeks I ll have a look at that problem again and inform all of you if I can solve the problem.

Tobi
gary7 likes this.
Tobi is offline   Reply With Quote

Old   November 7, 2012, 08:23
Question
  #79
New Member
 
Alessandro Mogavero
Join Date: Nov 2012
Location: Glasgow
Posts: 15
Rep Power: 14
alexmogavero is on a distinguished road
Hi all,
I am trying to manage openFoam source code with eclipse. Following the guide provided on this web site and this tread finally I got it work for the run configuration.
It worked also for the debug mode, but I was able just to stop in the main function without getting any information on the variables. Moreover I was not able to go foreword.
Then reading this tread again I understood that there is a bug in gdb 7x with eclipse, so I downgraded it to the version 6.8.
Now I've actually got some information on the variables, but I've soon got the following error:
Code:
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libm.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail /build/buildd/gdb-6.8/bfd/elf64-x86-64.c:278
[Thread debugging using libthread_db enabled]
[New Thread 0x7f55bd0ed740 (LWP 4854)]
[Switching to Thread 0x7f55bd0ed740 (LWP 4854)]
Cannot access memory at address 0x4008000000000000
Single stepping until exit from function main, 
Invalid binary operation on numbers.
which has no line number information.
and I've also got the error: No source available for "main() at 0x42fc38" that I did not get with the gdb 7x.
Of course I build the source in Debug mode.

Thank you for any suggestion
alexmogavero is offline   Reply With Quote

Old   November 7, 2012, 10:25
Question
  #80
New Member
 
Alessandro Mogavero
Join Date: Nov 2012
Location: Glasgow
Posts: 15
Rep Power: 14
alexmogavero is on a distinguished road
Updating...
I tried to debug a simple Hello world program with gdb 6.8 and I've got the same error, then I switched back to gdb 7.x and the Hello world program worked very well!
Thus I believe that it is not an issue of gdb, but may be an issue related with how wmake build openFoam. Indeed I built the Hello world program using the default builder of Eclipse.
I guess that gdb miss some files due to the fact that wmake place them in some unrecognised folder.

Anyone can give me a feedback about this?
alexmogavero 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 21:24.