|
[Sponsors] |
November 25, 2013, 08:37 |
OpenFoam 2.X and Eclipse Kepler
|
#1 |
New Member
Lionel GAMET
Join Date: Nov 2013
Location: Lyon
Posts: 20
Rep Power: 13 |
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 |
|
November 25, 2013, 11:20 |
|
#2 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
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? |
|
November 25, 2013, 11:55 |
|
#3 |
New Member
Lionel GAMET
Join Date: Nov 2013
Location: Lyon
Posts: 20
Rep Power: 13 |
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. |
|
November 25, 2013, 15:01 |
|
#4 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
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. |
|
November 26, 2013, 04:28 |
|
#5 |
New Member
Lionel GAMET
Join Date: Nov 2013
Location: Lyon
Posts: 20
Rep Power: 13 |
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 ? |
|
December 2, 2013, 04:59 |
|
#6 |
New Member
Lionel GAMET
Join Date: Nov 2013
Location: Lyon
Posts: 20
Rep Power: 13 |
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 |
|
January 24, 2014, 11:48 |
|
#7 |
New Member
Anonymous
Join Date: Mar 2012
Posts: 13
Rep Power: 14 |
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 |
|
February 7, 2014, 16:28 |
|
#8 |
Member
|
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/ |
|
February 9, 2014, 15:36 |
|
#9 |
Member
|
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. |
|
July 10, 2014, 16:27 |
|
#10 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
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__).
|
|
August 5, 2014, 19:11 |
|
#11 |
New Member
Bruno Kassar
Join Date: Apr 2014
Location: Rio de Janeiro
Posts: 9
Rep Power: 12 |
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 |
|
August 14, 2014, 13:02 |
|
#12 |
New Member
Bruno Kassar
Join Date: Apr 2014
Location: Rio de Janeiro
Posts: 9
Rep Power: 12 |
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 |
|
August 15, 2014, 04:39 |
|
#14 | |
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21 |
Quote:
__________________
~roman |
||
September 6, 2014, 20:28 |
|
#15 |
New Member
Bruno Kassar
Join Date: Apr 2014
Location: Rio de Janeiro
Posts: 9
Rep Power: 12 |
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 |
|
|
|
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 |