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

How to install two versions of OpenFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 20, 2012, 11:56
Default How to install two versions of OpenFoam
  #1
Member
 
Join Date: Jan 2010
Posts: 44
Rep Power: 16
Argen is on a distinguished road
I am trying to install a older version of OpenFOAM 1.5 to my cluster where OpenFOAM 1.7 was already installed. But I found that compiling OF 1.5 could ruin the existing OF 1.7. Any suggestion for installing OF1.5 correctly in this case?
Argen is offline   Reply With Quote

Old   July 20, 2012, 15:56
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
you can compile both versions and differ them by "alias" in bashrc:

example:
alias of16x='. /usr/lib/OpenFOAM-1.6-ext/etc/bashrc'
alias of211='. /opt/openfoam211/etc/bashrc'
alias of210='. /opt/openfoam210/etc/bashrc'
alias of201='. /opt/openfoam201/etc/bashrc'
elham-u, bfzah, siamak 60 and 1 others like this.
nimasam is offline   Reply With Quote

Old   July 20, 2012, 17:21
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
Greetings to all!

For more information about multiple versions: Advanced tips for working with the OpenFOAM shell environment

As for OpenFOAM 1.5: Blast from the past: installing OpenFOAM 1.5 in modern Linux boxes

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 23, 2012, 18:02
Default
  #4
Member
 
Join Date: Jan 2010
Posts: 44
Rep Power: 16
Argen is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings to all!

For more information about multiple versions: Advanced tips for working with the OpenFOAM shell environment

As for OpenFOAM 1.5: Blast from the past: installing OpenFOAM 1.5 in modern Linux boxes

Best regards,
Bruno
Thanks for your reply. I followed this link step by step, while gcc couldn't properly built when "./build-gcc43 > gccmake.log 2>&1 " is executed. The detailed log was attached. How to fix it?

/home/maa/OpenFOAM/ThirdParty-1.5/platforms/linux64/gcc-4.3.3/x86_64-unknown-linux-gnu/bin/ranlib libgcc.a
/home/maa/OpenFOAM/ThirdParty-1.5/platforms/linux64/gcc-4.3.3/x86_64-unknown-linux-gnu/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make[3]: *** [libgcc_s.so] Error 1
make[3]: Leaving directory `/nfs/rachel03/home01/maa/OpenFOAM/ThirdParty-1.5/platforms/build-linux64Gcc43/gcc-4.3.3/x86_64-unknown-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/nfs/rachel03/home01/maa/OpenFOAM/ThirdParty-1.5/platforms/build-linux64Gcc43/gcc-4.3.3'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/nfs/rachel03/home01/maa/OpenFOAM/ThirdParty-1.5/platforms/build-linux64Gcc43/gcc-4.3.3'
make: *** [all] Error 2
Attached Files
File Type: gz gcc-Gcc43_make.log.tar.gz (89.4 KB, 4 views)
Argen is offline   Reply With Quote

Old   July 23, 2012, 18:23
Default
  #5
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
Hi Argen,

I'm already too sleepy to remember where I've seen this error before and how it was fixed back then...

But still, what's the Linux distribution and version you are using on the cluster?

I've taken a look at my blog and this might be of help:
Quote:
Originally Posted by http://www.cfd-online.com/Forums/blogs/wyldckat/534-gcc-other-compiler-issues-openfoam.html
On how to compile gcc-4.3.3 that comes with the ThirdParty-1.6 package - follow the posts starting on this post: OpenFoam Installation in Redhat Enterprise linux 5 post #4
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 23, 2012, 18:52
Default
  #6
Member
 
Join Date: Jan 2010
Posts: 44
Rep Power: 16
Argen is on a distinguished road
Quote:
Originally Posted by wyldckat View Post

But still, what's the Linux distribution and version you are using on the cluster?
It's Linux version 2.6.32.28.
Argen is offline   Reply With Quote

Old   July 24, 2012, 16:18
Default
  #7
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
Hi Argen,

OK, I'm guessing then that you are using CentOS or RHEL 6.x. The error you're getting seems to be the one explained here: http://www.cyberciti.biz/faq/centos-...-findlc-error/
The fix seems to be:
Quote:
Originally Posted by http://www.cyberciti.biz/faq/centos-rhel-redhat-usrbinld-cannot-findlc-error/
To install this, login as root and type the following command:
Code:
# yum install  glibc-static
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 25, 2012, 13:43
Default
  #8
Member
 
Join Date: Jan 2010
Posts: 44
Rep Power: 16
Argen is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Argen,

OK, I'm guessing then that you are using CentOS or RHEL 6.x. The error you're getting seems to be the one explained here: http://www.cyberciti.biz/faq/centos-...-findlc-error/
The fix seems to be:

Hi Bruno,

It didn't work. Even yum couldn't be found as, "-bash: yum: command not found". Sorry to give your wrong version information in the previous reply. It actually is
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"

In this case, how can I sort it out?

Thanks,
Argen
Argen is offline   Reply With Quote

Old   July 25, 2012, 13:53
Default
  #9
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
Hi Argen,

Ah HA! OK, simple enough:
Code:
sudo apt-get install libc6-dev
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 25, 2012, 14:46
Default
  #10
Member
 
Join Date: Jan 2010
Posts: 44
Rep Power: 16
Argen is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Argen,

Ah HA! OK, simple enough:
Code:
sudo apt-get install libc6-dev
Best regards,
Bruno
I got the following information after running that command. It seems the newest version is already installed.

~# sudo apt-get install libc6-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6-dev is already the newest version.
libc6-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]?
Argen is offline   Reply With Quote

Old   July 25, 2012, 14:57
Default
  #11
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
Now I remember, I saw this before while I was trying to build Gcc 4.3.3 on Ubuntu 11.10. Things changed so much that a new few hacks are necessary. One such hack is this for 64bit platforms:
Code:
export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
Then try again building Gcc 4.3.3. The source for this hack was this: http://www.lukedodd.com/?p=225

The reason why this was added is because the library moved from the usual "/usr/lib" folder. To see where the required "libc.a" is located, run:
Code:
dpkg-query -S libc.a
__________________
wyldckat is offline   Reply With Quote

Old   July 25, 2012, 19:15
Default
  #12
Member
 
Join Date: Jan 2010
Posts: 44
Rep Power: 16
Argen is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Now I remember, I saw this before while I was trying to build Gcc 4.3.3 on Ubuntu 11.10. Things changed so much that a new few hacks are necessary. One such hack is this for 64bit platforms:
Code:
export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
Then try again building Gcc 4.3.3. The source for this hack was this: http://www.lukedodd.com/?p=225

The reason why this was added is because the library moved from the usual "/usr/lib" folder. To see where the required "libc.a" is located, run:
Code:
dpkg-query -S libc.a
It looks gcc-4.3 can be installed as shown in gcc-Gcc43_make-intall.log. But, once ./Allwmake > 3rdmake_1ststage.log 2>&1 is executed for ThirdParty-1.5, some errors happened as shown in 3rdmake_1ststage.log. What's the problem?
Attached Files
File Type: gz gcc-Gcc43_make-install.log.tar.gz (11.2 KB, 1 views)
File Type: gz 3rdmake_1ststage.log.tar.gz (66.7 KB, 4 views)

Last edited by Argen; July 25, 2012 at 19:35.
Argen is offline   Reply With Quote

Old   July 26, 2012, 03:43
Default
  #13
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
Hi Argen,

I'll have to look into this myself. This weekend I should be able to see what I can do on my Ubuntu 11.10.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 30, 2012, 01:36
Default
  #14
Member
 
Join Date: Jan 2010
Posts: 44
Rep Power: 16
Argen is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Argen,

I'll have to look into this myself. This weekend I should be able to see what I can do on my Ubuntu 11.10.

Best regards,
Bruno
Hi Bruno,

Have you figured it out?
Thanks,
Argen
Argen is offline   Reply With Quote

Old   July 30, 2012, 05:19
Default
  #15
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
Hi Argen,

Sorry, I haven't had the time to look into this yet. I'll see if later today I can test this myself.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 30, 2012, 15:42
Default
  #16
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
Hi Argen,

OK, I've managed to find the issue for the "ThirdParty-1.5" folder, but I haven't checked yet how the main "OpenFOAM-1.5" folder is going to behave.

Anyway, the fix is this:
Code:
foam
cd wmake/rules
sed -i -e 's=/lib/cpp $(GFLAGS)=cpp -traditional-cpp $(GFLAGS)=' linuxGcc43/general
sed -i -e 's=/lib/cpp $(GFLAGS)=cpp -traditional-cpp $(GFLAGS)=' linux64Gcc43/general
Then go back to the 3rd party folder and do:
Code:
cd $WM_THIRD_PARTY_DIR
(cd metis-5.0pre2 && make realclean)
(cd ParMetis-3.1 && make clean)
(cd ParMGridGen-1.0 && make realclean)

./Allwmake > 3rdmake_1ststage.log 2>&1
Do not worry about the errors that occur with Scotch, because OpenFOAM 1.5 doesn't even use Scotch!

I'll test the main OpenFOAM-1.5 next and update this post (or post a new one) when it finishes.


edit: OK, tested it successfully! I've added another version of the shell script that helps with the whole process, back in my blog post Blast from the past: installing OpenFOAM 1.5 in modern Linux boxes
If you don't want to use the script, then I advise you to update the environment variables once before each Allwmake you execute. Example for the main build:
Code:
of15
./Allwmake > make.log 2>&1
Where of15 is the alias set-up in "~/.bashrc".

Best regards,
Bruno
__________________

Last edited by wyldckat; July 30, 2012 at 16:29. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   August 6, 2012, 12:39
Default
  #17
Member
 
Join Date: Jan 2010
Posts: 44
Rep Power: 16
Argen is on a distinguished road
Thanks a lot, Bruno. When I cleaned ParMGridGen-1.0, I got the following error. Anything I missed?

:~/OpenFOAM/ThirdParty-1.5$ cd ParMGridGen-1.0 && make realclean
(cd MGridGen ; make realclean )
make[1]: Entering directory `~/OpenFOAM/ThirdParty-1.5/ParMGridGen-1.0/MGridGen'
(cd IMlib ; gmake realclean )
/bin/sh: gmake: not found
make[1]: *** [realclean] Error 127
make[1]: Leaving directory `~/OpenFOAM/ThirdParty-1.5/ParMGridGen-1.0/MGridGen'
make: *** [realclean] Error 2

Quote:
Originally Posted by wyldckat View Post
Hi Argen,

OK, I've managed to find the issue for the "ThirdParty-1.5" folder, but I haven't checked yet how the main "OpenFOAM-1.5" folder is going to behave.

Anyway, the fix is this:
Code:
foam
cd wmake/rules
sed -i -e 's=/lib/cpp $(GFLAGS)=cpp -traditional-cpp $(GFLAGS)=' linuxGcc43/general
sed -i -e 's=/lib/cpp $(GFLAGS)=cpp -traditional-cpp $(GFLAGS)=' linux64Gcc43/general
Then go back to the 3rd party folder and do:
Code:
cd $WM_THIRD_PARTY_DIR
(cd metis-5.0pre2 && make realclean)
(cd ParMetis-3.1 && make clean)
(cd ParMGridGen-1.0 && make realclean)

./Allwmake > 3rdmake_1ststage.log 2>&1
Do not worry about the errors that occur with Scotch, because OpenFOAM 1.5 doesn't even use Scotch!

I'll test the main OpenFOAM-1.5 next and update this post (or post a new one) when it finishes.


edit: OK, tested it successfully! I've added another version of the shell script that helps with the whole process, back in my blog post Blast from the past: installing OpenFOAM 1.5 in modern Linux boxes
If you don't want to use the script, then I advise you to update the environment variables once before each Allwmake you execute. Example for the main build:
Code:
of15
./Allwmake > make.log 2>&1
Where of15 is the alias set-up in "~/.bashrc".

Best regards,
Bruno
Argen is offline   Reply With Quote

Old   August 7, 2012, 06:26
Default
  #18
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
Hi Argen,

I see that gmake came back to haunt us Here's what I wrote about it and respective fix several months ago:
Quote:
Originally Posted by wyldckat View Post
The error associated to gmake is an ironic error: gmake stands for GNU make, which is the version usually packed with Linux distributions and always named as make. So, the simplest fix is to make a symbolic link of gmake to make; a simple non-root way to do this is:
Code:
ln -s `which make`  $WM_PROJECT_DIR/bin/gmake
This should create a symbolic link of make to the link gmake in OpenFOAM's bin folder.
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 8, 2012, 18:28
Default
  #19
Member
 
Join Date: Jan 2010
Posts: 44
Rep Power: 16
Argen is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Argen,

I see that gmake came back to haunt us Here's what I wrote about it and respective fix several months ago:


Best regards,
Bruno
Thanks for your help, Bruno. It works to clean ParMGridGen. But there's still some problem while compiling Third-party as follows. I check "which gcc, g++, make", and it shows "~/OpenFOAM/ThirdParty-1.5/platforms/linux64/gcc-4.3.3/bin/gcc, g++, make". Any idea for this problem?

========================================
Start ThirdParty Allwmake
========================================

========================================
Compile specific mpi libraries

have OPENMPI shared library
========================================
Build Scotch decomposition library

have scotch shared libraries
========================================
Build PTScotch decomposition library (requires MPI)

have ptscotch shared libraries
========================================
Build Metis decomposition

+ cd metis-5.0pre2
+ cpMakeFiles metis
+ set +x
+ wmake libso GKlib
g++: no input files
make: *** [libNULL.so] Error 1
+ wmake libso libmetis
g++: no input files
make: *** [libNULL.so] Error 1
========================================
Build ParMetis decomposition. Requires MPI.

+ cd ParMetis-3.1
+ cpMakeFiles ParMetis
+ set +x
+ wmake libso METISLib
g++: no input files
make: *** [libNULL.so] Error 1
+ wmake libso ParMETISLib
g++: no input files
make: *** [libNULL.so] Error 1
========================================
Build ParMGridGen

+ cd ParMGridGen-1.0
+ cpMakeFiles ParMGridGen
+ set +x
+ wmake libso MGridGen/IMlib
g++: no input files
make: *** [libNULL.so] Error 1
+ wmake libso MGridGen/Lib
g++: no input files
make: *** [libNULL.so] Error 1
========================================
Done ThirdParty Allwmake
========================================
Argen is offline   Reply With Quote

Old   August 9, 2012, 05:55
Default
  #20
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
Hi Argen,

Nothing to worry about. As I described in the script:
Quote:
Code:
#build 3rd party first, due to a strange bug regarding OpenMPI...
echo "Building ThirdParty, 1st stage, no monitoring needed..."
#lets fly to the Thirdparty-1.5 dir and fix a few things
cd $WM_THIRD_PARTY_DIR
./Allwmake > 3rdmake_1ststage.log 2>&1
You can now move on to running Allwmake in "OpenFOAM-1.5". Those other libraries will be built as intended.

Best regards,
Bruno
__________________
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
Can't get older versions of OpenFOAM fabioc OpenFOAM Installation 4 February 7, 2012 09:13
for every member help me please to install OpenFOAM dima133 OpenFOAM Installation 1 January 8, 2012 16:36
how to install openfoam on ubuntu 1.4 ? seyedashraf OpenFOAM Installation 8 August 23, 2011 05:50
OpenFoam install script Error during paraFoam installation SePe OpenFOAM Installation 10 June 19, 2010 15:15
Install openFOAM 1.6 on debian 32bit - blockMesh: command not found fossy OpenFOAM Installation 1 August 28, 2009 04:06


All times are GMT -4. The time now is 09:52.