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

[OpenFOAM.com] Error (Allwmake) : not located in $WM_PROJECT_DIR

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By linuxguy123

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 17, 2019, 20:54
Default Error (Allwmake) : not located in $WM_PROJECT_DIR
  #1
Member
 
Guy
Join Date: Jun 2019
Posts: 39
Rep Power: 6
linuxguy123 is on a distinguished road
Trying to install v1812 on my Fedora 30 box.


Error (Allwmake) : not located in $WM_PROJECT_DIR


Why does this not work ?

Code:
[me@Brix ~]$ WM_PROJECT_DIR=/home/me/openfoam-v1812
[me@Brix ~]$ export WM_PROJECT_DIR
[me@Brix ~]$ echo $WM_PROJECT_DIR
/home/me/openfoam-v1812
[me@Brix ~]$ cd $WM_PROJECT_DIR
[me@Brix openfoam-v1812]$ ls
Allwmake  applications  bin  BuildIssues.txt  COPYING  doc  etc  META-INFO  modules  README.md  src  tutorials  wmake



[me@Brix openfoam-v1812]$ ls $WM_PROJECT_DIR



Allwmake  applications  bin  BuildIssues.txt  COPYING  doc  etc  META-INFO  modules  README.md  src  tutorials  wmake



[me@Brix openfoam-v1812]$ ./Allwmake

WM_PROJECT_DIR is /home/me/openfoam-v1812

Error (Allwmake) : not located in $WM_PROJECT_DIR
    Check your OpenFOAM environment and installation

I added the following to Allwmake to see what is getting passed in:

Code:
echo
echo WM_PROJECT_DIR is $WM_PROJECT_DIR
echo




I don't understand this code:


Code:
cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR" 2>/dev/null || {
    echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR"
    echo "    Check your OpenFOAM environment and installation"
    exit 1

0% = a command line parameter right ? What if 0% = a null string ?


Also... how about splitting vmakeCheckPwd from this if statement and if that fails issue an "Invalid Password" error message ?

Last edited by wyldckat; July 9, 2019 at 19:10. Reason: Added [CODE][/CODE] markers
linuxguy123 is offline   Reply With Quote

Old   July 9, 2019, 19:20
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer:
  1. "Pwd" refers to this: https://en.wikipedia.org/wiki/Pwd - print working directory
  2. The problem should be on how the script "wmake/wmakeCheckPwd" processes the folder "/home/me/openfoam-v1812". More specifically, it checks if the folder does really exist or not, or if it's only a symbolic link.
  3. "${0%/*}" is a shell interpretation mechanism:
    1. "$0" is the command you used, namely "./Allwmake"
    2. The brackets "{}" are for using the additional controls, namely "%" in this case...
    3. This to say that "$0" and "${0}" should give you roughly the same thing.
    4. "%/*" is a control to ignore anything after the "/" character.
    5. So "${0%/*}" is interpreted to this "./" if I'm not mistaken.
  4. My guess is that the folder "/home/me/openfoam-v1812" is a symbolic link, hence the problem.
  5. The solution is that you do not need to use symbolic links. You can simply call the source command directly to the real folder where you have OpenFOAM's "etc/bashrc".
__________________
wyldckat is offline   Reply With Quote

Old   July 12, 2021, 00:57
Default
  #3
New Member
 
Alexander Kazantcev
Join Date: Sep 2019
Posts: 23
Rep Power: 6
AlexKaz is on a distinguished road
"source bashrc" needing.
AlexKaz is offline   Reply With Quote

Old   July 19, 2021, 16:04
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Code:
Special Parameters
...
       0      Expands to the name of the shell or shell script.  This is set at  shell  initialization.   If
              bash  is  invoked  with  a  file  of commands, $0 is set to the name of that file.  If bash is
              started with the -c option, then $0 is set to the first argument after the string to  be  exe-
              cuted, if one is present.  Otherwise, it is set to the file name used to invoke bash, as given
              by argument zero.
So, $0 cannot be zero.

Code:
       ${parameter%word}
       ${parameter%%word}
              The  word  is  expanded  to  produce  a pattern just as in pathname expansion.  If the pattern
              matches a trailing portion of the expanded value of parameter, then the result of  the  expan-
              sion is the expanded value of parameter with the shortest matching pattern (the ``%'' case) or
              the longest matching pattern (the ``%%'' case) deleted.  If parameter is @ or *,  the  pattern
              removal  operation  is  applied to each positional parameter in turn, and the expansion is the
              resultant list.  If parameter is an array variable  subscripted  with  @  or  *,  the  pattern
              removal  operation  is  applied  to each member of the array in turn, and the expansion is the
              resultant list.
So
Code:
${0%/}
removes script name and gets location of the script.
Code:
${0%/}
can be zero if
Code:
$0
is
Code:
/Allwmake
. And in general, this should not be the case.

In your concrete case
Code:
wmakeCheckPwd
is not in the path, so command fails and branch after || is executed. And as @wyldckat said, Pwd here has nothing to do with passwords.
alexeym is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
y+ for cells located away from the wall aylalisa OpenFOAM Post-Processing 5 August 23, 2023 05:24
where is "rhoEqa.H" file located Wilson Lee OpenFOAM Programming & Development 4 April 15, 2019 07:22
Number of Energy Source Terms - Where are the Sources located? mir9283 FLUENT 1 June 5, 2018 17:42
Defining source terms at the wall located between two fluids e_cfd FLUENT 3 December 18, 2017 09:14
Find cell where an arbitrary point is located hb12 Fluent UDF and Scheme Programming 0 January 19, 2015 04:38


All times are GMT -4. The time now is 05:03.