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] Problems installing OpenFOAM 2.3.0 on Ubuntu 12.04 (https://www.cfd-online.com/Forums/openfoam-installation/158244-problems-installing-openfoam-2-3-0-ubuntu-12-04-a.html)

arieljeds August 19, 2015 06:56

Problems installing OpenFOAM 2.3.0 on Ubuntu 12.04
 
Hi everyone,

So I have found other people asking this but I have yet to find an answer I understand...

Ok this is very frustrating.. I am trying to reinstall OpenFOAM with a different version than what I had before (I had 2.3.1 before and am now trying to install 2.3.0).. As far as I can tell, I had removed all of the previous version of OpenFOAM before trying to do this. I am following the instructions here:

http://openfoamwiki.net/index.php/In...u#Ubuntu_12.04

When I get to this line:
Code:

source $HOME/OpenFOAM/OpenFOAM-2.3.0/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI
I get the following output:
Code:

bash: /opt/OpenFOAM-2.3.0/bin/foamEtcFile: No such file or directory
bash: /opt/OpenFOAM-2.3.0/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-2.3.0/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-2.3.0/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-2.3.0/etc/config/settings.sh: No such file or directory
bash: /opt/OpenFOAM-2.3.0/etc/config/aliases.sh: No such file or directory
bash: /opt/OpenFOAM-2.3.0/bin/foamEtcFile: No such file or directory
bash: /opt/OpenFOAM-2.3.0/bin/foamEtcFile: No such file or directory
bash: /opt/OpenFOAM-2.3.0/bin/foamEtcFile: No such file or directory
bash: /opt/OpenFOAM-2.3.0/bin/foamEtcFile: No such file or directory
bash: /opt/OpenFOAM-2.3.0/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-2.3.0/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-2.3.0/bin/foamCleanPath: No such file or directory

I am installing OpenFOAM into the directory /home/ariel/OpenFOAM (it is showing up here and nowhere else)... I am so so confused why it is trying to find it in [CODE]/opt/[CODE]. I checked the bashrc file (OpenFOAM/OpenFOAM-2.3.0/etc/bashrc) and it looks like this:


Code:

# 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


I am getting desperate at this stage, I have no idea what the problem is. I did this before with version 2.3.1 following the same instructions for that version and it worked perfectly. Please help! I am so confused!

Thank you and I really really really appreciate any advice on this

wyldckat August 19, 2015 07:22

Greetings Ariel,

The problem is that you still have a working OpenFOAM shell environment from the previous installation.
This wiki page details a lot on this topic: http://openfoamwiki.net/index.php/In...with_the_Shell - this page is mentioned at the top of the page of those instructions you've indicated.

Nonetheless, the steps you're probably missing are:
  1. Edit the file "~/.bashrc".
  2. Near the end of that file, there should be some lines that refer to the installation you had in "/opt". Delete those lines.
  3. Save and close the file (in the editor).
  4. Start a new terminal window or tab.
  5. Now you can activate the shell environment for the installation you're trying to perform. I.e, do again step #6 from those instructions, namely http://openfoamwiki.net/index.php/In...u#Ubuntu_12.04
Best regards,
Bruno

arieljeds August 19, 2015 07:27

Hi Bruno,

Thanks a lot for getting back to me. This was what I suspected as well at the beginning of my problems but I removed all reference to OpenFOAM from the ~/.bashrc file, saved, closed it, and did a sudo apt-get update as well but same problem.

I was assuming that I had another version of OpenFOAM hiding somewhere but I can't find it and dont' seem to have another one anywhere.

Also, perhaps this is related but every time I open a new terminal now, the first line is:

Code:

of230: command not found
I am so confused about this because I can't see any reference at all to /opt/ or OpenFOAM even so I don't know how to find the rogue version...

If you have any more advice on this, I'd be really appreciative.

Thanks again for the message

Ariel

wyldckat August 19, 2015 07:30

Hi Ariel,

Please post the content of your file "~/.bashrc", so that I can see what you have inside that file.

Best regards,
Bruno

arieljeds August 19, 2015 07:31

Hi Bruno,

No problem. The ~/.bashrc file is:

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 or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# 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

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# 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'
of230
    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'

# Add an "alert" alias for long running commands.  Use like so:
#  sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# 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

Best,
Ariel

arieljeds August 19, 2015 07:33

Ooops, I just found the of230 problem! There's one floating in there... hopefully this fixes everything else too!

arieljeds August 19, 2015 07:39

Just to confirm: after many hours of searching and frustrating, this did seem to be the problem...

Thanks for pointing me to the right file, just had to search harder


All times are GMT -4. The time now is 00:50.