CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Install OpenFOAM-2.1.1 on Fedora 17 (http://www.cfd-online.com/Forums/openfoam-installation/105792-install-openfoam-2-1-1-fedora-17-a.html)

dark lancer August 9, 2012 04:49

Install OpenFOAM-2.1.1 on Fedora 17
 
hi
I have a fedora 17 and try to install open foam-2.1.1 but I dont understan this sentences and stop in this step
Building the Sources

Go to the top-level source directory $WM_PROJECT_DIR and execute the top-level build script ./Allwmake. In principle this will build everything, but if problems occur with the build order it may be necessary to update the environment variables and re-execute ./Allwmake.



I am do this but I am not sure is correct becuse have a error



[hadi@hadi ~]$ cd $HOME/OpenFOAM/OpenFOAM-2.1.1
[hadi@hadi OpenFOAM-2.1.1]$ ./Allwmake
./Allwmake: line 4: wmakeCheckPwd: command not found
Error: Current directory is not $WM_PROJECT_DIR
The environment variables are inconsistent with the installation.
Check the OpenFOAM entries in your dot-files and source them.

wyldckat August 9, 2012 06:21

Greetings Hadi and welcome to the forum!

That message is indicating that you should first run this command:
Code:

source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc
This line should also have been added to the file "$HOME/.bashrc".

Best regards,
Bruno

dark lancer August 9, 2012 08:29

thanks
I've done it and after it I got to this sentence
I am acting in accordance with site instructions
http://www.openfoam.org/download/source.php

wyldckat August 9, 2012 10:04

Quote:

Originally Posted by dark lancer (Post 376201)
thanks
I've done it and after it I got to this sentence
I am acting in accordance with site instructions
http://www.openfoam.org/download/source.php

:confused: So, do you mean you've managed to get it working? Or is it still not working!?

If it's not working, do you have any other OpenFOAM installations in your machine?

dark lancer August 9, 2012 10:36

I have no other OpenFOAM installations in my notebook
I do this order:
1-mkdir $HOME/OpenFOAM
copy the OpenFOAM-2.1.1.tgz and ThirdParty-2.1.1.tgz to directory
2-cd $HOME/OpenFOAM
3-tar xzf OpenFOAM-2.1.1.tgz
4-tar xzf ThirdParty-2.1.1.tgz
5-sudo yum groupinstall 'Development Tools
6-sudo yum install openmpi openmpi-devel qt-devel qt-webkit-devel zlib-devel
copy the
source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc
in to end line of the bashrc file
8-source $HOME/.bashrc
and copy these to terminal
9-export FOAM_INST_DIR=/data/app/OpenFOAM

10-foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.1.1/etc/bashrc
11-[ -f $foamDotFile ] && . $foamDotFile
and then check gcc and flex version
and now i dont know what to do?

for example:
when i do 9,10,11 have no error and I think is correct
[hadi@hadi OpenFOAM]$ export FOAM_INST_DIR=/data/app/OpenFOAM
[hadi@hadi OpenFOAM]$ foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.1.1/etc/bashrc
[hadi@hadi OpenFOAM]$ [ -f $foamDotFile ] && . $foamDotFile

wyldckat August 9, 2012 10:44

Quote:

Originally Posted by dark lancer (Post 376246)
when i do 9,1.,11 have no error and I think is correct
[hadi@hadi OpenFOAM]$ export FOAM_INST_DIR=/data/app/OpenFOAM
[hadi@hadi OpenFOAM]$ foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.1.1/etc/bashrc
[hadi@hadi OpenFOAM]$ [ -f $foamDotFile ] && . $foamDotFile

Uhm... those steps are just an example if you want to install OpenFOAM in a different folder. You don't need them if you're installing in "$HOME/OpenFOAM".

dark lancer August 9, 2012 11:43

ok
now What should I do after 8 ?
I did not ever work with Linux and I did not install the open foam.

[QUOTE=dark lancer;376246
I do this order:
1-mkdir $HOME/OpenFOAM
copy the [URL="http://downloads.sourceforge.net/foam/OpenFOAM-2.1.1.tgz?use_mirror=mesh"] OpenFOAM-2.1.1.tgz[/URL] and ThirdParty-2.1.1.tgz to directory
2-cd $HOME/OpenFOAM
3-tar xzf OpenFOAM-2.1.1.tgz
4-tar xzf ThirdParty-2.1.1.tgz
5-sudo yum groupinstall 'Development Tools
6-sudo yum install openmpi openmpi-devel qt-devel qt-webkit-devel zlib-devel
copy the
source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc
in to end line of the bashrc file
8-source $HOME/.bashrc]

wyldckat August 9, 2012 11:52

Code:

cd $WM_PROJECT_DIR
export WM_NCOMPPROCS=4
./Allwmake > make.log 2>&1

You can replace the 4 for the number of cores your machine has.
This is what is explained in the sections "Building the Sources" and "wmakeScheduler for faster compilation", although this last one is the generic version of second line I've shown in the code above.

dark lancer August 10, 2012 04:41

when run these order ,no happen

[hadi@hadi ~]$ cd $WM_PROJECT_DIR
When I run the command I would need to enter the desired directory but no happen?
[hadi@hadi ~]$ export WM_NCOMPPROCS=7
[hadi@hadi ~]$ ./Allwmake > make.log 2>&1
[hadi@hadi ~]$

just in my HOME create a make.log file that inside:
bash: ./Allwmake: No such file or directory

wyldckat August 10, 2012 05:48

OK, start a new terminal and run:
Code:

source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc
cd $WM_PROJECT_DIR
pwd
echo $HOME/OpenFOAM/OpenFOAM-2.1.1

The output of the last two lines should look identical. If they do not look identical, then something strange is going on...

But if they are identical, then continue by running:
Code:

export WM_NCOMPPROCS=7
./Allwmake > make.log 2>&1


dark lancer August 10, 2012 06:43

when run first line:
[hadi@hadi OpenFOAM]$ source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc
bash: end-of-file: command not found...
a question؟؟
I must copy the''source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc'' before or after the ''end-of-file'' into the bashrc file?
I copy after the''end-of-file''

wyldckat August 10, 2012 08:58

Hi Hadi,

Sorry I took so long to answer, but I didn't have sooner the computer resources for testing a Fedora 17 installation.

The idea is add the line:
Code:

source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc
To the end of the file "~/.bashrc", also known as "$HOME/.bashrc".

The original "~/.bashrc" on your Fedora installation should look something like this:
Code:

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions

After adding the line, it should look like this:
Code:

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions
source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc

If you've made any changes to "$HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc", then please undo those changes.

After this, start a new terminal, so we can be certain it's s clean environment. Then run the commands I indicated in the previous post.

Best regards,
Bruno

dark lancer August 10, 2012 09:54

I really thank you for the time I leave.



I'm a little confused.
this is my bashrc file
I have not found what you were told.
Quote:

#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/bashrc
#
# Description
# Startup file for OpenFOAM
# Sourced from ~/.profile or ~/.bashrc
# Should be usable by any POSIX-compliant shell (eg, ksh)
#
#------------------------------------------------------------------------------

export WM_PROJECT=OpenFOAM
export WM_PROJECT_VERSION=2.1.1

################################################## ##############################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
#
# either set $FOAM_INST_DIR before sourcing this file or set
# 'foamInstall' below to where OpenFOAM is installed
#
# Location of the OpenFOAM installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamInstall=$HOME/$WM_PROJECT
# foamInstall=~$WM_PROJECT
# foamInstall=/opt/$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
#
# END OF (NORMAL) USER EDITABLE PART
################################################## ##############################

#
# These are the defaults for this version which should generally be
# overridden from the prefs.sh file or from command-line specification
#
#- note the location for later use (eg, in job scripts)
: ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR

#- Compiler location:
# foamCompiler= system | ThirdParty (OpenFOAM)
foamCompiler=system

#- Compiler:
# WM_COMPILER = Gcc | Gcc43 | Gcc44 | Gcc45 | Gcc46 | Clang | Icc (Intel icc)
export WM_COMPILER=Gcc
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH

#- Architecture:
# WM_ARCH_OPTION = 32 | 64
export WM_ARCH_OPTION=64

#- Precision:
# WM_PRECISION_OPTION = DP | SP
export WM_PRECISION_OPTION=DP

#- Optimised, debug, profiling:
# WM_COMPILE_OPTION = Opt | Debug | Prof
export WM_COMPILE_OPTION=Opt

#- MPI implementation:
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI
# | GAMMA | MPI | QSMPI
export WM_MPLIB=OPENMPI

#- Operating System:
# WM_OSTYPE = POSIX | ???
export WM_OSTYPE=POSIX

#- Floating-point signal handling:
# set or unset
export FOAM_SIGFPE=

#- memory initialisation:
# set or unset
#export FOAM_SETNAN=


################################################## ##############################

# The old dirs to be cleaned from the various environment variables
# - remove anything under top-level directory.
# NB: the WM_PROJECT_INST_DIR might not be identical between versions
foamOldDirs="$FOAM_INST_DIR $WM_PROJECT_SITE $HOME/$WM_PROJECT/$USER"
if [ "$WM_PROJECT_INST_DIR" != "$FOAM_INST_DIR" ]
then
foamOldDirs="$WM_PROJECT_INST_DIR $foamOldDirs"
fi


# Location of installation
# ~~~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION

# Location of third-party software
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION

# Location of site-specific templates etc
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# unset is equivalent to $WM_PROJECT_INST_DIR/site
if [ -d "$WM_PROJECT_SITE" ]
then
export WM_PROJECT_SITE
else
unset WM_PROJECT_SITE
fi

# Location of user files
# ~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION


# Source files, possibly with some verbosity
_foamSource()
{
while [ $# -ge 1 ]
do
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1"
. $1
shift
done
}

# Evaluate command-line parameters
_foamEval()
{
while [ $# -gt 0 ]
do
case "$1" in
-*)
# stray option (not meant for us here) -> get out
break
;;
*=)
# name= -> unset name
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "unset ${1%=}"
eval "unset ${1%=}"
;;
*=*)
# name=value -> export name=value
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "export $1"
eval "export $1"
;;
*)
# filename: source it
if [ -f "$1" ]
then
_foamSource "$1"
else
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
fi
;;
esac
shift
done
}


# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`

# Evaluate command-line parameters and record settings for later
# these can be used to set/unset values, or specify alternative pref files
export FOAM_SETTINGS="$@"
_foamEval $@

# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath

#- Clean PATH
cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"

#- Clean LD_LIBRARY_PATH
cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` \
&& LD_LIBRARY_PATH="$cleaned"

#- Clean MANPATH
cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"

export PATH LD_LIBRARY_PATH MANPATH


# Source project setup files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource $WM_PROJECT_DIR/etc/config/settings.sh
_foamSource $WM_PROJECT_DIR/etc/config/aliases.sh


# Source user setup files for optional packages
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.sh`


# Clean environment paths again. Only remove duplicates
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~
#- Clean PATH
cleaned=`$foamClean "$PATH"` && PATH="$cleaned"

#- Clean LD_LIBRARY_PATH
cleaned=`$foamClean "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleaned"

#- Clean MANPATH (trailing ':' to find system pages)
cleaned=`$foamClean "$MANPATH"`: && MANPATH="$cleaned"

export PATH LD_LIBRARY_PATH MANPATH

#- Clean LD_PRELOAD
if [ -n "$LD_PRELOAD" ]
then
cleaned=`$foamClean "$LD_PRELOAD"` && LD_PRELOAD="$cleaned"
export LD_PRELOAD
fi


# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset cleaned foamClean foamInstall foamOldDirs
unset _foamSource _foamEval

# -----------------------------------------------------------------
end-of-file

wyldckat August 10, 2012 09:58

OK, no problem.

Have you managed to edit the file "~/.bashrc" with success?

And what happened after running these lines:
Code:

cd $WM_PROJECT_DIR
pwd
echo $HOME/OpenFOAM/OpenFOAM-2.1.1


dark lancer August 10, 2012 10:29

I do not edit my bashrc file because i do not understand where add the
Quote:

source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc
I have a idea:
I remove the openfoam and thirdparty then you say to me what to do and Events that occur for every order I place it here.
I appreciate you for this.
Quote:

[hadi@hadi ~]$ cd $WM_PROJECT_DIR
[hadi@hadi ~]$ pwd
/home/hadi
[hadi@hadi ~]$ echo $HOME/OpenFOAM/OpenFOAM-2.1.1
/home/hadi/OpenFOAM/OpenFOAM-2.1.1
[hadi@hadi ~]$

wyldckat August 10, 2012 12:01

Hi Hadi,

Sorry, it'll take me a while to write up step-by-step instructions... I've been planning on doing this, but it takes time to write a full step-by-step guide.

So instead, I'll write a copy-paste guide for Fedora x86_64 (and i386), based on the official instructions at http://www.openfoam.org/download/source.php
A few notes before you start copy-pasting:
  1. Lines that start with # don't have to be copy-pasted. They are just comments to let you know what's going on.
  2. One wrong character is enough for breaking this guide, so make sure you can read the characters properly or that the installed language system does not break the copied characters!
Quick copy-paste guide for Fedora x86_64:
Code:

#package installation
sudo yum groupinstall 'Development Tools'
sudo yum install openmpi openmpi-devel qt-devel qt-webkit-devel zlib-devel cmake

#OpenFOAM downloading and installation
cd ~
mkdir OpenFOAM
cd OpenFOAM
wget "http://downloads.sourceforge.net/foam/OpenFOAM-2.1.1.tgz?use_mirror=mesh" -O OpenFOAM-2.1.1.tgz
wget "http://downloads.sourceforge.net/foam/ThirdParty-2.1.1.tgz?use_mirror=mesh" -O ThirdParty-2.1.1.tgz

tar xzf OpenFOAM-2.1.1.tgz
tar xzf ThirdParty-2.1.1.tgz

#forcefully load Open-MPI into the environment
module load openmpi-x86_64     

#here you can change 4 to the number of cores you've got
source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI

echo "module load openmpi-x86_64" >> $HOME/.bashrc
echo "source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc $FOAM_SETTINGS" >> $HOME/.bashrc

#forgot that we need to go into OpenFOAM's main folder as well
cd OpenFOAM-2.1.1

# This next command will take a while... somewhere between 30 minutes to 3-6 hours.
./Allwmake > make.log 2>&1

#Run it a second time for getting a summary of the installation
./Allwmake > make.log 2>&1

#Edit the file "make.log" and check if there are any error messages

#Create a tarball in case you've seen any errors and attach the file "make.log.tar.gz" to your next post.
tar -czf make.log.tar.gz make.log

Quick copy-paste guide for Fedora i386:
Code:

#package installation
sudo yum groupinstall 'Development Tools'
sudo yum install openmpi openmpi-devel qt-devel qt-webkit-devel zlib-devel cmake

#OpenFOAM downloading and installation
cd ~
mkdir OpenFOAM
cd OpenFOAM
wget "http://downloads.sourceforge.net/foam/OpenFOAM-2.1.1.tgz?use_mirror=mesh" -O OpenFOAM-2.1.1.tgz
wget "http://downloads.sourceforge.net/foam/ThirdParty-2.1.1.tgz?use_mirror=mesh" -O ThirdParty-2.1.1.tgz

tar xzf OpenFOAM-2.1.1.tgz
tar xzf ThirdParty-2.1.1.tgz

#forcefully load Open-MPI into the environment
module load openmpi-i386

#here you can change 4 to the number of cores you've got
source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI WM_ARCH_OPTION=32

echo "module load openmpi-i386" >> $HOME/.bashrc
echo "source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc $FOAM_SETTINGS" >> $HOME/.bashrc

#forgot that we need to go into OpenFOAM's main folder as well
cd OpenFOAM-2.1.1

# This next command will take a while... somewhere between 30 minutes to 3-6 hours.
./Allwmake > make.log 2>&1

#Run it a second time for getting a summary of the installation
./Allwmake > make.log 2>&1

#Edit the file "make.log" and check if there are any error messages

#Create a tarball in case you've seen any errors and attach the file "make.log.tar.gz" to your next post.
tar -czf make.log.tar.gz make.log

Best regards,
Bruno

dark lancer August 10, 2012 17:25

this is results:
I copy the files of openfoam and thirdparty after ''cd openfoam'' because Idownload it and then unpack
Quote:

[hadi@hadi ~]$ sudo yum groupinstall 'Development Tools'
[sudo] password for hadi:
hadi is not in the sudoers file. This incident will be reported.
[hadi@hadi ~]$ su
Password:
[root@hadi hadi]# yum groupinstall 'Development Tools' Loaded plugins: langpacks, presto, refresh-packagekit
Warning: Group development-tools does not have any packages.
No packages in any requested group available to install or update
[root@hadi hadi]# yum install openmpi openmpi-devel qt-devel qt-webkit-devel zlib-devel
Loaded plugins: langpacks, presto, refresh-packagekit
Package openmpi-1.5.4-5.fc17.1.i686 already installed and latest version
Package openmpi-devel-1.5.4-5.fc17.1.i686 already installed and latest version
Package 1:qt-devel-4.8.2-4.fc17.i686 already installed and latest version
Package qtwebkit-devel-2.2.2-1.fc17.i686 already installed and latest version
Package zlib-devel-1.2.5-6.fc17.i686 already installed and latest version
Nothing to do
[root@hadi hadi]# exit root
exit
bash: exit: root: numeric argument required
[hadi@hadi ~]$ cd ~
[hadi@hadi ~]$ mkdir OpenFOAM
[hadi@hadi ~]$ cd OpenFOAM
[hadi@hadi OpenFOAM]$ tar xzf OpenFOAM-2.1.1.tgz
[hadi@hadi OpenFOAM]$ tar xzf ThirdParty-2.1.1.tgz
[hadi@hadi OpenFOAM]$ source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc WM_NCOMPPROCS=7 WM_MPLIB=SYSTEMOPENMPI
bash: mpicc: command not found...
bash: mpicc: command not found...
[hadi@hadi OpenFOAM]$

wyldckat August 10, 2012 18:53

Hi Hadi,

Please review the instructions. I had forgotten about the "module load" feature that Fedora uses... and is requires before the last command you used.

Best regards,
Bruno

dark lancer August 11, 2012 04:08

hi Bruno
my fedora is 32bit and just run this order
Quote:

#for 32bit use: module load openmpi-i386
not neccessary to replace ''x86_64'' by ''i386'' and run this orders:
Quote:

#for 64bit use: echo "module load openmpi-x86_64" >> $HOME/.bashrc
echo "source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc $FOAM_SETTINGS" >> $HOME/.bashrc

wyldckat August 11, 2012 06:02

.... I've updated the post and made the instructions for 64 and 32bit more explicit...


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