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

[Other] Bashrc problem on multiple OpenFOAM versions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 2, 2018, 15:15
Default Bashrc problem on multiple OpenFOAM versions
  #1
New Member
 
Rolanzo
Join Date: Jan 2016
Location: Texas, USA
Posts: 18
Rep Power: 10
Rolanzo is on a distinguished road
Hi everyone,

I really need help on running multiple OpenFOAM versions. I have been using OpenFOAM-3.0.1 for 1.5 year already but mostly only modifying on modifying and creating solvers nothing fancy and it has been working great. At this point, I need to use blockMatrixTools to solve a set of equations so I downloaded foam-extend-3.1 version following below link.

http://openfoamwiki.net/index.php/In...oam-extend-3.1

I then added below to .bashrc file

Code:
cd ~/foam/foam-extend-3.1
source etc/bashrc
 
echo "alias fe31='source \$HOME/foam/foam-extend-3.1/etc/bashrc'" >> $HOME/.bashrc
Then I opened .bashrc file and modified my original version by adding this line

Code:
alias of30='source \$HOME/OpenFOAM/OpenFOAM-3.0.1/etc/bashrc'
According to this link

http://openfoamwiki.net/index.php/In...with_the_Shell

In .bashrc file, this below line already exists, I am not sure if it was me who did this when I started working on OpenFOAM 1.5 year ago or it was originally there.

source /opt/openfoam30/etc/bashrc

So I deleted this line in .bashrc file then I went back to check my original version (OpenFOAM-3.0.1)

~/OpenFOAM/OpenFOAM-3.0.1

but after I used source etc/bashrc, it shows follow error

Code:
bash: /home/myName/foam/OpenFOAM-3.0.1/bin/foamEtcFile:
 No such file or directory
bash: /home/myName/foam/OpenFOAM-3.0.1/bin/foamCleanPath:
 No such file or directory
bash: /home/myName/foam/OpenFOAM-3.0.1/etc/config/settings.sh:
 No such file or directory
So I am wondering what I did wrong on .bashrc file, right now, it looks something like (cat .bashrc)

Code:
alias of30='source \$HOME/OpenFOAM/OpenFOAM-3.0.1/etc/bashrc'
alias fe31='source \$HOME/foam/foam-extend-3.1/etc/bashrc'
I am not sure if there is supposed to be more lines in .bashrc file?

If I type

Code:
ls /opt
here is what I get

Code:
openfoam30 paraviewopenfoam44
Now if I try to switch between the two using of30 or fe31 that I set earlier in .bashrc file. I get following errors when I choose of30 (OpenFOAM-3.0.1) but no error at all for fe31(extend-3.1):

Code:
bash: /home/myName/foam/OpenFOAM-3.0.1/bin/foamEtcFile:
 No such file or directory
bash: /home/myName/foam/OpenFOAM-3.0.1/bin/foamCleanPath:
 No such file or directory
bash: /home/myName/foam/OpenFOAM-3.0.1/etc/config/settings.sh:
 No such file or directory
bash: /home/myName/foam/OpenFOAM-3.0.1/etc/config/aliases.sh:
 No such file or directory
Which is similar to error I get when I did source etc/.bashrc

On of30 if I type

Code:
echo $WM_PROJECT_DIR
I get

Code:
/home/myName/foam/OpenFOAM-3.0.1
and if I type

Code:
echo $WM_PROJECT_USER_DIR
I get

Code:
/home/myName/foam/myName-3.0.1
Additionally, when I tried to compile one of my solvers that I built under $HOME/OpenFOAM/myName-3.0.1/applications/solvers, which is where I usually work on modifying my solvers, with wmake, I kept getting no such file or directory on many .H files included in the solver, i.e. #include "fvPatchFields.H" or "fvCFD.H". That led me to think that this installation of extend-3.1 must have messed with current environment as I have not changed anything on my OpenFOAM-3.0.1 at all, only changed .bashrc file.

I have attached file bash files from etc/bashrc from both OpenFOAM-3.0.1 and extend-3.1 as shown in attached files.

I have been trying to find solutions from many sites but have yet to figure out how to fix this problem. Now, I only want my original version (OpenFOAM-3.0.1) to at least work so I can continue to work on something I was working on previously. As for extend-3.1, I also tried to compile some random solver but got the same error as when I tried to compile 3.0.1 version, which is something is missing (no such file or directory).

Please kindly advise what part I did wrong or how to fix this problem? Any advices or suggestions would be highly appreciated.

Thank you.
Rolanzo
Attached Files
File Type: txt bashrc_fe31.txt (13.0 KB, 6 views)
File Type: txt bashrc_of30.txt (7.4 KB, 3 views)
Rolanzo is offline   Reply With Quote

Old   February 3, 2018, 11:03
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Rolanzo,

The problem seems to be that the instructions that you followed were not clear enough on how the "~/.bashrc" file should be modified.

I've updated the instructions on the foam-extend related installation pages at openfoamwiki.net, so that it's clearer that the users are meant to simply run the commands given there, instead of manually editing the ".bashrc" file themselves.

Now, in your "~/.bashrc" file, I ask you to:
  1. First, make a copy of that file, so that you don't loose anything vital from it, in case you accidentally erase something critical.
  2. Then edit that file "~/.bashrc" in a text editor, then remove all of the lines that refer to OpenFOAM and foam-extend in that file of yours.
  3. Next, add the following 3 lines to the end of that file:
    Code:
    alias of30opt='source /opt/openfoam30/etc/bashrc'
    alias of301='source $HOME/OpenFOAM/OpenFOAM-3.0.1/etc/bashrc'
    alias fe31='source $HOME/foam/foam-extend-3.1/etc/bashrc'
    The main problem you had is that the backslash "" did not allow the "HOME" variable to be properly used.
  4. Save and close this file in the text editor.

After this, the following steps should get things up and running again:
  1. Start a new terminal command line and run the following commands:
    Code:
    echo $WM_PROJECT_DIR
    export | grep FOAM
  2. These two commands should not give you any output. If they go give any text referring to paths of OpenFOAM or foam-extend, then you will need to log out and then log back in.
  3. If the commands in step #1 didn't give any output, then run the following command:
    Code:
    of30opt
    It should load the OpenFOAM 3.0 installation that you have in "/opt/openfoam30".
  4. Next, open another new terminal window or tab and test running the following command:
    Code:
    of301
    which should load your OpenFOAM 3.0.1 installation that you have at "~/OpenFOAM/OpenFOAM-3.0.1" (reminder: it's the same as "$HOME/OpenFOAM/OpenFOAM-3.0.1").
  5. Similarly, open a new terminal window or tab and test running the following command:
    Code:
    fe31
    for foam-extend 3.1.
  6. Keep in mind that whenever you need to use a specific version of OpenFOAM or foam-extend, you must only use 1 version per terminal window or tab.
Hopefully this solves your problem. If not, please report any error messages you get on each step.


Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 5, 2018, 00:59
Default
  #3
New Member
 
Rolanzo
Join Date: Jan 2016
Location: Texas, USA
Posts: 18
Rep Power: 10
Rolanzo is on a distinguished road
Hi wyldckat, Thank you so much for your response! I am now able to run both OpenFOAM-3.0.1(of30) and foam-extend-3.1 (fe31). However, I still have some problem regarding compiling a solver on foam-extend-3.1. I am trying to build a solver based on blockCoupledScalarTransportFoam. I started by copying an original solver and trying to compile using wmake. But here is what I get after wmake:

Code:
fatal error: fvCFD.H: No such file or directory
#include "fvCFD.H"
This fvCFD.H is the first file included in the solver blockCoupledScalarTransportFoam. I tried to create more solvers based on other solvers in foam-extend-3.1, i.e. elasticSolidFoam, but still ended up getting the same error, which is no such file or directory. So I am wondering if I need to link some library to this version for the solver to see all these files? I do not have such problem when I create solver on OpenFOAM-3.0.1.

Thank you in advance for your help!
Rolanzo is offline   Reply With Quote

Old   February 5, 2018, 19:31
Default
  #4
New Member
 
Rolanzo
Join Date: Jan 2016
Location: Texas, USA
Posts: 18
Rep Power: 10
Rolanzo is on a distinguished road
Today when I turned on my computer to start working. I tried again and when I opened a new terminal and typed fe31 to run extend-3.1. I got an error that I did not get yesterday as below, not sure whats going on.

Code:
modprobe: ERROR: could not insert 'fglrx': No such device
Error! Fail to load fglrx kernel module! Maybe you can switch to root user to load kernel module directly
modprobe: ERROR: could not insert 'fglrx': No such device
Error! Fail to load fglrx kernel module! Maybe you can switch to root user to load kernel module directly
modprobe: ERROR: could not insert 'fglrx': No such device
Error! Fail to load fglrx kernel module! Maybe you can switch to root user to load kernel module directly
Do you have any idea on how to fix this problem? Do I have to download a new kernel? OpenFOAM-3.0.1 is still working fine, only extend-3.1 that has problem. My Ubuntu version is 14.04. I do not want to try something myself that I am not sure as it could make the problem worse like what happened before.

Thank you.
Rolanzo is offline   Reply With Quote

Old   March 4, 2018, 16:42
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answers and sorry for the late replies:
Quote:
Originally Posted by Rolanzo View Post
I am trying to build a solver based on blockCoupledScalarTransportFoam. I started by copying an original solver and trying to compile using wmake.
If that solver is from foam-extend, then it will never build with OpenFOAM 3.0.1, unless you bring all of the blockCoupling mechanisms from foam-extend to OpenFOAM.
Either way, the error is because the include path for either "finiteVolume" or "OpenFOAM" is missing. For example, from here: https://github.com/OpenFOAM/OpenFOAM...m/Make/options
Quote:
Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/fvOptions/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
Quote:
Originally Posted by Rolanzo View Post
Today when I turned on my computer to start working. I tried again and when I opened a new terminal and typed fe31 to run extend-3.1. I got an error that I did not get yesterday as below, not sure whats going on.

Code:
modprobe: ERROR: could not insert 'fglrx': No such device
Error! Fail to load fglrx kernel module! Maybe you can switch to root user to load kernel module directly
modprobe: ERROR: could not insert 'fglrx': No such device
Error! Fail to load fglrx kernel module! Maybe you can switch to root user to load kernel module directly
modprobe: ERROR: could not insert 'fglrx': No such device
Error! Fail to load fglrx kernel module! Maybe you can switch to root user to load kernel module directly
Do you have any idea on how to fix this problem? Do I have to download a new kernel? OpenFOAM-3.0.1 is still working fine, only extend-3.1 that has problem. My Ubuntu version is 14.04. I do not want to try something myself that I am not sure as it could make the problem worse like what happened before.

Thank you.
It's possible that the drivers for the AMD graphics card were updated or the kernel was updated, but it was in such a way that the OpenGL library changed files names or something.

It's been a while since you asked, so I don't know if you managed to solve the problem.
__________________
wyldckat 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
Getting Started with OpenFOAM wyldckat OpenFOAM 26 June 21, 2024 07:54
[Other] Multiple versions of OpenFOAM in one machine? bussaco8 OpenFOAM Installation 1 June 5, 2018 13:47
[Other] Using different MPI types and versions with OpenFOAM spaceprop OpenFOAM Installation 2 May 28, 2018 04:31
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21
Problem installing OpenFOAM 1.5 installation on RHEL 4. vwsj84 OpenFOAM Installation 4 April 23, 2009 05:48


All times are GMT -4. The time now is 14:36.