Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
22fae652
Commit
22fae652
authored
14 years ago
by
Mark Olesen
Browse files
Options
Downloads
Patches
Plain Diff
BUG: FOAM_INST_DIR (or prefix) not passed correctly from foamExec
parent
80a391a4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/foamEtcFile
+5
-5
5 additions, 5 deletions
bin/foamEtcFile
bin/foamExec
+32
-19
32 additions, 19 deletions
bin/foamExec
with
37 additions
and
24 deletions
bin/foamEtcFile
+
5
−
5
View file @
22fae652
...
...
@@ -38,6 +38,10 @@
# && _foamSource $foamPrefs
# \endcode
#
# Note
# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
# or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version)
#
#-------------------------------------------------------------------------------
usage
()
{
[
"
${
quietOpt
:-
$silentOpt
}
"
=
true
]
&&
exit
1
...
...
@@ -73,13 +77,9 @@ USAGE
exit
1
}
#
# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
# or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version)
#
#-------------------------------------------------------------------------------
# the bindir:
# the bin
dir:
binDir
=
"
${
0
%/*
}
"
# the project dir:
...
...
This diff is collapsed.
Click to expand it.
bin/foamExec
+
32
−
19
View file @
22fae652
...
...
@@ -31,12 +31,21 @@
# Runs the <foamVersion> version of executable <foamCommand>
# with the rest of the arguments.
#
# Can also be used for parallel runs e.g.
# mpirun -np <nProcs> \
# foamExec -version <foamVersion> <foamCommand> ... -parallel
# Can also be used for parallel runs. For example,
# \code
# mpirun -np <nProcs> \
# foamExec -version <foamVersion> <foamCommand> ... -parallel
# \endcode
#
# Note
# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
# or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version)
#
# foamEtcFile must be found in the same directory as this script
#
# SeeAlso
# foamEtcFile
#
#------------------------------------------------------------------------------
usage
()
{
exec
1>&2
...
...
@@ -58,14 +67,22 @@ USAGE
exit
1
}
#
# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
# or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version)
#
# foamEtcFile must be found in the same directory as this script
#-------------------------------------------------------------------------------
unset
etcOpts prefix version
# the bin dir:
binDir
=
"
${
0
%/*
}
"
# the project dir:
projectDir
=
"
${
binDir
%/bin
}
"
# the prefix dir (same as foamInstall):
prefixDir
=
"
${
projectDir
%/*
}
"
# # the name used for the project directory
# projectDirName="${projectDir##*/}"
unset
etcOpts version
# parse options
while
[
"$#"
-gt
0
]
do
...
...
@@ -80,14 +97,14 @@ do
;;
-p
|
-prefix
)
[
"$#"
-ge
2
]
||
usage
"'
$1
' option requires an argument"
prefix
=
"
$2
"
etcOpts
=
"
$etcOpts
$1
$2
"
# pass-thru to foamEtcFile
prefixDir
=
"
$2
"
shift
;;
-v
|
-version
)
[
"$#"
-ge
2
]
||
usage
"'
$1
' option requires an argument"
version
=
"
$2
"
etcOpts
=
"
$etcOpts
$1
$2
"
# pass-thru to foamEtcFile
version
=
"
$2
"
shift
;;
--
)
...
...
@@ -104,23 +121,19 @@ do
shift
done
#
# Find and source OpenFOAM settings (bashrc)
# placed in function to preserve command-line arguments
#
sourceRc
()
{
# default is the current version
:
${
version
:
=
${
WM_PROJECT_VERSION
:-
unknown
}}
foamDotFile
=
"
$(
${
0
%/*
}
/foamEtcFile
$etcOpts
bashrc
)
"
||
{
echo
"Error : bashrc file could not be found for OpenFOAM-
$version
"
1>&2
foamDotFile
=
"
$(
$binDir
/foamEtcFile
$etcOpts
bashrc
)
"
||
{
echo
"Error : bashrc file could not be found for OpenFOAM-
${
version
:-${
WM_PROJECT_VERSION
:-
???
}}
"
1>&2
exit
1
}
#
extra safety when
sourcing the bashrc
[
-n
"
$prefix
"
]
&&
export
FOAM_INST_DIR
=
"
$prefix
"
#
set to consistent value before
sourcing the bashrc
export
FOAM_INST_DIR
=
"
$prefix
Dir
"
.
$foamDotFile
$FOAM_SETTINGS
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment