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

how to install OF 2.2.1 on Ubuntu 10.04

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Hao

Reply
 
LinkBack Thread Tools Display Modes
Old   September 10, 2013, 08:44
Cool how to install OF 2.2.1 on Ubuntu 10.04
  #1
Hao
New Member
 
Hao Wang
Join Date: Aug 2013
Posts: 14
Rep Power: 4
Hao is on a distinguished road
Hallo everyone!

Currently I am working with Ubuntu 10.04 and I want to install OpenFoam 2.2.1 on my pc. Is it possible because the latest OpenFoam release doesn't cover that version? Any detailed steps I can follow?

Thanks a lot!
Hao is offline   Reply With Quote

Old   September 10, 2013, 17:35
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Hao and welcome to the forum!

You can follow these instructions: http://openfoamwiki.net/index.php/In...u#Ubuntu_10.04 - but make sure to use "2.2.1" instead of "2.2.0", while you are following the instructions!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   September 16, 2013, 07:50
Unhappy error
  #3
Hao
New Member
 
Hao Wang
Join Date: Aug 2013
Posts: 14
Rep Power: 4
Hao is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings Hao and welcome to the forum!

You can follow these instructions: http://openfoamwiki.net/index.php/In...u#Ubuntu_10.04 - but make sure to use "2.2.1" instead of "2.2.0", while you are following the instructions!

Best regards,
Bruno
Thanks Bruno!

I did follow the instruction but some errors occured. First of all, in download command I used 2.2.1 instead of 2.2.0, but I still got version 2.2.0. Well, then 2.2.0, I got stuck at this step:
root@Nadine:~/OpenFOAM/OpenFOAM-2.2.0/etc# source $HOME/nadine/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI \
> foamCompiler=ThirdParty WM_COMPILER=Gcc45
bash: /home/nadine/nadine/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc: No such file or director

I also had a look at Installation Procedure of OF220 on Ubuntu 10.04LTS. I also modify the bashrc file, changing the line 62 with foamCompiler=ThirdParty, but this problem still remains.

The next step is:
Then go to the file

Code:
~/OpenFOAM/OpenFOAM-2.2.0/etc/config/settings.sh
and change the line 244 to

Code:
gcc_version=gcc-4.6.2
but in this file line 244 is 'setenv WM_CXX 'clang++'' . Could you give me some suggestions?
Hao is offline   Reply With Quote

Old   September 17, 2013, 05:00
Unhappy update from openfoam 2.1.0 to 2.2.1 on ubuntu 10.04
  #4
Hao
New Member
 
Hao Wang
Join Date: Aug 2013
Posts: 14
Rep Power: 4
Hao is on a distinguished road
Hi foamers,

I am working with ubuntu 10.04, Gcc 4.4.3. I already have a openfoam 2.1.1 installed. Now I want to install 2.2.0 instead, how can I do? I did follow the website http://openfoamwiki.net/index.php/In...M-2.2.0/Ubuntu, but after unpacking the OpenFoam and ThirdParty source, I found that the folder of OpenFoam-2.2.0 has a symbol of locker.

I stuck at this step: bash: ./home/nadine/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc: No such file or directory.

I don't know why and I am quite new to openfoam, not that familiar to linux. Someone has idea to solver this problem?
Hao is offline   Reply With Quote

Old   September 17, 2013, 08:35
Default
  #5
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 579
Blog Entries: 5
Rep Power: 13
elvis is on a distinguished road
Hi Hao,
you can have more than one OF-installation on your computer ->if your hard disk is big enought {hard not to be these days} ;-)

Anyway how is your "$HOME/.bashrc" looking?

You can work with the "alias"-command to choose which OF-version you gonna work with,
a good read might be
Multiple OpenFOAM versions on one machine
http://www.cfd-online.com/Forums/blo...vironment.html
elvis is offline   Reply With Quote

Old   September 17, 2013, 16:01
Default
  #6
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 295
Rep Power: 13
Lieven will become famous soon enough
Hi Hao,

Two things that immediately cross my mind:

1. Did you put a space between . and / cause this is required:
Code:
. /home/nadine/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc
2. Did you unpack the files while logged on as sudo or root? Could you post the output of
Code:
ls -l /home/nadine/OpenFOAM
Cheers,

Lieven
Lieven is offline   Reply With Quote

Old   September 17, 2013, 17:11
Default
  #7
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

@Hao: Sorry for the late reply, but these past days have been rather busy on my side.

OK, from your description, the problem is that you didn't do the last command from step #1 of the instructions: http://openfoamwiki.net/index.php/In...u#Ubuntu_10.04 - namely this command:
Code:
exit
The result was that you ended up performing all other commands as "root", which is the master administrator (super-user) account, leading to your normal user to not be able to access the OpenFOAM installation.

As for the downloaded files, the problem was that you didn't replace both version numbers that are in each command line. There are 2 occurrences of "2.2.0" on each line that starts with wget.


As for having more than one version of OpenFOAM installed, study Elvis' links.


Now, as for repairing the currently misplaced files, this is going to be a bit tricky, because I'll have to assume some details, so please pay close attention to the details I'm going to try to explain next:
  1. Open a new terminal window.
  2. Switch to "root" user by running:
    Code:
    sudo -s
  3. Go into the folder that I'm expecting is where you have the OpenFOAM files you downloaded and unpacked, by running this command:
    Code:
    cd ~/OpenFOAM
  4. Now, check what files and folders you have on this folder by running:
    Code:
    ls -l
    If I'm not mistaken, you should see the 2 downloaded tarballs and the respective folders.
  5. Now, check where exactly you are located in the filesystem, by running:
    Code:
    pwd
    You should see that you are located at:
    Code:
    /root/OpenFOAM
  6. Therefore, if my assumption is correct, and assuming you already have the base "OpenFOAM" folder in your own user folder, namely that the following path already exists:
    Code:
    /home/nadine/OpenFOAM
    If this is correct, then you can move the files you have on your root folder to your user folder, by running:
    Code:
    mv /root/OpenFOAM/* /home/nadine/OpenFOAM/
  7. Now, switch to the root's folder, by running:
    Code:
    cd
    and remove the (now empty) "OpenFOAM" folder:
    Code:
    rmdir OpenFOAM
  8. Now, you still have to fix the permissions in the files and folders you've moved from the root's own folder to your user folder. The fix should be successful if you run the following commands:
    Code:
    cd /home/nadine
    chown -R nadine:nadine OpenFOAM/
    The command chown changes the ownership of the files and folders, the "-R" says it's meant to be recursive (to also do the same on all sub-folders and files therein). The two names "nadine:nadine" refer to the user name and group the user belongs to. On Ubuntu, usually the group name is identical to the user name.
  9. Now, once the commands on step #8 are done, you can exit "root" mode by running:
    Code:
    exit
    To be certain that you are now in normal user mode, run:
    Code:
    whoami
    If it still says root, run the exit command once again.
  10. OK, now that you have things in the correct place, and since you now want to install OpenFOAM 2.2.0, then you can safely continue to follow the instructions - http://openfoamwiki.net/index.php/In...u#Ubuntu_10.04 - from the step #3.
Best regards,
Bruno

PS: I've merged the two threads, because they referred to the same topic.
wyldckat is offline   Reply With Quote

Old   September 18, 2013, 05:36
Lightbulb
  #8
Hao
New Member
 
Hao Wang
Join Date: Aug 2013
Posts: 14
Rep Power: 4
Hao is on a distinguished road
Quote:
Anyway how is your "$HOME/.bashrc" looking?
Hi thanks,

My $HOME/.bashrc is as followed:

Code:
 # ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

# source /opt/openfoam201/etc/bashrc
# source /opt/openfoam210/etc/bashrc
#. /opt/openfoam210/etc/bashrc

# source /opt/openfoam210/etc/bashrc
alias of210='. /opt/openfoam210/etc/bashrc'
# source /opt/openfoam221/etc/bashrc
alias of221='. /opt/OpenFOAM-2.2.1/etc/bashrc'

Last edited by wyldckat; September 19, 2013 at 18:57. Reason: Added [CODE][/CODE]
Hao is offline   Reply With Quote

Old   September 19, 2013, 04:24
Default
  #9
Hao
New Member
 
Hao Wang
Join Date: Aug 2013
Posts: 14
Rep Power: 4
Hao is on a distinguished road
Thanks Bruno,

many thanks for your help, but I got stuck again. I did forget to exit from root before. When I follow your instruction to correct this error, something strange occured at step 5 that my location was /home/nadine/OpenFOAM.

So I just shut the terminal and open it again, follow the instruction on http://openfoamwiki.net/index.php/In...u#Ubuntu_10.04.

This time I went further but get stuck at step 7. I run ./Allwmake > make.log 2>&1

second time but got some errors and no openfoam command (icoFoam) can be found. Now I can't use any version of OF now. How can I fix it?

Attached is the file make.log.

Cheers,
Hao


Attached Files
File Type: gz make.log.tar.gz (18.9 KB, 1 views)
Hao is offline   Reply With Quote

Old   September 19, 2013, 08:31
Default
  #10
Hao
New Member
 
Hao Wang
Join Date: Aug 2013
Posts: 14
Rep Power: 4
Hao is on a distinguished road
Hi Elvis,

sorry for the late reply! I tried Bruno's solution and went further but still suffered some problems. I misunderstood the directory and made some mistakes before. Now I have an other problem. When I run ' ./Allwmake > make.log 2>&1', permission denied. Then I tried 'sudo ./Allwmake' and it gave me:
Code:
./Allwmake: 9: wmakeCheckPwd: 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.
But I have navigated in to $WM_PROJECT_DIR. I don't know why.

Looking forward to your reply.

Cheers,
Hao

Last edited by wyldckat; September 19, 2013 at 18:58. Reason: Added [CODE][/CODE]
Hao is offline   Reply With Quote

Old   September 19, 2013, 19:04
Default
  #11
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Hao,

OK, the problem is that something very wrong happened when you followed the instructions in the steps #3, #4 and #5. Because the error you are getting is due to you trying to build OpenFOAM 2.2.1 with Gcc 4.4 that your Ubuntu has got, which is incompatible with OpenFOAM 2.2 .

My advice is to:
  1. Edit your personal file "~/.bashrc".
  2. Remove the lines referring to OpenFOAM 2.2 you have near the end of the file.
  3. Add this new one:
    Code:
    alias of221='source $HOME/OpenFOAM/OpenFOAM-2.2.1/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI foamCompiler=ThirdParty WM_COMPILER=Gcc45'
  4. Start a new terminal and run:
    Code:
    of221
  5. Now continue following the instructions from the step #4.
Good luck!
Bruno
wyldckat is offline   Reply With Quote

Old   September 20, 2013, 04:32
Default
  #12
Hao
New Member
 
Hao Wang
Join Date: Aug 2013
Posts: 14
Rep Power: 4
Hao is on a distinguished road
Hi Bruno,

I check my gcc version and now is already 4.5.2. The final lines of my ~/.bashrc file are:

# source /opt/openfoam210/etc/bashrc
alias of210='. /opt/openfoam210/etc/bashrc'
# source /opt/openfoam221/etc/bashrc
alias of221='source $HOME/OpenFOAM/OpenFOAM-2.2.1/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI foamCompiler=ThirdParty WM_COMPILER=Gcc45'

source /home/nadine/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI foamCompiler=ThirdParty WM_COMPILER=Gcc45 WM_ARCH_OPTION=32
source /home/nadine/OpenFOAM/OpenFOAM-2.2.1/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI foamCompiler=ThirdParty WM_COMPILER=Gcc45 WM_ARCH_OPTION=32
source /home/nadine/OpenFOAM/OpenFOAM-2.2.1/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI foamCompiler=ThirdParty WM_COMPILER=Gcc45 WM_ARCH_OPTION=32

Then I started a new terminal and run of221.

cd $WM_THIRD_PARTY_DIR

In this directory, both getBinutils and makeBinutils exist, but:

nadine@Nadine:~/OpenFOAM/ThirdParty-2.2.1$ chmod +x get* make*
chmod: changing permissions of `getBinutils': Operation not permitted
chmod: changing permissions of `getGcc': Operation not permitted
chmod: changing permissions of `makeBinutils': Operation not permitted
chmod: changing permissions of `makeCGAL': Operation not permitted
chmod: changing permissions of `makeCmake': Operation not permitted
chmod: changing permissions of `makeFastdualoctree_sgp': Operation not permitted
chmod: changing permissions of `makeGcc': Operation not permitted
chmod: changing permissions of `makeGcc46': Operation not permitted
chmod: changing permissions of `makeGcc47': Operation not permitted
chmod: changing permissions of `makeGperftools': Operation not permitted
chmod: changing permissions of `makeLLVM': Operation not permitted
chmod: changing permissions of `makeParaView': Operation not permitted
chmod: changing permissions of `makeQt': Operation not permitted

I was wondering why. Additionally, I have a OF 2.1.0 installed as root in opt/~, does it matter?


Cheers,
Hao
Hao is offline   Reply With Quote

Old   September 21, 2013, 06:00
Wink Problem solved
  #13
Hao
New Member
 
Hao Wang
Join Date: Aug 2013
Posts: 14
Rep Power: 4
Hao is on a distinguished road
Dear all,

thanks for your help!!!

I solved the problem a few minutes ago. Actually it is very easy, the instruction is correct. Just because I download two packages as a administrator but tried to install them as an user. Delete everything I created and downloaded and start from the very beginning, that's all!
wyldckat likes this.
Hao is offline   Reply With Quote

Reply

Tags
openfoam 2.2.1 10.04

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM-1.5 on Ubuntu 10.04 kurne OpenFOAM Installation 24 March 12, 2015 17:03
Can we install OpenFOAM v2.0.x in Ubuntu 10.04 LTS? hahajiushixing OpenFOAM 2 January 10, 2012 21:37
Ansys fluent 13.0 on ubuntu 10.04 mundhwam FLUENT 2 September 1, 2011 10:14
OpenFOAM 1.7 Ubuntu 10.04 stark22 OpenFOAM Installation 2 July 24, 2011 11:22
How to Install OpenFOAM on 64 Ubuntu 9.04 hansel OpenFOAM Installation 62 March 19, 2010 15:43


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