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

How to install OF DP and SP in parallel?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2011, 17:29
Default How to install OF DP and SP in parallel?
  #1
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
Hello,

I installed OpenFoam-2.0.1 with standard double precision (DP) on my computer. Works fine!

In addition to that I'd like to install as single precision (SP) version on the same computer for different purposes.

The DP version is installed in /OpenFOAM/OpenFOAM-2.0.1

I use the current version of Linux Mint.

When I tried to install an additional SP version some time ago, I messed the existing DP installation up and was not able to fix it afterwards. This time I'd like to avoid that, hence some questions:

My idea is:

1. Create a new directory $HOME/OpenFOAMSP/OpenFOAM-2.0.1
2. Update $HOME/.bashrc

change 'source $HOME/OpenFOAM/OpenFOAM-2.0.1/etc/bashrc' to 'source $HOME/OpenFOAMSP/OpenFOAM-2.0.1/etc/bashrc'

3. In the bashrc file in $HOME/OpenFOAMSP/OpenFOAM-2.0.1/etc/bashrc

change 'export WM_PROJECT=OpenFOAM' to 'export WM_PROJECT=OpenFOAMSP'

and

change 'export WM_PRECISION_OPTION=DP' to 'export WM_PRECISION_OPTION=SP'

Is there anything else to think about to be able to install and run the two version on one computer independently (but not at the same time)?

Regards,

Klaus
klausb is offline   Reply With Quote

Old   November 22, 2011, 17:48
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 Klaus,

I understand you wanting to make sure that they are separate, but the following method makes it perfectly safe to have both builds in the same OpenFOAM folder:
  1. Remove or comment the entries you added to your "$HOME/.bashrc" file.
  2. Add these instead:
    Code:
    alias of201D='. $HOME/OpenFOAM/OpenFOAM-2.0.1/etc/bashrc'
    alias of201S='. $HOME/OpenFOAM/OpenFOAM-2.0.1/etc/bashrc WM_PRECISION_OPTION=SP'
Then on each new terminal window/tab, run of201D or of201S according to the environment you want. If you want to switch between environments in the same terminal, run wmUNSET like this:
Code:
of201D

<run the commands you want>

wmUNSET
of201S
For more about this, see my (incomplete) blog post on Advanced tips for working with the OpenFOAM shell environment

But if you still want to have 2 fully separate installations, the key variable is "FOAM_INST_DIR", as shown here: http://www.openfoam.org/git.php#x3-9000
Stuffing those 3 lines into an alias can be done with adding ";":
Code:
alias of201D='export FOAM_INST_DIR=$HOME/OpenFOAM/ ; foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.0.1/etc/bashrc ; [ -f $foamDotFile ] && . $foamDotFile' 
alias of201S='export FOAM_INST_DIR=$HOME/OpenFOAMSP/ ; foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.0.1/etc/bashrc ; [ -f $foamDotFile ] && . $foamDotFile WM_PRECISION_OPTION=SP'
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   November 27, 2011, 11:02
Default This doesn't work...
  #3
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
Hello Bruno,

background: I need two separate versions as it's not just about SP/DP, there are more changes.

I've just setup the SP version for installation but for some reason, the path stuff in .bashrc and bashrc of the installation is messed up.

Note there is a perfectly working DP installation in $HOME/OpenFOAM...

The SP version needs to be installed in/the sources are in $HOME/OpenFOAMSP/OpenFOAMSP-2.0.1

The .bashrc entry is:

source $HOME/OpenFOAMSP/OpenFOAMSP-2.0.1/etc/bashrc

The bashrc in the installation directory (it's attached renamed bashrc.txt)

I changed export WM_PROJECT=OpenFOAM to:

export WM_PROJECT=OpenFOAMSP

When I try to run the installation ./Allwmake, the pwd check fails and source .bashrc results in the following errors:

source .bashrc
bash: Error: Datei oder Verzeichnis nicht gefunden
bash: :: Datei oder Verzeichnis nicht gefunden
bash: unknown/unsupported: Datei oder Verzeichnis nicht gefunden
bash: naming: Datei oder Verzeichnis nicht gefunden
bash: convention: Datei oder Verzeichnis nicht gefunden
bash: Error: Datei oder Verzeichnis nicht gefunden
bash: :: Datei oder Verzeichnis nicht gefunden
bash: unknown/unsupported: Datei oder Verzeichnis nicht gefunden
bash: naming: Datei oder Verzeichnis nicht gefunden
bash: convention: Datei oder Verzeichnis nicht gefunden
bash: Error: Datei oder Verzeichnis nicht gefunden
bash: :: Datei oder Verzeichnis nicht gefunden
bash: unknown/unsupported: Datei oder Verzeichnis nicht gefunden
bash: naming: Datei oder Verzeichnis nicht gefunden
bash: convention: Datei oder Verzeichnis nicht gefunden
bash: Error: Datei oder Verzeichnis nicht gefunden
bash: :: Datei oder Verzeichnis nicht gefunden
bash: unknown/unsupported: Datei oder Verzeichnis nicht gefunden
bash: naming: Datei oder Verzeichnis nicht gefunden
bash: convention: Datei oder Verzeichnis nicht gefunden


What's wrong with my settings?

klaus
Attached Files
File Type: txt bashrc.txt (7.1 KB, 7 views)
klausb is offline   Reply With Quote

Old   November 27, 2011, 14:42
Default
  #4
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
Hi Klaus,

The OpenFOAM code, although designed for easy project renaming for situations where the project could be forked, isn't always tested to check how compatible it is with fast forking.

In other words: do not change the WM_PROJECT variable unless you know what you are doing!

What you can do is make the following changes to these two variables:
Code:
export WM_PROJECT_VERSION=2.0.1-SP
foamInstall=$HOME/${WM_PROJECT}SP
If you truly wish to fix how "WM_PROJECT" works, then you'll have to do some debugging to the shell scripts.

By what I've seen, it seems that if you do want to change the WM_PROJECT variable, you'll have to at least change every occurrence of the word "OpenFOAM" to "OpenFOAMSP" in the file "bin/foamEtcFile".

Good luck!
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   November 27, 2011, 18:43
Default Nearly there -ThirdParty-2.0.1-SP not found
  #5
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
Hello Bruno,

thank you for your feedback! Things are getting better but I get a compilation error: no ThirdParty sources found - skipping

They are in: $HOME/OpenFOAMSP/ThirdParty-2.0.1-SP

Any idea what's the problem?

Klaus
klausb is offline   Reply With Quote

Old   November 28, 2011, 17:14
Default
  #6
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
Hi Klaus,

Quote:
Originally Posted by klausb View Post
thank you for your feedback! Things are getting better but I get a compilation error: no ThirdParty sources found - skipping

They are in: $HOME/OpenFOAMSP/ThirdParty-2.0.1-SP
Mmmm.... try starting a new terminal window, to be 100% certain that the shell environment is initiated properly.

My guess is that since you might have renamed the ThirdParty folder only after you edited OpenFOAM's "etc/bashrc" file, which might leave some essential variables not properly defined until you start a new terminal.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   January 7, 2012, 19:40
Default solved
  #7
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
step-by-step: I use the git version on Linux Mint

1. unpack the new version + ThirdParty in $Home/OpenFoam as usual

2. Update .bashrc in $HOME to match the new version

3. The differentiator is the entry: export WM_PROJECT_VERSION=2.0.1-SP in the $HOME/OpenFoam/OpenFoam-new_version/etc/bashrc

DON'T try to change export WM_PROJECT=OpenFOAM, as that can cause a lot of problems.

Klaus
klausb 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



All times are GMT -4. The time now is 10:54.