mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: improve setup for paraview
- removed reliance on ParaView_INCLUDE_DIR variable for conveying the
major.minor version information when compiling. This can be somewhat
fragile and also adds variable that is an unnecessary when running
(only used when compiling).
Instead use `have_pvplugin_support` function in paraviewFunctions
wmake script to determine the maj.min from the PV_PLUGIN_PATH
since we have already defined the output path there with paraview
maj.min numbering.
Can now build with paraview from the operating system,
provided that it has develop headers available.
ParaView_VERSION=system
In the etc/config.sh/paraview setup, the maj.min is taken from
the corresponding `paraview --version` output and used when
defining the PV_PLUGIN_PATH.
During the build, the include path taken from `paraview-config`
for a system installation, from the guess installation root
of the paraview binary, or ParaView_DIR otherwise.
NB: using a system ParaView for building runTimePostProcessing is unsupported.
- these types of builds appear to have various library resolution issues
(eg, libexpat not being loaded). Additionally, the build logic does
not yet cover this type of use case.
This commit is contained in:
@ -1,10 +1,8 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions # Source wmake functions
|
||||
|
||||
# Source the wmake functions
|
||||
. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions
|
||||
|
||||
# Cleanup OpenFOAM libraries
|
||||
# Cleanup libraries
|
||||
wclean libso foamPv
|
||||
wclean libso vtkPVblockMesh
|
||||
wclean libso vtkPVFoam
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
export WM_CONTINUE_ON_ERROR=true # Optional unit
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The CMake functions
|
||||
. $WM_PROJECT_DIR/wmake/scripts/paraviewFunctions # CMake and PV functions
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
@ -13,31 +13,19 @@ warnIncomplete()
|
||||
echo
|
||||
}
|
||||
|
||||
# major version as per paraview include directory:
|
||||
# Eg, "PREFIX/include/paraview-5.0" -> "5.0"
|
||||
major="${ParaView_INCLUDE_DIR##*-}"
|
||||
if have_pvplugin_support
|
||||
then
|
||||
(
|
||||
wmakeLibPv foamPv
|
||||
wmakeLibPv vtkPVblockMesh
|
||||
wmakeLibPv vtkPVFoam
|
||||
|
||||
case "$major" in
|
||||
[45].[0-9]*)
|
||||
if canBuildPlugin
|
||||
if [ "$targetType" != objects ]
|
||||
then
|
||||
(
|
||||
wmakeLibPv foamPv
|
||||
wmakeLibPv vtkPVblockMesh
|
||||
wmakeLibPv vtkPVFoam
|
||||
|
||||
if [ "$targetType" != objects ]
|
||||
then
|
||||
cmakePv $PWD/PVblockMeshReader || warnIncomplete "BlockMesh"
|
||||
cmakePv $PWD/PVFoamReader || warnIncomplete "OpenFOAM"
|
||||
fi
|
||||
)
|
||||
cmakePv $PWD/PVblockMeshReader || warnIncomplete "BlockMesh"
|
||||
cmakePv $PWD/PVFoamReader || warnIncomplete "OpenFOAM"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "==> skip build of ParaView plugins"
|
||||
echo " include directory was for paraview major version '${major:-none}'"
|
||||
;;
|
||||
esac
|
||||
)
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -26,7 +26,7 @@ set(OPENFOAM_LIBRARIES
|
||||
|
||||
# Set output library destination to plugin directory
|
||||
set(
|
||||
LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH}
|
||||
LIBRARY_OUTPUT_PATH $ENV{FOAM_PV_PLUGIN_LIBBIN}
|
||||
CACHE INTERNAL
|
||||
"Single output directory for building all libraries."
|
||||
)
|
||||
|
||||
@ -20,7 +20,7 @@ set(OPENFOAM_LIBRARIES
|
||||
|
||||
# Set output library destination to plugin directory
|
||||
set(
|
||||
LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH}
|
||||
LIBRARY_OUTPUT_PATH $ENV{FOAM_PV_PLUGIN_LIBBIN}
|
||||
CACHE INTERNAL
|
||||
"Single output directory for building all libraries."
|
||||
)
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
sinclude $(GENERAL_RULES)/paraview
|
||||
|
||||
EXE_INC = \
|
||||
${c++LESSWARN} \
|
||||
-I$(LIB_SRC)/conversion/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(ParaView_INCLUDE_DIR) \
|
||||
-I$(ParaView_INCLUDE_DIR)/vtkkwiml
|
||||
-I$(PARAVIEW_INC_DIR) \
|
||||
-I$(PARAVIEW_INC_DIR)/vtkkwiml
|
||||
|
||||
LIB_LIBS = \
|
||||
$(GLIBS)
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
sinclude $(GENERAL_RULES)/paraview
|
||||
|
||||
EXE_INC = \
|
||||
${c++LESSWARN} \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
@ -9,8 +7,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||
-I$(LIB_SRC)/conversion/lnInclude \
|
||||
-I$(ParaView_INCLUDE_DIR) \
|
||||
-I$(ParaView_INCLUDE_DIR)/vtkkwiml \
|
||||
-I$(PARAVIEW_INC_DIR) \
|
||||
-I$(PARAVIEW_INC_DIR)/vtkkwiml \
|
||||
-I../foamPv \
|
||||
-I../PVFoamReader
|
||||
|
||||
@ -20,5 +18,5 @@ LIB_LIBS = \
|
||||
-lconversion \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian \
|
||||
-L$(FOAM_LIBBIN) -lfoamPv-pv${ParaView_MAJOR} \
|
||||
-L$(FOAM_LIBBIN) -lfoamPv-pv$(PARAVIEW_MAJMIN) \
|
||||
$(GLIBS)
|
||||
|
||||
@ -1,18 +1,16 @@
|
||||
sinclude $(GENERAL_RULES)/paraview
|
||||
|
||||
EXE_INC = \
|
||||
${c++LESSWARN} \
|
||||
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||
-I$(LIB_SRC)/conversion/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/mesh/blockMesh/lnInclude \
|
||||
-I$(ParaView_INCLUDE_DIR) \
|
||||
-I$(ParaView_INCLUDE_DIR)/vtkkwiml \
|
||||
-I$(PARAVIEW_INC_DIR) \
|
||||
-I$(PARAVIEW_INC_DIR)/vtkkwiml \
|
||||
-I../foamPv \
|
||||
-I../PVblockMeshReader
|
||||
|
||||
LIB_LIBS = \
|
||||
-lmeshTools \
|
||||
-lblockMesh \
|
||||
-L$(FOAM_LIBBIN) -lfoamPv-pv${ParaView_MAJOR} \
|
||||
-L$(FOAM_LIBBIN) -lfoamPv-pv$(PARAVIEW_MAJMIN) \
|
||||
$(GLIBS)
|
||||
|
||||
Reference in New Issue
Block a user