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

Eclipse & OpenFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 20, 2014, 10:59
Default Eclipse & OpenFoam
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi,

I just want to run the "multiphaseEulerFoam" solver without any case applied to it. I followed the manual in the following link:

http://openfoamwiki.net/index.php/Ho...pse#Thanks_to_..

I have done the following steps:

1.Download Eclipse Kepler: www.eclipse.org/downloads/ and unpack the file
2.Start Eclipse and update it in Help -> Install New Software... ; Add ... with http://download.eclipse.org/tools/cdt/releases/galileo/
3. Configure the interface in Window -> Show View -> C/C++ for C++ projects
4. Create a new project Files -> New -> C++ Project. I chose the solver folder (since solver is a application) for the location and for the project name i chose the solver name.
5. Right click my project and chose properties:
->C/C++ build: Deactivate the default build command and type in "wmake".
->C/C++ General->PathsandSymbols: Included all necessary folders.

Problem:

When I build the project I get the error:

Quote:
wmake error: environment variable $WM_OPTIONS not set
When I try to run the ".c file" I get the message

Quote:
Launch failed.Bindary not found!
Why can t I run the solver and how can I solve this problems?

greetings
maybee

Last edited by maybee; February 23, 2014 at 12:47.
maybee is offline   Reply With Quote

Old   February 23, 2014, 11:22
Default
  #2
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 17
wouter is on a distinguished road
hello maybee,
a google search on openfoam eclips gave me this:
http://openfoamwiki.net/index.php/Ho...M_with_Eclipse
I used this and it works fine for me.

Hope this helps
Wouter
wouter is offline   Reply With Quote

Old   February 23, 2014, 12:50
Default
  #3
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi, this is the same manual I also used and posted the link (see first link of my first post) - still I get the described error message.
maybee is offline   Reply With Quote

Old   February 23, 2014, 15:53
Default
  #4
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 17
wouter is on a distinguished road
Hello maybee,

You need to start eclipse from a terminal window where OF is sourced or use another command for wmake like described in one of the other links you get when googleing.

Hope this helps more
Wouter
wouter is offline   Reply With Quote

Old   February 24, 2014, 07:45
Default
  #5
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi,

since I installed Eclipse like described here

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

I can t run it in the terminal, only getting the error message:

Quote:
application »eclipse« currently not installed. You can install it by:
sudo apt-get install eclipse-platform
Furthermore I added to the .bashrc file located in /opt/openfoam221/etc the line

Code:
source $opt/openfoam221/etc/bashrc
like described here

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

Unfortunately I could not run the command

Code:
source $opt/.bashrc
or even when after changing the terminals path to "/opt/openfoam221/etc"

Code:
source $etc/.bashrc
I get the error message:

bash: /.bashrc: File or Folder not found although the file exists.

Total-Result: I still can t build my project, still getting :

Build:
Quote:
wmake error: environment variable $WM_OPTIONS not set
When I try to run the ".c file" I get the message
Run:
Quote:
Launch failed.Bindary not found!

greetings maybee
maybee is offline   Reply With Quote

Old   February 24, 2014, 16:53
Default
  #6
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 17
wouter is on a distinguished road
hello maybee,
I do not know enough of linux to help you like wyldckat, but maybe I can help you a little. In the reference you gave there is mention to add the source ... to ~/.bashrc nothing to do with openfoam, just the bash file that is started when you start a terminal window. If you add the source ... to the end of this file and start a new terminal window you should be able to run wmake in the directory where Make is.

Hope this helps
wouter
wouter is offline   Reply With Quote

Old   February 25, 2014, 06:25
Default
  #7
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi wouter,

I added now

Code:
source $opt/openfoam221/etc/bashrc
to the file bash.bahsrc which is located in "/etc". Still I can t run my project neither in KDev4 nor in Eclipse. However running "wmake" in the terminal is no problem though. It is just not comfortable debugging my code with the terminal.

Other "bach files" available after search are:

Code:
bash.bashrc in /usr/share/doc/adduser/examples/adduser.local.conf.examples
dot.bashrc in /usr/share/base-files
dot.bashrc in /usr/share/doc/adduser/examples/adduser.local.conf.examples/skel
maybee is offline   Reply With Quote

Old   February 25, 2014, 15:54
Default
  #8
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 17
wouter is on a distinguished road
hello Maybee,
As I told you before I am no expert,but here is a guide step by step.
first step:
in terminal:
cd ~
second step:
gedit .bashrc
in this file at the bottom add:
source /opt/openfoam221/etc/bashrc

save and close
close terminal
next step
open terminal
type:
eclipse
This should start eclipse and you should be able to use wmake from eclipse as described

Hope this helps
Wouter
wouter is offline   Reply With Quote

Old   February 26, 2014, 05:21
Default
  #9
bfa
Member
 
Björn Fabritius
Join Date: Mar 2009
Location: Freiberg, Germany
Posts: 31
Rep Power: 17
bfa is on a distinguished road
Hi maybee,

where did you install eclipse to? because the fact that you can't start eclipse from the terminal suggests that the path is not set correctly. Quoting from the wiki guide: "[...] start Eclipse from the terminal after setting the path variable."

If you type
Code:
which eclipse
in the terminal and it comes back with an empty line, linux is not able to find the executable. If you unpacked it to something like $HOME/eclipse, you need to either add the following line to your .bashrc file:
Code:
export PATH="$PATH:$HOME/eclipse/"
or you need to start it using
Code:
$HOME/eclipse/eclipse
If you sourced OpenFOAM and then start eclipse in one of the ways described above, you should be able to compile your code.

Hope that helps!
Bjoern
bfa is offline   Reply With Quote

Old   February 26, 2014, 13:37
Default
  #10
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
@ wouter: Still does not work. Furthermore I already added

Code:
source /opt/openfoam221/etc/bashrc
to the right .bashrc file


Still I get the error:

Code:
application »eclipse« currently not installed. You can install it by:
sudo apt-get install eclipse-platform
@bfa:

Ok I can start now Eclipse after putting the folder with the executable into the home folder and adding the lines you described to the bash file. Now I get the error

Code:
/opt/openfoam221/wmake/wmake all 
/opt/openfoam221/wmake/wmake: 181: /opt/openfoam221/wmake/wmake: ./Allwmake: Permission denied
when I want to build my project.
maybee is offline   Reply With Quote

Old   February 26, 2014, 14:35
Default
  #11
bfa
Member
 
Björn Fabritius
Join Date: Mar 2009
Location: Freiberg, Germany
Posts: 31
Rep Power: 17
bfa is on a distinguished road
You need to put your own code in a folder to which you have writing permission. /opt/openfoam is certainly write-protected. I guess your admin has installed OpenFOAM there for you.

Follow the instructions here
http://www.csc.fi/english/research/s...penfoam/modsol
to find out, how to create the directories in your $HOME folder, which files you need to compile a solver and so on. Also put your Eclipse project files there.

(Linux is based on a restrictive rights management, so a "normal" user cannot break the system. But you have unlimited access to anything in your $HOME folder.)
bfa is offline   Reply With Quote

Old   February 27, 2014, 22:18
Default
  #12
New Member
 
Jianzhi Li
Join Date: Jul 2013
Location: Shanghai, China
Posts: 27
Rep Power: 12
epi_c is on a distinguished road
Send a message via Skype™ to epi_c
Hello maybee,
I also used the Eclipse following the instruction:
http://openfoamwiki.net/index.php/Ho...M_with_Eclipse
And it works, Here are my steps:

1.Download "Eclipse IDE for C/C++ Developers" from http://www.eclipse.org/downloads/
2.Untar the file getting an folder "eclipse", move the folder to /usr/lib/ using root access.
3.Make a link so that eclipse can run in a terminal:
cd /usr/bin
sudo ln -s /usr/lib/eclipse/eclipse
4.Copy the slover folder to $HOME, so you can have the permission to edit them without root access.
......
epi_c is offline   Reply With Quote

Old   February 28, 2014, 05:15
Default
  #13
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
@epi_c: I have done as you described. Also I have added the line

export PATH="$PATH:$usr/lib/eclipse/"

OR

export PATH="$PATH:$usr/lib/eclipse/eclipse"

into the .bashrc file.

But unfortunately I get the same error message as before:

Code:
application »eclipse« currently not installed. You can install it by:
sudo apt-get install eclipse-platform
maybee is offline   Reply With Quote

Old   February 28, 2014, 06:50
Default
  #14
New Member
 
Jianzhi Li
Join Date: Jul 2013
Location: Shanghai, China
Posts: 27
Rep Power: 12
epi_c is on a distinguished road
Send a message via Skype™ to epi_c
@maybee: Ok, I don't know what's your problem really is. If you don't mind, try what I did as follows (System information: Ubuntu 12.04 LTS, 32bit):
Tips: You don't have to edit the .bashrc file following my way, It is suggested that you delete your changes in .bashrc file befor installation.

1. Download JRE which Eclipse needs from
http://www.oracle.com/technetwork/ja...s-1880261.html, the package suit for me is “jre-7u51-linux-i586.tar.gz”
2. Download "Eclipse IDE for C/C++ Developers" from http://www.eclipse.org/downloads/, the package is “eclipse-cpp-kepler-SR1-linux-gtk.tar.gz” (I put above two packages in $HOME/Downloads)
3. Install and set JRE:
cd /usr/lib
sudo mkdir java (The directory that JRE to be installed)
cd java
sudo mv $HOME/Downloads/jre-7u51-linux-i586.tar.gz .
sudo tar xzf jre-7u51-linux-i586.tar.gz
sudo rm jre-7u51-linux-i586.tar.gz (To save space)
sudo update-alternatives --install /usr/bin/java java /usr/lib/java/jre1.7.0_51/bin/java 1
sudo update-alternatives --set java /usr/lib/java/jre1.7.0_51/bin/java
4. Install Eclipse:
sudo mv $HOME/Downloads/eclipse-cpp-kepler-SR1-linux-gtk.tar.gz /usr/lib
cd /usr/lib
sudo tar xzf eclipse-cpp-kepler-SR1-linux-gtk.tar.gz
sudo rm eclipse-cpp-kepler-SR1-linux-gtk.tar.gz
cd /usr/bin
sudo ln -s /usr/lib/eclipse/eclipse
5. Type "java --version" in a terminal to test whether JRE is installed correctly or not,
6. Type "which eclipse" to test whether you can run eclipse in a terminal or not
7. Run eclipse in a terminal, then you can do as http://openfoamwiki.net/index.php/Ho...M_with_Eclipse
epi_c is offline   Reply With Quote

Old   February 28, 2014, 07:27
Default
  #15
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi thx a lot for the help,

but I still have some problems even with your manual.

First of all the second package is

Quote:
eclipse-standard-kepler-SR1-linux-gtk.tar.gz
when I download it.

Secondly, when I run the command

Code:
sudo mv $HOME/Downloads/jre-7u51-linux-i586.tar.gz
I get the error:

Code:
Missing destination-file operator behind »/home/USER/Downloads/jre-7u51-linux-i586.tar.gz“
maybee is offline   Reply With Quote

Old   February 28, 2014, 07:42
Default
  #16
New Member
 
Jianzhi Li
Join Date: Jul 2013
Location: Shanghai, China
Posts: 27
Rep Power: 12
epi_c is on a distinguished road
Send a message via Skype™ to epi_c
Ok, the first problem, you download the standard eclipse package, then after finishing my manual, you should install CDT plugin by hand. Or you should download from http://www.eclipse.org/downloads/pac...pers/keplersr1
The second, "sudo mv $HOME/Downloads/jre-7u51-linux-i586.tar.gz ."
There is a "dot" that represent the CWD, type mv --help for more information
epi_c is offline   Reply With Quote

Old   February 28, 2014, 09:57
Default
  #17
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
Sorry for my fail ,

I' ll check this tomorrow or sunday.

have a nice weekend.
maybee is offline   Reply With Quote

Old   February 28, 2014, 10:44
Smile
  #18
New Member
 
Jianzhi Li
Join Date: Jul 2013
Location: Shanghai, China
Posts: 27
Rep Power: 12
epi_c is on a distinguished road
Send a message via Skype™ to epi_c
I just tried on my virtual machine with exact the same system (Ubuntu 12.04 LTS, 32bit), and it works, below are my command logs:

fran@lico:~$ cd /usr/lib/
fran@lico:/usr/lib$ sudo mkdir java
[sudo] password for fran:
fran@lico:/usr/lib$ cd java/
fran@lico:/usr/lib/java$ sudo mv $HOME/Downloads/jre-7u51-linux-i586.tar.gz .
-alternative command$ sudo mv $HOME/Downloads/jre-7u51-linux-i586.tar.gz /usr/lib/java))
fran@lico:/usr/lib/java$ sudo tar xzf jre-7u51-linux-i586.tar.gz
fran@lico:/usr/lib/java$ sudo rm jre-7u51-linux-i586.tar.gz
fran@lico:/usr/lib/java$ sudo update-alternatives --install /usr/bin/java java /usr/lib/java/jre1.7.0_51/bin/java 1
update-alternatives: using /usr/lib/java/jre1.7.0_51/bin/java to provide /usr/bin/java (java) in auto mode.
fran@lico:/usr/lib/java$ sudo update-alternatives --set java /usr/lib/java/jre1.7.0_51/bin/java
fran@lico:/usr/lib/java$ java --version
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
fran@lico:/usr/lib/java$ java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode)
fran@lico:/usr/lib/java$ sudo mv $HOME/Downloads/eclipse-cpp-kepler-SR1-linux-gtk.tar.gz /usr/lib
fran@lico:/usr/lib/java$ cd /usr/lib/
fran@lico:/usr/lib$ sudo tar xzf eclipse-cpp-kepler-SR1-linux-gtk.tar.gz
fran@lico:/usr/lib$ sudo rm eclipse-cpp-kepler-SR1-linux-gtk.tar.gz
fran@lico:/usr/lib$ cd /usr/bin/
fran@lico:/usr/bin$ sudo ln -s /usr/lib/eclipse/eclipse
fran@lico:/usr/bin$ which eclipse
/usr/bin/eclipse
fran@lico:/usr/bin$ eclipse

I made a mistake, the command "java --version" should replace with "java -version".
While using eclipse, some setup files will be written in the project folder, so it is suggested that you copy the solver's source file folder to $HOME/***, i.e. $HOME/OpenFOAM. May you success!

Last edited by epi_c; February 28, 2014 at 21:27.
epi_c is offline   Reply With Quote

Old   March 2, 2014, 13:18
Default
  #19
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
Hi again,

this worked now fine for me and I m able to start eclipse. When building my project now (the solver) I get the output

Quote:
8:09:08 **** Incremental Build of configuration Debug for project SolverSQMOM ****
/opt/openfoam221/wmake/wmake all
/opt/openfoam221/wmake/wmake: 181: /opt/openfoam221/wmake/wmake: ./Allwmake: Permission denied

18:09:08 Build Finished (took 87ms)
I don t understand this since I m the owner of file "Allwmake" located in "/opt/openfoam221/".

If I try to build I get

Code:
Launch failed. Binary not found!
greetings maybee

Last edited by maybee; March 3, 2014 at 05:22.
maybee is offline   Reply With Quote

Old   March 2, 2014, 21:23
Default
  #20
New Member
 
Jianzhi Li
Join Date: Jul 2013
Location: Shanghai, China
Posts: 27
Rep Power: 12
epi_c is on a distinguished road
Send a message via Skype™ to epi_c
Morning,

As I mentioned before, while using eclipse some setting files with prefix "." (.project, .cproject) will be written into project folder, and, when execute command like wmake, new files like "*.dep, *.o" will be written into project folder too. So, even you are the owner of Allwmake (which means that you can execute Allwmake without root access), the command wmake called in the script will need root access to write files into directory (except $HOME).

The solutions can be:

1. Launch eclipse in a terminal with command "sudo eclipse", then you can have root access during the whole time.

or:

2. Copy the project folder into somewhere in $HOME, so you can run eclipse in a terminal with command "eclipse".

....As I know, compiling a single solver has nothing to do with the script Allwmake, you should remove unrelated files like Allwmake away. I found a Allwmake under applications/solvers/incompressible/simpleFoam, and its only function is to compile solvers SRFSimpleFoam and porousSimpleFoam.
epi_c is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
OpenFOAM Foundation releases OpenFOAM 2.2.2 opencfd OpenFOAM Announcements from ESI-OpenCFD 0 October 14, 2013 08:18
ESI-OpenCFD Releases OpenFOAM v2.2.0 opencfd OpenFOAM Announcements from ESI-OpenCFD 13 March 30, 2013 17:52
[Gmsh] gmsh 2.6.0 conversion to OpenFoam 160 rosswin OpenFOAM Meshing & Mesh Conversion 0 March 5, 2013 08:34
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 19:07
OpenFOAM Training and Workshop Hrvoje Jasak Main CFD Forum 0 October 7, 2005 08:14


All times are GMT -4. The time now is 10:25.