CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   How to install two versions of OpenFoam (http://www.cfd-online.com/Forums/openfoam-installation/105017-how-install-two-versions-openfoam.html)

Argen July 20, 2012 11:56

How to install two versions of OpenFoam
 
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?

nimasam July 20, 2012 15:56

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'

wyldckat July 20, 2012 17:21

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

Argen July 23, 2012 18:02

1 Attachment(s)
Quote:

Originally Posted by wyldckat (Post 372700)
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

wyldckat July 23, 2012 18:23

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

Argen July 23, 2012 18:52

Quote:

Originally Posted by wyldckat (Post 373099)

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

It's Linux version 2.6.32.28.

wyldckat July 24, 2012 16:18

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

Argen July 25, 2012 13:43

Quote:

Originally Posted by wyldckat (Post 373311)
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

wyldckat July 25, 2012 13:53

Hi Argen,

Ah HA! OK, simple enough:
Code:

sudo apt-get install libc6-dev
Best regards,
Bruno

Argen July 25, 2012 14:46

Quote:

Originally Posted by wyldckat (Post 373535)
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]?

wyldckat July 25, 2012 14:57

:eek: 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

Argen July 25, 2012 19:15

2 Attachment(s)
Quote:

Originally Posted by wyldckat (Post 373544)
:eek: 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?

wyldckat July 26, 2012 03:43

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

Argen July 30, 2012 01:36

Quote:

Originally Posted by wyldckat (Post 373632)
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

wyldckat July 30, 2012 05:19

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 July 30, 2012 15:42

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 August 6, 2012 12:39

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 (Post 374407)
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


wyldckat August 7, 2012 06:26

Hi Argen,

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

Originally Posted by wyldckat (Post 288946)
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

Argen August 8, 2012 18:28

Quote:

Originally Posted by wyldckat (Post 375762)
Hi Argen,

I see that gmake came back to haunt us :D 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
========================================

wyldckat August 9, 2012 05:55

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


All times are GMT -4. The time now is 23:20.