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
8f4b0805
Commit
8f4b0805
authored
4 years ago
by
Mark OLESEN
Browse files
Options
Downloads
Patches
Plain Diff
ENH: preserve ThirdParty locations in env modules
parent
9f7a4009
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/tools/foamCreateModuleInclude
+51
-8
51 additions, 8 deletions
bin/tools/foamCreateModuleInclude
with
51 additions
and
8 deletions
bin/tools/foamCreateModuleInclude
+
51
−
8
View file @
8f4b0805
...
...
@@ -152,7 +152,7 @@ then
# Check that it appears to be an OpenFOAM installation
# could also check [ -d "$projectDir/META-INFO" ]
if
[
-d
"
$projectDir
"
]
&&
[
-f
"etc/bashrc"
]
if
[
-d
"
$projectDir
"
]
&&
[
-f
"
$projectDir
/
etc/bashrc"
]
then
echo
"Appears to be an OpenFOAM installation"
1>&2
else
...
...
@@ -276,17 +276,52 @@ fi
echo
"Using openfoam:
$WM_PROJECT_DIR
"
1>&2
echo
"==>
$moduleOutput
"
1>&2
# Remove user directories as being unreliable
# Check if directory is the OpenFOAM or ThirdParty tree
dirInTree
()
{
local dir
=
"
$1
"
[
"
${
dir
#
$WM_PROJECT_DIR
}
"
!=
"
$dir
"
]
||
\
[
"
${
dir
#
$WM_THIRD_PARTY_DIR
}
"
!=
"
$dir
"
]
}
# User directories are entirely unreliable
foamOldDirs
=
"
$FOAM_USER_APPBIN
$FOAM_USER_LIBBIN
"
foamOldDirs
=
"
$ADIOS2_ARCH_PATH
$BOOST_ARCH_PATH
$CGAL_ARCH_PATH
$FFTW_ARCH_PATH
\
$MESA_ARCH_PATH
$LLVM_ARCH_PATH
\
$MPI_ARCH_PATH
$SCOTCH_ARCH_PATH
\
$FOAM_SITE_APPBIN
$FOAM_SITE_LIBBIN
$WM_PROJECT_SITE
\
$FOAM_USER_APPBIN
$FOAM_USER_LIBBIN
"
# Site locations must be within the OpenFOAM/ThirdParty tree
for
dir
in
"
$WM_PROJECT_SITE
"
"
$FOAM_SITE_APPBIN
"
"
$FOAM_SITE_LIBBIN
"
do
if
[
-d
"
$dir
"
]
&&
dirInTree
"
$dir
"
then
continue
fi
# Discard non-directories or non-OpenFOAM/ThirdParty locations
foamOldDirs
=
"
$foamOldDirs
$dir
"
done
# Changes associated with the '[A-Z].*_ARCH_PATH' variables must be
# within the OpenFOAM/ThirdParty tree
# - avoids adding items that may have come from another module
for
envname
in
$(
env
|
sed
-n
-e
's/^\(.*ARCH_PATH\)=.*$/\1/p'
)
do
eval
"dir=
\$
$envname
"
||
continue
if
[
-d
"
$dir
"
]
&&
dirInTree
"
$dir
"
then
continue
fi
# Discard non-directories or non-OpenFOAM/ThirdParty locations
foamOldDirs
=
"
$foamOldDirs
$dir
"
done
if
[
"
${
optParaview
:-
false
}
"
!=
true
]
then
foamOldDirs
=
"
$foamOldDirs
$ParaView_DIR
"
for
dir
in
"
$ParaView_DIR
"
do
if
[
-d
"
$dir
"
]
&&
dirInTree
"
$dir
"
then
continue
fi
foamOldDirs
=
"
$foamOldDirs
$ParaView_DIR
"
done
fi
foamClean
=
"
$WM_PROJECT_DIR
/bin/foamCleanPath"
...
...
@@ -336,6 +371,14 @@ unset FOAM_SITE_APPBIN FOAM_SITE_LIBBIN WM_PROJECT_SITE
# Should work without (use default)
unset
WM_DIR
# Remove any sourcing cruft
# Remove: 'BASH_.*'
for
envname
in
$(
env
|
sed
-n
-e
's/^\(BASH_.*\)=.*$/\1/p'
)
do
eval
"unset
$envname
"
done
# Third-party cruft - only used for orig compilation
# - as per spack installation
...
...
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