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

Promlems with compilation of new solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2013, 02:38
Default Promlems with compilation of new solver
  #1
New Member
 
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 13
Galchenko is on a distinguished road
Hello!

I installed OpenFoam on my computer and everything worked fine. Now I want to implement new solver and when I try to compile it(I use Allwmake in OpenFoam/application directory) I get such an error:

tesla0@tesla0-desktop:/opt/openfoam210$ sudo ./Allwmake
./Allwmake: 9: wmakeCheckPwd: not found
Error: Current directory is not $WM_PROJECT_DIR
The environment variables are inconsistent with the installation.
Check the OpenFOAM entries in your dot-files and source them.



Though my wmakeCheckPwd file is located in make directory, as it should be, I suppose.
My enviroment variables for OpenFoam are set(including WM_PROJECT_DIR).
if I try to run Allwmake in main OpenFoam installation directory I get the same error.
So I am really puzzled what to do with this.
Do I have to set any extra enviroment variables? Or maybe there is something else?

My version of OpenFoam is 2.1.0, gcc 4.4.3, ubuntu 10.04


Best regards, Olga
Galchenko is offline   Reply With Quote

Old   April 26, 2013, 03:19
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
I'm guessing WM_PROJECT_DIR is set to something in your home folder (check with "echo $WM_PROJECT_DIR"). Instead of compiling using sudo, better just compile as a regular user in WM_PROJECT_DIR.

- Anton
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   April 26, 2013, 03:44
Default
  #3
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Hi Galchenko,

You shouldn't have copied the Allwmake file from the main installation dir (based on the error you get, I'm pretty sure this is what you did.

But if it is only one solver you are compiling, there is no need for a Allwmake script. Instead, just make sure you have a Make-folder with the proper 'files' and 'options' in the same directory as the source files of the new solver and simply type
Code:
wmake
Cheers,

L
Lieven is offline   Reply With Quote

Old   April 26, 2013, 04:22
Default
  #4
New Member
 
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 13
Galchenko is on a distinguished road
Thanks a lot for your quick replies)

Anton, I've checked this and this variable is set as opt/openfoam210, do I understant right that it is not user's directory?

And I have to use sudo, because if not I get an error
mkdir: cannot create folder "linux64GccDPOpt": permission denied
So I have problems with user's rights

L, But I didn't copy allwmake, I tried to run it from main directory..
When I try to run wmake in the directory of the solver I get an error:

sudo: wmake: command not found
Though I have Make-folder with proper files..

Best regards, Olga
Galchenko is offline   Reply With Quote

Old   April 26, 2013, 07:24
Default
  #5
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Right, that's ok. WM_PROJECT_USER_DIR is where you should put your cases and self-made applications. And if OpenFOAM is properly configured you should just have to type wmake as Lieven mentioned, no need for Allwmake. Did you source etc/bashrc before trying to compile?
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   April 26, 2013, 08:11
Default
  #6
New Member
 
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 13
Galchenko is on a distinguished road
Yes, I did everything about setting variables again as it is mentioned in the instruction: http://www.openfoam.org/download/git.php

I'm not sure my OpenFoam is configured properly. When I run foamInstallationTest, I get

FATAL ERROR: OpenFOAM environment not configured

But I can't catch what I'm missing, as I followed the instructions..
And I checked enviromental variables - all of them were set well.
Should I configure smth else?
Galchenko is offline   Reply With Quote

Old   April 26, 2013, 08:19
Default
  #7
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Are you aware that you have to source the configurations file every time you want to use OpenFOAM in a new shell? Do this by executing "source /opt/openfoam210/etc/bashrc", and then check if foamInstallationTest still reports an error.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   April 26, 2013, 08:22
Default
  #8
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Ok, open a terminal, go to the installation folder and type
Code:
pwd && grep foamInstall bashrc
and copy the output here.

Also try
Code:
source etc/bashrc
foamInstallationTest
Cheers,

L
Lieven is offline   Reply With Quote

Old   April 26, 2013, 08:24
Default
  #9
New Member
 
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 13
Galchenko is on a distinguished road
I did as you said, but nothing changed and I got the same error..
Galchenko is offline   Reply With Quote

Old   April 26, 2013, 08:28
Default
  #10
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Could you first please copy the output from
Code:
pwd && grep foamInstall OpenFOAMdir/etc/bashrc
Lieven is offline   Reply With Quote

Old   April 26, 2013, 08:32
Default
  #11
New Member
 
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 13
Galchenko is on a distinguished road
L, after running this commands I get:
/opt/openfoam210
grep: opt/openfoam210/etc/bashrc: no such file or directory

though this file exists in this directory..
Galchenko is offline   Reply With Quote

Old   April 26, 2013, 08:42
Default
  #12
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
You forgot the first '/':

grep foamInstall /opt/openfoam210/etc/bashrc
Lieven is offline   Reply With Quote

Old   April 26, 2013, 08:46
Default
  #13
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Also see what the output is of
Code:
echo $FOAM_SRC
If the environment variables are really loaded correctly, this should give
/opt/openfoam210/src
Lieven is offline   Reply With Quote

Old   April 26, 2013, 09:36
Default
  #14
New Member
 
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 13
Galchenko is on a distinguished road
Really thanks for your recomendations. I'll try them next week and write what I get.

Regards, Olga
Galchenko is offline   Reply With Quote

Old   April 30, 2013, 02:12
Default
  #15
New Member
 
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 13
Galchenko is on a distinguished road
Hello!

Quote:
Originally Posted by Lieven View Post
Also see what the output is of
Code:
echo $FOAM_SRC
I get the right directory here.

And after runnint pwd && grep :

# 'foamInstall' below to where OpenFOAM is installed
foamInstall=/opt
# foamInstall=~$WM_PROJECT
# foamInstall=/opt/$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
: ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR
unset cleaned foamClean foamInstall foamOldDirs
Galchenko is offline   Reply With Quote

Old   April 30, 2013, 03:11
Default
  #16
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
It just occurred to me that the environment variables probably get lost when you use 'sudo'.

So
Code:
$ sudo su -
$ cd /opt/openfoam210/
$ source etc/bashrc
$ Allwmake
will probably work.

However, if it goal is to compile a custom solver, I would strongly recommend you to put it somewhere in the home-directory and not in the /opt/openfoam210 - folder so you can compile it without the sudo-command. This will cause problems at a later stage (check out http://www.cfd-online.com/Forums/ope...und-error.html )

Cheers,

L
Lieven is offline   Reply With Quote

Old   April 30, 2013, 07:17
Default
  #17
New Member
 
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 13
Galchenko is on a distinguished road
It workes!!!!!

Thanks a lot) Your help was really irreplaceable!

Regards, Olga
Galchenko is offline   Reply With Quote

Reply


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
thobois class engineTopoChangerMesh error Peter_600 OpenFOAM 4 August 2, 2014 09:52
Interfoam blows on parallel run danvica OpenFOAM Running, Solving & CFD 16 December 22, 2012 02:09
Unexplained Error during Solver Runs cfb CFX 6 November 9, 2012 15:42
Strange residuals of the Density Based Solver Pat84 FLUENT 0 October 22, 2012 15:59
why the solver reject it? Anyone with experience? bearcat CFX 6 April 28, 2008 14:08


All times are GMT -4. The time now is 19:24.