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)

AMahrla July 19, 2011 05:27

Hi Arne,

as I can only guess, what's the real problem, you could try to include the "lnIncludes". We've added some line to the Eclipse-entry in the OpenFOAM-Wiki at the end of chapter 5.2 ...

This should also improve the autocompletion..

Best,

Astrid

anfho August 22, 2011 14:09

Dear Foamers,


I just wanted to make sure these combinations of versions will play well together before I will waste time on solving version related issues...


I am using:
-----------
Ubuntu 11.04
OpenFoam 1.7.x
gcc 4.5.2 (checked with "gcc -v")

About gdb:
-----------
The current gdb version installed is:
gdb 7.2 (checked with "gdb -v")
The tutorial suggests not to use gdb 7.x, so should I downgrade to 6.8?
But how to?

About Eclipse
-------------
The current version of Eclipse is 3.7, but I am assuming that should not be an issue. But which one exactly should I download:
-Eclipse IDE for C/C++ developers?
-Eclipse Classic
Will this version of Eclipse Classic already include the CDT?

Adding gfortran to Eclipse:
-------------------------
Another hurdle I will have to take is that I also need gfortran in Eclipse as I am currently coupling F90 subroutines with OpenFoam/fireFoam.
Does anyone know if that is possible and/or knows how to do that (or can provide helpful links)?


Thanks! Best regards,
Andreas

gascortado August 24, 2011 08:15

Hi,

I followed the tutorial. I just trying to run the cavity case (using icoFoam). I import the case folder and set the application to be /home/santiago/OpenFOAM/OpenFOAM-1.6/applications/bin/linuxGccDPOpt/icoFoam in eclipse. When I hit run I get this:

/home/santiago/OpenFOAM/OpenFOAM-1.6/applications/bin/linuxGccDPOpt/icoFoam: error while loading shared libraries: libfiniteVolume.so: cannot open shared object file: No such file or directory

Any idea of what is wrong?

Also, regarding http://www.cfd-online.com/Forums/ope...tml#post261470 I just downloaded eclipse as indicated in the wiki, then I browse to the executable file and run eclipse (if i try to run eclipse from the terminal its says that the program is not installed) however it runs when I double click the executable file.

I have the same problem when trying to use wmake as shown http://www.cfd-online.com/Forums/ope...tml#post260405 . I would like to run eclipse from the terminal if that is going to solve my problems.

I will appreciate any help. THanks

wyldckat August 24, 2011 16:14

Hi Santiago,

Check post #12: http://www.cfd-online.com/Forums/ope...tml#post261470 :)

Also, reading the whole thread might lead you to some more details that I don't remember or didn't read about ;)

Best regards,
Bruno

Bufacchi February 4, 2012 17:56

Hi Foamers,

I'm running OpenFOAM 2.1.x on OpenSUSE 11.4 64 bits. I compiled OpenFOAM in debug mode.

I downloaded Eclipse IDE for C/C++ Developers (includes Incubating components), for 64 bits. It is version Indigo (3.7) Service Release 1.

Thanks to the Wiki http://openfoamwiki.net/index.php/Ho...M_with_Eclipse installation and configuration ran smoothly. I also read the thread Eclipse for OpenFOAM.

I imported the icoFoam solver and cavity case as projects to my workspace. Prior to that I ran blockMesh.

When I run the case, it goes well, without errors. But when I debug it, I have the following error:

Debug Perspective:

Console Window:

Missing separate debuginfo for /lib64/ld-linux-x86-64.so.2
Try: zypper install -C "debuginfo(build-id)=b1d398a5cb1609e7ac1c51a26588e87fc20f753c"
Missing separate debuginfo for /lib64/libdl.so.2
Try: zypper install -C "debuginfo(build-id)=9a8d0811525ec7a152dca9e109292adca81857c1"
Missing separate debuginfo for /usr/lib64/libstdc++.so.6
Try: zypper install -C "debuginfo(build-id)=e87ebb28b8b5aa032cf2925387aaa13f2cb93c90"
Missing separate debuginfo for /lib64/libm.so.6
Try: zypper install -C "debuginfo(build-id)=5ac64cd348d3581ec2a223ee70f42e73cad029cc"
Missing separate debuginfo for /lib64/libgcc_s.so.1
Try: zypper install -C "debuginfo(build-id)=e6eb8011838a065946e5808e036550844548379f"
Missing separate debuginfo for /lib64/libc.so.6
Try: zypper install -C "debuginfo(build-id)=70bab20280816eb26a0553f13382ee75d53179f5"
Missing separate debuginfo for /lib64/libpthread.so.0
Try: zypper install -C "debuginfo(build-id)=e23cbc772e670af00bea9874f925e2e61afda713"
[Thread debugging using libthread_db enabled]
Missing separate debuginfo for /lib64/libz.so.1
Try: zypper install -C "debuginfo(build-id)=61e4e9a46287c10135232e8a269575a1ceda7638"
Missing separate debuginfo for /lib64/libnsl.so.1
Try: zypper install -C "debuginfo(build-id)=2d5906a5f42a9ad6df5fc2f91ab5bca478ce4959"
Missing separate debuginfo for /lib64/libutil.so.1
Try: zypper install -C "debuginfo(build-id)=5751266e22e9f2cbca821b110e87ecd37e70e7b4"


Debug Window:

cavity [C/C++ Application]
/home/paulo/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPDebug/bin/icoFoam [15362] [cores: 4]
Thread [1] 15362 [core: 4] (Suspended : Breakpoint)
main() at setRootCase.H:5 0x4409ed
gdb
cavity [C/C++ Application]
/home/paulo/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPDebug/bin/icoFoam [15408] [cores: 7]
Thread [1] 15408 [core: 7] (Suspended : Breakpoint)
main() at setRootCase.H:5 0x4409ed
gdb
cavity [C/C++ Application]
/home/paulo/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPDebug/bin/icoFoam [15447] [cores: 0]
Thread [1] 15447 [core: 0] (Suspended : Breakpoint)
main() at setRootCase.H:5 0x4409ed
gdb


It is important to say that I'm not compiling an application. I'm running the case and I started Eclipse from the icon in its folder and not from a terminal.

Although I have included all paths, it seems that the icoFoam.C file can't find many other files and variables.

How can I fix the error?


Thanks,

Paulo

gschaider February 4, 2012 19:13

Quote:

Originally Posted by Bufacchi (Post 342759)
Hi Foamers,

I'm running OpenFOAM 2.1.x on OpenSUSE 11.4 64 bits. I compiled OpenFOAM in debug mode.

I downloaded Eclipse IDE for C/C++ Developers (includes Incubating components), for 64 bits. It is version Indigo (3.7) Service Release 1.

Thanks to the Wiki http://openfoamwiki.net/index.php/Ho...M_with_Eclipse installation and configuration ran smoothly. I also read the thread Eclipse for OpenFOAM.

I imported the icoFoam solver and cavity case as projects to my workspace. Prior to that I ran blockMesh.

When I run the case, it goes well, without errors. But when I debug it, I have the following error:

Debug Perspective:

Console Window:

Missing separate debuginfo for /lib64/ld-linux-x86-64.so.2
Try: zypper install -C "debuginfo(build-id)=b1d398a5cb1609e7ac1c51a26588e87fc20f753c"
Missing separate debuginfo for /lib64/libdl.so.2
Try: zypper install -C "debuginfo(build-id)=9a8d0811525ec7a152dca9e109292adca81857c1"
Missing separate debuginfo for /usr/lib64/libstdc++.so.6
Try: zypper install -C "debuginfo(build-id)=e87ebb28b8b5aa032cf2925387aaa13f2cb93c90"
Missing separate debuginfo for /lib64/libm.so.6
Try: zypper install -C "debuginfo(build-id)=5ac64cd348d3581ec2a223ee70f42e73cad029cc"
Missing separate debuginfo for /lib64/libgcc_s.so.1
Try: zypper install -C "debuginfo(build-id)=e6eb8011838a065946e5808e036550844548379f"
Missing separate debuginfo for /lib64/libc.so.6
Try: zypper install -C "debuginfo(build-id)=70bab20280816eb26a0553f13382ee75d53179f5"
Missing separate debuginfo for /lib64/libpthread.so.0
Try: zypper install -C "debuginfo(build-id)=e23cbc772e670af00bea9874f925e2e61afda713"
[Thread debugging using libthread_db enabled]
Missing separate debuginfo for /lib64/libz.so.1
Try: zypper install -C "debuginfo(build-id)=61e4e9a46287c10135232e8a269575a1ceda7638"
Missing separate debuginfo for /lib64/libnsl.so.1
Try: zypper install -C "debuginfo(build-id)=2d5906a5f42a9ad6df5fc2f91ab5bca478ce4959"
Missing separate debuginfo for /lib64/libutil.so.1
Try: zypper install -C "debuginfo(build-id)=5751266e22e9f2cbca821b110e87ecd37e70e7b4"


Debug Window:

cavity [C/C++ Application]
/home/paulo/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPDebug/bin/icoFoam [15362] [cores: 4]
Thread [1] 15362 [core: 4] (Suspended : Breakpoint)
main() at setRootCase.H:5 0x4409ed
gdb
cavity [C/C++ Application]
/home/paulo/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPDebug/bin/icoFoam [15408] [cores: 7]
Thread [1] 15408 [core: 7] (Suspended : Breakpoint)
main() at setRootCase.H:5 0x4409ed
gdb
cavity [C/C++ Application]
/home/paulo/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPDebug/bin/icoFoam [15447] [cores: 0]
Thread [1] 15447 [core: 0] (Suspended : Breakpoint)
main() at setRootCase.H:5 0x4409ed
gdb


It is important to say that I'm not compiling an application. I'm running the case and I started Eclipse from the icon in its folder and not from a terminal.

Although I have included all paths, it seems that the icoFoam.C file can't find many other files and variables.

How can I fix the error?


Thanks,

Paulo

Disclaimer: I user neither Eclipse nor OpenSUSI

If you google around you'll find that the libraries (libm.so ,libpthread.so ..) are not part of OF. So this is a general problem. It seems that the developers of Eclipse knew that Suse-Users need a bit of handholding so the told them how to fix thsi. Maybe they should have been a bit more verbose and write something like:

Try the command "zypper install -C .... " to fix this

Bufacchi February 7, 2012 15:08

Hi Bernhard,

Thanks for your note.

I did try the zypper command as super user, but I got an error message, saying about a repository. The problem is that openSUSE-12.1-Debug, openSUSE-12.1-Update-Debug and openSUSE-12.1-Source repositories were not enabled. After changing that, the zypper command worked well.

Thanks,

Paulo

Matt_B February 11, 2012 11:14

Problems with Eclpse
 
Hi everybody,
I'm brand new on this forum and quite new in learning OpenFoam. I'm very interested in using Eclipse, because I found out that is possible to debug the very heavy C++ code and it could be a very powerful and useful thing to understand how OpenFoam really works.I read all this thread and I tried to follow all the steps of the Eclipse user guide one by one but I didn't succeded untill now.
First of all I tried to build simpleFoam solver by means of "wmake" but it didn't work; after that I swapped "wmake" with $HOME/directory/foamExec wmake, as one user suggested, and finally it started to build the project. The problem is that after a while, build operation quits with 6 errors, all concerning the LIBRARY listed in the "Make/Option" file (-lincompressible... for example). Eclipse goes in a wrong directory to find shared libraries. My question is: why compiler doesn't use correct directory? Could I set somehow? Has it something to do with "bashrc" and the problem that Eclipse doesn't read it?
Thank you in advance for the answers.

Matteo

wyldckat February 11, 2012 11:41

Greetings Matteo and welcome to the forum!

OK, let's step back a few steps. Apparently the first problem is that you are not able to compile OpenFOAM in debug mode. So:
  1. Which OpenFOAM version and which Linux distribution and version are you using?
  2. What instructions did you follow to build OpenFOAM?
If we know these, it'll be a loooot easier to help you!

Best regards,
Bruno

Matt_B February 11, 2012 18:07

Hi Bruno,
thank you for the very quick reply ;)

Quote:

OK, let's step back a few steps. Apparently the first problem is that you are not able to compile OpenFOAM in debug mode
You are definitely right: I haven't ever compiled OpenFoam in debug mode so far, that's why I'm interested in managing Eclipse in a proper way. And by the way, if it could help, I never used wmake so far too in Terminal shell, but I don't thing it would give any problem.

Quote:

  1. Which OpenFOAM version and which Linux distribution and version are you using?

I'm using OpenFoam 2.1.0 and UBUNTU 11.10.

Quote:

2. What instructions did you follow to build OpenFOAM?
I followed step by step the instructions given on OpenFoam official site and I never have had any problems in running solvers and test cases by terminal window. I can run a test case until postprocessing by means of Paraview.
When I try to build a solver or to run a test case in Eclipse, I receive error message because the shared libraries specified in the Make/Options file.
Here below the error message i receive in Eclipse:
Code:

**** Build of configuration Debug for project simpleFoam ****

/home/matteo/OpenFOAM/OpenFOAM-1.7.1/bin/foamExec wmake all
g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3  -DNoRepository -ftemplate-depth-40 -I/home/matteo/OpenFOAM/OpenFOAM-1.7.1/src/turbulenceModels    -I/home/matteo/OpenFOAM/OpenFOAM-1.7.1/src/turbulenceModels/incompressible/RAS/RASModel    -I/home/matteo/OpenFOAM/OpenFOAM-1.7.1/src/transportModels    -I/home/matteo/OpenFOAM/OpenFOAM-1.7.1/src/transportModels/incompressible/singlePhaseTransportModel    -I/home/matteo/OpenFOAM/OpenFOAM-1.7.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/matteo/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude -I/home/matteo/OpenFOAM/OpenFOAM-1.7.1/src/OSspecific/POSIX/lnInclude  -fPIC Make/linuxGccDPOpt/simpleFoam.o -L/home/matteo/OpenFOAM/OpenFOAM-1.7.1/lib/linuxGccDPOpt \
        -lincompressibleTurbulenceModel    -lincompressibleRASModels    -lincompressibleTransportModels    -lfiniteVolume -lOpenFOAM -liberty -ldl  -lm -o /home/matteo/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linuxGccDPOpt/simpleFoam
/usr/bin/ld: cannot find -lincompressibleTurbulenceModel
/usr/bin/ld: cannot find -lincompressibleRASModels
/usr/bin/ld: cannot find -lincompressibleTransportModels
/usr/bin/ld: cannot find -lfiniteVolume
/usr/bin/ld: cannot find -lOpenFOAM
collect2: ld returned 1 exit status
make: *** [/home/matteo/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linuxGccDPOpt/simpleFoam] Error 1

I know that the correct directory for libraries shall be the following:
/opt/openfoam210/platforms/linuxGccDPOpt/lib.
I tried to let artificially recognize library by Eclipse, substituting -l with -L, for example:
-lincompressibleTurbulenceModel with:
-L$/opt/openfoam210/platforms/linuxGccDPOpt/lib/libincompressibleTransportModels
It works but I don't fix the problem completely.
I hope to have helped you to help me :p

wyldckat February 12, 2012 08:50

Hi Matteo,

OK, you've got more than one OpenFOAM installation. In this case, first read the following blog post of mine: Advanced tips for working with the OpenFOAM shell environment

Then build OpenFOAM 2.1.0 as instructed on the website: http://www.openfoam.org/download/source.php
Also to take into account, if you want to build things faster and keep a good log on it:
Code:

export WM_NCOMPPROCS=4
./Allwmake > make.log 2>&1

This will build with 4 cores and keep a full log in the file "make.log". When complete, search for the expression "Error " (without quotes and with the space after the word "Error"); if only one line appears, then it's all OK.

Then you can try and build the Debug version. I think that the respective instructions are on the wiki.

Best regards,
Bruno

Matt_B February 12, 2012 11:59

Quote:

Originally Posted by wyldckat (Post 344007)
Hi Matteo,

OK, you've got more than one OpenFOAM installation. In this case, first read the following blog post of mine: Advanced tips for working with the OpenFOAM shell environment

Then build OpenFOAM 2.1.0 as instructed on the website: http://www.openfoam.org/download/source.php
Also to take into account, if you want to build things faster and keep a good log on it:
Code:

export WM_NCOMPPROCS=4
./Allwmake > make.log 2>&1

This will build with 4 cores and keep a full log in the file "make.log". When complete, search for the expression "Error " (without quotes and with the space after the word "Error"); if only one line appears, then it's all OK.

Then you can try and build the Debug version. I think that the respective instructions are on the wiki.

Best regards,
Bruno

Thanks again Bruno, I understood that having multiple OpenFoam installations could be the reason of confusion. I installed first the 1.7.0 release and after a while straight to the 2.1.0, following this steps http://www.openfoam.org/download/ubuntu.php.
Neverthless your help with the new install procedure you pointed out to me, I can't still succeed because it seems to have problems with the ./Allwmake command: it reports a lot of errors ("Access to folder denied" and "No such directory" for example). I'm thinking it could be better to uninstall both OpenFoam versions before to begin building again new version, but I don't know how to make it. What do you think about?:confused:

wyldckat February 12, 2012 12:17

Hi Matteo,

If you want to build your own builds of OpenFOAM for debugging, then follow these instructions: http://www.openfoam.org/download/source.php - then you can also try building the Debug version.

The instructions for Ubuntu deb packages is for simply using OpenFOAM, and perhaps building your own solvers and utilities. But if you want to do "full-on debugging", then you should do your own builds! You can still have the ".deb" version installed and use it just in case your own builds fail ;)

Best regards,
Bruno

Matt_B February 12, 2012 12:55

I'm sorry to bother you again, but as I already told you, I tried to build OpenFoam with the Source installation pack but all I got is errors. If I type "foamInstallationTest" I got a FATAL ERROR.
I'm still a newbie with Linux, because I installed it just after knowing that OpenFoam could run only on this O.S. I even tried to build just one solver from Eclipse Environment, pointing to new Openfoam 2.1.0 Application/solvers/incompressible/simpleFoam folder but still I got errors with libraries location....it seems I didn't get any step further.... :-(

Bufacchi February 12, 2012 13:22

Quote:

Originally Posted by Matt_B (Post 344023)
I'm sorry to bother you again, but as I already told you, I tried to build OpenFoam with the Source installation pack but all I got is errors. If I type "foamInstallationTest" I got a FATAL ERROR.
I'm still a newbie with Linux, because I installed it just after knowing that OpenFoam could run only on this O.S. I even tried to build just one solver from Eclipse Environment, pointing to new Openfoam 2.1.0 Application/solvers/incompressible/simpleFoam folder but still I got errors with libraries location....it seems I didn't get any step further.... :-(


Hi Matteo and Bruno,

Let me try a different point of view here.

I have many different OpenFOAM versions on my computer, and I can assure you that they don't interfere with each other. There will always be a single version in use, and that version is the one in your $HOME/.bashrc file or similar (depends on the shell).

Second, if you follow strictly what is on the download page, (almost) nothing can go wrong. I say that because I already did a lot of installs (over 20) using Ubuntu and Suse.

I would like to sugest Matteo to begin from scratch. If you are not sure about the many changes you made in your OS, reinstall it.

If there is something well written is the installation procedure.

I hope this helps and encourages you in installing OpenFOAM.

Paulo
:)

romant March 21, 2012 05:07

Hej,

I have a question about the "Path & Symbols" includes. Which ones should I definitely include?

1. The ones that are also listed in the files and options file?
2. Additional ones?

At the moment I have the solver buoyantBoussinesqSimpleFoam loaded with includes to the following
http://i42.tinypic.com/35id9hs.jpg

It resolved the whole "unresolved" sources part in the main file. However, I am still getting error messages on "wrong syntax" as one can see on the open file next to it, which is pEqn.H.

In the main file I don't have any squiggly lines, but in the pEqn.H file I do. How do I get rid of these?

In the createFields.H the squiggly lines are only on the Info lines
Code:

Info<< "Reading field p_rgh\n" << endl;
and in the UEqn.H only on the second part
Code:

    // Solve the momentum equation

    tmp<fvVectorMatrix> UEqn
    (
        fvm::div(phi, U)
      + turbulence->divDevReff(U)
    );

    UEqn().relax();

    if (simple.momentumPredictor())
    {
        solve
        (
            UEqn()
            ==
            fvc::reconstruct
            (
                (
                  - ghf*fvc::snGrad(rhok)
                  - fvc::snGrad(p_rgh)
                )*mesh.magSf()
            )
        );
    }

And it states syntax error.

ata March 22, 2012 06:16

Hi
I had that "wrong syntax" message too in the included files but every thing was OK and the solvers compiled truly.

romant March 22, 2012 06:53

Yes, I have seen this, that they compile, it is annoying, since I can't see if I make a mistake.

Matt_B April 11, 2012 05:28

Hi again everybody!
Still here, with the same problem, after a lot of steps further by the way...
As I posted before, I had troubles with debugging a test case: I didn't succeed before and I still don't succeed now.
What I did untill now is compiling OpenFoam version 2.1.0 by means of Source code using .Allwmake utility and in both Optimization and Debug mode. I'm now able to run a test case with gdc by a terminal shell and to build a solver in Eclipse environment exploiting the foamExec script, because without it, the simple wmake doesn't work at all.
When I tried to run a test case, I got the message that it couldn't find shared libraries and, after a while, I bypassed this problem manually defining in the ld.so.config file the directories leading to OpenFoam's libraries and it worked. Now, when I run or debug a test case I don't receive the shared libraries error anymore, but a new error (Fatal error) regarding the fact that it cannot find controlDict. I suppose it can't find the reference to this header but I don't know how to get do it.
Maybe the answer is in the Bruno's hint below but I don't understand how to implement this. Could anyone help me?

Quote:

Originally Posted by wyldckat (Post 311683)

  • To launch wmake, use:
    Code:

    $HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec wmake
    Update OpenFOAM version/path accordingly to your installation.
    No problem with that: It worked.
  • Likewise for launching the built solver; for example, to run icoFoam:
    Code:

    $HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec icoFoam
    Not working.
    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".
    Not working.

    Best regards,
    Bruno

I don't understand WHERE I should put the foamExec directory for the binary applcation. I understood (actually it's not explicit above) that I have to go to "Run configurations" (or "Debug configurations") and in the same field where I should put the directory to the binary solver, I have to substitute it with
Code:

$HOME/OpenFOAM/OpenFOAM-2.1.0/bin/foamExec icoFoam
it doesn't work because it is not recognized as a valid executable. After I even tried to put instead the binary solver directory, executing it with the foamExec script in this fashion
Code:

$HOME/Opt/OpenFOAM/OpenFOAM-2.1.0/...../foamExec icoFoam
but even in this case
it is not recognized as a valid executable.
Where am I mistaken? As a last attempt, I
even tried to build the test case switching to Debug and substituting
Code:

$HOME/OpenFOAM/OpenFOAM-1.6/bin/foamExec wmake
with
Code:

$HOME/OpenFOAM/OpenFOAM-2.1.0/bin/foamExec icoFoam
but I received a lot of other errors :confused::confused::confused::confused:

Thank you in advance.

Matteo

wyldckat April 11, 2012 17:19

Hi Matteo,

Sorry about not being very clear on that old post. The idea I had back then was to explain how to run things on the command line.

So, let me explain further:
  • If the application icoFoam is not running because Eclipse is unable to tell it where everything is, then we need to first call an application that knows where things are, namely foamExec.
  • For example, icoFoam can be called from almost anywhere with the following command:
    Code:

    icoFoam -case $HOME/OpenFOAM/$USER-1.6/mytestcase
    This means that the application is icoFoam and "-case $HOME/OpenFOAM/$USER-1.6/mytestcase" are arguments. These arguments are meant to be placed on the second tab that says "(x)= Arguments":
    http://openfoamwiki.net/images/8/8c/Eclipse07.png
  • Now when I say that foamExec has to be called first, this becomes the application and icoFoam becomes an argument.

Anyway, the most clean way of doing this is to simply launch eclipse from the command line, straight from a working shell environment where the debug version of icoFoam can work without any problems ;)

Best regards,
Bruno

Matt_B April 12, 2012 12:10

Thank you, Bruno! It worked finally! :D
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

gascortado April 28, 2012 16:56

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

wyldckat April 28, 2012 17:11

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

gascortado April 28, 2012 21:57

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:eek::eek:. Thanks

wyldckat April 29, 2012 05:53

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

benk May 9, 2012 12:11

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

Tobi June 1, 2012 05:55

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

romant June 1, 2012 07:15

Quote:

Originally Posted by Tobi (Post 364256)
FIXED

how did you fix it?

Tobi June 1, 2012 08:28

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 June 2, 2012 10:39

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

wyldckat June 2, 2012 17:47

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

Tobi June 2, 2012 17:55

Quote:

Originally Posted by wyldckat (Post 364454)
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?

fabian_roesler July 10, 2012 04:59

Symbols in header files cannot be resolved
 
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

Tobi July 10, 2012 12:55

No sorry, I didn `t manage it :(

Krendel July 30, 2012 05:28

GDB version used
 
Does anybody use GDB-7.x ?
Or GBD-6.8 is the right version only?

Ivooo August 1, 2012 06:43

About lnInclude and #includes
 
Quote:

Originally Posted by Tobi (Post 364456)
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.

gary7 October 23, 2012 11:35

Underlined classes and methods?
 
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.

Tobi October 24, 2012 06:48

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

alexmogavero November 7, 2012 07:23

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 November 7, 2012 09:25

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?


All times are GMT -4. The time now is 02:34.