CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Is it better to create a user for openFOAM? (http://www.cfd-online.com/Forums/openfoam-installation/65790-better-create-user-openfoam.html)

Xwang June 25, 2009 18:06

Is it better to create a user for openFOAM?
 
Hi, I've tried to install openFOAM using my user, but I've see that it changes the default gcc compiler to the one shipped with openFOAM. So I'm wondering if it is better to create a user specifically for OF15 so that to mantain the base system as shipped by the distro. Then to use OF and paraview I've just to log as the newuser using ssh -X, is it correct? Xwang

gunnar June 26, 2009 05:25

>Is it better to create a user for openFOAM?

No, in my opinion it is better to eat vegetables.

hellorishi June 26, 2009 05:30

You can use the same user for OF and other requirements.
It is all about sourcing the correct variables. If you remove/or better hide the following line from your .bachrc file, you can use default gcc compiler of your Linux (not OF)

. $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/bashrc
AND

You can also create a seperate user for OF (and ParaView) and then just log into that system, by rebooting or logging off current user.

roth June 26, 2009 08:47

Or you can just use your system compiler by making a switch in your $WM_PROJECT_DIR/etc/settings.sh:

Quote:

# Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# compilerInstall = OpenFOAM | System
compilerInstall=System
I find using the system compiler is the path of least resistance.

Michael

Xwang June 26, 2009 13:58

Quote:

Originally Posted by roth (Post 220613)
Or you can just use your system compiler by making a switch in your $WM_PROJECT_DIR/etc/settings.sh:

I find using the system compiler is the path of least resistance.

Michael

The fact that system compiler is 4.3.2 instead of openfoam 4.3.1, can create problems? Xwang

Xwang June 27, 2009 04:00

I've set in etc/settings.sh:

Code:

WM_COMPILER_INST=System
but if I run the foamInstallationTest I obtain:

Code:

./foamInstallationTest:                               


Checking basic setup...
-------------------------------------------------------------------------------
Shell:              bash                                                     
Host:              pro5av                                                   
OS:                Linux version 2.6.27-14-generic                           
-------------------------------------------------------------------------------


Checking main OpenFOAM env variables...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory                Valid      Crit 
-------------------------------------------------------------------------------
$WM_PROJECT_INST_DIR /home/andreak/OpenFOAM                  yes      yes   
$WM_PROJECT_USER_DIR /home/andreak/OpenFOAM/andreak-1.5      yes      no   
$WM_THIRD_PARTY_DIR  /home/andreak/OpenFOAM/ThirdParty        yes      yes   
-------------------------------------------------------------------------------


Checking the OpenFOAM env variables set on the PATH...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory                Valid Path Crit 
-------------------------------------------------------------------------------
$WM_PROJECT_DIR      /home/andreak/OpenFOAM/OpenFOAM-1.5      yes  yes  yes   

$FOAM_APPBIN        ...1.5/applications/bin/linux64GccDPOpt  yes  yes  yes
$FOAM_USER_APPBIN    ...1.5/applications/bin/linux64GccDPOpt  yes  yes  no                                                                                                     
$WM_DIR              .../andreak/OpenFOAM/OpenFOAM-1.5/wmake  yes  yes  yes                                                                                                     
-------------------------------------------------------------------------------                                                                                                 


Checking the OpenFOAM env variables set on the LD_LIBRARY_PATH...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory                Valid Path Crit 
-------------------------------------------------------------------------------
$FOAM_LIBBIN        ...OAM/OpenFOAM-1.5/lib/linux64GccDPOpt  yes  yes  yes   
$FOAM_USER_LIBBIN    ...FOAM/andreak-1.5/lib/linux64GccDPOpt  yes  yes  no   
$MPI_ARCH_PATH      ...nmpi-1.2.6/platforms/linux64GccDPOpt  yes  yes  yes   
-------------------------------------------------------------------------------


Third party software
-------------------------------------------------------------------------------
Software Version  Location                                                   
-------------------------------------------------------------------------------
WARNING: gcc version does not match gcc supplied with this release of OpenFOAM
        Supplied version: 4.3.1                                             
        User version    : ../src/configure                                   
4.3.2
        Minimum required: 4.2.0

gcc      ...figure
WARNING:  Conflicting installations:
          OpenFOAM settings        : /bin/gcc
          current path            : /usr/bin/gcc
          CRITICAL ERROR

gzip    1.3.12    /bin/gzip
tar      1.20      /bin/tar
icoFoam  1.5      .../OpenFOAM-1.5/applications/bin/linux64GccDPOpt/icoFoam
-------------------------------------------------------------------------------


Checking networking...
-------------------------------------------------------------------------------
Action                  Result                                      Crit
-------------------------------------------------------------------------------
Pinging_pro5av          Successful                                  yes
Pinging_localHost        Successful                                  yes
Test_rsh:                Unsuccessful_connection_refused*            yes
Test_ssh:                Successful                                  yes
(*) Only one of rsh or ssh is required by the OpenFOAM enviroment.

-------------------------------------------------------------------------------

Base configuration ok.

The foam installation contains 1 critical error(s).

Review the output for warning messages and consult
the installation guide for trouble shooting.

done.

So it seems that I have to change the path of the gcc compiler in OpenFoam (which is wrong).
How can I change it?
Thank you,
Xwang

arudolf July 15, 2009 06:31

Solution
 
You have set the WM_COMPILER_DIR to /usr. You can try that it works by simply setting this variable in your shell and then run foamInstallationTest.

To have the correct setting in all shells, I have added the red lines in $WM_PROJECT_DIR/etc/$settings.sh:

....
WM_COMPILER_BIN=$WM_COMPILER_DIR/bin
WM_COMPILER_LIB=$WM_COMPILER_DIR/lib$WM_COMPILER_LIB_ARCH:$WM_COMPILER_DIR/lib
;;

System)
export WM_COMPILER_DIR=/usr
;;

esac
...


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