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

[foam-extend.org] Having difficulties using more than one OpenFOAM/foam-extend installation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 24, 2018, 08:11
Default Having difficulties using more than one OpenFOAM/foam-extend installation
  #1
New Member
 
Join Date: Mar 2017
Posts: 28
Rep Power: 9
saatt is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Quick answer:
  1. Run the following command:
    Code:
    grep -i "openfoam" ~/.bash*
    It will reveal the majority of the environments being loaded-in automatically. It might tell you that there is more than one file with lines referring to OpenFOAM.
  2. After you modify the ".bash*" files to all use alias, then start a new terminal and try checking again.



"After you modify the ".bash*" files to all use alias, " what is means? what should I do ? Please tell me the details


[Moderator note: Moved this post and the one below to a new thread, given that they were both on the same topic, for different versions.]

Last edited by wyldckat; October 24, 2018 at 17:37. Reason: replaced with the correct quote and added a moderator note
saatt is offline   Reply With Quote

Old   October 24, 2018, 08:44
Default Same problem can't be solved
  #2
New Member
 
Join Date: Mar 2017
Posts: 28
Rep Power: 9
saatt is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Quick answer: I'm really late on this, but the solution is that you need to use aliases to make it easier to use each OpenFOAM/foam-extend version independently. Details are available at section 2.2 "Using aliases to help manage multiple OpenFOAM versions", here: https://openfoamwiki.net/index.php/I...nFOAM_versions
Hi, I meet the same problem when i install the foam-extend-4.0, but I also can't solve it according your mentioned. Actually I add the contents of 'source...' and 'aliases...' in bashrc file,
Code:
source /home/yy/OpenFOAM/OpenFOAM-v1806/etc/bashrc
 source /opt/openfoam6/etc/bashrc
 source /home/yy/foam/foam-extend-4.0/etc/bashrc
alias of18='source $HOME/OpenFOAM/OpenFOAM-v1806/etc/bashrc $FOAM_SETTINGS'
 alias of6='source /opt/openfoam6/etc/bashrc $FOAM_SETTINGS'
 alias fe40='source $HOME/foam/foam-extend-4.0/etc/bashrc $FOAM_SETTINGS'
However, when i open a terminal, there are some errors like this post
Code:
bash: /opt/foam-extend-4.0/bin/foamGetSystemInfo: No such file or directory
bash: /opt/foam-extend-4.0/bin/foamCleanPath: No such file or directory
bash: /opt/foam-extend-4.0/bin/foamCleanPath: No such file or directory
bash: /opt/foam-extend-4.0/bin/foamCleanPath: No such file or directory
bash: /opt/foam-extend-4.0/etc/settings.sh: No such file or directory
bash: /opt/foam-extend-4.0/etc/aliases.sh: No such file or directory
bash: /opt/foam-extend-4.0/bin/foamCleanPath: No such file or directory
bash: /opt/foam-extend-4.0/bin/foamCleanPath: No such file or directory
bash: /opt/foam-extend-4.0/bin/foamCleanPath: No such file or directory
So what I NEED to DO? PLEASE
NOTE: when I key in Terminal these, and I get the message
Code:
 echo $WM_PROJECT_DIR
/opt/foam-extend-4.0

Last edited by wyldckat; October 24, 2018 at 17:30. Reason: Added [CODE][/CODE] markers
saatt is offline   Reply With Quote

Old   October 24, 2018, 17:27
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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 answer: Oh, OK, so you are almost there... you need to remove the first 3 lines, namely to change this
Code:
source /home/yy/OpenFOAM/OpenFOAM-v1806/etc/bashrc
 source /opt/openfoam6/etc/bashrc
 source /home/yy/foam/foam-extend-4.0/etc/bashrc
alias of18='source $HOME/OpenFOAM/OpenFOAM-v1806/etc/bashrc $FOAM_SETTINGS'
 alias of6='source /opt/openfoam6/etc/bashrc $FOAM_SETTINGS'
 alias fe40='source $HOME/foam/foam-extend-4.0/etc/bashrc $FOAM_SETTINGS'
To this:
Code:
alias of18='source $HOME/OpenFOAM/OpenFOAM-v1806/etc/bashrc'
alias of6='source /opt/openfoam6/etc/bashrc'
alias fe40='source $HOME/foam/foam-extend-4.0/etc/bashrc'
I also removed "$FOAM_SETTINGS", because this is only used after we have an already working shell environment and this variable was already defined...

Make sure you saved the modified file in the text editor.

Then start a new terminal window (or tab) and run this command:
Code:
echo $WM_PROJECT_DIR
If it outputs nothing, just an empty line, then you can activate one of the OpenFOAM or foam-extend versions, by running the associated alias name:
  • For OpenFOAM v1806:
    Code:
    of18
  • For OpenFOAM 6:
    Code:
    of6
  • For foam-extend 4.0:
    Code:
    fe40
Keep in mind that in order to use another version, you must start a new terminal window (or tab), so that there is no collision between environments.

----

The quick answer I had originally written for the first post:

In this page: https://openfoamwiki.net/index.php/I...with_the_Shell - detailed instructions are given in section Using aliases to help manage multiple OpenFOAM versions

Last edited by wyldckat; October 24, 2018 at 17:37. Reason: edited my answer
wyldckat is offline   Reply With Quote

Old   October 24, 2018, 21:46
Default
  #4
New Member
 
Join Date: Mar 2017
Posts: 28
Rep Power: 9
saatt is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Quick answer: Oh, OK, so you are almost there... you need to remove the first 3 lines, namely to change this
Code:
source /home/yy/OpenFOAM/OpenFOAM-v1806/etc/bashrc
 source /opt/openfoam6/etc/bashrc
 source /home/yy/foam/foam-extend-4.0/etc/bashrc
alias of18='source $HOME/OpenFOAM/OpenFOAM-v1806/etc/bashrc $FOAM_SETTINGS'
 alias of6='source /opt/openfoam6/etc/bashrc $FOAM_SETTINGS'
 alias fe40='source $HOME/foam/foam-extend-4.0/etc/bashrc $FOAM_SETTINGS'
To this:
Code:
alias of18='source $HOME/OpenFOAM/OpenFOAM-v1806/etc/bashrc'
alias of6='source /opt/openfoam6/etc/bashrc'
alias fe40='source $HOME/foam/foam-extend-4.0/etc/bashrc'
I also removed "$FOAM_SETTINGS", because this is only used after we have an already working shell environment and this variable was already defined...

Make sure you saved the modified file in the text editor.

Then start a new terminal window (or tab) and run this command:
Code:
echo $WM_PROJECT_DIR
If it outputs nothing, just an empty line, then you can activate one of the OpenFOAM or foam-extend versions, by running the associated alias name:
  • For OpenFOAM v1806:
    Code:
    of18
  • For OpenFOAM 6:
    Code:
    of6
  • For foam-extend 4.0:
    Code:
    fe40
Keep in mind that in order to use another version, you must start a new terminal window (or tab), so that there is no collision between environments.

----

The quick answer I had originally written for the first post:

In this page: https://openfoamwiki.net/index.php/I...with_the_Shell - detailed instructions are given in section Using aliases to help manage multiple OpenFOAM versions
Hi,wyldckat ~ I change something under your guidance. When I key in the code fe40 or source etc/bashrc, I both get error messages
bash: export: `1': not a valid identifier
bash: /home/yy/foam/foam-extend-4.0/ThirdParty/packages/gcc-4.9.2/platforms/linux64Gcc49DPOpt/etc/gcc-4.9.2.sh: No such file or directory

Warning in /home/yy/foam/foam-extend-4.0/etc/settings.sh:
Cannot find /home/yy/foam/foam-extend-4.0/ThirdParty/packages/gcc-4.9.2/platforms/linux64Gcc49DPOpt installation.
Please install this compiler version or if you wish to use the system compiler,
change the 'compilerInstall' setting to 'System' in this file
NOTE: the system is Ubuntu 16.04
THANK YOU FOR YOUR REPLYING
------------------------------------------------
I read some your past reply, and that may be useful for me.
How to install foam-extend 4.0 in UBUNTU 18.04
NOW, the foam-extend is compiling... waiting for the result~~~
saatt is offline   Reply With Quote

Old   October 25, 2018, 09:06
Default
  #5
Senior Member
 
calim_cfd's Avatar
 
mauricio
Join Date: Jun 2011
Posts: 172
Rep Power: 17
calim_cfd is on a distinguished road
Hi, Saatt.
For an version of OF to work you must set the environment variables accordingly.

Say you have 3 versions:

assume that you compiled/installed all the files at
$HOME/OpenFOAM/OpenFOAM-v1/
$HOME/OpenFOAM/OpenFOAM-v2/
$HOME/OpenFOAM/OpenFOAM-v3/

Each installation has its own variables to work with. Since many commands are similar among the distributions you need to do as wyldckat said. Using my folder and naming hypothesis, edit your $HOME/.bashrc to include the aliases:

Code:
alias ofv1='source $HOME/OpenFOAM/OpenFOAM-v1/etc/bashrc'
alias ofv2='source $HOME/OpenFOAM/OpenFOAM-v2/etc/bashrc'
alias ofv3='source $HOME/OpenFOAM/OpenFOAM-v3/etc/bashrc'
Now, assuming your OF files are properly installed, every time you open a terminal you wont have the OF's commands available until you source the respective environment variables.
So, say you wanna use the v1 version, when you open a terminal, then if you did the right thing, you must type

Code:
 ofv1
it will enable the v1 version and commands.
Say now you wanna run the same tutorial with version v2.
You can either type
Code:
 ofv2
in the same terminal or open another one/tab and type the ofv2 command so you willl have 2 terminals with different versions running. So when you use the icoFoam solver/command on the first terminal you're calling the files from the the v1 folder and so on.

What the regular installation steps tell you to do is to add this line
Code:
source $HOME/OpenFOAM/OpenFOAM-v1/etc/bashrc
to the $HOME/.bashrc file so everytime you open a terminal the environment variable you be automatically set and the OF's commands from that specific installation will be used. YOU MUST CHANGE THIS STEP to what wyldckat said to creat the alises.

NOTE: make sure you install all versions under the same user. Do use the root user because each user has its own bashrc file so when you change users throughout the installation you will almost always bump into errors.

Hope it helps
__________________
Best Regards
/calim

"Elune will grant us the strength"
calim_cfd 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
[foam-extend.org] A problem about installation of open foam extend 3.1 Toalchemist OpenFOAM Installation 1 May 31, 2018 08:58
Sig Density Based Solver installation with FOAM Extend 3.2 qjh888 OpenFOAM Bugs 0 September 21, 2016 08:16
[foam-extend.org] Foam extend 3.2 wrong installation directory geop OpenFOAM Installation 0 May 11, 2016 05:52
ParaView-4.0.1 did not compile for foam extend 3.0 installation mhkenergy OpenFOAM Installation 8 June 4, 2014 02:26
Difficulties using parafoam, one critical error in installation of OpenFOAM-1.6 PeterNaa OpenFOAM Installation 4 April 9, 2010 08:48


All times are GMT -4. The time now is 00:33.