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

OpenFoam 2.X and Eclipse Kepler

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 2 Post By LiteCFD
  • 6 Post By bkassar

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 25, 2013, 08:37
Default OpenFoam 2.X and Eclipse Kepler
  #1
New Member
 
Lionel GAMET
Join Date: Nov 2013
Location: Lyon
Posts: 20
Rep Power: 13
x86_64leon is on a distinguished road
Hi everybody,

New to OpenFoam, I'm trying to set up a development environment using Eclipse (Kepler version) and OpenFoam 2.2.2.

I have tried many options and also tried to follow the tutorial at
http://openfoamwiki.net/index.php/Ho...M_with_Eclipse

but was not really successful in having Eclipse to be correctly able to edit OF files.
Instructions on the OF Wiki might be out dated with regards to OF 2.X and latest Eclipse versions.

The problem are many "symbol 'XXX' could not be resolved" in some (but not all) source files.

I have tried to import subdirectories or complete OF root, as an Eclipse C++ project.

I have tried to add Symbols (like WM_DP for instance) in the project <Properties> under <C/C++ General>/<Paths and Symbols>/<#Symbols> menu.

I have tried to add all or only some lnInclude directories under <C/C++ General>/<Paths and Symbols>/<Includes> menu.

None of these worked.

It seems Eclipse get lost in indexing the project.

Anybody has succeeded in having OF 2.X handled correctly under Eclipse ?

Regards

Lionel

Last edited by x86_64leon; November 25, 2013 at 08:38. Reason: Wrong message
x86_64leon is offline   Reply With Quote

Old   November 25, 2013, 11:20
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
One problem, I was never able to solve are the "macro" files used in solvers: As they are .h files which do not include the rest of the solver, variables defined in the solver .c file or other .h files included somewhere else in the solver can not be resolved in such a macro file.

Can you give examples of symbols (in which source files?) which cannot be resolved?
jherb is offline   Reply With Quote

Old   November 25, 2013, 11:55
Default
  #3
New Member
 
Lionel GAMET
Join Date: Nov 2013
Location: Lyon
Posts: 20
Rep Power: 13
x86_64leon is on a distinguished road
In some files, I have seen macros working perfectly while not in others....

For instance, macro "transFunc" is not recognized in src/OpenFoam/Scalar/Scalar.H while it is OK in file src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C, where you can hover your mouse and see what the macro does ...

Very strange behavior.

I posted an image showing a non working file, like src/OpenFoam/Scalar/Scalar.H and another file working well. Hope the image can be viewed in the forum.

On the lhs of the image, you can see that symbols Scalar, pTraits, Istream, etc ... are not resolved.
Attached Images
File Type: jpg OF-eclipse--Scalar.H--VectorSpace.H.jpg (94.9 KB, 69 views)
x86_64leon is offline   Reply With Quote

Old   November 25, 2013, 15:01
Default
  #4
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
Scalar.H (with capital S at the beginning) is only included in double/floatScalar.H It needs the definition of Scalar which is defined in these files by a typedef. So it compiles. But Eclipse has no chance to know this. This causes the error messages.

I guess most of the problems reported by Eclipse are caused by similar missing definitions.
jherb is offline   Reply With Quote

Old   November 26, 2013, 04:28
Default
  #5
New Member
 
Lionel GAMET
Join Date: Nov 2013
Location: Lyon
Posts: 20
Rep Power: 13
x86_64leon is on a distinguished road
Thanks for your helpful hints !

One of the other common problems I encounter with OF in eclipse are :

"Symbol 'runTime' could not be resolved"

This appears in solvers. +other unresolved symbols.
For instance in applications/solvers/incompressible/pimpleFoam/pimpleFoam.C.

Has anybody also experienced or solved these problems ?
x86_64leon is offline   Reply With Quote

Old   December 2, 2013, 04:59
Default
  #6
New Member
 
Lionel GAMET
Join Date: Nov 2013
Location: Lyon
Posts: 20
Rep Power: 13
x86_64leon is on a distinguished road
Hi all

I finally have understood what the problem was with unresolved symbols by eclipse.

It arises from the usage of include files for defining variables. For instance, the "runtime" variable is defined in include file "createTime.H". If you manually inline the code contained in "createTime.H" in a problematic file, everything gets fine for Eclipse.

So it seems Eclipse cannot resolve those symbols that are defined in files included directly in the source code. Those files are not real "include" files, in the meaning of C++ or C standards but are rather pieces of source code commonly used.

Has anybody been able to solve this under Eclipse ?

Regards
x86_64leon is offline   Reply With Quote

Old   January 24, 2014, 11:48
Default
  #7
New Member
 
Anonymous
Join Date: Mar 2012
Posts: 13
Rep Power: 14
LiteCFD is on a distinguished road
Hi all

Yesterday i tried to build openFoam solver via Eclipse with no success.
Today I gotten working project without Eclipse's problem for an one hour in QtCreator.
Eclipse good IDE, but solving nonobvious problems is not good waste of time. So, I suggest using QtCreator.

http://openfoamwiki.net/index.php/Ho...with_QtCreator

Best regards
songwukong and rkc.cfd like this.
LiteCFD is offline   Reply With Quote

Old   February 7, 2014, 16:28
Default
  #8
Member
 
Krishna
Join Date: Jun 2012
Posts: 33
Blog Entries: 1
Rep Power: 14
rkc.cfd is on a distinguished road
Hello All,

I have posted the question in elipse forum and got no answer. I am also switching to Qt-Creator as its easy to setup.

http://www.eclipse.org/forums/index.php/t/628402/
rkc.cfd is offline   Reply With Quote

Old   February 9, 2014, 15:36
Default
  #9
Member
 
Krishna
Join Date: Jun 2012
Posts: 33
Blog Entries: 1
Rep Power: 14
rkc.cfd is on a distinguished road
Hello All,

I have tested the new version of eclipse and openfoam, the same problem exists. It was working partially, but not reliable.

Cheers,

RKC

Last edited by rkc.cfd; February 10, 2014 at 13:25.
rkc.cfd is offline   Reply With Quote

Old   July 10, 2014, 16:27
Default
  #10
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
Just an update: Some/most of the error message go away if one selects in Project Properties -> C/C++ General -> Preprocessor Include Path -> Providers both, CDT GCC Build-in Compiler Settings and CDT Managed Build Settings Entries. The former one adds your settings under (Path and Symbols, namely the symbols WM_DP and WP_DP). The latter includes the directories and symbols used automatically by gcc (e.g. __INT_MAX__).
jherb is offline   Reply With Quote

Old   August 5, 2014, 19:11
Default
  #11
New Member
 
Bruno Kassar
Join Date: Apr 2014
Location: Rio de Janeiro
Posts: 9
Rep Power: 12
bkassar is on a distinguished road
Hi everyone,
Following the discussions in the forum, I managed to make Eclipse compile ok.
However, I still got the same issues with code completion.
Specially for variables declared in *.H files.
For the ones who tried QtCreator, did it work without any problem?
And, how about Netbeans?
cheers,
Bruno
bkassar is offline   Reply With Quote

Old   August 14, 2014, 13:02
Default
  #12
New Member
 
Bruno Kassar
Join Date: Apr 2014
Location: Rio de Janeiro
Posts: 9
Rep Power: 12
bkassar is on a distinguished road
Hi all,
After struggling with Eclipse and Netbeans, I decided to give Qt Creator a try.
I followed the instructions on the wiki (http://openfoamwiki.net/index.php/Ho...with_QtCreator) and found it would be useful to give a complete tutorial with more figures. So I posted a tutorial on how to install and setup Qt Creator for OpenFOAM in the following link http://www.tecgraf.puc-rio.br/~bkassar/openFOAM/QtFOAM/
Hope it helps.
cheers,
Bruno
bkassar is offline   Reply With Quote

Old   August 14, 2014, 15:53
Default
  #13
Member
 
Krishna
Join Date: Jun 2012
Posts: 33
Blog Entries: 1
Rep Power: 14
rkc.cfd is on a distinguished road
Thanks Bruno for the nice tutorial.
rkc.cfd is offline   Reply With Quote

Old   August 15, 2014, 04:39
Default
  #14
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 bkassar View Post
Hi all,
After struggling with Eclipse and Netbeans, I decided to give Qt Creator a try.
I followed the instructions on the wiki (http://openfoamwiki.net/index.php/Ho...with_QtCreator) and found it would be useful to give a complete tutorial with more figures. So I posted a tutorial on how to install and setup Qt Creator for OpenFOAM in the following link http://www.tecgraf.puc-rio.br/~bkassar/openFOAM/QtFOAM/
Hope it helps.
cheers,
Bruno
Could you add how to use github/bitbucket or a similar service to the picture tutorial. I think it could be quite useful.
__________________
~roman
romant is offline   Reply With Quote

Old   September 6, 2014, 20:28
Default
  #15
New Member
 
Bruno Kassar
Join Date: Apr 2014
Location: Rio de Janeiro
Posts: 9
Rep Power: 12
bkassar is on a distinguished road
Hi Roman,
I will quickly reply it here an then, when I find some spare time, I can add this to the tutorial. I use PySVN WorkBench. It is quite straightforward to use.
It is available at Ubuntu Software Center. After installing it, you just need to add your project:
Go to "Project"-> "Add...", then type the URL of your subversion project. After that, select the folder you want to copy your project files to and set a name to your Project.
Then, right-click on your project on the left pane and select "Checkout". This will download all files from the SVN repository.
Any time you modify your working copy, you can "Checkin" to upload your modifications to the repository.

cheers,
Bruno
bkassar 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse for OpenFOAM AMahrla OpenFOAM Programming & Development 109 October 8, 2017 17:20
OpenFoam & Eclipse gary7 OpenFOAM Programming & Development 4 March 19, 2012 12:29
Eclipse - case debug error Bufacchi OpenFOAM 1 February 7, 2012 16:15
Debugging in Eclipse carowjp OpenFOAM Programming & Development 1 October 1, 2011 17:06
OpenFOAM + Eclipse Svensson OpenFOAM 2 April 10, 2011 12:02


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