|
[Sponsors] |
April 26, 2013, 03:38 |
Promlems with compilation of new solver
|
#1 |
New Member
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
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 |
|
April 26, 2013, 04:19 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
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. |
|
April 26, 2013, 04:44 |
|
#3 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23 |
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 L |
|
April 26, 2013, 05:22 |
|
#4 |
New Member
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
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 |
|
April 26, 2013, 08:24 |
|
#5 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
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. |
|
April 26, 2013, 09:11 |
|
#6 |
New Member
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
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? |
|
April 26, 2013, 09:19 |
|
#7 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
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. |
|
April 26, 2013, 09:22 |
|
#8 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23 |
Ok, open a terminal, go to the installation folder and type
Code:
pwd && grep foamInstall bashrc Also try Code:
source etc/bashrc foamInstallationTest L |
|
April 26, 2013, 09:24 |
|
#9 |
New Member
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
I did as you said, but nothing changed and I got the same error..
|
|
April 26, 2013, 09:28 |
|
#10 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23 |
Could you first please copy the output from
Code:
pwd && grep foamInstall OpenFOAMdir/etc/bashrc |
|
April 26, 2013, 09:32 |
|
#11 |
New Member
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
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.. |
|
April 26, 2013, 09:42 |
|
#12 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23 |
You forgot the first '/':
grep foamInstall /opt/openfoam210/etc/bashrc |
|
April 26, 2013, 09:46 |
|
#13 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23 |
Also see what the output is of
Code:
echo $FOAM_SRC /opt/openfoam210/src |
|
April 26, 2013, 10:36 |
|
#14 |
New Member
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
Really thanks for your recomendations. I'll try them next week and write what I get.
Regards, Olga |
|
April 30, 2013, 03:12 |
|
#15 |
New Member
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
Hello!
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 |
|
April 30, 2013, 04:11 |
|
#16 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23 |
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 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 |
|
April 30, 2013, 08:17 |
|
#17 |
New Member
Galchenko Olga
Join Date: Nov 2012
Posts: 16
Rep Power: 14 |
It workes!!!!!
Thanks a lot) Your help was really irreplaceable! Regards, Olga |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
thobois class engineTopoChangerMesh error | Peter_600 | OpenFOAM | 4 | August 2, 2014 10:52 |
Interfoam blows on parallel run | danvica | OpenFOAM Running, Solving & CFD | 16 | December 22, 2012 03:09 |
Unexplained Error during Solver Runs | cfb | CFX | 6 | November 9, 2012 16:42 |
Strange residuals of the Density Based Solver | Pat84 | FLUENT | 0 | October 22, 2012 16:59 |
why the solver reject it? Anyone with experience? | bearcat | CFX | 6 | April 28, 2008 15:08 |