From f14b5e24560e1daebb97207656f54e4e9ad7c9e0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 28 Jan 2014 12:54:14 +0000 Subject: [PATCH] ENH: etc: added CGAL setup --- .../utilities/mesh/generation/Allwmake | 2 +- .../mesh/generation/foamyHexMesh/Allwmake | 2 +- .../mesh/generation/foamyQuadMesh/Allwmake | 2 +- etc/bashrc | 1 + etc/config/CGAL.csh | 50 ++++++++++++++++++ etc/config/CGAL.sh | 51 +++++++++++++++++++ etc/config/settings.csh | 29 ----------- etc/config/settings.sh | 34 ------------- etc/cshrc | 1 + 9 files changed, 106 insertions(+), 66 deletions(-) create mode 100644 etc/config/CGAL.csh create mode 100644 etc/config/CGAL.sh diff --git a/applications/utilities/mesh/generation/Allwmake b/applications/utilities/mesh/generation/Allwmake index 8f7cbada96..f9861db464 100755 --- a/applications/utilities/mesh/generation/Allwmake +++ b/applications/utilities/mesh/generation/Allwmake @@ -7,7 +7,7 @@ wmake all extrude wmake all extrude2DMesh wmake all snappyHexMesh -if [ -d "$CGAL_ARCH_PATH" ] +if [ -n "$CGAL_ARCH_PATH" ] then wmake libso foamyHexMesh/conformalVoronoiMesh wmake all foamyHexMesh diff --git a/applications/utilities/mesh/generation/foamyHexMesh/Allwmake b/applications/utilities/mesh/generation/foamyHexMesh/Allwmake index 3a5c35d779..67770e51c5 100755 --- a/applications/utilities/mesh/generation/foamyHexMesh/Allwmake +++ b/applications/utilities/mesh/generation/foamyHexMesh/Allwmake @@ -2,7 +2,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x -if [ -d "$CGAL_ARCH_PATH" ] +if [ -n "$CGAL_ARCH_PATH" ] then wmake libso conformalVoronoiMesh wmake diff --git a/applications/utilities/mesh/generation/foamyQuadMesh/Allwmake b/applications/utilities/mesh/generation/foamyQuadMesh/Allwmake index 18fc1e952a..242939465f 100755 --- a/applications/utilities/mesh/generation/foamyQuadMesh/Allwmake +++ b/applications/utilities/mesh/generation/foamyQuadMesh/Allwmake @@ -2,7 +2,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x -if [ -d "$CGAL_ARCH_PATH" ] +if [ -n "$CGAL_ARCH_PATH" ] then #- Already built by ../Allwake #wmake libso ../foamyHexMesh/conformalVoronoiMesh diff --git a/etc/bashrc b/etc/bashrc index 0a3f216d51..5ac6a20081 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -214,6 +214,7 @@ _foamSource $WM_PROJECT_DIR/etc/config/aliases.sh _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.sh` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/gperftools.sh` +_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/CGAL.sh` # Clean environment paths again. Only remove duplicates diff --git a/etc/config/CGAL.csh b/etc/config/CGAL.csh new file mode 100644 index 0000000000..2e3f81f0e4 --- /dev/null +++ b/etc/config/CGAL.csh @@ -0,0 +1,50 @@ +#----------------------------------*-sh-*-------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2014 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 . +# +# File +# config/CGAL.csh +# +# Description +# Setup file for CGAL (& boost) include/libraries. +# Sourced from OpenFOAM-/etc/cshrc +##------------------------------------------------------------------------------ + +set boost_version=boost-system +set cgal_version=CGAL-4.3 + +setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version +setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version + +if ($?FOAM_VERBOSE && $?prompt) then + echo "Using CGAL and boost" + echo " $cgal_version at $CGAL_ARCH_PATH" + echo " $boost_version at $BOOST_ARCH_PATH" +endif + +if ( -d "$BOOST_ARCH_PATH" ) then + _foamAddLib $BOOST_ARCH_PATH/lib +endif + +unset boost_version cgal_version + +# ----------------------------------------------------------------------------- diff --git a/etc/config/CGAL.sh b/etc/config/CGAL.sh new file mode 100644 index 0000000000..dcb2606461 --- /dev/null +++ b/etc/config/CGAL.sh @@ -0,0 +1,51 @@ +#----------------------------------*-sh-*-------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2014 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 . +# +# File +# config/CGAL.sh +# +# Description +# Setup file for CGAL (& boost) include/libraries. +# Sourced from OpenFOAM-/etc/bashrc +#------------------------------------------------------------------------------ + +boost_version=boost-system +cgal_version=CGAL-4.3 + +export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version +export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version + +if [ "$FOAM_VERBOSE" -a "$PS1" ] +then + echo "Using CGAL and boost" + echo " $cgal_version at $CGAL_ARCH_PATH" + echo " $boost_version at $BOOST_ARCH_PATH" +fi + +if ( -d "$BOOST_ARCH_PATH" ) then + _foamAddLib $BOOST_ARCH_PATH/lib +fi + +unset boost_version cgal_version + +# ----------------------------------------------------------------------------- diff --git a/etc/config/settings.csh b/etc/config/settings.csh index af748c57c2..a316037710 100644 --- a/etc/config/settings.csh +++ b/etc/config/settings.csh @@ -353,35 +353,6 @@ if ( $?WM_CXXFLAGS ) then endif -# boost and CGAL -# ~~~~~~~~~~~~~~ - -set boost_version=boost_1_45_0 -set cgal_version=CGAL-4.0 - -setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version -setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version - -# enabled if CGAL is available -if ($?FOAM_VERBOSE && $?prompt) then - echo "Checking for" - echo " $cgal_version at $CGAL_ARCH_PATH" - echo " $boost_version at $BOOST_ARCH_PATH" -endif - -if ( -d "$CGAL_ARCH_PATH" ) then - if ( -d "$BOOST_ARCH_PATH" ) then - _foamAddLib $BOOST_ARCH_PATH/lib - else - unsetenv BOOST_ARCH_PATH - endif - _foamAddLib $CGAL_ARCH_PATH/lib -else - unsetenv BOOST_ARCH_PATH CGAL_ARCH_PATH MPFR_ARCH_PATH GMP_ARCH_PATH -endif - -unset boost_version cgal_version - # Communications library # ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/etc/config/settings.sh b/etc/config/settings.sh index bc8fd220c5..487c550d24 100644 --- a/etc/config/settings.sh +++ b/etc/config/settings.sh @@ -370,40 +370,6 @@ then fi -# boost and CGAL -# ~~~~~~~~~~~~~~ - -boost_version=boost_1_45_0 -cgal_version=CGAL-4.0 - -export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version -export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version - -# enabled if CGAL is available -if [ "$FOAM_VERBOSE" -a "$PS1" ] -then - echo "Checking for" - echo " $cgal_version at $CGAL_ARCH_PATH" - echo " $boost_version at $BOOST_ARCH_PATH" -fi - -if [ -d "$CGAL_ARCH_PATH" ] -then - if [ -d "$BOOST_ARCH_PATH" ] - then - _foamAddLib $BOOST_ARCH_PATH/lib - _foamAddLib $BOOST_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH - else - unset BOOST_ARCH_PATH - fi - _foamAddLib $CGAL_ARCH_PATH/lib - _foamAddLib $CGAL_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH -else - unset BOOST_ARCH_PATH CGAL_ARCH_PATH MPFR_ARCH_PATH GMP_ARCH_PATH -fi - -unset boost_version cgal_version - # Communications library # ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/etc/cshrc b/etc/cshrc index bb232b22be..fc86f61432 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -203,6 +203,7 @@ _foamSource $WM_PROJECT_DIR/etc/config/aliases.csh # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.csh` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.csh` +_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/CGAL.csh` # Clean environment paths again. Only remove duplicates