|
[Sponsors] |
[OpenFOAM.org] unable to source openFOAM under $HOME directory |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 6, 2012, 14:03 |
unable to source openFOAM under $HOME directory
|
#1 |
New Member
llh
Join Date: Jan 2012
Posts: 22
Rep Power: 14 |
Dear all,
I would like to modify the solver in openfoam210 but it seems that I cannot make any changes to the files under /opt/ So I moved it to my home directory and add the following line into my $HOME/.bashrc file source $HOME/openfoam210/etc/bashrc. Then I run “source $HOME/.bashrc” in the terminal window and these were the information I got: bash: /opt/openfoam210/bin/foamEtcFile: No such file or directory bash: /opt/openfoam210/bin/foamCleanPath: No such file or directory bash: /opt/openfoam210/bin/foamCleanPath: No such file or directory bash: /opt/openfoam210/bin/foamCleanPath: No such file or directory bash: /opt/openfoam210/etc/config/settings.sh: No such file or directory bash: /opt/openfoam210/etc/config/aliases.sh: No such file or directory bash: /opt/openfoam210/bin/foamEtcFile: No such file or directory bash: /opt/openfoam210/bin/foamEtcFile: No such file or directory bash: /opt/openfoam210/bin/foamCleanPath: No such file or directory bash: /opt/openfoam210/bin/foamCleanPath: No such file or directory bash: /opt/openfoam210/bin/foamCleanPath: No such file or directory can anyone please tell to me is there any thing I miss? Regards, L |
|
November 7, 2012, 03:18 |
|
#2 |
Member
Join Date: Mar 2012
Location: Munich, Germany
Posts: 67
Rep Power: 14 |
Hello,
did you move your hole OpenFOAM folder? In this case you have to compile again... You can modify solvers in your home folder. You just have to copy the solver into your user directory of OpenFoam, normally home/<user>/OpenFOAM/<user>-<version>/applications/... In this case you can modify solvers without a sudo or moving the OpenFOAM installation. It´s like the run directory . regards treima |
|
November 7, 2012, 18:51 |
|
#3 |
New Member
llh
Join Date: Jan 2012
Posts: 22
Rep Power: 14 |
Hi treima,
Thanks for your reply, I moved the whole OpenFOAM folder, How to compile it again? I type wmake all or ./Allwmake under the new directory in terminal window but it doesnt work. It says that wmake commmand is not found Regards, L |
|
November 8, 2012, 03:52 |
|
#4 |
Member
Join Date: Jun 2011
Posts: 53
Rep Power: 15 |
Hello lilinghan,
look into your bashrc. (gedit $HOME/.bashrc) there should be written something like: source /opt/openfoam211/etc/bashrc change this to your new location of the OpenFOAM folder, e.g. source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc source the bashrc again (. $HOME/bashrc) and try ./Allwmake in the OpenFOAM folder regards, squirrel |
|
November 8, 2012, 05:44 |
|
#5 |
New Member
llh
Join Date: Jan 2012
Posts: 22
Rep Power: 14 |
Hi Squirrel,
Thanks for ur reply, I have done the step that changing the location in bashrc, and when and run "source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc" I got the error messages as I mentioned in my post above. Regards, L |
|
November 8, 2012, 06:38 |
|
#6 |
Member
Join Date: Jun 2011
Posts: 53
Rep Power: 15 |
Ok, sorry I didn't check the bash file of the OpenFOAM installation.
In /OpenFOAM/OpenFOAM-2.1.0/etc/bashrc file there is written (line 43) Code:
# Location of the OpenFOAM installation # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foamInstall=/opt # foamInstall=~$WM_PROJECT # foamInstall=/opt/$WM_PROJECT # foamInstall=/usr/local/$WM_PROJECT # So you have two possibilities, I would suggest the first one, because it is less likely to accidentally overwrite a working solver: 1.) you move your whole OpenFOAM directory back to the /opt/ directory and test whether it works again. Then you create a directory in your home $HOME/OpenFOAM/user-2.1.0 Then you COPY the solver you want to modify from the opt/openfoam into your user directory, but keep a similar directory tree e.g. simpleFoam would be copy from /opt/openfoam210/applications/solvers/incompressible/simpleFoam to $HOME/OpenFOAM/user-2.1.0/applications/solvers/incompressible/simpleFoam In the copied solver directory edit the Make/files Code:
EXE = $(FOAM_USER_APPBIN)/mysimpleFoam modify to whatever you want and compile again. You can use the modified solver with the new name mysimpleFoam (you can name it whatever you like in Make/files, but I would suggest not using the original name). 2. you change in /OpenFOAM/OpenFOAM-2.1.0/etc/bashrc to the correct foamInstall directory. foamInstall = $HOME/$WM_PROJECT regards squirrel Last edited by blacksquirrel; November 8, 2012 at 07:19. |
|
November 8, 2012, 08:38 |
|
#7 |
New Member
llh
Join Date: Jan 2012
Posts: 22
Rep Power: 14 |
Hi again,
I need to modify the solver and I download a other people's work which is also needed to change the libraries in the original file so I prefer the 2rd method. I changed the foamInstall directory to foamInstall=$HOME/$WM_PROJECT BUt I still got the error message, do i need also change the code: Code:
#- note the location for later use (eg, in job scripts) : ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR Regards, L |
|
November 8, 2012, 08:57 |
|
#8 |
Member
Join Date: Jun 2011
Posts: 53
Rep Power: 15 |
Ok, this is curious. What do you get, if you type
echo $WM_PROJECT_DIR and echo $FOAM_INST_DIR ? I don't think you need to change the code for FOAM_INST_DIR, because Code:
#- note the location for later use (eg, in job scripts) : ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR And you can also compile new libraries with my first method. I'm doing the same, modifying solvers and libraries. It isn't more complicated. |
|
November 8, 2012, 09:09 |
|
#9 |
New Member
llh
Join Date: Jan 2012
Posts: 22
Rep Power: 14 |
HI,
one is /opt/OpenFOAM-2.1.1 and the second is /opt |
|
November 8, 2012, 09:19 |
|
#10 |
Member
Join Date: Jun 2011
Posts: 53
Rep Power: 15 |
Ok, so there is still the wrong directory.
Let's try the simplest thing: close the terminal and open another one. Try again. Still the same? I tried it with my installation and it doesn't change the directory despite sourcing the bash file, but it worked after closing and reopening the terminal. I'm kinda out of ideas right now, sorry... |
|
November 8, 2012, 09:56 |
|
#11 |
New Member
llh
Join Date: Jan 2012
Posts: 22
Rep Power: 14 |
HI,
I close and open a new terminal window, and now it works! Thanks very much for your replies! Regards, L |
|
January 9, 2014, 09:12 |
|
#12 | |
Member
Peter
Join Date: Nov 2011
Posts: 46
Rep Power: 15 |
Hi, blacksquirrel!
Here is my situation: Quote:
Regards. Peter |
||
January 10, 2014, 06:16 |
|
#13 |
Member
Join Date: Jun 2011
Posts: 53
Rep Power: 15 |
Hi Peter,
Please specify your problem. What exactly do you want to do, and what is not working? Your output means, that the installation directory of OpenFOAM is /home/hpc/OpenFOAM. If you want to modify a solver and/or library and have the problem, that you don't have the permission to do it in the /opt directory, I strongly recommend possibility 1 of my post from November 8, 2012 11:38. Regards squirrel |
|
January 10, 2014, 06:28 |
|
#14 | |
Member
Peter
Join Date: Nov 2011
Posts: 46
Rep Power: 15 |
Hi, squirrel!
Thank you for your reply. I try to install OpenFOAM following this instruction: http://www.openfoam.org/archive/2.0....oad/ubuntu.php I think I have already solved the problem by adding Quote:
Regards. Peter |
||
November 16, 2016, 23:09 |
|
#15 |
New Member
QuocThien
Join Date: Apr 2013
Posts: 16
Rep Power: 13 |
All you need is just
0. make sure in etc/bashrc file : foamInstall=$HOME/$WM_PROJECT (no # before) 1. go straight to the .../etc/ directory 2. open the terminal in directory above then type: source bashrc 3. echo $WM_PROJECT_DIR to check 4. Install OpenFoam in the main OpenFOAM directory by ./Allwamke 5. F*** someone to enjoy |
|
October 15, 2019, 03:53 |
OpenFOAM sourcing
|
#16 |
New Member
Usama Niaz
Join Date: Oct 2019
Location: Pakistan
Posts: 7
Rep Power: 7 |
Hi,
I am installing OpenFOAM 1906 version. right now i am sourcing the OpenFOAM environment through the following command; source ~/OpenFOAM/OpenFOAM-v1906/etc/bashrc but i am getting the following error message No completion added for /home/anonymous/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/bin ... incorrect platform, or not yet compiled? can any one help? i am not getting it. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[waves2Foam] Tripping over several build issues with OpenFOAM 2.1.1 | Yage | OpenFOAM Community Contributions | 18 | February 15, 2016 03:02 |
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 | Seroga | OpenFOAM Community Contributions | 9 | June 12, 2015 18:18 |
Problem compiling a custom Lagrangian library | brbbhatti | OpenFOAM Programming & Development | 2 | July 7, 2014 12:32 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |
[swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 06:18 |