CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] Installation of OpenFOAM 2.3.1 on RHEL 6.3 (https://www.cfd-online.com/Forums/openfoam-installation/150497-installation-openfoam-2-3-1-rhel-6-3-a.html)

Turbulent March 24, 2015 01:27

Installation of OpenFOAM 2.3.1 on RHEL 6.3
 
Hi,

Is it possbile to install OpenFOAM 2.3.1 on RHEL Server 6.3?
The latest upgradable GCC version for the system is 4.4.7 while OpenFOAM demands GCC 4.5.0 and above.

Any help would be appreciated.

Thanks,

Jack

alexeym March 24, 2015 10:55

Hi,

Yes, it is possible. You even have two possibilities:

1. Build newer version gcc (using makeGcc script from ThirdParty folder, http://openfoamwiki.net/index.php/In...HEL#CentOS_6.5)

2. Install newer version of Gcc using Sofware Collections (https://access.redhat.com/documentat...e_Collections/).

donQi March 26, 2015 03:32

Hi Jack,

here comes another way I used [but before try Alexey's suggestion that is a more elegant solution]

Similarly to you, I had a redhat server 6.4 Santiago, and gcc 4.4.7 without the possibility to become root.

Therefore I did the following:
1) take an hard disk with some GB of space and install on it virtual box portable http://www.vbox.me/
2) create a virtual machine installing CentOS 6.6
3) follow the instruction from http://www.openfoam.org/download/git.php
4) copy the compiled version of the virtual machine into your redhat 6.4 server
5) modify the environment variables
I test some tutorials and they are running well.

If you are interested in more details I copy below my diary of command executed:

In the virtual machine centOS6.6:

as root:
Code:

yum install git
download the sources
Code:

cd /home/donQi/OpenFOAM
as normal user [not Root]
Code:

git clone git://github.com/OpenFOAM/OpenFOAM-2.3.x.git
    cd OpenFOAM-2.3.x
    git pull

save in /home/donQi/OpenFOAM the ThirdParty-2.3.1.tgz
(always as normal user)
Code:

tar xzf ThirdParty-2.3.1.tgz
    mv ThirdParty-2.3.1 ThirdParty-2.3.x

now as root:
Code:

yum groupinstall 'Development Tools'
    yum install openmpi openmpi-devel
    yum-config-manager --nogpgcheck --add-repo http://dl.atrpms.net/el6-x86_64/atrpms/stable
    yum install --nogpgcheck qtwebkit qtwebkit-devel
    yum install --nogpgcheck CGAL CGAL-devel

then :
Code:

ln -s /usr/lib64/libboost_thread-mt.so /usr/lib64/libboost_thread.so
then as normal user
Code:

gedit ~/.bashrc
add the lines:
Code:

export PATH=/usr/lib64/openmpi/bin/:$PATH
    export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib/:$LD_LIBRARY_PATH

then in terminal
Code:

source ~/.bashrc
    mpirun --version

you should see the message:
mpirun (Open MPI) 1.8.1
then as root:
Code:

yum-config-manager --nogpgcheck --add-repo http://springdale.princeton.edu/data/puias/6.5/x86_64/os
    yum-config-manager --nogpgcheck --add-repo http://springdale.princeton.edu/data/puias/DevToolset/6.5/x86_64
    yum install --nogpgcheck devtoolset-1.1-runtime devtoolset-1.1-gcc.x86_64 devtoolset-1.1-gcc-c++.x86_64

This creates an isolated installation of GCC which can be used by sourcing the relevant script by typing the following in a local terminal:
Code:

  source /opt/rh/devtoolset-1.1/enable
then as normal user
Code:

    source /opt/rh/devtoolset-1.1/enable
    gcc --version

and we get
Code:

gcc (GCC) 4.7.2 20121015 (Red Hat 4.7.2-5)
        Copyright (C) 2012 Free Software Foundation, Inc.
        This is free software; see the source for copying conditions.  There is NO
        warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Finally!!!
ENVIRONMENT VARIABLES
in thunder VirtualMachine where we had /home/donQi/OpenFOAM/ we have just add in ~/.bashrc :
Code:

source $HOME/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc
type:
foam
and you should be in the directory OpenFOAM-2.3.x
let's check
Code:

foamSystemCheck
we get:
Code:

System check: PASS
Jeremy Clarkson get the vietnamese driving license!!! OK!!!!
Then
Code:

cd $WM_PROJECT_DIR
to avoid an error [ "/usr/bin/ld: cannot find -lz" ] before launching the Allrun install also
Code:

    yum install zlib-static
    yum install glibc-static

NOTE: if you get an error "NOKEY.." then use:
Code:

    yum install --nogpgcheck zlib-static
    yum install --nogpgcheck glibc-static

Then launch:
Code:

./Allwmake > make.log 2>&1
OK zero errors.

Now back to copy in our server.
>> Copying the compiled openFOAM to Redhat6.4 /
In the thunder VirtualMachine, copy all the files inside the OpenFOAM directory into the share directory:
Code:

sudo su -
    cd -rL /home/donQi/OpenFOAM/* /media/sf_ShareThunder

NOTE: we add the L option to avoid the error "ERROR Cannot create symlink to"
Then back to the RedHat6.4 machine:
we copy the directory from the virtual machine (OpenFOAM-2.3.x, donQi-2.3.x and ThirdParty-2.3.x) into
Code:

/net/lnx6/home/donQi/OpenFOAM/thunderCompiled
In ~/.bashrc set :
Code:

alias OF23x='. /net/lnx6/home/donQi/OpenFOAM/thunderCompiled/OpenFOAM-2.3.x/etc/bashrc'
e nella ect/bash
Code:

foamInstall=/net/lnx6/home/donQi/OpenFOAM/thunderCompiled/
new terminal
Code:

  source ~/.bashrc
  OF23x
  tut
  cd incompressible/icoFoam
  blockMesh

OK works

Code:

[1034 cavity] >> blockMesh
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.x                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.x-c70d1f3c1beb
Exec  : blockMesh
Date  : Mar 26 2015



All times are GMT -4. The time now is 06:15.