Commit f88b74a0 authored by Mark Olesen's avatar Mark Olesen
Browse files

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.

CONFIG: add so version to libcatalystFoam

STYLE: add OpenFOAM/include directory in CMakeLists

- eg for foamVersion.H
parent dd242fff
......@@ -29,6 +29,7 @@ endif()
# ----------------------------------------------------------------------
include_directories(
${LIB_SRC}/OpenFOAM/include
${LIB_SRC}/OpenFOAM/lnInclude
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
${LIB_SRC}/finiteArea/lnInclude
......@@ -96,6 +97,13 @@ add_library(
${SOURCE_FILES}
)
set_target_properties(
catalystFoam
PROPERTIES
VERSION ${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}.${PARAVIEW_VERSION_PATCH}
SOVERSION ${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
)
target_link_libraries(
catalystFoam
${LINK_LIBRARIES}
......
#!/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
#------------------------------------------------------------------------------
......@@ -6,6 +6,7 @@ link_directories(
)
include_directories(
${LIB_SRC}/OpenFOAM/include
${LIB_SRC}/OpenFOAM/lnInclude
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
${LIB_SRC}/fileFormats/lnInclude
......@@ -26,7 +27,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."
)
......
......@@ -6,6 +6,7 @@ link_directories(
)
include_directories(
${LIB_SRC}/OpenFOAM/include
${LIB_SRC}/OpenFOAM/lnInclude
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
${LIB_SRC}/meshing/blockMesh/lnInclude
......@@ -20,7 +21,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."
)
......
foamPvCore.C
LIB = $(FOAM_LIBBIN)/libfoamPv-pv${ParaView_MAJOR}
LIB = $(FOAM_LIBBIN)/libfoamPv-pv${PARAVIEW_API}
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)
......@@ -5,4 +5,4 @@ vtkPVFoamMeshLagrangian.C
vtkPVFoamMeshVolume.C
vtkPVFoamUpdateInfo.C
LIB = $(FOAM_LIBBIN)/libvtkPVFoam-pv${ParaView_MAJOR}
LIB = $(FOAM_LIBBIN)/libvtkPVFoam-pv${PARAVIEW_API}
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_API} \
$(GLIBS)
vtkPVblockMesh.C
vtkPVblockMeshConvert.C
LIB = $(FOAM_LIBBIN)/libvtkPVblockMesh-pv${ParaView_MAJOR}
LIB = $(FOAM_LIBBIN)/libvtkPVblockMesh-pv${PARAVIEW_API}
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_API} \
$(GLIBS)
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source the wmake functions
. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions # Source wmake functions
# Cleanup library
rm -f $FOAM_LIBBIN/librunTimePostProcessing* 2>/dev/null
......
......@@ -14,6 +14,7 @@ else()
endif()
include_directories(
${LIB_SRC}/OpenFOAM/include
${LIB_SRC}/OpenFOAM/lnInclude
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
${LIB_SRC}/finiteVolume/lnInclude
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment