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

Something wrong with Allwmake

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 4, 2017, 16:35
Default Something wrong with Allwmake
  #1
New Member
 
Join Date: Jan 2017
Posts: 5
Rep Power: 2
pmjzhai is on a distinguished road
hi all,

Would you please help me correct the openfoam installation. I input ./Allwmake in the command line, but received an error shown below.

Code:
 ./Allwmake:7:.:Can't open /wmake/scripts/AllwmakeParseArguments
Attached are Allwmake file in OpenFOAM-3.0.x folder and bashrc file in home folder.

1
Code:
#!/bin/sh
cd ${0%/*} || exit 1    # Run from this directory

# Parse arguments for library compilation without documentation by default
genDoc=0
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments

wmakeCheckPwd "$WM_PROJECT_DIR" || {
    echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR"
    echo "    The environment variables are inconsistent with the installation."
    echo "    Check the OpenFOAM entries in your dot-files and source them."
    exit 1
}

[ -n "$FOAM_EXT_LIBBIN" ] || {
    echo "Allwmake error: FOAM_EXT_LIBBIN not set"
    echo "    Check the OpenFOAM entries in your dot-files and source them."
    exit 1
}

# Compile wmake support applications
(cd wmake/src && make)

# Compile ThirdParty libraries and applications
if [ -d "$WM_THIRD_PARTY_DIR" ]
then
    $WM_THIRD_PARTY_DIR/Allwmake
else
    echo "Allwmake: no ThirdParty directory found - skipping"
fi

# Compile OpenFOAM libraries and applications
src/Allwmake $targetType $*

# Compile OpenFOAM libraries and applications
applications/Allwmake $targetType $*

# Optionally build OpenFOAM Doxygen documentation
if [ $genDoc -eq 1 ]
then
    doc/Allwmake
fi


# ----------------------------------------------------------------- end-of-file
2
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
alias of230='source $HOME/OpenFOAM/OpenFOAM-3.0.x/etc/bashrc'
Thanks so much.

Last edited by wyldckat; January 7, 2017 at 13:17. Reason: pmjzhai: explanation | moderator: added [CODE] markers
pmjzhai is offline   Reply With Quote

Old   January 5, 2017, 05:39
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,618
Rep Power: 27
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

In fact something wrong is with environment, not with Allwmake. Line 7 is

Code:
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
Since your environment is not set up, $WM_PROJECT_DIR is expanded into empty string. So do `source etc/bashrc` before running Allwmake.

I do not know why there is a check like this

Code:
wmakeCheckPwd "$WM_PROJECT_DIR" || {
echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
and there is no check for $WM_PROJECT_DIR not being empty.
alexeym is offline   Reply With Quote

Old   January 5, 2017, 05:58
Default
  #3
New Member
 
Join Date: Jan 2017
Posts: 5
Rep Power: 2
pmjzhai is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

In fact something wrong is with environment, not with Allwmake. Line 7 is

Code:
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
Since your environment is not set up, $WM_PROJECT_DIR is expanded into empty string. So do `source etc/bashrc` before running Allwmake.

I do not know why there is a check like this

Code:
wmakeCheckPwd "$WM_PROJECT_DIR" || {
echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
and there is no check for $WM_PROJECT_DIR not being empty.
Hi Alexey,

Thanks for your reply.

Firstly, I input 'source etc/bashrc' in the shell, but not got the error below.

-bash: /root/OpenFOAM/OpenFOAM-3.0.x/bin/foamEtcFile: No such file or directory
-bash: /root/OpenFOAM/OpenFOAM-3.0.x/bin/foamCleanPath: No such file or directory
-bash: /root/OpenFOAM/OpenFOAM-3.0.x/bin/foamCleanPath: No such file or directory
-bash: /root/OpenFOAM/OpenFOAM-3.0.x/bin/foamCleanPath: No such file or directory
-bash: /root/OpenFOAM/OpenFOAM-3.0.x/etc/config/settings.sh: No such file or directory
-bash: /root/OpenFOAM/OpenFOAM-3.0.x/etc/config/aliases.sh: No such file or directory
-bash: /root/OpenFOAM/OpenFOAM-3.0.x/bin/foamEtcFile: No such file or directory
-bash: /root/OpenFOAM/OpenFOAM-3.0.x/bin/foamEtcFile: No such file or directory
-bash: /root/OpenFOAM/OpenFOAM-3.0.x/bin/foamEtcFile: No such file or directory
-bash: /root/OpenFOAM/OpenFOAM-3.0.x/bin/foamCleanPath: No such file or directory
-bash: /root/OpenFOAM/OpenFOAM-3.0.x/bin/foamCleanPath: No such file or directory
-bash: /root/OpenFOAM/OpenFOAM-3.0.x/bin/foamCleanPath: No such file or directory

Would you please tell me what's wrong with it?

Secondly, I dont know the check either since I downloaded from github directly.

Many thanks for your reply.
pmjzhai is offline   Reply With Quote

Old   January 5, 2017, 06:04
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,618
Rep Power: 27
alexeym will become famous soon enoughalexeym will become famous soon enough
Well, second part of the answer was of rant type. I think 50% of questions here raise due to environment not being correctly set up and I do not know why foundation still did not implement environment setup checks in their Allwmake/Allrun scripts.

Could you describe how do you install OpenFOAM? It seems that you have downloaded it under non-privileged user and now are trying to compile it using root account.
alexeym is offline   Reply With Quote

Old   January 5, 2017, 06:12
Default
  #5
New Member
 
Join Date: Jan 2017
Posts: 5
Rep Power: 2
pmjzhai is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Well, second part of the answer was of rant type. I think 50% of questions here raise due to environment not being correctly set up and I do not know why foundation still did not implement environment setup checks in their Allwmake/Allrun scripts.

Could you describe how do you install OpenFOAM? It seems that you have downloaded it under non-privileged user and now are trying to compile it using root account.
Hi Alexey,

I installed a ubuntu virtual machine firstly. Then I git clone https:.... to download the two firectories 'OpenFOAM-3.0.x' and 'ThirdParty-3.0.x'. Now the problem occurs after I change directory to OpenFOAM-3.0.x and input ./Allwmake in the shell.

I download it using root with inputing sudo -i and password before downloading.
pmjzhai is offline   Reply With Quote

Old   January 5, 2017, 06:18
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,618
Rep Power: 27
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

1. Where did you clone sources? They do not seem to be in /root/OpenFOAM/OpenFOAM-3.0.x.
2. Why do you need root for installation? It is your virtual machine, so I guess, only you will use the installation.
alexeym is offline   Reply With Quote

Old   January 5, 2017, 06:21
Default
  #7
New Member
 
Join Date: Jan 2017
Posts: 5
Rep Power: 2
pmjzhai is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

1. Where did you clone sources? They do not seem to be in /root/OpenFOAM/OpenFOAM-3.0.x.
2. Why do you need root for installation? It is your virtual machine, so I guess, only you will use the installation.
Hi Alexey,

I used a manual from online and do all command step by step. Finally I got the error. What do you suggest me to do to solve the problem. Thanks so much.
pmjzhai is offline   Reply With Quote

Old   January 5, 2017, 06:25
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,618
Rep Power: 27
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

There are LOTS of manuals online. Which one did you use?
alexeym is offline   Reply With Quote

Old   January 5, 2017, 06:28
Default
  #9
New Member
 
Join Date: Jan 2017
Posts: 5
Rep Power: 2
pmjzhai is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

There are LOTS of manuals online. Which one did you use?
Hi Alexey,

Thanks for your remind. I tried without root and it's working.

Cheers
pmjzhai is offline   Reply With Quote

Old   January 7, 2017, 14:01
Default
  #10
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,917
Blog Entries: 39
Rep Power: 108
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Greetings to all!

@alexeym:
Quote:
Originally Posted by alexeym View Post
I do not know why there is a check like this
[...]
and there is no check for $WM_PROJECT_DIR not being empty.
How did I not notice this before?
This bug was inherited from a proposition I did a few years ago... in 2011: https://bugs.openfoam.org/view.php?id=256 - it was integrated with a lot of modifications in December 2014 and I didn't even notice that bug since then. I'll submit a patch request as soon as possible.

Quote:
Originally Posted by alexeym View Post
I think 50% of questions here raise due to environment not being correctly set up and I do not know why foundation still did not implement environment setup checks in their Allwmake/Allrun scripts.
I'm guessing that it was because this wasn't reported sooner... And ironically, that hadn't cross my mind... and I've been at this for quite some time already... although then there is the issue of making it elegant/practical enough to be acceptable... I'll try to look into it as well.

Quote:
Originally Posted by alexeym View Post
There are LOTS of manuals online. Which one did you use?
Since pmjzhai didn't state, I going to have to guess from the pattern that it was either the ones I wrote at openfoamwiki.net or that someone based their description on. I'll have to revise the instructions, increase the font and bolden the line that states that people need to exit root mode.

Many thanks for point out these issues!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 8, 2017, 05:04
Default
  #11
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,618
Rep Power: 27
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

@wyldckat

Quote:
Originally Posted by wyldckat View Post
I'm guessing that it was because this wasn't reported sooner... And ironically, that hadn't cross my mind... and I've been at this for quite some time already... although then there is the issue of making it elegant/practical enough to be acceptable... I'll try to look into it as well.
As a temporary solution check could be added just to $WM_PROJECT_DIR/Allwamake, since it easy to deduce location of etc/bashrc. For Allrun scripts it could be part of RunFunctions, yet in this case you have to go through usual installation locations during guessing process and finally run `find / -name 'OpenFOAM' -type d` to locate installation

Quote:
Since pmjzhai didn't state, I going to have to guess from the pattern that it was either the ones I wrote at openfoamwiki.net or that someone based their description on. I'll have to revise the instructions, increase the font and bolden the line that states that people need to exit root mode.
Does it really help to go to root mode instead of prefixing command with sudo?
alexeym is offline   Reply With Quote

Old   January 8, 2017, 14:54
Default
  #12
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,917
Blog Entries: 39
Rep Power: 108
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Hi Alexey,

Quote:
Originally Posted by alexeym View Post
As a temporary solution check could be added just to $WM_PROJECT_DIR/Allwmake, since it easy to deduce location of etc/bashrc.
I actually did misdiagnose this issue yesterday and thought that the command blocks were switched around... although the already existing message would at least help diagnose the issue.
And I ended up not sending a patch yet, because I got hung up on which was the best error information to provide...


Quote:
Originally Posted by alexeym View Post
For Allrun scripts it could be part of RunFunctions, yet in this case you have to go through usual installation locations during guessing process and finally run `find / -name 'OpenFOAM' -type d` to locate installation
If the main environment variable is not set, "RunFunctions" won't be loaded either... and relying on find probably would not be accepted and would likely find the wrong installation more often than not .
The most likely acceptable solution would be a one/two-liner that checks the main variable and complains if the environment is not active/sourced/set, i.e. something that doesn't overshadow the real purpose of the Allrun scripts.


Quote:
Originally Posted by alexeym View Post
Does it really help to go to root mode instead of prefixing command with sudo?
Not all Linux Distributions come with sudo pre-configured during installation, for some users it might be configured for another user name than their current login (e.g. shared workstation), so I had to go with a one-size-with-2-options-fits-all.

Best regards,
Bruno

edit: Report for the issue in Allwmake is now here: https://bugs.openfoam.org/view.php?id=2424

Last edited by wyldckat; January 8, 2017 at 17:08. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   April 4, 2017, 20:20
Smile /wmake/scripts/AllwmakeParseArguments error OpenFOAM
  #13
New Member
 
Smrutimaya Pattanaik
Join Date: May 2016
Location: Chennai, India
Posts: 5
Rep Power: 3
smrutimaya is on a distinguished road
One has to do the following steps to get rid of the error:

  1. You have to source bashrc in both user and sudo modes:
  • gedit ~/.bashrc
  • add following line below bashrc
  • source /opt/OpenFOAM41/OpenFOAM-4.1/etc/bashrc
  • sudo su
  • password
  • gedit ~/.bashrc
  • add following line below bashrc
  • source /opt/OpenFOAM41/OpenFOAM-4.1/etc/bashrc
2. Now run ./Allwmake in sudo mode
  • cd $WM_PROJECT_DIR
  • sudo su
  • password
  • ./Allwmake
smrutimaya is offline   Reply With Quote

Reply

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
Wrong oriented faces due to opposite face bends? Arnoldinho OpenFOAM 5 August 16, 2012 05:00
Warning: Dynamic zone with wrong CG using 6DOF Manoj Kumar FLUENT 1 August 11, 2012 04:03
CFX problems with supersonic inlet condition - Inlet values in CFX-Post are wrong jannnesss CFX 5 February 25, 2011 17:24
Axi-symmetric case gives wrong answer pbryant OpenFOAM Bugs 1 February 14, 2011 22:17
A huge mistake that could ruin my project: wrong turbulence specification Cheeko FLUENT 1 June 12, 2010 07:02


All times are GMT -4. The time now is 19:51.