wmake, wmakeLnIncludeAll: Automated the creation of the lnInclude directories based on dependency
Now lnInclude are created as required by the presence of entries in the EXE_INC variable in the Make/options file. This removes the need for calling wmakeLnInclude in various Allwmake files to ensure the existence of the lnInclude directories prior to compilation of dependent libraries.
This commit is contained in:
@ -4,7 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
# Parse arguments for library compilation
|
# Parse arguments for library compilation
|
||||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||||
|
|
||||||
wmakeLnInclude interfacialModels
|
|
||||||
wmake $targetType multiphaseSystem
|
wmake $targetType multiphaseSystem
|
||||||
wmake $targetType interfacialModels
|
wmake $targetType interfacialModels
|
||||||
wmake $targetType
|
wmake $targetType
|
||||||
|
|||||||
@ -4,15 +4,10 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
# Parse arguments for library compilation
|
# Parse arguments for library compilation
|
||||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||||
|
|
||||||
wmakeLnInclude interfacialModels
|
|
||||||
wmakeLnInclude interfacialCompositionModels
|
|
||||||
wmakeLnInclude derivedFvPatchFields
|
|
||||||
wmake $targetType phaseSystems
|
wmake $targetType phaseSystems
|
||||||
wmake $targetType interfacialModels
|
wmake $targetType interfacialModels
|
||||||
wmake $targetType interfacialCompositionModels
|
wmake $targetType interfacialCompositionModels
|
||||||
wmake $targetType derivedFvPatchFields
|
wmake $targetType derivedFvPatchFields
|
||||||
wmakeLnInclude reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels
|
|
||||||
wmakeLnInclude reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels
|
|
||||||
reactingTwoPhaseEulerFoam/Allwmake $targetType $*
|
reactingTwoPhaseEulerFoam/Allwmake $targetType $*
|
||||||
reactingMultiphaseEulerFoam/Allwmake $targetType $*
|
reactingMultiphaseEulerFoam/Allwmake $targetType $*
|
||||||
wmake $targetType functionObjects
|
wmake $targetType functionObjects
|
||||||
|
|||||||
@ -4,7 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
# Parse arguments for library compilation
|
# Parse arguments for library compilation
|
||||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||||
|
|
||||||
wmakeLnInclude interfacialModels
|
|
||||||
wmake $targetType twoPhaseSystem
|
wmake $targetType twoPhaseSystem
|
||||||
wmake $targetType interfacialModels
|
wmake $targetType interfacialModels
|
||||||
wmake $targetType phaseCompressibleTurbulenceModels
|
wmake $targetType phaseCompressibleTurbulenceModels
|
||||||
|
|||||||
@ -21,8 +21,6 @@ wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
|
|||||||
# Update OpenFOAM version strings if required
|
# Update OpenFOAM version strings if required
|
||||||
wmakePrintBuild -check || wrmo OpenFOAM/global/global.o 2>/dev/null
|
wmakePrintBuild -check || wrmo OpenFOAM/global/global.o 2>/dev/null
|
||||||
|
|
||||||
wmakeLnInclude OpenFOAM
|
|
||||||
wmakeLnInclude OSspecific/${WM_OSTYPE:-POSIX}
|
|
||||||
Pstream/Allwmake $targetType $*
|
Pstream/Allwmake $targetType $*
|
||||||
|
|
||||||
OSspecific/${WM_OSTYPE:-POSIX}/Allwmake $targetType $*
|
OSspecific/${WM_OSTYPE:-POSIX}/Allwmake $targetType $*
|
||||||
@ -35,11 +33,8 @@ wmake $targetType meshTools
|
|||||||
|
|
||||||
# Decomposition methods needed by dummyThirdParty
|
# Decomposition methods needed by dummyThirdParty
|
||||||
# (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools
|
# (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools
|
||||||
parallel/decompose/AllwmakeLnInclude
|
|
||||||
dummyThirdParty/Allwmake $targetType $*
|
dummyThirdParty/Allwmake $targetType $*
|
||||||
|
|
||||||
wmakeLnInclude fvOptions
|
|
||||||
|
|
||||||
wmake $targetType finiteVolume
|
wmake $targetType finiteVolume
|
||||||
wmake $targetType lagrangian/basic
|
wmake $targetType lagrangian/basic
|
||||||
wmake $targetType lagrangian/distributionModels
|
wmake $targetType lagrangian/distributionModels
|
||||||
|
|||||||
@ -36,8 +36,6 @@ wmakeMpiLib()
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
wmakeLnInclude decompositionMethods
|
|
||||||
|
|
||||||
if [ -n "$SCOTCH_ARCH_PATH" ]
|
if [ -n "$SCOTCH_ARCH_PATH" ]
|
||||||
then
|
then
|
||||||
wmake $targetType scotchDecomp
|
wmake $targetType scotchDecomp
|
||||||
|
|||||||
@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
|
||||||
|
|
||||||
wmakeLnInclude decompositionMethods
|
|
||||||
wmakeLnInclude metisDecomp
|
|
||||||
wmakeLnInclude scotchDecomp
|
|
||||||
wmakeLnInclude ptscotchDecomp
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
@ -32,6 +32,6 @@ $(OBJECTS_DIR)/%.dep : %
|
|||||||
-R '$(OBJECTS_DIR)/' '$$(OBJECTS_DIR)/' \
|
-R '$(OBJECTS_DIR)/' '$$(OBJECTS_DIR)/' \
|
||||||
-R '$(WM_PROJECT_DIR)/' '$$(WM_PROJECT_DIR)/' \
|
-R '$(WM_PROJECT_DIR)/' '$$(WM_PROJECT_DIR)/' \
|
||||||
-R '$(WM_THIRD_PARTY_DIR)/' '$$(WM_THIRD_PARTY_DIR)/' \
|
-R '$(WM_THIRD_PARTY_DIR)/' '$$(WM_THIRD_PARTY_DIR)/' \
|
||||||
-I$(*D) $(LIB_HEADER_DIRS) $< $@
|
$(LIB_HEADER_DIRS) $< $@
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -289,6 +289,9 @@ then
|
|||||||
wmakeLnIncludeAll -update $parOpt
|
wmakeLnIncludeAll -update $parOpt
|
||||||
wclean empty
|
wclean empty
|
||||||
export WM_UPDATE_DEPENDENCIES=yes
|
export WM_UPDATE_DEPENDENCIES=yes
|
||||||
|
elif [ -z "$all" ]
|
||||||
|
then
|
||||||
|
wmakeLnIncludeAll -dep "$parOpt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -313,6 +316,7 @@ then
|
|||||||
&& echo "$d"; \
|
&& echo "$d"; \
|
||||||
done | xargs \
|
done | xargs \
|
||||||
)
|
)
|
||||||
|
|
||||||
if [ ! "$FOAM_APPS" = "" ]
|
if [ ! "$FOAM_APPS" = "" ]
|
||||||
then
|
then
|
||||||
# Compile all applications in sub-directories
|
# Compile all applications in sub-directories
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -68,6 +68,9 @@ nCores=0
|
|||||||
# Default 'wmakeLnInclude' option
|
# Default 'wmakeLnInclude' option
|
||||||
wmLnOpt=
|
wmLnOpt=
|
||||||
|
|
||||||
|
# Option to execute 'wmakeLnInclude' on all dependent libraries
|
||||||
|
depOpt=
|
||||||
|
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -77,6 +80,10 @@ do
|
|||||||
-u | -update)
|
-u | -update)
|
||||||
wmLnOpt="-update"
|
wmLnOpt="-update"
|
||||||
;;
|
;;
|
||||||
|
-d | -dep)
|
||||||
|
depOpt=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
# Parallel execution on WM_NCOMPPROCS cores
|
# Parallel execution on WM_NCOMPPROCS cores
|
||||||
-j)
|
-j)
|
||||||
nCores=$WM_NCOMPPROCS
|
nCores=$WM_NCOMPPROCS
|
||||||
@ -98,21 +105,55 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
FAIL=0
|
if [ "$depOpt" = true ]
|
||||||
|
|
||||||
if [ "$nCores" -gt 0 ]
|
|
||||||
then
|
then
|
||||||
echo "$Script: starting wmakeLnInclude processes on $nCores cores"
|
|
||||||
|
MakeDir=Make
|
||||||
|
|
||||||
|
[ -r $MakeDir/options ] || {
|
||||||
|
echo "$Script error: file '$MakeDir/options' does not exist" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
LIB_SRC="$WM_PROJECT_DIR/src"
|
||||||
|
|
||||||
|
includeDirs="
|
||||||
|
$WM_PROJECT_DIR/src/$WM_PROJECT
|
||||||
|
$WM_PROJECT_DIR/src/OSspecific/$WM_OSTYPE
|
||||||
|
$(grep -e '-I.*lnInclude' $MakeDir/options |
|
||||||
|
sed -e 's%-I\([.$(a-zA-Z0-9_)/]*\)/lnInclude.*%\1%' -e 's/$(\(.*\))/$\1/')"
|
||||||
|
|
||||||
|
printed=
|
||||||
|
for d in $includeDirs
|
||||||
|
do [ ! -d "$d" ]
|
||||||
|
path=$(eval echo $d)
|
||||||
|
if [ ! -d $path/lnInclude ]
|
||||||
|
then
|
||||||
|
[ $printed ] || echo "$Script: running wmakeLnInclude on dependent libraries:"
|
||||||
|
printed=true
|
||||||
|
echo -n " "
|
||||||
|
eval wmakeLnInclude $wmLnOpt $d
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
unset MakeDir LIB_SRC printed
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
FAIL=0
|
||||||
|
|
||||||
|
if [ "$nCores" -gt 0 ]
|
||||||
|
then
|
||||||
|
echo "$Script: starting wmakeLnInclude processes on $nCores cores"
|
||||||
|
else
|
||||||
echo "$Script: running wmakeLnInclude"
|
echo "$Script: running wmakeLnInclude"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Defaults to searching from CWD
|
||||||
|
[ "$#" -gt 0 ] || set -- .
|
||||||
|
|
||||||
# Defaults to searching from CWD
|
for checkDir
|
||||||
[ "$#" -gt 0 ] || set -- .
|
do
|
||||||
|
|
||||||
for checkDir
|
|
||||||
do
|
|
||||||
if [ -d $checkDir ]
|
if [ -d $checkDir ]
|
||||||
then
|
then
|
||||||
echo " searching $checkDir for 'Make' directories"
|
echo " searching $checkDir for 'Make' directories"
|
||||||
@ -150,17 +191,20 @@ do
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$nCores" -gt 0 ]
|
if [ "$nCores" -gt 0 ]
|
||||||
then
|
then
|
||||||
# Wait for all of the wmakeLnInclude jobs to finish
|
# Wait for all of the wmakeLnInclude jobs to finish
|
||||||
wait
|
wait
|
||||||
|
|
||||||
# Synchronize the file system to ensure that all of the links exist
|
# Synchronize the file system to ensure that all of the links exist
|
||||||
# before compilation
|
# before compilation
|
||||||
# sync
|
# sync
|
||||||
sleep 2
|
sleep 3
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset FAIL joblist
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -168,7 +212,7 @@ fi
|
|||||||
# Cleanup local variables and functions
|
# Cleanup local variables and functions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
unset Script usage error
|
unset Script usage error findName nCores wmLnOpt depOpt
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user