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/)
-   -   Eclipse for OpenFOAM (https://www.cfd-online.com/Forums/openfoam-programming-development/75800-eclipse-openfoam.html)

TUM January 10, 2013 03:11

Quote:

Originally Posted by fabian_roesler (Post 370595)

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?

I am having the same problem, did anyone manage to find a solution for this yet?

alquimista January 23, 2013 14:42

I also obtained several errors with "could not be resolved". I have spend my whole day trying to fix it without success. Are there some progress?

Thank you.

Tobi January 31, 2013 14:06

Hi all,

i tried to figure out the problem of the non resolved problem.
Still no solution!

DheepanPillai February 1, 2013 03:19

reg. "Symbol cannot be resolved" error
 
Hi,

The problem is that Eclipse does not read the header files without the
Code:

#ifndef
#define

format. createFields.H and other similar header files do not follow that format. I do not know how to solve, but may be the following experience may help people to solve it.

A Work Around :
Create a project and then click open file. Open the .C file which is not in the project directory. Now all problems will be resolved. As you can see, i created a project with icoDymFoam.C and opened LaplacianFoam.C ...... Even the auto complete function works!:D

https://lh5.googleusercontent.com/-2...Screenshot.jpg

alexmogavero February 1, 2013 05:13

I have just tried this solution and actually works in the sense that no warning appears within the source.
But I am afraid that in this case will not be possible to compile the code. Moreover in my case the auto complete function did not work.

DheepanPillai February 3, 2013 02:11

Hi Alessandro,

I am familiar neither with openfoam nor eclipse. :( And yes, it cannot be compiled when it is not in the workspace. But when i can open like that, it is very much easier for me to edit it, use autocomplete (in mine it works as shown), double-click on a class and open the file it was declared etc. After editing it in eclipse comfortably, i wmake it from terminal. :rolleyes:

Please do tell if you find any other solution!

Dheepan

alexmogavero February 3, 2013 05:01

Quote:

Originally Posted by DheepanPillai (Post 405696)
Hi Alessandro,

I am familiar neither with openfoam nor eclipse. :( And yes, it cannot be compiled when it is not in the workspace. But when i can open like that, it is very much easier for me to edit it, use autocomplete (in mine it works as shown), double-click on a class and open the file it was declared etc. After editing it in eclipse comfortably, i wmake it from terminal. :rolleyes:

Please do tell if you find any other solution!

Dheepan

Hi Dheepan,
I must check why in my case autocomplete does not work. Which is your eclipse version? Mine is Indigo. Anyway in my case, the auto complete function and search for declaration file works only for the function directly imported with #include.
All you have to do is to add manually to the search path the directory containing the included header.

Cheers
Alessandro

reynoldsStress February 14, 2013 12:40

Hi all,

Im using
  • OpenFOAM-2.1.x compiled in debug
  • Ubuntu 12.04
  • Eclipse 3.7.2 Indigo
  • wmake and wclean work in eclipse
  • a default solver works fine that is compiled by eclipse
  • every lninclude folder in openfoam is imported into the project

I can't seem to do code completion or resolve errors that should be fine since the headers are in my include path. If this is an issue with #ifndef, then how can Eclipse get around its own addition of #ifndef to classes defined in Eclipse? i went through the documents on the wiki....but maybe they are outdated with a new version of Eclipse? Anyone experiencing the same thing?

alexmogavero February 14, 2013 16:37

It seems that everyone has the same issue.
Anyway, may I ask you if you are able to perform the step by step debug?
I tried a lot but at the end I had to give up :(

Thanks
Alessandro

reynoldsStress February 14, 2013 16:44

Quote:

Originally Posted by alexmogavero (Post 407898)
It seems that everyone has the same issue.
Anyway, may I ask you if you are able to perform the step by step debug?
I tried a lot but at the end I had to give up :(

Thanks
Alessandro

Nope, not able to do step-by-step debugging. Im tempted to move over to Netbeans here.

alexmogavero February 14, 2013 16:53

That is a nice temptation... if you manage to do it let's us know the result:D

dzi March 6, 2013 08:30

something new here plus Allwmake problem fix
 
hello,
are there any new ideas about fixing this issue with eclipse? code competion and classbrowser would really be nice.... I tried older versions until eclipse helios, without real success (ubuntu 12.04).

Anyway, I also had a problem getting "Allwmake" to run properly (not found-in-Path-error) in eclipse after defining a make-target like explained in the eclipse-foam tutorial.

To get the "Allwmake" as make-target run in eclipse try following procedure:
properties->c/c++ build ->environment.
set PATH variable
append a variable to native environment
${ProjDirPath}
from variable dropdown list.
Now all compilation outputs are passed to eclipse-console (works in helios, but i expect the same for juno)
thx dirk

dzi March 7, 2013 09:35

to follow up, the problem is somehow related to the eclipse indexer which cannot resolve symbols, methods etc from header files. See eg
http://www.eclipse.org/forums/index.php/m/733997/

I tried on eclipse indigo to play around with the properties->c/c++general->Indexer->files to index up-front and added headerfiles here by tracing back in the definitions.

This feature does not exist in latest release (juno) because it was only a workaround in the former versions.

I could omit many of these "symbol not found remarks", but unfortunately not all.

hulk March 8, 2013 05:35

Hi,

I am also having problems with using wmake, I always get the two warnings, and an error at the end, saying that ld returned a satus of 1, so the application could not be compield:

/usr/bin/ld: warning: libPstream.so, needed by /home/niko/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so, not found (try using -rpath or -rpath-link)

and

/usr/bin/ld: warning: libfileFormats.so, needed by /home/niko/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libtriSurface.so, not found (try using -rpath or -rpath-link)

even though I tried to follow the tutorial, and setting up wmake like described. The compilation using wmake in the console is working just fine. Does any one know how to fix this?

jherb March 8, 2013 09:24

Problem with eclipse indexer solved
 
The problem with 'scalar' can be solved by adding the variable WM_DP to Properties for (Project) -> Paths and Symbols. Set it to any value, e.g. 1, for the C++ compiler (actully I added it to all configurations and all languages). I guess if you compile OpenFOAM with single precision, you should add the variable WM_SP instead. I didn't find a place in the OpenFOAM source code, where these variables are set, so I guess it is done by wmake somewhere (perhaps related to the environment variable WM_PRECISION_OPTION).


Quote:

Originally Posted by benk (Post 360135)
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?


Tobi March 22, 2013 08:25

1 Attachment(s)
Hi all,

I am back in programming with eclipse and OpenFOAM.
At the moment I rebuild a thermodynamic model for using it in 2.2.x

All variables are resolved and everything is working fine.

alexmogavero March 22, 2013 11:54

Hello Tobi,
sometimes I also got all the classes resolved, but I am not able to understand why it does not works always.
Does it is always reproducible for you?

Thanks

Sylv May 22, 2013 09:32

Quote:

Originally Posted by Tobi (Post 415695)
Hi all,

I am back in programming with eclipse and OpenFOAM.
At the moment I rebuild a thermodynamic model for using it in 2.2.x

All variables are resolved and everything is working fine.

Tobi, how did you manage to resolve all variables? I'm still stuck with this issue. I moved to qt-creator in the meantime...

Tobi May 24, 2013 07:43

Hi all,

hmmm,... I am not sure why everything is working there.

1. I copied the thermodynamic files into $FOAM_RUN/../developement/thermodynamics/

2. I added all the paths (lnInclude) from the Make Files into eclipse
3. finished.


At the moment I am not building any stuff so I can not say if everything is resolved all the time.

x86_64leon November 25, 2013 09:19

I had just opened a new thread about this issue of OF+eclipse, as it seems that information is a bit outdated. The thread can be found here :

http://www.cfd-online.com/Forums/ope...se-kepler.html

================================================== ==========


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

louisgag January 17, 2014 09:47

Lionel, make sure you complete the following step and wait for the indexer to reach 100% (bottom right of eclipse window)

Quote:

Originally Posted by jherb (Post 412552)
The problem with 'scalar' can be solved by adding the variable WM_DP to Properties for (Project) -> Paths and Symbols. Set it to any value, e.g. 1, for the C++ compiler (actully I added it to all configurations and all languages). I guess if you compile OpenFOAM with single precision, you should add the variable WM_SP instead. I didn't find a place in the OpenFOAM source code, where these variables are set, so I guess it is done by wmake somewhere (perhaps related to the environment variable WM_PRECISION_OPTION).

and that you add the paths mentioned in the wiki tutorial you mentioned.

These two steps worked for me.

-Louis

Henning86 September 23, 2014 09:20

i managed to compile the application with eclipse


but the i get a lot of errors:

type <scalar> could not be resolved

i tried to add the variable WM_DP in path and symbols/ includes but there is now variable WM_DP

where i have to define the variable?

best regards

Henning

louisgag September 26, 2014 04:17

Dear Henning,
If I remember correctly, you have to create the variable yourself.
-Louis

Magid November 18, 2014 08:21

Debugger jump to wrong line
 
Dear Foamer,

I would like to step through the source of my own solver and OpenFoam 2.1 . I hope you have some hints for me what to do.
I have the following problems with Eclipse:

1) I have to click on the step-over button several times to execute the
highlighted line and to jump to the next line. Thereby the debugger jumps often to the wrong line such as a comment line.

2) When the debugger executes a method, the Variable-View will be also refreshed in such a way that for a few minutes the GDB activity is at 100%.

I use:
OpenFoam 2.1
GDB version 7.6
Eclipse Kepler
Ubuntu 12.04

kenyi89 February 10, 2015 07:30

Hi all,

I have a problem similar to the last post, only using Ubuntu 14.04. The debugger gets stuck in my case on the first line, when progressing gdb starts running with occupying 1 core at 100%. However it never finishes executing the statement and crashes eventually (after 20 minutes).

Given it is very difficult by now to downgrade GDB to 6.x (the crash appears to happen only with GDB 7.x) currently it's not possible to debug openFOAM with Eclipse. Any help on this issue would be greatly appreciated. Currently I'm circumventing the issue by using QtCreator instead of Eclipse, which doesn't seem to have this problem.

berezka February 19, 2015 03:42

some problem
 
Hi,
i want to debug icoFoam solver, but i have some problem:
after creating a c++ project and importing an icoFoam directory, i've tried to add all includes to the project (properties--> c++ general --> path and symbols). I think that i should include all the includes according to Make/options file. Am i correct ?
After that, a lot of errors appeares in Problems window, like "symbol 'mesh' could not be resolved". So how to compile and debug with this problem ? ...
__
P.S. I have never used Eclipse before.

Tariq Ahmed February 23, 2015 08:47

Eclipse 3.6.1
 
Hi,
I am new to OpenFOAM and eclipse. I am currently using OpenFOAM-2.3.x and eclipse 3.6.1 (Scientific Linux 6, KD Environment). I am using sprayFOAM for my work and I used the tutorial as mentioned in some of the posts above
  • To launch wmake, use: Code:
    $HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec wmake
    Update OpenFOAM version/path accordingly to your installation.
  • Likewise for launching the built solver; for example, to run icoFoam: Code:
    $HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec icoFoam
    Or even for extended completeness: Code:
    $HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec icoFoam -case $HOME/OpenFOAM/$USER-1.6/mytestcase
    This way it will run on the case "$HOME/OpenFOAM/$USER-1.6/mytestcase".
But when I run my project, I get the following error


" /home12233/tariq/OpenFOAM/tariq-2.3.x/platforms/linux64GccDPOpt/bin/mysprayFoam: error while loading shared libraries: libfiniteVolume.so: cannot open shared object file: No such file or directory"


and in the problems tab of eclipse,


" Invalid project path: Duplicate path entries found (/mysprayFoam [Include path] isSystemInclude:true includePath:/usr/local/intel/composer_xe_2013.4.183/mkl/include), path: [/mysprayFoam]. "




The eclipse is able to build the project but not run the project



**** Build of configuration Debug for project mysprayFoam ****

/home12233/tariq/OpenFOAM/OpenFOAM-2.3.x/bin/foamExec wmake all
+ wmake
make: `/home12233/tariq/OpenFOAM/tariq-2.3.x/platforms/linux64GccDPOpt/bin/mysprayFoam' is up to date.
+ wmake sprayEngineFoam
make: `/home12233/tariq/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/bin/sprayEngineFoam' is up to date.



I am able to run my case from the konsole terminal but not the eclipse. The eclipse is able to update the libraries but not run the project.


Many people posted the above error but no solution to this problem was given. It will be helpful if someone is able to guide me through this.

kenyi89 February 23, 2015 08:56

Hi Tariq,

Regarding your error in libfiniteVolume.so, it is most likely caused by Eclipse not having the right environment variables set. Perhaps you could try starting a terminal, sourcing the etc/bashrc file in the OpenFOAM folder, and then launching Eclipse from that same terminal? That worked for me.

Kind regards,

Jeroen

Tariq Ahmed February 27, 2015 08:51

Eclipse 3.6.1 works
 
Quote:

Originally Posted by kenyi89 (Post 533028)
Hi Tariq,

Regarding your error in libfiniteVolume.so, it is most likely caused by Eclipse not having the right environment variables set. Perhaps you could try starting a terminal, sourcing the etc/bashrc file in the OpenFOAM folder, and then launching Eclipse from that same terminal? That worked for me.

Kind regards,

Jeroen

Thanks Mr.Jeroen, Now I am able to run my case in eclipse. Sourcing from the terminal seems to work.:)

Regards,
tariq

abiy October 8, 2017 16:20

'scalar' and 'label' are not recognized in NetBeans
 
Quote:

Originally Posted by benk (Post 360135)
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 :D:

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?


If you are using the NetBean as a code editor and use the wmake command on ur Linux terminal to compile your code, those errors actually don't produce any problem in the compilation process. However, if you want to get away from those errors you can define the 'scalar' as a 'double' value by the typedef syntax as follows inside the definition of your class contained in the *.H files. I have also included a similar solution for 'label' types in OpenFOAM using 'int' type, they are also not recognized by NetBeans usually.

Code:


typedef double scalar;
typedef int label;



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