Promlems with compilation of new solver
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 |
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 |
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 |
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 |
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?
|
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? |
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.
|
Ok, open a terminal, go to the installation folder and type
Code:
pwd && grep foamInstall bashrc Also try Code:
source etc/bashrc L |
I did as you said, but nothing changed and I got the same error..
|
Could you first please copy the output from
Code:
pwd && grep foamInstall OpenFOAMdir/etc/bashrc |
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.. |
You forgot the first '/':
grep foamInstall /opt/openfoam210/etc/bashrc |
Also see what the output is of
Code:
echo $FOAM_SRC /opt/openfoam210/src |
Really thanks for your recomendations. I'll try them next week and write what I get.
Regards, Olga |
Hello!
Quote:
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 |
It just occurred to me that the environment variables probably get lost when you use 'sudo'.
So Code:
$ sudo su - 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 |
It workes!!!!!
Thanks a lot) Your help was really irreplaceable! Regards, Olga |
All times are GMT -4. The time now is 12:32. |