CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   OpenFoam 2.X and Eclipse Kepler (https://www.cfd-online.com/Forums/openfoam-programming-development/126736-openfoam-2-x-eclipse-kepler.html)

x86_64leon November 25, 2013 07:37

OpenFoam 2.X and Eclipse Kepler
 
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

jherb November 25, 2013 10:20

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?

x86_64leon November 25, 2013 10:55

1 Attachment(s)
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.

jherb November 25, 2013 14:01

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.

x86_64leon November 26, 2013 03:28

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 December 2, 2013 03:59

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

LiteCFD January 24, 2014 10:48

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

rkc.cfd February 7, 2014 15:28

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 February 9, 2014 14:36

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

jherb July 10, 2014 15:27

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

bkassar August 5, 2014 18:11

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 August 14, 2014 12:02

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

rkc.cfd August 14, 2014 14:53

Thanks Bruno for the nice tutorial. :)

romant August 15, 2014 03:39

Quote:

Originally Posted by bkassar (Post 506018)
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.

bkassar September 6, 2014 19:28

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


All times are GMT -4. The time now is 20:53.