Skip to content

Commit 84f63ba

Browse files
author
Henry Weller
committed
Allwmake: Provides clearer message when OpenFOAM environment is not loaded
Patch contributed by Bruno Santos Resolves patch request https://bugs.openfoam.org/view.php?id=2424
1 parent 0dd9616 commit 84f63ba

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

Allwmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
cd ${0%/*} || exit 1 # Run from this directory
33

44
# Parse arguments for library compilation
5-
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
5+
. wmake/scripts/AllwmakeParseArguments
66

7+
# Perform various checks
78
wmakeCheckPwd "$WM_PROJECT_DIR" || {
89
echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR"
910
echo " The environment variables are inconsistent with the installation."

applications/Allwmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
cd ${0%/*} || exit 1 # Run from this directory
33

44
# Parse arguments for library compilation
5-
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
5+
. ../wmake/scripts/AllwmakeParseArguments
66

7+
# Perform various checks
78
wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
89
echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR/applications"
910
echo " The environment variables are inconsistent with the installation."

src/Allwmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
cd ${0%/*} || exit 1 # Run from this directory
33

44
# Parse arguments for library compilation
5-
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
5+
. ../wmake/scripts/AllwmakeParseArguments
66

7+
# Perform various checks
78
wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
89
echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR/src"
910
echo " The environment variables are inconsistent with the installation."

wmake/scripts/AllwmakeParseArguments

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# ========= |
33
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
44
# \\ / O peration |
5-
# \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
5+
# \\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
66
# \\/ M anipulation |
77
#------------------------------------------------------------------------------
88
# License
@@ -34,6 +34,15 @@
3434
#------------------------------------------------------------------------------
3535
Script=${0##*/}
3636

37+
if [ -z "$WM_PROJECT_DIR" ]
38+
then
39+
echo "$Script error: The OpenFOAM environment is not set."
40+
echo " Check the OpenFOAM entries in your dot-files and source them."
41+
echo " If in doubt, please read:"
42+
echo " http://openfoam.org/download/source/setting-environment"
43+
exit 1
44+
fi
45+
3746
usage() {
3847
exec 1>&2
3948
while [ "$#" -ge 1 ]; do echo "$1"; shift; done

0 commit comments

Comments
 (0)