Files
OpenFOAM-12/etc/config.csh/paraview
2023-01-16 16:29:48 +00:00

146 lines
5.0 KiB
Bash

#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config.csh/paraview
#
# Description
# Setup file for paraview-[4-5].x
# Sourced from OpenFOAM-<VERSION>/etc/cshrc or from foamPV alias
#
# Note
# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
# are required for building plugins
#
#------------------------------------------------------------------------------
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
# Clean the PATH
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
if ( $status == 0 ) setenv PATH $cleaned
# Determine the cmake to be used. Take the most recent.
unsetenv CMAKE_HOME CMAKE_ROOT
set nonomatch
foreach cmake ( $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake-* )
if ( -d $cmake ) then
if ( $?CMAKE_HOME ) then
$WM_PROJECT_DIR/bin/tools/foamVersionCompare $CMAKE_HOME lt $cmake
endif
if ( ! $?CMAKE_HOME || $status == 0 ) then
setenv CMAKE_HOME $cmake
setenv CMAKE_ROOT $cmake
endif
endif
end
if ( $?CMAKE_HOME ) then
setenv PATH $cmake/bin:${PATH}
endif
#- ParaView version, automatically determine major version:
#setenv ParaView_VERSION 5.6.3
setenv ParaView_VERSION 5.10.1
setenv ParaView_MAJOR detect
#setenv ParaView_GL system
setenv ParaView_GL mesa
# Evaluate command-line parameters for ParaView
while ( $#argv > 0 )
switch ($argv[1])
case ParaView*=*:
# name=value -> setenv name value
eval "setenv $argv[1]:s/=/ /"
breaksw
endsw
shift
end
# Set MAJOR version to correspond to VERSION
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
switch ("$ParaView_VERSION")
case "$ParaView_MAJOR".*:
# Version and major appear to correspond
breaksw
case [0-9]*:
# Extract major from the version
setenv ParaView_MAJOR `echo ${ParaView_VERSION} | \
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
breaksw
endsw
# Set the binary and source directories
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/ParaView-$ParaView_VERSION
set paraviewSrcDir=$WM_THIRD_PARTY_DIR/ParaView-${ParaView_VERSION}
# Set paths if binaries or source are present
if ( -d $ParaView_DIR || -d $paraviewSrcDir ) then
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-${ParaView_MAJOR}
set paraviewArch=
if ( -d $ParaView_DIR/lib64 ) then
set paraviewArch=64
endif
set paraviewLibSubDir=
$WM_PROJECT_DIR/bin/tools/foamVersionCompare $ParaView_VERSION lt 5.5.0
if ( $status == 0 ) then
set paraviewLibSubDir=/paraview-$ParaView_MAJOR
endif
setenv ParaView_LIB_DIR $ParaView_DIR/lib$paraviewArch$paraviewLibSubDir
setenv PATH ${ParaView_DIR}/bin:${PATH}
setenv LD_LIBRARY_PATH "${ParaView_LIB_DIR}:${LD_LIBRARY_PATH}"
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using paraview"
echo " ParaView_DIR : $ParaView_DIR"
echo " ParaView_LIB_DIR : $ParaView_LIB_DIR"
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
endif
# Add in python libraries if required
set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
if ( -r $paraviewPython ) then
if ($?PYTHONPATH) then
setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_LIB_DIR
else
setenv PYTHONPATH ${paraviewPython}:$ParaView_LIB_DIR
endif
endif
# Alias paraview to launch with mesa if necessary
if ("$ParaView_GL" == mesa) then
alias paraview 'env LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ParaView_LIB_DIR}/mesa paraview'
endif
else
unsetenv PV_PLUGIN_PATH
endif
unset cleaned cmake paraviewInstDir paraviewPython
#------------------------------------------------------------------------------