diff --git a/.gitignore b/.gitignore index 4565478..b058312 100644 --- a/.gitignore +++ b/.gitignore @@ -1,79 +1,32 @@ -# man gitignore for more information - -# editor and misc backup files - anywhere +# Ignore editor and misc backup files - anywhere *~ .*~ *.bak *.bak[0-9][0-9] -*.orig -*.orig[0-9][0-9] \#*\# -# file-browser settings - anywhere -.directory - -# CVS recovered versions - anywhere -.#* - -# objects and archives - anywhere -*.[oa] -*.la -*.so -*.jar - -# derived files -lex.yy.c - -# Corefiles -core - -# dependency files - anywhere -*.dep - -# lnInclude (symlink) folders - anywhere -lnInclude - -# build folders - anywhere -linux*Gcc*/ -linux*Icc*/ -linuxming*/ -SiCortex*Gcc*/ -solaris*Gcc*/ -SunOS*Gcc*/ - -# source packages - anywhere +# Ignore source packages - anywhere *.tar.bz2 *.tar.gz *.tar *.tgz *.gtgz +# Ignore build and platforms folders +build/ +platforms/ -# ignore the persistent .build tag in the main directory -/.build +# Generated files in the main directory +/*.html -# ignore .timeStamp in the main directory -/.timeStamp - -# ignore unpacked sources in the main directory (match pkg-ver) +# Ignore unpacked sources in the main directory (match pkg-ver) # this also matches symlinks /*[-_][0-9]* -# ignore all sub-directories +# Ignore all top-level sub-directories /*/ -# do not ignore these ones +# Do not ignore these ones though !/etc/ -# do not ignore the first level of these ones -!/malloc/ -/malloc/*/ -!/malloc/fbsdmalloc/ - -# ignore these extra symlinks -libccmio - -# track this patched version directly - until metis gets dropped -!/metis-5.0pre2/libmetis/metislib.h - -# end-of-file +# End-of-file diff --git a/Allclean b/Allclean index 524fde9..22792c1 100755 --- a/Allclean +++ b/Allclean @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ M anipulation | +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -23,7 +23,7 @@ # along with OpenFOAM. If not, see . # # Script -# AllClean +# Allclean # # Description # Clean script for third-party applications and libraries @@ -39,24 +39,115 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { } # . etc/tools/ThirdPartyFunctions #------------------------------------------------------------------------------ +Script=${0##*/} +usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat< [ ... ]] +options: + -all remove all platforms directories. + -current clean the current platform ($WM_OPTIONS). + -help print the usage -# clean various packages via 'distclean' -for i in openmpi-* +Cleanup intermediate build directories. +Optionally remove specified platform(s) from the ThirdParty platforms +directory $WM_THIRD_PARTY_DIR/platforms + +USAGE + exit 1 +} + +# Print help message +if [ "$1" = "-h" -o "$1" = "-help" ]; then + usage +fi + +#------------------------------------------------------------------------------ + +# Clean various packages via 'distclean' +for i in openmpi-* ADIOS-* do - [ -d "$i" ] && ( set -x; cd $i && make distclean ) + [ -d "$i" ] && ( + echo + echo "${i%/*}" + echo " make distclean" + echo + cd $i && make distclean + ) done -# clean various packages via 'realclean' +# Clean various packages via 'realclean' for i in scotch*/src do - [ -d "$i" ] && ( set -x; cd $i && make realclean ) + [ -d "$i" ] && ( + echo + echo "${i%/*}" + echo " make realclean" + echo + cd $i && make realclean + ) done -# clean out-of-source build directories -[ -d platforms ] && ( set -x; rm -rf platforms/* ) +# Clean out-of-source build directories +if [ -d build ] +then + echo + echo "Clean build/ directory" + rm -rf build/* +fi + +# ----------------------------------------------------------------------------- + +# +# Clean platforms directories +# +if [ "$#" -ge 1 ] +then + echo + echo "Clean platforms/sub-directories" +fi + +removePlatform() +{ + local platform="$1" + if [ -n "$platform" -a -d "platforms/$platform" ] + then + echo + echo "Cleaning platform '$platform'" + \rm -rf "platforms/$platform" + else + echo + echo "Platform '$platform' not built" + fi +} -# ----------------------------------------------------------------- end-of-file +# Optionally cleanup platforms specified from the arguments +while [ "$#" -ge 1 ] +do + case "$1" in + -all) + echo + echo "Removing all platforms/sub-directories" + echo + \rm -rf platforms/* + break + ;; + + -current) + echo "Current platform '$WM_OPTIONS'" + removePlatform "$WM_OPTIONS" + ;; + + *) + removePlatform "$1" + ;; + esac + shift +done + +#------------------------------------------------------------------------------ diff --git a/Allwmake b/Allwmake index 1b06a50..9a8c381 100755 --- a/Allwmake +++ b/Allwmake @@ -3,8 +3,8 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation -# \\/ M anipulation | +# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -56,12 +56,12 @@ echo echo ======================================== echo Start ThirdParty Allwmake echo ======================================== + + echo - - echo ======================================== echo Build MPI libraries if required -echo +echo " $MPI_ARCH_PATH" case "$WM_MPLIB" in OPENMPI) if [ -r $MPI_ARCH_PATH/lib${WM_COMPILER_LIB_ARCH}/libmpi.so ] @@ -74,24 +74,34 @@ OPENMPI) echo else ( - set -x - cd "${MPI_ARCH_PATH##*/}" || exit 1 # change to openmpi-VERSION - - make distclean 2>/dev/null - rm -rf $MPI_ARCH_PATH - - # start with GridEngine support, - # it can be built without external libraries + # configuration options: + # Start with GridEngine support - builds without external libraries configOpt="--with-sge" - # Infiniband support - # if [ -d /usr/local/ofed -a -d /usr/local/ofed/lib64 ] - # then - # configOpt="$configOpt --with-openib=/usr/local/ofed" - # configOpt="$configOpt --with-openib-libdir=/usr/local/ofed/lib64" - # fi + # Add InfiniBand support + ibDir=/usr/local/ofed + ibLib=$infbDIR/lib${WM_COMPILER_LIB_ARCH} + if [ -d "$ibDir" -a -d "$ibLib" ] + then + configOpt="$configOpt --with-verbs=$ibDir --with-verbs-lib=$ibLib" + fi - ./configure \ + # end of configuration options + # ---------------------------- + mpiPACKAGE="${MPI_ARCH_PATH##*/}" + sourceDIR=$WM_THIRD_PARTY_DIR/$mpiPACKAGE + buildDIR=$buildBASE/$mpiPACKAGE + + cd $sourceDIR || exit 1 + [ -e Makefile ] && make distclean 2>/dev/null + + rm -rf $MPI_ARCH_PATH + rm -rf $buildDIR + mkdir -p $buildDIR + cd $buildDIR + + set -x + $sourceDIR/configure \ --prefix=$MPI_ARCH_PATH \ --disable-orterun-prefix-by-default \ --enable-shared --disable-static \ @@ -99,11 +109,13 @@ OPENMPI) --enable-mpi-fortran=none \ --disable-mpi-profile \ $configOpt \ - ; - - make -j $WM_NCOMPPROCS && make install - make distclean - ) + && make -j $WM_NCOMPPROCS \ + && make install \ + && echo "Built: $mpiPACKAGE" + ) || { + echo "Error building: $mpiPACKAGE" + exit 1 + } fi ;; @@ -112,19 +124,20 @@ MPICH) then echo " have $WM_MPLIB shared library ($FOAM_MPI)" echo - echo elif [ -r $MPI_ARCH_PATH/lib/libmpich.a ] then echo " have $WM_MPLIB static library ($FOAM_MPI)" echo else ( + # WARNING: unmaintained build code: + # --------------------------------- set -x cd $MPI_HOME || exit 1 # change to mpich-VERSION - make distclean 2>/dev/null + [ -e Makefile ] && make distclean 2>/dev/null rm -rf $MPI_ARCH_PATH - rm util/machines/machines.* + rm -rf util/machines/machines.* ./configure \ --prefix=$MPI_ARCH_PATH \ @@ -172,23 +185,26 @@ MPICH) esac +#------------------------------------------------------------------------------ +# building scotch is still a bit of a pain + # get SCOTCH_VERSION, SCOTCH_ARCH_PATH -if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/scotch.sh` +if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) then . $settings else echo - echo "Error: no config/scotch.sh settings" + echo "Error: no config.sh/scotch settings" echo fi -# building scotch is still a bit of a pain +echo echo ======================================== echo "Build Scotch decomposition library $SCOTCH_VERSION" echo " $SCOTCH_ARCH_PATH" # this needs generalizing -scotchMakefile=../../etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-$WM_ARCH_OPTION$WM_LABEL_OPTION +scotchMakefile=../../etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM if [ -f $SCOTCH_ARCH_PATH/include/scotch.h \ -a -r $FOAM_EXT_LIBBIN/libscotch.so \ @@ -196,11 +212,11 @@ if [ -f $SCOTCH_ARCH_PATH/include/scotch.h \ then echo " scotch header in $SCOTCH_ARCH_PATH/include" echo " scotch libs in $FOAM_EXT_LIBBIN" - echo -else +elif [ -d "$SCOTCH_VERSION" ] +then ( - set -x cd $SCOTCH_VERSION/src || exit 1 + applyPatch $SCOTCH_VERSION .. # patch at parent-level prefixDIR=$SCOTCH_ARCH_PATH libDIR=$FOAM_EXT_LIBBIN @@ -233,23 +249,24 @@ else # cleanup, could also remove Makefile.inc make realclean 2>/dev/null ) +else + echo " Optional component (SCOTCH) was not found" fi -# verify existence of scotch include -[ -f $SCOTCH_ARCH_PATH/include/scotch.h ] || { - echo - echo " WARNING: required include file 'scotch.h' not found!" - echo -} - - # build ptscotch if MPI (ThirdParty or system) is available -if [ "${FOAM_MPI:-dummy}" != dummy ] -then - echo ======================================== - echo "Build PTScotch decomposition library $SCOTCH_VERSION (uses MPI)" - echo " $SCOTCH_ARCH_PATH" +# and there is a scotch include available (ie, normal scotch was built) +if [ "${FOAM_MPI:-dummy}" != dummy ] && \ + [ -f $SCOTCH_ARCH_PATH/include/scotch.h ] || \ +{ echo + echo " WARNING: skipping pt-scotch - 'scotch.h' include file not found!" + false +} +then + echo + echo ======================================== + echo "Build pt-scotch decomposition library $SCOTCH_VERSION (with $FOAM_MPI)" + echo " $SCOTCH_ARCH_PATH" if [ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h \ -a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libptscotch.so \ @@ -257,9 +274,9 @@ then then echo " ptscotch header in $SCOTCH_ARCH_PATH/include/$FOAM_MPI" echo " ptscotch libs in $FOAM_EXT_LIBBIN/$FOAM_MPI" - echo else ( + echo set -x cd $SCOTCH_VERSION/src || exit 1 @@ -301,19 +318,19 @@ then [ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h ] || { echo echo " WARNING: required include file 'ptscotch.h' not found!" - echo } fi -# ----------------------------------------------------------------------------- +#------------------------------------------------------------------------------ # Metis is optional +echo echo ======================================== echo Build Metis decomposition # get METIS_VERSION, METIS_ARCH_PATH -if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/metis.sh` +if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) then . $settings fi @@ -330,39 +347,105 @@ then ( set -x cd $METIS_VERSION || exit 1 + + if [ "$WM_PRECISION_OPTION" = "DP" ] + then + FLOAT_PRECISION=64 + elif [ "$WM_PRECISION_OPTION" = "SP" ] + then + FLOAT_PRECISION=32 + else + echo " Metis pre-configure error:" + echo " WM_PRECISION_OPTION is neither DP nor SP" + exit 1 + fi + + # Change user settings automatically + sed -i -e 's=\(#define IDXTYPEWIDTH\).*=\1 '$WM_LABEL_SIZE'=' \ + -e 's=\(#define REALTYPEWIDTH\).*=\1 '$FLOAT_PRECISION'=' \ + include/metis.h + make config shared=1 prefix=$METIS_ARCH_PATH make -j $WM_NCOMPPROCS install cp $METIS_ARCH_PATH/lib/libmetis.so $FOAM_EXT_LIBBIN ) fi else - echo " optional component Metis was not found" + echo " Optional component (METIS) was not found" fi +#------------------------------------------------------------------------------ + +warnBuildIssues() +{ + echo + echo " ---------------------------------------------------" + echo " Optional component ($1) had build issues" + echo " OpenFOAM will nonetheless remain largely functional" + echo " ---------------------------------------------------" + echo +} + +warnNotFound() +{ + echo " Optional component ($1) was not found" + echo +} + + # CGAL is optional +echo echo ======================================== echo Build CGAL -if [ -n "$CGAL_ARCH_PATH" ] +if [ -d "$CGAL_ARCH_PATH/include" \ + -a -r "$CGAL_ARCH_PATH/lib/libCGAL.so" ] then -( - if [ -r $CGAL_ARCH_PATH/lib/libCGAL.so ] + # first some information about boost + if [ -d "$BOOST_ARCH_PATH/include/boost" \ + -a -r "$BOOST_ARCH_PATH/lib/libboost_system.so" ] then - echo " CGAL headers in $CGAL_ARCH_PATH/include" - echo " CGAL libs in $CGAL_ARCH_PATH/lib" - else - ./makeCGAL + echo " BOOST headers in $BOOST_ARCH_PATH/include" + echo " BOOST libs in $BOOST_ARCH_PATH/lib" + elif [ -d "/usr/include/boost" \ + -a -r "/usr/lib${WM_COMPILER_LIB_ARCH}/libboost_system.so" ] + then + echo " BOOST headers in /usr/include" + echo " BOOST libs in /usr/lib${WM_COMPILER_LIB_ARCH}" fi -) + echo " CGAL headers in $CGAL_ARCH_PATH/include" + echo " CGAL libs in $CGAL_ARCH_PATH/lib" +elif [ -n "$CGAL_ARCH_PATH" ] +then + ./makeCGAL || warnBuildIssues CGAL else - echo " optional component was not found" + warnNotFound CGAL fi + +# FFTW is optional +echo +echo ======================================== +echo Build FFTW +if [ -d "$FFTW_ARCH_PATH/include" \ + -a -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3.so" ] +then + echo " FFTW headers in $FFTW_ARCH_PATH/include" + echo " FFTW libs in $FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" +elif [ -n "$FFTW_ARCH_PATH" ] +then + ./makeFFTW || warnBuildIssues FFTW +else + warnNotFound FFTW +fi + + +#------------------------------------------------------------------------------ + echo echo ======================================== echo Done ThirdParty Allwmake echo ======================================== echo - -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/AllwmakeLibccmio b/AllwmakeLibccmio deleted file mode 100755 index a3473a5..0000000 --- a/AllwmakeLibccmio +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2011 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 . -# -# Script -# AllwmakeLibccmio -# -# Description -# Get and build CD-adapco's ccmio library -# -#------------------------------------------------------------------------------ -packageDir=libccmio-2.6.1 - -#------------------------------------------------------------------------------ -# run from third-party directory only -cd ${0%/*} || exit 1 -wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { - echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR" - echo " The environment variables are inconsistent with the installation." - echo " Check the OpenFOAM entries in your dot-files and source them." - exit 1 -} -. etc/tools/ThirdPartyFunctions -#------------------------------------------------------------------------------ - -usage() -{ - cat< - - - -OpenFOAM-3.0.x Third-Party packages - - - - - - - -
-

OpenFOAM-3.0.x Third-Party packages

- - -
-

1 Description

-
-

-Scripts for building third-party packages. -

-
-
-
-

2 Order of execution:

-
-
    -
  • makeGcc (recommended if the system gcc is < 4.7) -
  • -
  • Allwmake (Builds OpenMPI, Scotch etc.) -
  • -
  • makeCmake (if the system cmake version is < 2.8.8) -
  • -
  • makeParaView4 -
  • -
-
-
-

2.1 Optional

-
-
    -
  • AllwmakeLibccmio (Only required for conversion of STAR-CCM+ meshes) -
  • -
  • Allclean (Only required to save disk space) -
  • -
-
-
-
- -
-

4 Notes

-
-
-

4.1 Building ParaView-4.3.1/4.4.0

-
-

-The ParaView-4.3.1/4.4.0 source-pack provided by KitWare will not build and -install correctly without a minor correction: lines 653-656 must be removed -or commented from file -ThirdParty-3.0.0/ParaView-4.?.?/Qt/Components/CMakeLists.txt after -unpacking and renaming the ParaView-4.?.? directory. This is because the -file ui_pqExportStateWizard.h referred to in the lines 653-656: -

-
- -
if(PARAVIEW_INSTALL_DEVELOPMENT_FILES)
-  install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h"
-          DESTINATION "${VTK_INSTALL_INCLUDE_DIR}")
-endif()
-
-
-

-does not exist and cannot be installed causing the build and installation to -fail. -

- -

-Additionally for ParaView-4.4.0 there is a bug in the STL reader which can -be patched by running the following command from within the ThirdParty-??? -directory: -

- -

-See also http://www.openfoam.org/mantisbt/view.php?id=1887 -

-
-
- -
-

4.2 Building ParaView-4.1.0

-
-

-On Ubuntu 14.10 and higher, OpenSuSE 13.2 and probably other recent -GNU/Linux distributions there is an issue in the GL libraries requiring a -change to the vtkXOpenGLRenderWindow.cxx file in ParaView: Uncomment line 30 -

- -

-#define GLX_GLXEXT_LEGACY -

-
-
-
-
-
-

Date: 3rd November 2015

-

Created: 2015-11-03 Tue 17:54

-

Emacs 24.5 (Org mode 8.2.10)

-

Validate

-
- - diff --git a/README.org b/README.org index 01f8d50..88768f6 100644 --- a/README.org +++ b/README.org @@ -1,51 +1,61 @@ # -*- mode: org; -*- # -#+TITLE: OpenFOAM-3.0.x Third-Party packages -#+AUTHOR: The OpenFOAM Foundation -#+DATE: 3rd November 2015 +#+TITLE: OpenFOAM Third-Party packages +#+AUTHOR: The OpenFOAM Foundation / OpenCFD Ltd. +#+DATE: 2016-06-28 #+LINK: http://www.openfoam.org #+OPTIONS: author:nil ^:{} -# Copyright (c) 2015 OpenFOAM Foundation. +# Copyright (c) 2014-2016 OpenFOAM Foundation. +# Copyright (c) 2016 OpenCFD Ltd. * Description Scripts for building third-party packages. -* Order of execution: +* Build Order: + makeGcc (recommended if the system gcc is < 4.7) + Allwmake (Builds OpenMPI, Scotch etc.) + makeCmake (if the system cmake version is < 2.8.8) - + makeParaView4 -*** Optional - + AllwmakeLibccmio (Only required for conversion of STAR-CCM+ meshes) - + Allclean (Only required to save disk space) + + makeParaView +*** Optional Build Components: + + makeLLVM (Replaces makeGcc in the above description + - to use clang as compiler) + + makeCCMIO (Only required for conversion of STAR-CCM+ meshes) + + Allclean (Only required to save disk space) * Versions and locations to download the third party packages *** Gcc C++ Compiler The minimum version of gcc required is 4.5.0 + gcc http://gcc.gnu.org/releases.html + gmp http://gmplib.org/ - ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.2.tar.bz2 + ftp://ftp.gnu.org/gnu/gmp/gmp-6.1.0.tar.bz2 + mpfr http://www.mpfr.org/ - ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.2.tar.bz2 + ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.4.tar.bz2 + mpc http://www.multiprecision.org/ - http://www.multiprecision.org/mpc/download/mpc-1.0.1.tar.gz + ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz *** Parallel Processing - + OpenMPI: http://www.open-mpi.org/software/ompi/v1.10/downloads/openmpi-1.10.0.tar.bz2 - + Scotch/PtScotch: https://gforge.inria.fr/frs/download.php/file/34099/scotch_6.0.3.tar.gz +***** Scotch + + Scotch/PtScotch: https://gforge.inria.fr/frs/download.php/file/34099/scotch_6.0.3.tar.gz +***** OpenMPI + + OpenMPI: http://www.open-mpi.org/software/ompi/v1.10/downloads/openmpi-1.10.2.tar.bz2 *** ParaView - + cmake http://www.cmake.org/files/v3.2/cmake-3.2.1.tar.gz - + ParaView http://www.paraview.org/files/v4.4/ParaView-v4.4.0-source.tar.gz + + cmake http://www.cmake.org/files/v3.5/cmake-3.5.2.tar.gz + + ParaView-4.4.0 http://www.paraview.org/files/v4.4/ParaView-v4.4.0-source.tar.gz + + ParaView-5.0.1 http://www.paraview.org/files/v5.0/ParaView-v5.0.1-source.tar.gz + but may need patching to compile (See [[Notes]]). *** CGAL - + CGAL https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.7/CGAL-4.7.tar.xz - + boost http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.bz2/download + + CGAL https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.8/CGAL-4.8.tar.xz + + CGAL https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.8.1/CGAL-4.8.1.tar.xz + + boost https://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2/download *** Miscellaneous + + FFTW http://www.fftw.org/fftw-3.3.4.tar.gz + libccmio http://portal.nersc.gov/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz * Notes -*** Building ParaView-4.3.1/4.4.0 - The ParaView-4.3.1/4.4.0 source-pack provided by KitWare will not build and - install correctly without a minor correction: lines 653-656 must be removed - or commented from file - /ThirdParty-3.0.0/ParaView-4.?.?/Qt/Components/CMakeLists.txt/ after - unpacking and renaming the ParaView-4.?.? directory. This is because the - file ui_pqExportStateWizard.h referred to in the lines 653-656: +*** Building ParaView-4.3.1/4.4.0/5.0.0/5.0.1 + The ParaView-4.3.1/4.4.0/5.0.0 source-pack provided by KitWare will not + build and install correctly without a minor correction: lines 653-656 + (650-653 in ParaView-5.0.0, 659-662 in ParaView-5.0.1) must be removed or + commented from file + /ThirdParty-???/ParaView-[45].?.?/Qt/Components/CMakeLists.txt/ after + unpacking and renaming the ParaView-[45].?.? directory. This is because the + file ui_pqExportStateWizard.h referred to in #+begin_src C if(PARAVIEW_INSTALL_DEVELOPMENT_FILES) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h" @@ -55,12 +65,28 @@ does not exist and cannot be installed causing the build and installation to fail. - Additionally for ParaView-4.4.0 there is a bug in the STL reader which can - be patched by running the following command from within the ThirdParty-??? - directory: - + wget https://raw.githubusercontent.com/Kitware/VTK/40937e934308e5009e80769dc0c451ee4f157749/IO/Geometry/vtkSTLReader.cxx -O ParaView-4.4.0/VTK/IO/Geometry/vtkSTLReader.cxx - See also http://www.openfoam.org/mantisbt/view.php?id=1887 + Additionally for ParaView-4.4.0 there is a bug in the STL reader. + (see http://www.openfoam.org/mantisbt/view.php?id=1887). + For ParaView-4.4.0 and ParaView-5.0.1, + the necessary patches are supplied with the ThirdParty repository + (see the etc/patches directory) and are applied when building paraview. + +*** Building ParaView-5.0.1 with gcc-6.1.0 +***** Add support for gcc-6.?.? + The following cmake files + + ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake + + ParaView-5.0.1/VTK/CMake/GenerateExportHeader.cmake + specifically limit the gcc versions supported. + To add support gcc-6.?.? replace the '[345]' with '[3456]'. + + This patch is also supplied with the ThirdParty repository and + applied when building paraview. + +***** SciberQuestToolKit + The SciberQuestToolKit plugin fails to compile with gcc-6.1.0 and causes + the compilation of ParaView to halt. The easiest solution is to delete + the ParaView-5.0.1/Plugins/SciberQuestToolKit directory. *** Building ParaView-4.1.0 On Ubuntu 14.10 and higher, OpenSuSE 13.2 and probably other recent GNU/Linux distributions there is an issue in the GL libraries requiring a diff --git a/README_scotch b/README_scotch new file mode 100644 index 0000000..f61dec9 --- /dev/null +++ b/README_scotch @@ -0,0 +1,543 @@ +OpenFOAM uses shared object libraries from the Scotch/PT-Scotch software: +https://www.labri.fr/perso/pelegrin/scotch/ + +The software is licensed under the CeCILL-C Free Software Licence +Agreement, a copy of which is reproduced below. + +Please note the limitation of both the Licensor's warranty and liability +as set forth in Articles 8 and 9 of the Agreement. + +If only the object libraries of Scotch are provided, the full source code +can be obtained from: + +http://gforge.inria.fr/projects/scotch/ + Home page of the SCOTCH project repository. + +http://gforge.inria.fr/frs/?group_id=248 + File download section of the SCOTCH project repository, + where source tarballs can be downloaded from. + +http://gforge.inria.fr/scm/?group_id=248 + Source code repository of the SCOTCH project. + +http://gforge.inria.fr/docman/?group_id=248 + Documentation regarding the SCOTCH project. + +--- + +CeCILL-C FREE SOFTWARE LICENSE AGREEMENT + + + Notice + +This Agreement is a Free Software license agreement that is the result +of discussions between its authors in order to ensure compliance with +the two main principles guiding its drafting: + + * firstly, compliance with the principles governing the distribution + of Free Software: access to source code, broad rights granted to + users, + * secondly, the election of a governing law, French law, with which + it is conformant, both as regards the law of torts and + intellectual property law, and the protection that it offers to + both authors and holders of the economic rights over software. + +The authors of the CeCILL-C (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre]) +license are: + +Commissariat à l'Energie Atomique - CEA, a public scientific, technical +and industrial research establishment, having its principal place of +business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France. + +Centre National de la Recherche Scientifique - CNRS, a public scientific +and technological establishment, having its principal place of business +at 3 rue Michel-Ange, 75794 Paris cedex 16, France. + +Institut National de Recherche en Informatique et en Automatique - +INRIA, a public scientific and technological establishment, having its +principal place of business at Domaine de Voluceau, Rocquencourt, BP +105, 78153 Le Chesnay cedex, France. + + + Preamble + +The purpose of this Free Software license agreement is to grant users +the right to modify and re-use the software governed by this license. + +The exercising of this right is conditional upon the obligation to make +available to the community the modifications made to the source code of +the software so as to contribute to its evolution. + +In consideration of access to the source code and the rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors only have limited liability. + +In this respect, the risks associated with loading, using, modifying +and/or developing or reproducing the software by the user are brought to +the user's attention, given its Free Software status, which may make it +complicated to use, with the result that its use is reserved for +developers and experienced professionals having in-depth computer +knowledge. Users are therefore encouraged to load and test the +suitability of the software as regards their requirements in conditions +enabling the security of their systems and/or data to be ensured and, +more generally, to use and operate it in the same conditions of +security. This Agreement may be freely reproduced and published, +provided it is not altered, and that no provisions are either added or +removed herefrom. + +This Agreement may apply to any or all software for which the holder of +the economic rights decides to submit the use thereof to its provisions. + + + Article 1 - DEFINITIONS + +For the purpose of this Agreement, when the following expressions +commence with a capital letter, they shall have the following meaning: + +Agreement: means this license agreement, and its possible subsequent +versions and annexes. + +Software: means the software in its Object Code and/or Source Code form +and, where applicable, its documentation, "as is" when the Licensee +accepts the Agreement. + +Initial Software: means the Software in its Source Code and possibly its +Object Code form and, where applicable, its documentation, "as is" when +it is first distributed under the terms and conditions of the Agreement. + +Modified Software: means the Software modified by at least one +Integrated Contribution. + +Source Code: means all the Software's instructions and program lines to +which access is required so as to modify the Software. + +Object Code: means the binary files originating from the compilation of +the Source Code. + +Holder: means the holder(s) of the economic rights over the Initial +Software. + +Licensee: means the Software user(s) having accepted the Agreement. + +Contributor: means a Licensee having made at least one Integrated +Contribution. + +Licensor: means the Holder, or any other individual or legal entity, who +distributes the Software under the Agreement. + +Integrated Contribution: means any or all modifications, corrections, +translations, adaptations and/or new functions integrated into the +Source Code by any or all Contributors. + +Related Module: means a set of sources files including their +documentation that, without modification to the Source Code, enables +supplementary functions or services in addition to those offered by the +Software. + +Derivative Software: means any combination of the Software, modified or +not, and of a Related Module. + +Parties: mean both the Licensee and the Licensor. + +These expressions may be used both in singular and plural form. + + + Article 2 - PURPOSE + +The purpose of the Agreement is the grant by the Licensor to the +Licensee of a non-exclusive, transferable and worldwide license for the +Software as set forth in Article 5 hereinafter for the whole term of the +protection granted by the rights over said Software. + + + Article 3 - ACCEPTANCE + +3.1 The Licensee shall be deemed as having accepted the terms and +conditions of this Agreement upon the occurrence of the first of the +following events: + + * (i) loading the Software by any or all means, notably, by + downloading from a remote server, or by loading from a physical + medium; + * (ii) the first time the Licensee exercises any of the rights + granted hereunder. + +3.2 One copy of the Agreement, containing a notice relating to the +characteristics of the Software, to the limited warranty, and to the +fact that its use is restricted to experienced users has been provided +to the Licensee prior to its acceptance as set forth in Article 3.1 +hereinabove, and the Licensee hereby acknowledges that it has read and +understood it. + + + Article 4 - EFFECTIVE DATE AND TERM + + + 4.1 EFFECTIVE DATE + +The Agreement shall become effective on the date when it is accepted by +the Licensee as set forth in Article 3.1. + + + 4.2 TERM + +The Agreement shall remain in force for the entire legal term of +protection of the economic rights over the Software. + + + Article 5 - SCOPE OF RIGHTS GRANTED + +The Licensor hereby grants to the Licensee, who accepts, the following +rights over the Software for any or all use, and for the term of the +Agreement, on the basis of the terms and conditions set forth hereinafter. + +Besides, if the Licensor owns or comes to own one or more patents +protecting all or part of the functions of the Software or of its +components, the Licensor undertakes not to enforce the rights granted by +these patents against successive Licensees using, exploiting or +modifying the Software. If these patents are transferred, the Licensor +undertakes to have the transferees subscribe to the obligations set +forth in this paragraph. + + + 5.1 RIGHT OF USE + +The Licensee is authorized to use the Software, without any limitation +as to its fields of application, with it being hereinafter specified +that this comprises: + + 1. permanent or temporary reproduction of all or part of the Software + by any or all means and in any or all form. + + 2. loading, displaying, running, or storing the Software on any or + all medium. + + 3. entitlement to observe, study or test its operation so as to + determine the ideas and principles behind any or all constituent + elements of said Software. This shall apply when the Licensee + carries out any or all loading, displaying, running, transmission + or storage operation as regards the Software, that it is entitled + to carry out hereunder. + + + 5.2 RIGHT OF MODIFICATION + +The right of modification includes the right to translate, adapt, +arrange, or make any or all modifications to the Software, and the right +to reproduce the resulting software. It includes, in particular, the +right to create a Derivative Software. + +The Licensee is authorized to make any or all modification to the +Software provided that it includes an explicit notice that it is the +author of said modification and indicates the date of the creation thereof. + + + 5.3 RIGHT OF DISTRIBUTION + +In particular, the right of distribution includes the right to publish, +transmit and communicate the Software to the general public on any or +all medium, and by any or all means, and the right to market, either in +consideration of a fee, or free of charge, one or more copies of the +Software by any means. + +The Licensee is further authorized to distribute copies of the modified +or unmodified Software to third parties according to the terms and +conditions set forth hereinafter. + + + 5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION + +The Licensee is authorized to distribute true copies of the Software in +Source Code or Object Code form, provided that said distribution +complies with all the provisions of the Agreement and is accompanied by: + + 1. a copy of the Agreement, + + 2. a notice relating to the limitation of both the Licensor's + warranty and liability as set forth in Articles 8 and 9, + +and that, in the event that only the Object Code of the Software is +redistributed, the Licensee allows effective access to the full Source +Code of the Software at a minimum during the entire period of its +distribution of the Software, it being understood that the additional +cost of acquiring the Source Code shall not exceed the cost of +transferring the data. + + + 5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE + +When the Licensee makes an Integrated Contribution to the Software, the +terms and conditions for the distribution of the resulting Modified +Software become subject to all the provisions of this Agreement. + +The Licensee is authorized to distribute the Modified Software, in +source code or object code form, provided that said distribution +complies with all the provisions of the Agreement and is accompanied by: + + 1. a copy of the Agreement, + + 2. a notice relating to the limitation of both the Licensor's + warranty and liability as set forth in Articles 8 and 9, + +and that, in the event that only the object code of the Modified +Software is redistributed, the Licensee allows effective access to the +full source code of the Modified Software at a minimum during the entire +period of its distribution of the Modified Software, it being understood +that the additional cost of acquiring the source code shall not exceed +the cost of transferring the data. + + + 5.3.3 DISTRIBUTION OF DERIVATIVE SOFTWARE + +When the Licensee creates Derivative Software, this Derivative Software +may be distributed under a license agreement other than this Agreement, +subject to compliance with the requirement to include a notice +concerning the rights over the Software as defined in Article 6.4. +In the event the creation of the Derivative Software required modification +of the Source Code, the Licensee undertakes that: + + 1. the resulting Modified Software will be governed by this Agreement, + 2. the Integrated Contributions in the resulting Modified Software + will be clearly identified and documented, + 3. the Licensee will allow effective access to the source code of the + Modified Software, at a minimum during the entire period of + distribution of the Derivative Software, such that such + modifications may be carried over in a subsequent version of the + Software; it being understood that the additional cost of + purchasing the source code of the Modified Software shall not + exceed the cost of transferring the data. + + + 5.3.4 COMPATIBILITY WITH THE CeCILL LICENSE + +When a Modified Software contains an Integrated Contribution subject to +the CeCILL license agreement, or when a Derivative Software contains a +Related Module subject to the CeCILL license agreement, the provisions +set forth in the third item of Article 6.4 are optional. + + + Article 6 - INTELLECTUAL PROPERTY + + + 6.1 OVER THE INITIAL SOFTWARE + +The Holder owns the economic rights over the Initial Software. Any or +all use of the Initial Software is subject to compliance with the terms +and conditions under which the Holder has elected to distribute its work +and no one shall be entitled to modify the terms and conditions for the +distribution of said Initial Software. + +The Holder undertakes that the Initial Software will remain ruled at +least by this Agreement, for the duration set forth in Article 4.2. + + + 6.2 OVER THE INTEGRATED CONTRIBUTIONS + +The Licensee who develops an Integrated Contribution is the owner of the +intellectual property rights over this Contribution as defined by +applicable law. + + + 6.3 OVER THE RELATED MODULES + +The Licensee who develops a Related Module is the owner of the +intellectual property rights over this Related Module as defined by +applicable law and is free to choose the type of agreement that shall +govern its distribution under the conditions defined in Article 5.3.3. + + + 6.4 NOTICE OF RIGHTS + +The Licensee expressly undertakes: + + 1. not to remove, or modify, in any manner, the intellectual property + notices attached to the Software; + + 2. to reproduce said notices, in an identical manner, in the copies + of the Software modified or not; + + 3. to ensure that use of the Software, its intellectual property + notices and the fact that it is governed by the Agreement is + indicated in a text that is easily accessible, specifically from + the interface of any Derivative Software. + +The Licensee undertakes not to directly or indirectly infringe the +intellectual property rights of the Holder and/or Contributors on the +Software and to take, where applicable, vis-à-vis its staff, any and all +measures required to ensure respect of said intellectual property rights +of the Holder and/or Contributors. + + + Article 7 - RELATED SERVICES + +7.1 Under no circumstances shall the Agreement oblige the Licensor to +provide technical assistance or maintenance services for the Software. + +However, the Licensor is entitled to offer this type of services. The +terms and conditions of such technical assistance, and/or such +maintenance, shall be set forth in a separate instrument. Only the +Licensor offering said maintenance and/or technical assistance services +shall incur liability therefor. + +7.2 Similarly, any Licensor is entitled to offer to its licensees, under +its sole responsibility, a warranty, that shall only be binding upon +itself, for the redistribution of the Software and/or the Modified +Software, under terms and conditions that it is free to decide. Said +warranty, and the financial terms and conditions of its application, +shall be subject of a separate instrument executed between the Licensor +and the Licensee. + + + Article 8 - LIABILITY + +8.1 Subject to the provisions of Article 8.2, the Licensee shall be +entitled to claim compensation for any direct loss it may have suffered +from the Software as a result of a fault on the part of the relevant +Licensor, subject to providing evidence thereof. + +8.2 The Licensor's liability is limited to the commitments made under +this Agreement and shall not be incurred as a result of in particular: +(i) loss due the Licensee's total or partial failure to fulfill its +obligations, (ii) direct or consequential loss that is suffered by the +Licensee due to the use or performance of the Software, and (iii) more +generally, any consequential loss. In particular the Parties expressly +agree that any or all pecuniary or business loss (i.e. loss of data, +loss of profits, operating loss, loss of customers or orders, +opportunity cost, any disturbance to business activities) or any or all +legal proceedings instituted against the Licensee by a third party, +shall constitute consequential loss and shall not provide entitlement to +any or all compensation from the Licensor. + + + Article 9 - WARRANTY + +9.1 The Licensee acknowledges that the scientific and technical +state-of-the-art when the Software was distributed did not enable all +possible uses to be tested and verified, nor for the presence of +possible defects to be detected. In this respect, the Licensee's +attention has been drawn to the risks associated with loading, using, +modifying and/or developing and reproducing the Software which are +reserved for experienced users. + +The Licensee shall be responsible for verifying, by any or all means, +the suitability of the product for its requirements, its good working +order, and for ensuring that it shall not cause damage to either persons +or properties. + +9.2 The Licensor hereby represents, in good faith, that it is entitled +to grant all the rights over the Software (including in particular the +rights set forth in Article 5). + +9.3 The Licensee acknowledges that the Software is supplied "as is" by +the Licensor without any other express or tacit warranty, other than +that provided for in Article 9.2 and, in particular, without any warranty +as to its commercial value, its secured, safe, innovative or relevant +nature. + +Specifically, the Licensor does not warrant that the Software is free +from any error, that it will operate without interruption, that it will +be compatible with the Licensee's own equipment and software +configuration, nor that it will meet the Licensee's requirements. + +9.4 The Licensor does not either expressly or tacitly warrant that the +Software does not infringe any third party intellectual property right +relating to a patent, software or any other property right. Therefore, +the Licensor disclaims any and all liability towards the Licensee +arising out of any or all proceedings for infringement that may be +instituted in respect of the use, modification and redistribution of the +Software. Nevertheless, should such proceedings be instituted against +the Licensee, the Licensor shall provide it with technical and legal +assistance for its defense. Such technical and legal assistance shall be +decided on a case-by-case basis between the relevant Licensor and the +Licensee pursuant to a memorandum of understanding. The Licensor +disclaims any and all liability as regards the Licensee's use of the +name of the Software. No warranty is given as regards the existence of +prior rights over the name of the Software or as regards the existence +of a trademark. + + + Article 10 - TERMINATION + +10.1 In the event of a breach by the Licensee of its obligations +hereunder, the Licensor may automatically terminate this Agreement +thirty (30) days after notice has been sent to the Licensee and has +remained ineffective. + +10.2 A Licensee whose Agreement is terminated shall no longer be +authorized to use, modify or distribute the Software. However, any +licenses that it may have granted prior to termination of the Agreement +shall remain valid subject to their having been granted in compliance +with the terms and conditions hereof. + + + Article 11 - MISCELLANEOUS + + + 11.1 EXCUSABLE EVENTS + +Neither Party shall be liable for any or all delay, or failure to +perform the Agreement, that may be attributable to an event of force +majeure, an act of God or an outside cause, such as defective +functioning or interruptions of the electricity or telecommunications +networks, network paralysis following a virus attack, intervention by +government authorities, natural disasters, water damage, earthquakes, +fire, explosions, strikes and labor unrest, war, etc. + +11.2 Any failure by either Party, on one or more occasions, to invoke +one or more of the provisions hereof, shall under no circumstances be +interpreted as being a waiver by the interested Party of its right to +invoke said provision(s) subsequently. + +11.3 The Agreement cancels and replaces any or all previous agreements, +whether written or oral, between the Parties and having the same +purpose, and constitutes the entirety of the agreement between said +Parties concerning said purpose. No supplement or modification to the +terms and conditions hereof shall be effective as between the Parties +unless it is made in writing and signed by their duly authorized +representatives. + +11.4 In the event that one or more of the provisions hereof were to +conflict with a current or future applicable act or legislative text, +said act or legislative text shall prevail, and the Parties shall make +the necessary amendments so as to comply with said act or legislative +text. All other provisions shall remain effective. Similarly, invalidity +of a provision of the Agreement, for any reason whatsoever, shall not +cause the Agreement as a whole to be invalid. + + + 11.5 LANGUAGE + +The Agreement is drafted in both French and English and both versions +are deemed authentic. + + + Article 12 - NEW VERSIONS OF THE AGREEMENT + +12.1 Any person is authorized to duplicate and distribute copies of this +Agreement. + +12.2 So as to ensure coherence, the wording of this Agreement is +protected and may only be modified by the authors of the License, who +reserve the right to periodically publish updates or new versions of the +Agreement, each with a separate number. These subsequent versions may +address new issues encountered by Free Software. + +12.3 Any Software distributed under a given version of the Agreement may +only be subsequently distributed under the same version of the Agreement +or a subsequent version. + + + Article 13 - GOVERNING LAW AND JURISDICTION + +13.1 The Agreement is governed by French law. The Parties agree to +endeavor to seek an amicable solution to any disagreements or disputes +that may arise during the performance of the Agreement. + +13.2 Failing an amicable solution within two (2) months as from their +occurrence, and unless emergency proceedings are necessary, the +disagreements or disputes shall be referred to the Paris Courts having +jurisdiction, by the more diligent Party. + + +Version 1.0 dated 2006-09-05. diff --git a/etc/patches/mkdiff-paraview-5.0.1 b/etc/patches/mkdiff-paraview-5.0.1 new file mode 100644 index 0000000..c6a7343 --- /dev/null +++ b/etc/patches/mkdiff-paraview-5.0.1 @@ -0,0 +1,13 @@ +#!/bin/sh + +# simple script to generate patches +paraview=ParaView-5.0.1 + +for i in \ + $paraview/VTK/CMake/vtkCompilerExtras.cmake \ + $paraview/VTK/CMake/GenerateExportHeader.cmake \ + $paraview/Qt/Components/CMakeLists.txt \ + ; +do + diff -uw $i.orig $i +done diff --git a/etc/patches/paraview-4.4.0 b/etc/patches/paraview-4.4.0 new file mode 100644 index 0000000..2c34de3 --- /dev/null +++ b/etc/patches/paraview-4.4.0 @@ -0,0 +1,50 @@ +--- ParaView-4.4.0/VTK/IO/Geometry/vtkSTLReader.cxx.orig 2015-09-11 19:59:24.000000000 +0200 ++++ ParaView-4.4.0/VTK/IO/Geometry/vtkSTLReader.cxx 2016-06-19 12:59:50.769770143 +0200 +@@ -448,7 +448,7 @@ + done = done || (fscanf(fp,"%s", line)==EOF); + } + } +- if (!done) ++ else if (!done) + { + done = (fgets(line, 255, fp) == 0); + lineCount++; +--- ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake.orig 2016-03-28 17:07:10.000000000 +0200 ++++ ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake 2016-06-11 15:10:14.820958942 +0200 +@@ -32,7 +32,7 @@ + OUTPUT_VARIABLE _gcc_version_info + ERROR_VARIABLE _gcc_version_info) + +- string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]*" ++ string (REGEX MATCH "[3-6]\\.[0-9]\\.[0-9]*" + _gcc_version "${_gcc_version_info}") + if(NOT _gcc_version) + string (REGEX REPLACE ".*\\(GCC\\).*([34]\\.[0-9]).*" "\\1.0" +--- ParaView-5.0.1/VTK/CMake/GenerateExportHeader.cmake.orig 2016-03-28 17:07:10.000000000 +0200 ++++ ParaView-5.0.1/VTK/CMake/GenerateExportHeader.cmake 2016-06-11 15:12:16.344357746 +0200 +@@ -166,7 +166,7 @@ + execute_process(COMMAND ${CMAKE_C_COMPILER} ARGS --version + OUTPUT_VARIABLE _gcc_version_info + ERROR_VARIABLE _gcc_version_info) +- string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]*" ++ string(REGEX MATCH "[3-6]\\.[0-9]\\.[0-9]*" + _gcc_version "${_gcc_version_info}") + # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the + # patch level, handle this here: +--- ParaView-5.0.1/Qt/Components/CMakeLists.txt.orig 2016-06-13 09:27:27.827849525 +0200 ++++ ParaView-5.0.1/Qt/Components/CMakeLists.txt 2016-06-13 09:29:28.599318445 +0200 +@@ -656,10 +656,10 @@ + #the pqSGExportStateWizard has subclasses that directly access + #the UI file, and currently we don't have a clean way to break this hard + #dependency, so for no we install this ui file. +-if(PARAVIEW_INSTALL_DEVELOPMENT_FILES) +- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h" +- DESTINATION "${VTK_INSTALL_INCLUDE_DIR}") +-endif() ++#OPENFOAM patch#if(PARAVIEW_INSTALL_DEVELOPMENT_FILES) ++#OPENFOAM patch# install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h" ++#OPENFOAM patch# DESTINATION "${VTK_INSTALL_INCLUDE_DIR}") ++#OPENFOAM patch#endif() + + #IF (NOT PV_INSTALL_NO_DEVELOPMENT) + # # Headers diff --git a/etc/patches/paraview-5.0.1 b/etc/patches/paraview-5.0.1 new file mode 100644 index 0000000..24aceba --- /dev/null +++ b/etc/patches/paraview-5.0.1 @@ -0,0 +1,39 @@ +--- ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake.orig 2016-03-28 17:07:10.000000000 +0200 ++++ ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake 2016-06-11 15:10:14.820958942 +0200 +@@ -32,7 +32,7 @@ + OUTPUT_VARIABLE _gcc_version_info + ERROR_VARIABLE _gcc_version_info) + +- string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]*" ++ string (REGEX MATCH "[3-6]\\.[0-9]\\.[0-9]*" + _gcc_version "${_gcc_version_info}") + if(NOT _gcc_version) + string (REGEX REPLACE ".*\\(GCC\\).*([34]\\.[0-9]).*" "\\1.0" +--- ParaView-5.0.1/VTK/CMake/GenerateExportHeader.cmake.orig 2016-03-28 17:07:10.000000000 +0200 ++++ ParaView-5.0.1/VTK/CMake/GenerateExportHeader.cmake 2016-06-11 15:12:16.344357746 +0200 +@@ -166,7 +166,7 @@ + execute_process(COMMAND ${CMAKE_C_COMPILER} ARGS --version + OUTPUT_VARIABLE _gcc_version_info + ERROR_VARIABLE _gcc_version_info) +- string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]*" ++ string(REGEX MATCH "[3-6]\\.[0-9]\\.[0-9]*" + _gcc_version "${_gcc_version_info}") + # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the + # patch level, handle this here: +--- ParaView-5.0.1/Qt/Components/CMakeLists.txt.orig 2016-06-13 09:27:27.827849525 +0200 ++++ ParaView-5.0.1/Qt/Components/CMakeLists.txt 2016-06-13 09:29:28.599318445 +0200 +@@ -656,10 +656,10 @@ + #the pqSGExportStateWizard has subclasses that directly access + #the UI file, and currently we don't have a clean way to break this hard + #dependency, so for no we install this ui file. +-if(PARAVIEW_INSTALL_DEVELOPMENT_FILES) +- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h" +- DESTINATION "${VTK_INSTALL_INCLUDE_DIR}") +-endif() ++#OPENFOAM patch#if(PARAVIEW_INSTALL_DEVELOPMENT_FILES) ++#OPENFOAM patch# install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h" ++#OPENFOAM patch# DESTINATION "${VTK_INSTALL_INCLUDE_DIR}") ++#OPENFOAM patch#endif() + + #IF (NOT PV_INSTALL_NO_DEVELOPMENT) + # # Headers diff --git a/etc/patches/paraview-5.1.0 b/etc/patches/paraview-5.1.0 new file mode 100644 index 0000000..534e698 --- /dev/null +++ b/etc/patches/paraview-5.1.0 @@ -0,0 +1,17 @@ +--- ParaView-5.1.0/Qt/Components/CMakeLists.txt.orig 2016-06-13 09:27:27.827849525 +0200 ++++ ParaView-5.1.0/Qt/Components/CMakeLists.txt 2016-06-13 09:29:28.599318445 +0200 +@@ -656,10 +656,10 @@ + #the pqSGExportStateWizard has subclasses that directly access + #the UI file, and currently we don't have a clean way to break this hard + #dependency, so for no we install this ui file. +-if(PARAVIEW_INSTALL_DEVELOPMENT_FILES) +- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h" +- DESTINATION "${VTK_INSTALL_INCLUDE_DIR}") +-endif() ++#OPENFOAM patch#if(PARAVIEW_INSTALL_DEVELOPMENT_FILES) ++#OPENFOAM patch# install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h" ++#OPENFOAM patch# DESTINATION "${VTK_INSTALL_INCLUDE_DIR}") ++#OPENFOAM patch#endif() + + #IF (NOT PV_INSTALL_NO_DEVELOPMENT) + # # Headers diff --git a/etc/patches/scotch_6.0.4 b/etc/patches/scotch_6.0.4 new file mode 100644 index 0000000..87c8e5a --- /dev/null +++ b/etc/patches/scotch_6.0.4 @@ -0,0 +1,10 @@ +--- scotch_6.0.4/src/libscotch/common.h.orig 2015-03-01 10:14:02.000000000 +0100 ++++ scotch_6.0.4/src/libscotch/common.h 2016-06-16 09:23:00.314985888 +0200 +@@ -306,6 +306,8 @@ + ThreadLaunchStartFunc stafptr; /*+ Pointer to start routine +*/ + ThreadLaunchJoinFunc joifptr; /*+ Pointer to join routine +*/ + ThreadBarrier barrdat; /*+ Barrier data structure +*/ ++#else ++ int thrdnbr; /* dummy for non-threaded */ + #endif /* ((defined COMMON_PTHREAD) || (defined SCOTCH_PTHREAD)) */ + } ThreadGroupHeader; diff --git a/etc/relocateQt b/etc/relocateQt index ac6f186..1542115 100755 --- a/etc/relocateQt +++ b/etc/relocateQt @@ -69,17 +69,16 @@ do ;; -f | -force) forceOpt=true - shift ;; [1-9]* | qt-[1-9]*) qtVERSION="${1%%/}"; qtVERSION="${qtVERSION#qt-}" - shift ;; *) - usage "unknown option/argument: '$*'" + die "unknown option/argument: '$1'" ;; esac + shift done #------------------------------------------------------------------------------ diff --git a/etc/tools/ParaView4Functions b/etc/tools/ParaView3Functions similarity index 60% rename from etc/tools/ParaView4Functions rename to etc/tools/ParaView3Functions index 04323da..7a3cd28 100644 --- a/etc/tools/ParaView4Functions +++ b/etc/tools/ParaView3Functions @@ -2,8 +2,8 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation -# \\/ M anipulation | +# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -32,14 +32,14 @@ # buildBASE, installBASE defined from tools/ThirdPartyFunctions # -# where things are or should be put +# Where things are or should be put # ParaView_VERSION and ParaView_MAJOR should already have been set # # ParaView_SOURCE_DIR : location of the original sources # ParaView_BINARY_DIR : location of the build # ParaView_DIR : location of the installed program # -setDirs() +setParaViewDirs() { ParaView_SOURCE_DIR=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION @@ -51,10 +51,10 @@ setDirs() exit 1 } - # ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION-$OBJ_ADD + # ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION${OBJ_ADD:+-$OBJ_ADD} ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION - # ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION-$OBJ_ADD + # ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION${OBJ_ADD:+-$OBJ_ADD} ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION export ParaView_SOURCE_DIR ParaView_BINARY_DIR ParaView_DIR @@ -63,17 +63,27 @@ setDirs() echo "ParaView_SOURCE_DIR=$ParaView_SOURCE_DIR" echo "ParaView_BINARY_DIR=$ParaView_BINARY_DIR" echo "ParaView_DIR=$ParaView_DIR" + + # Forcefully override the .git path for the ParaView source code directory + export GIT_DIR=$ParaView_SOURCE_DIR/.git } # -# set ParaView_VERSION and adjust ParaView_MAJOR accordingly +# Set ParaView_VERSION and adjust ParaView_MAJOR accordingly # -setVersion() +# $1 can contain something something like 4.4.0, paraview-4.4.0, ParaView-4.0.0 +# +setParaViewVersion() { - [ "$#" -ge 1 ] && ParaView_VERSION="${1##paraview-}" + [ $# -gt 0 ] || { + echo "Error: function setParaViewVersion() called without an argument" + exit 1 + } - # the major version is "." + ParaView_VERSION="${1##*-}" + + # The major version is "." ParaView_MAJOR=$(echo $ParaView_VERSION | \ sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/') @@ -84,58 +94,27 @@ setVersion() #------------------------------------------------------------------------------ # -# extract and echo date stamp information from -# VTK/Utilities/kwsys/kwsysDateStamp.cmake -# since the order of the entries is already correct, can use simple sed script -# -echoDateStamp() -{ - ( - set -- $( - sed -ne 's/^SET(KWSYS_DATE_STAMP_[A-Z]*\([ 0-9]*\)).*$/\1/p' \ - $ParaView_SOURCE_DIR/VTK/Utilities/kwsys/kwsysDateStamp.cmake - ) - - IFS='-' - echo "date-stamp: $*" - ) -} - - -# -# extract version information from -# CMakeLists.txt -# since the order of the entries is already correct, can use simple sed script -# -getVersion() -{ - ( - set -- $( - sed -ne 's/^SET(PARAVIEW_VERSION_[A-Z]*\([ 0-9]*\)).*$/\1/p' \ - $ParaView_SOURCE_DIR/CMakeLists.txt - ) - - IFS='.' - echo "$*" - ) -} - -# -# compare version information +# Compare version information (specified vs what is found in CMakeLists.txt) +# Parse this type of content: +# set (PARAVIEW_VERSION_FULL "3.98.1") # checkVersion() { - local ver=$(getVersion) + local ver=$( + sed -ne 's/^ *set *( *PARAVIEW_VERSION_FULL[ "]*\([.0-9]*\).*$/\1/ip' \ + $ParaView_SOURCE_DIR/CMakeLists.txt + ) + if [ "$ParaView_VERSION" != "$ver" ] then echo "MISMATCH!" echo " specified $ParaView_VERSION" - echo " found $ver" + echo " found ${ver:-NONE}" fi } # -# set CMake cache variables +# Set CMake cache variables # addCMakeVariable() { @@ -148,20 +127,27 @@ addCMakeVariable() # -# verbose makefiles +# Verbose makefiles # addVerbosity() { - [ "$withVERBOSE" = true ] && addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE" + if [ "${withVERBOSE:=false}" = true ] + then + addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE" + fi } # -# define options for mpi support +# Define options for mpi support # addMpiSupport() { - [ "${withMPI:=false}" = true ] || return + if [ "${withMPI:=false}" != true ] + then + return + fi + OBJ_ADD="$OBJ_ADD-mpi" addCMakeVariable "PARAVIEW_USE_MPI=ON VTK_USE_MPI=ON" @@ -170,18 +156,22 @@ addMpiSupport() # -# define options for python support +# Define options for python support # addPythonSupport() { - [ "${withPYTHON:=false}" = true ] || return + if [ "${withPYTHON:=false}" != true ] + then + return + fi + OBJ_ADD="$OBJ_ADD-py" if pythonBin=$(which python 2>/dev/null) then if [ -n "$PYTHON_LIBRARY" ] then - # check $PYTHON_LIBRARY if it has been set + # Check $PYTHON_LIBRARY if it has been set if [ ! -e "$PYTHON_LIBRARY" ] then echo "*** Error: libpython not found at location specified " \ @@ -192,9 +182,9 @@ addPythonSupport() PYTHON_LIBRARY=$(ldd $pythonBin | \ sed -ne '/libpython/s/.* => \(.*\) (.*/\1/p') - [ -e "$PYTHON_LIBRARY" ] || { - echo "*** Error: Unable to determine path to python library." - } + [ -e "$PYTHON_LIBRARY" ] || { + echo "*** Error: Unable to determine path to python library." + } fi [ -e "$PYTHON_LIBRARY" ] || { @@ -208,7 +198,7 @@ addPythonSupport() pythonMajor=$(echo $PYTHON_LIBRARY | sed 's/.*libpython\(.*\)\.so.*/\1/') pythonInclude=/usr/include/python$pythonMajor - # note - we could also allow for a PYTHON_INCLUDE variable ... + # Note - we could also allow for a PYTHON_INCLUDE variable ... [ -d "$pythonInclude" ] || { echo " No python headers found in $pythonInclude/" echo " Please install python headers or deactivate " @@ -238,17 +228,20 @@ addPythonSupport() # -# define options for mesa support +# Define options for mesa support # addMesaSupport() { - [ "${withMESA:=false}" = true ] || return + if [ "${withMESA:=false}" != true ] + then + return + fi if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ] then OBJ_ADD="$OBJ_ADD-mesa" - addCMakeVariable "VTK_OPENGL_HAS_OSMESA=ON" + addCMakeVariable "VTK_OPENGL_HAS_OSMESA:BOOL=ON" addCMakeVariable "OSMESA_INCLUDE_DIR=$MESA_INCLUDE" addCMakeVariable "OSMESA_LIBRARY=$MESA_LIBRARY" @@ -266,69 +259,33 @@ addMesaSupport() addQtSupport() { QtVersion=none - [ "${withQT:=false}" = true ] || return + + if [ "${withQT:=false}" != true ] + then + return + fi addCMakeVariable "PARAVIEW_BUILD_QT_GUI=ON" - unset qmakeExe - if [ -n "$QMAKE_PATH" ] - then - if [ -d "$QMAKE_PATH" ] - then - if [ -x "$QMAKE_PATH/qmake" ] - then - qmakeExe=$QMAKE_PATH/qmake - elif [ -x "$QMAKE_PATH/bin/qmake" ] - then - qmakeExe=$QMAKE_PATH/bin/qmake - fi - elif [ -x "$QMAKE_PATH" ] - then - qmakeExe=$QMAKE_PATH - fi - - if [ -n "$qmakeExe" ] - then - # use absolute path - if [ "${qmakeExe#/}" = "$qmakeExe" ] - then - qmakeExe="$(cd ${qmakeExe%/qmake} 2>/dev/null && pwd)/qmake" - fi - else - echo - echo "qmake not found under specified QMAKE_PATH" - echo " QMAKE_PATH=$QMAKE_PATH" - echo "leaving unspecified" - echo - fi - fi - - # default to using qmake from the path - if [ -n "$qmakeExe" ] - then - addCMakeVariable "QT_QMAKE_EXECUTABLE:FILEPATH=$qmakeExe" - else - qmakeExe=qmake - fi - + local qmake=$(findQtMake) # Check qmake can be found - if type $qmakeExe >/dev/null 2>&1 + if type $qmake >/dev/null 2>&1 then # Check the Qt version selected # parse -> "Using Qt version X.Y.Z in ..." - QtVersion=$($qmakeExe -query QT_VERSION) + QtVersion=$($qmake -query QT_VERSION) - # split Major.Minor.Revision - could also use IFS hacking + # Split Major.Minor.Revision - could also use IFS hacking set -- $(echo "$QtVersion" | sed -e 's/\./ /g') QtMajor=$1 QtMinor=$2 - if [ $QtMajor -lt 4 ] || [ $QtMajor -eq 4 -a $QtMinor -lt 5 ] + if [ $QtMajor -ne 4 -o $QtMajor -eq 4 -a $QtMinor -lt 5 ] then echo "*** Error: Qt version provided < 4.5" - echo "*** Please use the -qmake option to specify the location of a version of Qt >= 4.5 " + echo "*** Please use the -qmake option to specify the location of a version of Qt >= 4.5 and < 5.0" echo "*** e.g." echo "*** -qmake /usr/local/qt-4.6.2/bin/qmake" echo "*** -qmake $installBASE/qt-4.6.2/bin/qmake" @@ -342,47 +299,13 @@ addQtSupport() # -# configure via cmake, but don't actually build anything +# Configure via cmake, but don't actually build anything # configParaView() { - unset cmakeExe - if [ -n "$CMAKE_PATH" ] - then - if [ -d "$CMAKE_PATH" ] - then - if [ -x "$CMAKE_PATH/cmake" ] - then - cmakeExe=$CMAKE_PATH/cmake - elif [ -x "$CMAKE_PATH/bin/cmake" ] - then - cmakeExe=$CMAKE_PATH/bin/cmake - fi - elif [ -x "$CMAKE_PATH" ] - then - cmakeExe=$CMAKE_PATH - fi + local cmake=$(findCMake) - if [ -n "$cmakeExe" ] - then - # use absolute path - if [ "${cmakeExe#/}" = "$cmakeExe" ] - then - cmakeExe="$(cd ${cmakeExe%/cmake} 2>/dev/null && pwd)/cmake" - fi - else - echo - echo "cmake not found under specified CMAKE_PATH" - echo " CMAKE_PATH=$CMAKE_PATH" - echo "leaving unspecified" - echo - fi - fi - - # default to using cmake from the path - [ -n "$cmakeExe" ] || cmakeExe=cmake - - # remove any existing build folder and recreate + # Remove any existing build folder and recreate if [ -d $ParaView_BINARY_DIR ] then echo "removing old build directory" @@ -391,23 +314,22 @@ configParaView() fi mkdir -p $ParaView_BINARY_DIR - addCMakeVariable "CMAKE_BUILD_TYPE:STRING=$buildType" - - cd $ParaView_BINARY_DIR || exit 1 # change to build folder + cd $ParaView_BINARY_DIR || exit 1 # Change to build folder echo "----" echo "Configuring paraview-$ParaView_VERSION (major version: $ParaView_MAJOR)" echo " MPI support : ${withMPI:-false}" echo " Python support : ${withPYTHON:-false}" echo " MESA support : ${withMESA:-false}" + echo " GL2 rendering : false" echo " Qt dev support : ${withQT:-false}" echo " Source : $ParaView_SOURCE_DIR" echo " Build : $ParaView_BINARY_DIR" echo " Target : $ParaView_DIR" - echo " Build type : $buildType" + echo " Cmake : $cmake" echo "----" echo - echo "$cmakeExe" \ + echo "$cmake" \ -DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \ $CMAKE_VARIABLES \ $ParaView_SOURCE_DIR @@ -415,8 +337,8 @@ configParaView() echo "----" echo - # run cmake to create Makefiles - $cmakeExe \ + # Run cmake to create Makefiles + $cmake -Wno-dev \ -DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \ $CMAKE_VARIABLES \ $ParaView_SOURCE_DIR @@ -424,40 +346,53 @@ configParaView() # -# invoke make +# Invoke make # also link bin/ to lib/paraview-* for development without installation # makeParaView() { - cd $ParaView_BINARY_DIR || exit 1 # change to build folder + cd $ParaView_BINARY_DIR || exit 1 # Change to build folder echo " Starting make" time make -j $WM_NCOMPPROCS echo " Done make" - # remove lib if it is a link + # Remove lib if it is a link # (how this was previously handled before 'make install' worked) - [ -L lib ] && rm lib 2>/dev/null + if [ -L lib ] + then + rm lib 2>/dev/null + fi } # -# install the program +# Install the program # installParaView() { - cd $ParaView_BINARY_DIR || exit 1 # change to build folder + cd $ParaView_BINARY_DIR || exit 1 # Change to build folder echo " Installing ParaView to $ParaView_DIR" make install +# hack for missing files after install of version 3.14.1 + echo "Copying missing files to install folder" + CMAKE_SRC_DIR=$ParaView_SOURCE_DIR/CMake + CMAKE_INSTALL_DIR=$ParaView_DIR/lib/paraview-$ParaView_MAJOR/CMake + cp -f $ParaView_SOURCE_DIR/ParaViewUse.cmake $CMAKE_INSTALL_DIR + cp -f $CMAKE_SRC_DIR/generate_proxydocumentation.cmake $CMAKE_INSTALL_DIR + cp -f $CMAKE_SRC_DIR/smxml_to_xml.xsl $CMAKE_INSTALL_DIR + cp -f $CMAKE_SRC_DIR/xml_to_html.xsl $CMAKE_INSTALL_DIR + cp -f $CMAKE_SRC_DIR/xml_to_wiki.xsl.in $CMAKE_INSTALL_DIR + cp -f $CMAKE_SRC_DIR/generate_qhp.cmake $CMAKE_INSTALL_DIR + unset CMAKE_SRC_DIR CMAKE_INSTALL_DIR +# --- end hack + cat<< INFO --- Installation complete for paraview-$ParaView_VERSION - Set environment variables: - - export ParaView_DIR=$ParaView_DIR - export PATH=\$ParaView_DIR/bin:\$PATH - export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview-$ParaView_MAJOR + Now update the environment by running: + wmREFRESH --- INFO } @@ -465,23 +400,27 @@ INFO #------------------------------------------------------------------------------ -# clear the referenced variables before using any of the functions +# Clear the referenced variables before using any of the functions unset withMPI withVERBOSE unset withQT QMAKE_PATH unset withMESA MESA_INCLUDE MESA_LIBRARY unset withPYTHON PYTHON_INCLUDE PYTHON_LIBRARY unset CMAKE_VARIABLES unset OBJ_ADD -unset buildType -# start with these general settings + +# Start with these general settings +addCMakeVariable "VTK_USE_TK:BOOL=OFF" addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF" +addCMakeVariable "CMAKE_BUILD_TYPE:STRING=Release" -# include development files in "make install" -addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON" +# Include development files in "make install" +addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT:BOOL=ON" -# don't build test tree +# Don't build test tree addCMakeVariable "BUILD_TESTING:BOOL=OFF" +# remove dependency on WebKit +# addCMakeVariable VTK_QT_USE_WEBKIT:BOOL=OFF -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/etc/tools/ParaViewFunctions b/etc/tools/ParaViewFunctions index 96bf8a4..c989264 100644 --- a/etc/tools/ParaViewFunctions +++ b/etc/tools/ParaViewFunctions @@ -2,8 +2,8 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation -# \\/ M anipulation | +# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -32,14 +32,14 @@ # buildBASE, installBASE defined from tools/ThirdPartyFunctions # -# where things are or should be put +# Where things are or should be put # ParaView_VERSION and ParaView_MAJOR should already have been set # # ParaView_SOURCE_DIR : location of the original sources # ParaView_BINARY_DIR : location of the build # ParaView_DIR : location of the installed program # -setDirs() +setParaViewDirs() { ParaView_SOURCE_DIR=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION @@ -51,10 +51,10 @@ setDirs() exit 1 } - # ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION-$OBJ_ADD + # ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION${OBJ_ADD:+-$OBJ_ADD} ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION - # ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION-$OBJ_ADD + # ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION${OBJ_ADD:+-$OBJ_ADD} ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION export ParaView_SOURCE_DIR ParaView_BINARY_DIR ParaView_DIR @@ -63,17 +63,27 @@ setDirs() echo "ParaView_SOURCE_DIR=$ParaView_SOURCE_DIR" echo "ParaView_BINARY_DIR=$ParaView_BINARY_DIR" echo "ParaView_DIR=$ParaView_DIR" + + # Forcefully override the .git path for the ParaView source code directory + export GIT_DIR=$ParaView_SOURCE_DIR/.git } # -# set ParaView_VERSION and adjust ParaView_MAJOR accordingly +# Set ParaView_VERSION and adjust ParaView_MAJOR accordingly # -setVersion() +# $1 can contain something something like 4.4.0, paraview-4.4.0, ParaView-4.0.0 +# +setParaViewVersion() { - [ "$#" -ge 1 ] && ParaView_VERSION="${1##paraview-}" + [ $# -gt 0 ] || { + echo "Error: function setParaViewVersion() called without an argument" + exit 1 + } - # the major version is "." + ParaView_VERSION="${1##*-}" + + # The major version is "." ParaView_MAJOR=$(echo $ParaView_VERSION | \ sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/') @@ -84,58 +94,27 @@ setVersion() #------------------------------------------------------------------------------ # -# extract and echo date stamp information from -# VTK/Utilities/kwsys/kwsysDateStamp.cmake -# since the order of the entries is already correct, can use simple sed script -# -echoDateStamp() -{ - ( - set -- $( - sed -ne 's/^SET(KWSYS_DATE_STAMP_[A-Z]*\([ 0-9]*\)).*$/\1/p' \ - $ParaView_SOURCE_DIR/VTK/Utilities/kwsys/kwsysDateStamp.cmake - ) - - IFS='-' - echo "date-stamp: $*" - ) -} - - -# -# extract version information from -# CMakeLists.txt -# since the order of the entries is already correct, can use simple sed script -# -getVersion() -{ - ( - set -- $( - sed -ne 's/^SET(PARAVIEW_VERSION_[A-Z]*\([ 0-9]*\)).*$/\1/p' \ - $ParaView_SOURCE_DIR/CMakeLists.txt - ) - - IFS='.' - echo "$*" - ) -} - -# -# compare version information +# Compare version information (specified vs what is found in CMakeLists.txt) +# Parse this type of content: +# set (PARAVIEW_VERSION_FULL "5.0.1") # checkVersion() { - local ver=$(getVersion) + local ver=$( + sed -ne 's/^ *set *( *PARAVIEW_VERSION_FULL[ "]*\([.0-9]*\).*$/\1/ip' \ + $ParaView_SOURCE_DIR/CMakeLists.txt + ) + if [ "$ParaView_VERSION" != "$ver" ] then echo "MISMATCH!" echo " specified $ParaView_VERSION" - echo " found $ver" + echo " found ${ver:-NONE}" fi } # -# set CMake cache variables +# Set CMake cache variables # addCMakeVariable() { @@ -148,40 +127,54 @@ addCMakeVariable() # -# verbose makefiles +# Verbose makefiles # addVerbosity() { - [ "$withVERBOSE" = true ] && addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE" + if [ "${withVERBOSE:=false}" = true ] + then + addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE" + fi } # -# define options for mpi support +# Define options for mpi support # addMpiSupport() { - [ "${withMPI:=false}" = true ] || return + if [ "${withMPI:=false}" != true ] + then + return + fi + OBJ_ADD="$OBJ_ADD-mpi" addCMakeVariable "PARAVIEW_USE_MPI=ON VTK_USE_MPI=ON" - addCMakeVariable "VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS" + if [ "${MPI_MAX_PROCS:=0}" -gt 1 ] + then + addCMakeVariable "VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS" + fi } # -# define options for python support +# Define options for python support # addPythonSupport() { - [ "${withPYTHON:=false}" = true ] || return + if [ "${withPYTHON:=false}" != true ] + then + return + fi + OBJ_ADD="$OBJ_ADD-py" if pythonBin=$(which python 2>/dev/null) then if [ -n "$PYTHON_LIBRARY" ] then - # check $PYTHON_LIBRARY if it has been set + # Check $PYTHON_LIBRARY if it has been set if [ ! -e "$PYTHON_LIBRARY" ] then echo "*** Error: libpython not found at location specified " \ @@ -192,9 +185,9 @@ addPythonSupport() PYTHON_LIBRARY=$(ldd $pythonBin | \ sed -ne '/libpython/s/.* => \(.*\) (.*/\1/p') - [ -e "$PYTHON_LIBRARY" ] || { - echo "*** Error: Unable to determine path to python library." - } + [ -e "$PYTHON_LIBRARY" ] || { + echo "*** Error: Unable to determine path to python library." + } fi [ -e "$PYTHON_LIBRARY" ] || { @@ -208,8 +201,8 @@ addPythonSupport() pythonMajor=$(echo $PYTHON_LIBRARY | sed 's/.*libpython\(.*\)\.so.*/\1/') pythonInclude=/usr/include/python$pythonMajor - # note - we could also allow for a PYTHON_INCLUDE variable ... - [ -d "$pythonInclude" ] || { + # Note - we could also allow for a PYTHON_INCLUDE variable ... + [ -d "$pythonInclude" -a -f "$pythonInclude/Python.h" ] || { echo " No python headers found in $pythonInclude/" echo " Please install python headers or deactivate " echo " python support by not using the -python option" @@ -217,7 +210,7 @@ addPythonSupport() } addCMakeVariable "PARAVIEW_ENABLE_PYTHON=ON" - addCMakeVariable "PYTHON_INCLUDE_PATH=$pythonInclude" + addCMakeVariable "PYTHON_INCLUDE_DIRS=$pythonInclude" addCMakeVariable "PYTHON_LIBRARY=$PYTHON_LIBRARY" echo "----" @@ -238,17 +231,20 @@ addPythonSupport() # -# define options for mesa support +# Define options for mesa support # addMesaSupport() { - [ "${withMESA:=false}" = true ] || return + if [ "${withMESA:=false}" != true ] + then + return + fi if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ] then OBJ_ADD="$OBJ_ADD-mesa" - addCMakeVariable "VTK_OPENGL_HAS_OSMESA=ON" + addCMakeVariable "VTK_OPENGL_HAS_OSMESA:BOOL=ON" addCMakeVariable "OSMESA_INCLUDE_DIR=$MESA_INCLUDE" addCMakeVariable "OSMESA_LIBRARY=$MESA_LIBRARY" @@ -263,72 +259,54 @@ addMesaSupport() } +# +# new rendering backend +# +addGL2Support() +{ + if [ "${withGL2:=false}" = true ] + then + addCMakeVariable "VTK_RENDERING_BACKEND=OpenGL2" + fi +} + + addQtSupport() { QtVersion=none - [ "${withQT:=false}" = true ] || return + + if [ "${withQT:=false}" != true ] + then + return + fi addCMakeVariable "PARAVIEW_BUILD_QT_GUI=ON" - unset qmakeExe - if [ -n "$QMAKE_PATH" ] + local qmake=$(findQtMake) + + # From somewhere other than in the path + if [ "${qmake:=qmake}" != qmake ] then - if [ -d "$QMAKE_PATH" ] - then - if [ -x "$QMAKE_PATH/qmake" ] - then - qmakeExe=$QMAKE_PATH/qmake - elif [ -x "$QMAKE_PATH/bin/qmake" ] - then - qmakeExe=$QMAKE_PATH/bin/qmake - fi - elif [ -x "$QMAKE_PATH" ] - then - qmakeExe=$QMAKE_PATH - fi - - if [ -n "$qmakeExe" ] - then - # use absolute path - if [ "${qmakeExe#/}" = "$qmakeExe" ] - then - qmakeExe="$(cd ${qmakeExe%/qmake} 2>/dev/null && pwd)/qmake" - fi - else - echo - echo "qmake not found under specified QMAKE_PATH" - echo " QMAKE_PATH=$QMAKE_PATH" - echo "leaving unspecified" - echo - fi + addCMakeVariable "QT_QMAKE_EXECUTABLE:FILEPATH=$qmake" fi - # default to using qmake from the path - if [ -n "$qmakeExe" ] - then - addCMakeVariable "QT_QMAKE_EXECUTABLE:FILEPATH=$qmakeExe" - else - qmakeExe=qmake - fi - - # Check qmake can be found - if type $qmakeExe >/dev/null 2>&1 + if type $qmake >/dev/null 2>&1 then # Check the Qt version selected # parse -> "Using Qt version X.Y.Z in ..." - QtVersion=$($qmakeExe -query QT_VERSION) + QtVersion=$($qmake -query QT_VERSION) - # split Major.Minor.Revision - could also use IFS hacking + # Split Major.Minor.Revision - could also use IFS hacking set -- $(echo "$QtVersion" | sed -e 's/\./ /g') QtMajor=$1 QtMinor=$2 - if [[ ($QtMajor -lt 4) || ($QtMajor -eq 4 && $QtMinor -lt 5) ]] + if [ $QtMajor -lt 4 -o $QtMajor -eq 4 -a $QtMinor -lt 5 ] then echo "*** Error: Qt version provided < 4.5" - echo "*** Please use the -qmake option to specify the location of a version of Qt >= 4.5 " + echo "*** Please use the -qmake option to specify the location of a version of Qt >= 4.5" echo "*** e.g." echo "*** -qmake /usr/local/qt-4.6.2/bin/qmake" echo "*** -qmake $installBASE/qt-4.6.2/bin/qmake" @@ -342,47 +320,22 @@ addQtSupport() # -# configure via cmake, but don't actually build anything +# Apply source-code patch if possible +# +patchParaView() +{ + applyPatch "paraview-$ParaView_VERSION" "$ParaView_SOURCE_DIR" +} + + +# +# Configure via cmake, but don't actually build anything # configParaView() { - unset cmakeExe - if [ -n "$CMAKE_PATH" ] - then - if [ -d "$CMAKE_PATH" ] - then - if [ -x "$CMAKE_PATH/cmake" ] - then - cmakeExe=$CMAKE_PATH/cmake - elif [ -x "$CMAKE_PATH/bin/cmake" ] - then - cmakeExe=$CMAKE_PATH/bin/cmake - fi - elif [ -x "$CMAKE_PATH" ] - then - cmakeExe=$CMAKE_PATH - fi + local cmake=$(findCMake) - if [ -n "$cmakeExe" ] - then - # use absolute path - if [ "${cmakeExe#/}" = "$cmakeExe" ] - then - cmakeExe="$(cd ${cmakeExe%/cmake} 2>/dev/null && pwd)/cmake" - fi - else - echo - echo "cmake not found under specified CMAKE_PATH" - echo " CMAKE_PATH=$CMAKE_PATH" - echo "leaving unspecified" - echo - fi - fi - - # default to using cmake from the path - [ -n "$cmakeExe" ] || cmakeExe=cmake - - # remove any existing build folder and recreate + # Remove any existing build folder and recreate if [ -d $ParaView_BINARY_DIR ] then echo "removing old build directory" @@ -391,20 +344,25 @@ configParaView() fi mkdir -p $ParaView_BINARY_DIR - cd $ParaView_BINARY_DIR || exit 1 # change to build folder + addCMakeVariable "CMAKE_BUILD_TYPE:STRING=$buildType" + + cd $ParaView_BINARY_DIR || exit 1 # Change to build folder echo "----" echo "Configuring paraview-$ParaView_VERSION (major version: $ParaView_MAJOR)" echo " MPI support : ${withMPI:-false}" echo " Python support : ${withPYTHON:-false}" echo " MESA support : ${withMESA:-false}" + echo " GL2 rendering : ${withGL2:-false}" echo " Qt dev support : ${withQT:-false}" echo " Source : $ParaView_SOURCE_DIR" echo " Build : $ParaView_BINARY_DIR" echo " Target : $ParaView_DIR" + echo " Build type : $buildType" + echo " Cmake : $cmake" echo "----" echo - echo "$cmakeExe" \ + echo "$cmake" \ -DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \ $CMAKE_VARIABLES \ $ParaView_SOURCE_DIR @@ -412,8 +370,8 @@ configParaView() echo "----" echo - # run cmake to create Makefiles - $cmakeExe \ + # Run cmake to create Makefiles + $cmake \ -DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \ $CMAKE_VARIABLES \ $ParaView_SOURCE_DIR @@ -421,53 +379,43 @@ configParaView() # -# invoke make +# Invoke make # also link bin/ to lib/paraview-* for development without installation # makeParaView() { - cd $ParaView_BINARY_DIR || exit 1 # change to build folder + cd $ParaView_BINARY_DIR || exit 1 # Change to build folder echo " Starting make" time make -j $WM_NCOMPPROCS echo " Done make" - # remove lib if it is a link + # Remove lib if it is a link # (how this was previously handled before 'make install' worked) - [ -L lib ] && rm lib 2>/dev/null + if [ -L lib ] + then + rm lib 2>/dev/null + fi } # -# install the program +# Install the program # installParaView() { - cd $ParaView_BINARY_DIR || exit 1 # change to build folder + cd $ParaView_BINARY_DIR || exit 1 # Change to build folder echo " Installing ParaView to $ParaView_DIR" make install -# hack for missing files after install of version 3.14.1 - echo "Copying missing files to install folder" - CMAKE_SRC_DIR=$ParaView_SOURCE_DIR/CMake - CMAKE_INSTALL_DIR=$ParaView_DIR/lib/paraview-$ParaView_MAJOR/CMake - cp -f $ParaView_SOURCE_DIR/ParaViewUse.cmake $CMAKE_INSTALL_DIR - cp -f $CMAKE_SRC_DIR/generate_proxydocumentation.cmake $CMAKE_INSTALL_DIR - cp -f $CMAKE_SRC_DIR/smxml_to_xml.xsl $CMAKE_INSTALL_DIR - cp -f $CMAKE_SRC_DIR/xml_to_html.xsl $CMAKE_INSTALL_DIR - cp -f $CMAKE_SRC_DIR/xml_to_wiki.xsl.in $CMAKE_INSTALL_DIR - cp -f $CMAKE_SRC_DIR/generate_qhp.cmake $CMAKE_INSTALL_DIR - unset CMAKE_SRC_DIR CMAKE_INSTALL_DIR -# --- end hack - cat<< INFO + --- Installation complete for paraview-$ParaView_VERSION - Set environment variables: + ParaView_DIR=$ParaView_DIR - export ParaView_DIR=$ParaView_DIR - export PATH=\$ParaView_DIR/bin:\$PATH - export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview-$ParaView_MAJOR + You may need to update the OpenFOAM environment by running: + wmREFRESH --- INFO } @@ -475,27 +423,23 @@ INFO #------------------------------------------------------------------------------ -# clear the referenced variables before using any of the functions +# Clear the referenced variables before using any of the functions unset withMPI withVERBOSE unset withQT QMAKE_PATH unset withMESA MESA_INCLUDE MESA_LIBRARY unset withPYTHON PYTHON_INCLUDE PYTHON_LIBRARY unset CMAKE_VARIABLES unset OBJ_ADD +unset buildType - -# start with these general settings -addCMakeVariable "VTK_USE_TK:BOOL=OFF" +# Start with these general settings addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF" -addCMakeVariable "CMAKE_BUILD_TYPE:STRING=Release" -# include development files in "make install" -addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT:BOOL=ON" +# Include development files in "make install" +addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON" -# don't build test tree +# Don't build test tree addCMakeVariable "BUILD_TESTING:BOOL=OFF" -# remove dependency on WebKit -# addCMakeVariable VTK_QT_USE_WEBKIT:BOOL=OFF -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/etc/tools/ThirdPartyFunctions b/etc/tools/ThirdPartyFunctions index a82a569..40356ce 100644 --- a/etc/tools/ThirdPartyFunctions +++ b/etc/tools/ThirdPartyFunctions @@ -2,8 +2,8 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ M anipulation | +# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -31,29 +31,198 @@ # Define WM_NCOMPPROCS always. #------------------------------------------------------------------------------ -# define the normal build and prefix directories +# Define the normal build and prefix directories buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER + # -# mostly building without wmake +# Mostly building without wmake # - disable wmakeScheduler variables -# - restrict WM_NCOMPPROCS to local number of cores +# - use max number of cores for building # unset WM_HOSTS WM_SCHEDULER -export WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo 2>/dev/null | wc -l) -if [ $WM_NCOMPPROCS -le 1 ] +if [ -r /proc/cpuinfo ] then + WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l) +else WM_NCOMPPROCS=1 -elif [ $WM_NCOMPPROCS -ge 8 ] -then - WM_NCOMPPROCS=8 fi +export WM_NCOMPPROCS # echo "Building on $WM_NCOMPPROCS cores" # -# download file $1 from url $2 into download/ directory +# If WM_CONTINUE_ON_ERROR not set activate the shell option "stop on error" +# +if [ -z "${WM_CONTINUE_ON_ERROR}" ] +then + set -e +fi + + +# Report error and exit +die() +{ + exec 1>&2 + echo + echo "Error: see '${0##*/} -help' for usage" + while [ "$#" -ge 1 ]; do echo " $1"; shift; done + echo + exit 1 +} + +# Test if it matches "*-none" +_foamIsNone() +{ + test "${1##*-}" = none +} + +# Test if it matches "*-system" +_foamIsSystem() +{ + test "${1##*-}" = system +} + + +# +# try to locate cmake according to the CMAKE_PATH +# or just use what is found in the path +# +findCMake() +{ + local candidate + local foundExe + + if [ -n "$CMAKE_PATH" ] + then + # check as directory + if [ -d "$CMAKE_PATH" ] + then + for candidate in \ + $CMAKE_PATH/cmake \ + $CMAKE_PATH/bin/cmake \ + ; + do + if [ -f "$candidate" -a -x "$candidate" ] + then + foundExe=$candidate + break + fi + done + fi + + # check as file, include ThirdParty installation in the search + if [ -z "$foundExe" ] + then + for candidate in \ + $CMAKE_PATH \ + $installBASE/$CMAKE_PATH/bin/cmake \ + $installBASE/cmake-$CMAKE_PATH/bin/cmake \ + ; + do + if [ -f "$candidate" -a -x "$candidate" ] + then + foundExe=$candidate + break + fi + done + fi + + if [ -n "$foundExe" ] + then + # Use absolute path + if [ "${foundExe#/}" = "$foundExe" ] + then + foundExe="$(cd ${foundExe%/cmake} 2>/dev/null && pwd)/cmake" + fi + + echo "$foundExe" + return 0 + else + cat << NOT_FOUND 1>&2 +'cmake' not found under specified CMAKE_PATH + CMAKE_PATH=$CMAKE_PATH +reverting to using command from path +NOT_FOUND + fi + fi + + # Default is cmake from the path + echo cmake +} + + +# +# try to locate qmake according to the QMAKE_PATH +# or just use what is found in the path +# +findQtMake() +{ + local candidate + local foundExe + + if [ -n "$QMAKE_PATH" ] + then + # check as directory + if [ -d "$QMAKE_PATH" ] + then + for candidate in \ + $QMAKE_PATH/qmake \ + $QMAKE_PATH/bin/qmake \ + ; + do + if [ -f "$candidate" -a -x "$candidate" ] + then + foundExe=$candidate + break + fi + done + fi + + # check as file, include ThirdParty installation in the search + if [ -z "$foundExe" ] + then + for candidate in \ + $QMAKE_PATH \ + $installBASE/$QMAKE_PATH/bin/qmake \ + $installBASE/qt-$QMAKE_PATH/bin/qmake \ + ; + do + if [ -f "$candidate" -a -x "$candidate" ] + then + foundExe=$candidate + break + fi + done + fi + + if [ -n "$foundExe" ] + then + # Use absolute path + if [ "${foundExe#/}" = "$foundExe" ] + then + foundExe="$(cd ${foundExe%/qmake} 2>/dev/null && pwd)/qmake" + fi + + echo "$foundExe" + return 0 + else + cat << NOT_FOUND 1>&2 +'qmake' not found under specified QMAKE_PATH + QMAKE_PATH=$QMAKE_PATH +reverting to using command from path +NOT_FOUND + fi + fi + + # Default is qmake from the path + echo qmake +} + + +# +# Download file $1 from url $2 into download/ directory # downloadFile() { @@ -62,8 +231,8 @@ downloadFile() return 1 } - file="$1" - url="$2" + local file="$1" + local url="$2" if [ ! -e download/$file ] then @@ -75,10 +244,10 @@ downloadFile() # -# copy Make/{files,options} from wmakeFiles/PACKAGE +# Copy Make/{files,options} from etc/wmakeFiles/PACKAGE # # $1 = PACKAGE -# $2 (optional) TARGET DIRECTORY +# $2 = TARGET DIRECTORY (optional) cpMakeFiles() { set +x @@ -88,8 +257,8 @@ cpMakeFiles() return 1 } - pkg=$1 - dst=${2:-.} + local pkg=$1 + local dst="${2:-.}" echo "cpMakeFiles" $pkg $dst wmakeFiles=$WM_THIRD_PARTY_DIR/etc/wmakeFiles/$pkg @@ -119,4 +288,41 @@ cpMakeFiles() } -# ----------------------------------------------------------------- end-of-file +# +# Apply source-code patch if possible. +# Patches are taken from etc/patches/PACKAGE +# +# $1 = PACKAGE +# $2 = TARGET DIRECTORY (optional) +applyPatch() +{ + [ "$#" -eq 1 -o "$#" -eq 2 ] || { + echo "applyPatch called with incorrect number of arguments ($#): $@" + return 1 + } + + local pkg="$1" + local dst="${2:-.}" + + local patch="$WM_THIRD_PARTY_DIR/etc/patches/$pkg" + local sentinel="PATCHED_DURING_OPENFOAM_BUILD" + + if [ -r "$patch" ] + then + ( + cd $dst || exit 1 + if [ -f "$sentinel" ] + then + echo "patch for $pkg was already applied" + else + echo "apply patch for $pkg" + touch "$sentinel" + patch -p1 < $patch 2>&1 | tee $sentinel + fi + ) + else + echo "no patch found for $pkg" + fi +} + +#------------------------------------------------------------------------------ diff --git a/etc/tools/vtkFunctions b/etc/tools/vtkFunctions new file mode 100644 index 0000000..a87e4e0 --- /dev/null +++ b/etc/tools/vtkFunctions @@ -0,0 +1,204 @@ +#---------------------------------*- sh -*------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. +# \\/ 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 +# etc/tools/vtkFunctions +# +# Description +# VTK (library) make/install helper functions. +# To be loaded *after* etc/tools/ParaViewFunctions +# +#------------------------------------------------------------------------------ + +# buildBASE, installBASE defined from tools/ThirdPartyFunctions + +# +# Where things are or should be put +# VTK_VERSION and VTK_MAJOR should already have been set +# +# VTK_SOURCE_DIR : location of the original sources +# VTK_BINARY_DIR : location of the build +# VTK_DIR : location of the installed program +# +setVtkDirs() +{ + VTK_SOURCE_DIR=$WM_THIRD_PARTY_DIR/VTK-$VTK_VERSION + + [ -d "$VTK_SOURCE_DIR" ] || { + echo "did not find VTK-$VTK_VERSION in these directories:" + echo " WM_THIRD_PARTY_DIR=$WM_THIRD_PARTY_DIR" + echo + echo "abort build" + exit 1 + } + + # VTK_BINARY_DIR=$buildBASE/VTK-$VTK_VERSION${OBJ_ADD:+-$OBJ_ADD} + VTK_BINARY_DIR=$buildBASE/VTK-$VTK_VERSION + + # VTK_DIR=$installBASE/VTK-$VTK_VERSION${OBJ_ADD:+-$OBJ_ADD} + VTK_DIR=$installBASE/VTK-$VTK_VERSION + + export VTK_SOURCE_DIR VTK_BINARY_DIR VTK_DIR + + echo + echo "VTK_SOURCE_DIR=$VTK_SOURCE_DIR" + echo "VTK_BINARY_DIR=$VTK_BINARY_DIR" + echo "VTK_DIR=$VTK_DIR" + + # Forcefully override the .git path for the VTK source code directory + export GIT_DIR=$ParaView_SOURCE_DIR/.git +} + + +# +# Set VTK_VERSION and adjust VTK_MAJOR accordingly +# +# $1 can contain something something like 4.4.0, vtk-4.4.0, VTK-4.0.0 +# +setVtkVersion() +{ + [ $# -gt 0 ] || { + echo "Error: function setVtkVersion() called without an argument" + exit 1 + } + + VTK_VERSION="${1##*-}" + + # The major version is "." + VTK_MAJOR=$(echo $VTK_VERSION | \ + sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/') + + export VTK_VERSION VTK_MAJOR +} + + +#------------------------------------------------------------------------------ + +# +# Apply source-code patch if possible +# +patchVTK() +{ + applyPatch "vtk-$VTK_VERSION" "$VTK_SOURCE_DIR" +} + + +# +# Configure via cmake, but don't actually build anything +# +configVTK() +{ + local cmake=$(findCMake) + + # Remove any existing build folder and recreate + if [ -d $VTK_BINARY_DIR ] + then + echo "removing old build directory" + echo " $VTK_BINARY_DIR" + rm -rf $VTK_BINARY_DIR + fi + mkdir -p $VTK_BINARY_DIR + + addCMakeVariable "CMAKE_BUILD_TYPE:STRING=$buildType" + + cd $VTK_BINARY_DIR || exit 1 # change to build folder + + echo "----" + echo "Configuring VTK-$VTK_VERSION" + echo " MESA support : ${withMESA:-false}" + echo " Source : $VTK_SOURCE_DIR" + echo " Build : $VTK_BINARY_DIR" + echo " Target : $VTK_DIR" + echo " Build type : $buildType" + echo " Cmake : $cmake" + echo "----" + echo + echo "$cmake" \ + -DCMAKE_INSTALL_PREFIX:PATH=$VTK_DIR \ + $CMAKE_VARIABLES \ + $VTK_SOURCE_DIR + echo + echo "----" + echo + + # Run cmake to create Makefiles + $cmake \ + -DCMAKE_INSTALL_PREFIX:PATH=$VTK_DIR \ + $CMAKE_VARIABLES \ + $VTK_SOURCE_DIR +} + + +# +# Invoke make +# also link bin/ to lib/paraview-* for development without installation +# +makeVTK() +{ + cd $VTK_BINARY_DIR || exit 1 # change to build folder + echo " Starting make" + time make -j $WM_NCOMPPROCS + echo " Done make" + + # Remove lib if it is a link + # (how this was previously handled before 'make install' worked) + if [ -L lib ] + then + rm lib 2>/dev/null + fi +} + + +# +# Install the program +# +installVTK() +{ + cd $VTK_BINARY_DIR || exit 1 # Change to build folder + echo " Installing VTK to $VTK_DIR" + + make install + +cat<< INFO + + --- + Installation complete for vtk-$VTK_VERSION + VTK_DIR=$VTK_DIR + --- +INFO +} + + +#------------------------------------------------------------------------------ + +# Clear the referenced variables before using any of the functions +unset CMAKE_VARIABLES + +# Start with these general settings +addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF" + +# Don't build test tree +addCMakeVariable "BUILD_TESTING:BOOL=OFF" + + +#------------------------------------------------------------------------------ diff --git a/etc/wmakeFiles/libccmio/files b/etc/wmakeFiles/libccmio/files new file mode 100644 index 0000000..f4e9ca6 --- /dev/null +++ b/etc/wmakeFiles/libccmio/files @@ -0,0 +1,27 @@ +/* NOTE: make any changes to this file in etc/wmakeFiles/ */ + +adf = libadf +$(adf)/ADF_fortran_2_c.c +$(adf)/ADF_interface.c +$(adf)/ADF_internals.c + +ccmio = libccmio +$(ccmio)/ccmio.c +$(ccmio)/ccmiocore.c +$(ccmio)/ccmioprivate.c +$(ccmio)/ccmioutility.c +$(ccmio)/ccmioversion.c + +/* + * the cgns library is not used by ccmio + * retain for documentation purposes only + * + cgns = libcgns + $(cgns)/adf_cond.c + $(cgns)/adf_ftoc.c + $(cgns)/cgns_error.c + $(cgns)/cgns_internals.c + $(cgns)/cgnslib.c +*/ + +LIB = $(FOAM_EXT_LIBBIN)/libccmio diff --git a/etc/wmakeFiles/libccmio/options b/etc/wmakeFiles/libccmio/options new file mode 100644 index 0000000..5f4fb60 --- /dev/null +++ b/etc/wmakeFiles/libccmio/options @@ -0,0 +1,3 @@ +/* NOTE: make any changes to this file in etc/wmakeFiles/ */ + +/* EXE_INC = */ diff --git a/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM b/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM new file mode 100644 index 0000000..8c83e09 --- /dev/null +++ b/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM @@ -0,0 +1,33 @@ +# openfoam notes: +# WM_CFLAGS, WM_LDFLAGS contain "-m32 -fPIC" etc +# WM_LABEL_SIZE == 64 for 'long' instead of 'int' for OpenFOAM labels + +# compiled without pthread + +EXE = +LIB = .so +OBJ = .o + +MAKE = make +AR = gcc +ARFLAGS = $(WM_CFLAGS) -shared -o +CAT = cat +CCS = gcc +CCP = mpicc +CCD = mpicc +CFLAGS = $(WM_CFLAGS) -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict + +# 32-bit vs. 64-bit labels +ifeq ($(WM_LABEL_SIZE),64) +CFLAGS += -DINTSIZE64 +endif + +CLIBFLAGS = -shared +LDFLAGS = -Xlinker --no-as-needed $(WM_LDFLAGS) -lz -lm -lrt +CP = cp +LEX = flex -Pscotchyy -olex.yy.c +LN = ln +MKDIR = mkdir +MV = mv +RANLIB = echo +YACC = bison -pscotchyy -y -b y diff --git a/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-32Int32 b/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-32Int32 deleted file mode 100644 index 62fec4c..0000000 --- a/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-32Int32 +++ /dev/null @@ -1,21 +0,0 @@ -EXE = -LIB = .so -OBJ = .o - -MAKE = make -AR = gcc -ARFLAGS = -m32 -shared -o -CAT = cat -CCS = gcc -CCP = mpicc -CCD = mpicc -CFLAGS = -m32 -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict -CLIBFLAGS = -shared -fPIC -LDFLAGS = -Xlinker --no-as-needed -L$MPI_ARCH_PATH/lib -m32 -lz -lm -lrt -CP = cp -LEX = flex -Pscotchyy -olex.yy.c -LN = ln -MKDIR = mkdir -MV = mv -RANLIB = echo -YACC = bison -pscotchyy -y -b y diff --git a/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-64Int32 b/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-64Int32 deleted file mode 100644 index 0598d56..0000000 --- a/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-64Int32 +++ /dev/null @@ -1,21 +0,0 @@ -EXE = -LIB = .so -OBJ = .o - -MAKE = make -AR = gcc -ARFLAGS = -shared -o -CAT = cat -CCS = gcc -CCP = mpicc -CCD = mpicc -CFLAGS = -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict -CLIBFLAGS = -shared -fPIC -LDFLAGS = -Xlinker --no-as-needed -lz -lm -lrt -CP = cp -LEX = flex -Pscotchyy -olex.yy.c -LN = ln -MKDIR = mkdir -MV = mv -RANLIB = echo -YACC = bison -pscotchyy -y -b y diff --git a/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-64Int64 b/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-64Int64 deleted file mode 100644 index fe285a2..0000000 --- a/etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-64Int64 +++ /dev/null @@ -1,21 +0,0 @@ -EXE = -LIB = .so -OBJ = .o - -MAKE = make -AR = gcc -ARFLAGS = -shared -o -CAT = cat -CCS = gcc -CCP = mpicc -CCD = mpicc -CFLAGS = -O3 -DINTSIZE64 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict -CLIBFLAGS = -shared -fPIC -LDFLAGS = -Xlinker --no-as-needed -lz -lm -lrt -CP = cp -LEX = flex -Pscotchyy -olex.yy.c -LN = ln -MKDIR = mkdir -MV = mv -RANLIB = echo -YACC = bison -pscotchyy -y -b y diff --git a/makeADIOS b/makeADIOS new file mode 100755 index 0000000..a731185 --- /dev/null +++ b/makeADIOS @@ -0,0 +1,217 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. +# \\/ 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 . +# +# Script +# makeADIOS +# +# Description +# Build script for ADIOS (and MXML) +# +#------------------------------------------------------------------------------ +adiosPACKAGE=adios-git +mxmlPACKAGE=mxml-2.9 + +#------------------------------------------------------------------------------ +# run from third-party directory only +wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { + echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR" + echo " The environment variables are inconsistent with the installation." + echo " Check the OpenFOAM entries in your dot-files and source them." + exit 1 +} +. etc/tools/ThirdPartyFunctions +#------------------------------------------------------------------------------ + +usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat</dev/null + mkdir -p $buildDIR + + [ -e Makefile ] && make clean 2>/dev/null # for safety + mkdir -p $FOAM_EXT_LIBBIN 2>/dev/null + + # handle non-gcc compilers + unset configEnv + if [ "${WM_CC:-gcc}" != gcc ] + then + export CC=$WM_CC + export CCS=$WM_CC + fi + + # installs into lib64/ + cd $buildDIR && \ + $sourceDIR/configure --prefix=$MXML_ARCH_PATH \ + && make -j $WM_NCOMPPROCS all \ + && make install \ + && echo "Built: $mxmlPACKAGE" \ + && rsync -a $MXML_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/*.so* $FOAM_EXT_LIBBIN/ + ) || { + echo "Error building: $mxmlPACKAGE" + } + fi +fi + +# build ADIOS +echo +echo ======================================== +echo "Build adios library $adiosPACKAGE" +echo + +# Needs future adjustment for shared library, for mpi-specific library location +if [ -f $ADIOS_ARCH_PATH/include/adios.h \ + -a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libadios.so ] +then + echo " ADIOS header in $ADIOS_ARCH_PATH/include" + echo " ADIOS libs in $FOAM_EXT_LIBBIN" + echo +else +( + # configuration options: + # Start with GridEngine support - builds without external libraries + unset configOpt + + # Add InfiniBand support + ibDir=/usr/local/ofed + if [ -d "$ibDir/include" ] + then + configOpt="$configOpt --with-infiniband=$ibDir" + fi + ## $configOpt="$configOpt --with-hdf5=..." + + # for externally compiled MXML + # configOpt="$configOpt --with-mxml=$MXML_ARCH_PATH" + + # end of configuration options + # ---------------------------- + + sourceDIR=$WM_THIRD_PARTY_DIR/$adiosPACKAGE + buildDIR=$buildBASE/$adiosPACKAGE + + cd $sourceDIR || exit 1 + export GIT_DIR=$sourceDIR/.git + + # Remove any existing build folder and recreate + \rm -rf $buildDIR 2>/dev/null + mkdir -p $buildDIR + + [ -e Makefile ] && make clean 2>/dev/null # for safety + + [ -f configure ] || { + echo "no configure for $adiosPACKAGE ... trying autogen" + ./autogen.sh + } + + # installs into lib64/ + cd $buildDIR && \ + CC=mpicc CXX=mpicxx CFLAGS="-fPIC" $sourceDIR/configure \ + --prefix=$ADIOS_ARCH_PATH \ + --disable-fortran \ + --with-pic \ + --without-fastbit \ + $configOpt \ + && make -j $WM_NCOMPPROCS all \ + && make install \ + && echo "Built: $adiosPACKAGE" \ + && rsync -a --no-r $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/ $FOAM_EXT_LIBBIN/$FOAM_MPI/ +) || { + echo "Error building: $adiosPACKAGE" +} +fi + +# ----------------------------------------------------------------- end-of-file diff --git a/makeCCMIO b/makeCCMIO new file mode 100755 index 0000000..5d1beb6 --- /dev/null +++ b/makeCCMIO @@ -0,0 +1,139 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2011-2016 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 . +# +# Script +# makeCCMIO +# +# Description +# Build CD-adapco's ccmio library +# +#------------------------------------------------------------------------------ + +# Get version info +. $WM_PROJECT_DIR/etc/config.sh/functions +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio) + +ccmioPACKAGE=${ccmio_version:-libccmio-2.6.1} +targetType=lib + +#------------------------------------------------------------------------------ +# run from third-party directory only +cd ${0%/*} || exit 1 +wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { + echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR" + echo " The environment variables are inconsistent with the installation." + echo " Check the OpenFOAM entries in your dot-files and source them." + exit 1 +} +[ -n "$FOAM_EXT_LIBBIN" ] || { + echo "Error: FOAM_EXT_LIBBIN not set" + echo " Check the OpenFOAM entries in your dot-files and source them." + exit 1 +} +. etc/tools/ThirdPartyFunctions +#------------------------------------------------------------------------------ + +usage() +{ + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + /bin/cat</dev/null + mkdir -p $libDIR 2>/dev/null + + cpMakeFiles libccmio 2>/dev/null + set +x + if wmake $targetType + then + # make headers available: + /bin/cp -pv libccmio/ccmio*.h $incDIR + + # relocate static libraries to sub-directory: + if [ "$targetType" = lib ] + then + /bin/mv -v $FOAM_EXT_LIBBIN/libccmio.a $libDIR + fi + fi +) + + +#------------------------------------------------------------------------------ diff --git a/makeCGAL b/makeCGAL index 6291227..c8f6796 100755 --- a/makeCGAL +++ b/makeCGAL @@ -3,8 +3,8 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation -# \\/ M anipulation | +# \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -34,18 +34,22 @@ # simply specify a 'system' version. For example, # makeCGAL boost-system gmp-system # -# Mixing system and ThirdParty for gmp/mpfr is not supported. -# #------------------------------------------------------------------------------ -set -x -cgalPACKAGE=CGAL-4.7 -boostPACKAGE=boost-system -gmpPACKAGE=gmp-system -mpfrPACKAGE=mpfr-system +# Get CGAL, boost and gmp/mpfr versions +. $WM_PROJECT_DIR/etc/config.sh/functions +unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only + +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL) +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler) + +boostPACKAGE=${boost_version:-boost-system} +gmpPACKAGE=${gmp_version:-gmp-system} +mpfrPACKAGE=${mpfr_version:-mpfr-system} +cgalPACKAGE=$cgal_version #------------------------------------------------------------------------------ -# run from third-party directory only +# Run from third-party directory only wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR" echo " The environment variables are inconsistent with the installation." @@ -54,77 +58,97 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { } . etc/tools/ThirdPartyFunctions #------------------------------------------------------------------------------ +Script="${0##*/}" usage() { exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat</dev/null) + + cat< $buildInfoFile +CGAL=${CGAL_ARCH_PATH##*/} +BOOST=${BOOST_ARCH_PATH##*/} +GMP=${GMP_ARCH_PATH##*/} +MPFR=${MPFR_ARCH_PATH##*/} +CGAL_VERSION=$CGAL_VERSION +BOOST_VERSION=$BOOST_VERSION +BUILD_INFO +} + + +# compare expected vs what is extracted as KEY=... in text +# $1 = key +# $2 = expected +# $3 = text to extract from +infoValueEq() +{ + local val=$(echo "${3:-unset}" | sed -ne "s/^$1=//p") + if [ "$2" = "$val" ] + then + : + else + echo " $1=$2, previous build had $1='${val:-not-found}'" + return 1 + fi +} + +# needs build +cgalIsCurrent() +{ + local info=$(cat $buildInfoFile 2>/dev/null) + [ -n "$info" ] || return 1 + + echo "checking information from existing build ..." + echo " ${CGAL_ARCH_PATH}" + + infoValueEq CGAL "${CGAL_ARCH_PATH##*/}" "$info" || return 1 + infoValueEq BOOST "${BOOST_ARCH_PATH##*/}" "$info" || return 1 + infoValueEq GMP "${GMP_ARCH_PATH##*/}" "$info" || return 1 + infoValueEq MPFR "${MPFR_ARCH_PATH##*/}" "$info" || return 1 + infoValueEq BOOST_VERSION "${BOOST_VERSION}" "$info" || return 1 + + return 0 +} + +if cgalIsCurrent +then + echo " ${CGAL_ARCH_PATH##*/} build appears to be up-to-date - skipping" + echo + exit 0 +fi + ( - # remove any existing build folder and recreate + # Remove any existing build folder and recreate if [ -d $CGAL_BINARY_DIR ] then echo "removing old build directory" @@ -212,9 +318,9 @@ MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE cd $CGAL_BINARY_DIR || exit 1 - unset configBoost configGmpMpfr + unset configBoost configGmp configMpfr echo "----" - echo "Configuring $cgalPACKAGE with boost $BOOST_VERSION_NO" + echo "Configuring $cgalPACKAGE with boost $BOOST_VERSION" echo " Source : $CGAL_SOURCE_DIR" echo " Build : $CGAL_BINARY_DIR" echo " Target : $CGAL_DIR" @@ -230,7 +336,7 @@ MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE -DBoost_THREAD_LIBRARY_RELEASE=$boostLib/libboost_thread.so -DBoost_SYSTEM_LIBRARY=$boostLib/libboost_system.so -DBoost_SYSTEM_LIBRARY_RELEASE=$boostLib/libboost_system.so - -DBoost_VERSION=$BOOST_VERSION_NO + -DBoost_VERSION=$BOOST_VERSION CMAKE_OPTIONS ) else @@ -241,22 +347,32 @@ CMAKE_OPTIONS ) fi - if [ -d "$GMP_ARCH_PATH" -a -d "$MPFR_ARCH_PATH" ] + if [ -d "$GMP_ARCH_PATH" ] then - echo " ThirdParty : gmp/mpfr" - configGmpMpfr=$(cat <. +# +# Script +# makeFFTW +# +# Description +# Build script for FFTW +# +#------------------------------------------------------------------------------ + +# Get FFTW versions +. $WM_PROJECT_DIR/etc/config.sh/functions +unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only + +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW) + +fftwPACKAGE=${fftw_version:-fftw-system} + +#------------------------------------------------------------------------------ +# Run from third-party directory only +wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { + echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR" + echo " The environment variables are inconsistent with the installation." + echo " Check the OpenFOAM entries in your dot-files and source them." + exit 1 +} +. etc/tools/ThirdPartyFunctions +#------------------------------------------------------------------------------ +Script="${0##*/}" + +usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat<&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< +usage: $Script [OPTION] [gcc-VERSION] [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION] +options: + -multilib for 64-bit systems with 32-bit support required + -no-multilib for 64-bit systems without 32-bit support (DEFAULT) + -no-threadsafe disable mpfr thread-safe (default is auto-detect) + -system use system versions for gmp/mpfr/mpc + -help * build combinations of gmp, mpfr, mpc and gcc $gmpPACKAGE $mpfrPACKAGE $mpcPACKAGE - $gccPACKAGE + ${gccPACKAGE:-'unspecified GCC version'} USAGE exit 1 } +#------------------------------------------------------------------------------ +# build 32-bit libraries on 64-bit systems (normally not needed) +optMultilib=disable +unset optThreadSafe # unset=auto # Parse options while [ "$#" -gt 0 ] @@ -70,34 +100,50 @@ do -h | -help) usage ;; - gmp-[4-9]*) + -multi*) + optMultilib=enable + ;; + -no-multi*) + optMultilib=disable + ;; + -no-thread*) + optThreadSafe=disable + ;; + -sys*) + gmpPACKAGE="gmp-system" + mpfrPACKAGE="mpfr-system" + mpcPACKAGE="mpc-system" + ;; + gmp-[4-9]* | gmp-system) gmpPACKAGE="${1%%/}" - shift ;; - mpfr-[2-9]*) + mpfr-[2-9]* | mpfr-system) mpfrPACKAGE="${1%%/}" - shift ;; - mpc-[0-9]*) + mpc-[0-9]* | mpc-system) mpcPACKAGE="${1%%/}" - shift ;; - gcc-[4-9]*) + gcc-[4-9]* | gcc-system) gccPACKAGE="${1%%/}" - shift ;; *) - usage "unknown option/argument: '$*'" + die "unknown option/argument: '$1'" ;; esac + shift done -if [ -z "$gccPACKAGE" ] -then - usage "Please specify gcc-VERSION" - exit 1 -fi +[ -n "$gccPACKAGE" ] || die "The gcc-VERSION was not specified" +cat</dev/null - unset withMpc - [ -d "$MPC_ARCH_PATH" ] && withMpc="--with-mpc=$MPC_ARCH_PATH" - rm -rf $buildDIR mkdir -p $buildDIR cd $buildDIR + unset configOpt + # with/without multi-lib (32-bit support on 64-bit systems) + [ -n "$optMultilib" ] && configOpt="--${optMultilib}-multilib" + set -x $sourceDIR/configure \ --prefix=$GCC_ARCH_PATH \ - --with-gmp=$GMP_ARCH_PATH \ - --with-mpfr=$MPFR_ARCH_PATH \ - $withMpc \ --with-pkgversion=OpenFOAM \ --enable-languages=c,c++ \ --enable-__cxa_atexit \ --enable-libstdcxx-allocator=new \ --with-system-zlib \ + $configGMP $configMPFR $configMPC $configOpt \ MAKEINFO=missing \ && make -j $WM_NCOMPPROCS \ && make install \ @@ -292,4 +379,4 @@ else fi -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/makeGperftools b/makeGperftools index 3bf9bd2..31bf036 100755 --- a/makeGperftools +++ b/makeGperftools @@ -69,12 +69,12 @@ do ;; gperftools-[0-9]* | gperftools-svn*) gperftoolsPACKAGE="${1%%/}" - shift ;; *) - usage "unknown option/argument: '$*'" + die "unknown option/argument: '$1'" ;; esac + shift done #------------------------------------------------------------------------------ @@ -115,4 +115,4 @@ else } fi -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/makeLLVM b/makeLLVM index 505d407..33c0e0b 100755 --- a/makeLLVM +++ b/makeLLVM @@ -3,8 +3,8 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ M anipulation | +# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -26,18 +26,39 @@ # makeLLVM # # Description -# Build script for llvm/clang etc. +# Build script for llvm, clang etc. # -# - Checkout LLVM: -# svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm-svn +# Note +# - Ensure that you always use matching versions between llvm and clang. +# - The LLVM components reside in the LLVM tools/ subdirectory # -# - Checkout Clang: -# cd llvm-svn/tools -# svn co http://llvm.org/svn/llvm-project/cfe/trunk clang -# cd - +# Example, building from svn repository: +# 1) Checkout LLVM: +# svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm-svn +# +# 2) Checkout Clang, in the correct location +# cd llvm-svn/tools +# svn co http://llvm.org/svn/llvm-project/cfe/trunk clang +# cd - +# +# Example, building from tar files (version 3.8.0) +# - Unpack LLVM: +# tar -Jvf llvm-3.8.0.src.tar.xz +# mv llvm-3.8.0.src llvm-3.8.0 +# +# - Unpack Clang (also know as cfe): +# tar -Jvf cfe-3.8.0.src.tar.xz +# mv cfe-3.8.0.src llvm-3.8.0/tools/clang # #------------------------------------------------------------------------------ -llvmPACKAGE=llvm-3.6.0 +# get default llvm/clang version +WM_COMPILER_TYPE="ThirdParty" # ensure we get the correct compiler settings +WM_COMPILER=Clang # force values for 'clang' + +. $WM_PROJECT_DIR/etc/config.sh/functions +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler) + +llvmPACKAGE=$clang_version #------------------------------------------------------------------------------ # run from third-party directory only @@ -49,21 +70,25 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { } . etc/tools/ThirdPartyFunctions #------------------------------------------------------------------------------ +Script=${0##*/} usage() { exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<. +# +# Script +# makeMesa +# +# Description +# Build script for Mesa +# +# Note +# Building with mesa-12.0.1 failed to install an "osmesa.h" file, +# which renders it useless for off-screen VTK. +# +#------------------------------------------------------------------------------ +mesaPACKAGE=mesa-11.2.2 + +#------------------------------------------------------------------------------ +# run from third-party directory only +cd ${0%/*} || exit 1 +wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { + echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR" + echo " The environment variables are inconsistent with the installation." + echo " Check the OpenFOAM entries in your dot-files and source them." + exit 1 +} +. etc/tools/ThirdPartyFunctions +#------------------------------------------------------------------------------ +Script=${0##*/} + +usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat<&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<. # # Script -# makeParaView +# makeParaView3 # # Description -# Make and install paraview +# Make and install paraview for version 3.14.1 and higher # - place the paraview source under $WM_THIRD_PARTY_DIR/ParaView-VERSION # (note capitalisation) # #------------------------------------------------------------------------------ -# run from third-party directory only +# Get ParaView_DIR location from OpenFOAM config file +. $WM_PROJECT_DIR/etc/config.sh/functions +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview) + +# Determine ParaView_VERSION from ParaView_DIR location: +ParaView_VERSION="${ParaView_DIR##*/}"; export ParaView_VERSION +: ${ParaView_VERSION##*-} + +#------------------------------------------------------------------------------ +# Run from third-party directory only cd ${0%/*} || exit 1 wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR" @@ -40,7 +49,7 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { exit 1 } . etc/tools/ThirdPartyFunctions -. etc/tools/ParaView4Functions +. etc/tools/ParaView3Functions #------------------------------------------------------------------------------ # # USER OPTIONS: @@ -55,12 +64,12 @@ MPI_MAX_PROCS=32 # If it fails, specify the path using the PYTHON_LIBRARY variable withPYTHON=false PYTHON_LIBRARY="" -# PYTHON_LIBRARY="/usr/lib64/libpython2.6.so.1.0" +# PYTHON_LIBRARY="/usr/lib$WM_COMPILER_LIB_ARCH/libpython2.6.so.1.0" # MESA graphics support: withMESA=false MESA_INCLUDE="/usr/include/GL" -MESA_LIBRARY="/usr/lib64/libOSMesa.so" +MESA_LIBRARY="/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so" # extra QT gui support (useful for some third party apps) withQT=true @@ -78,10 +87,12 @@ CMAKE_PATH="" Script=${0##*/} usage() { + : ${ParaView_VERSION:=none} # some dummy value for usage information + exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<. +# +# Script +# makeVTK +# +# Description +# Make and install VTK +# - place the VTK source under $WM_THIRD_PARTY_DIR/VTK-VERSION +# +# To use the VTK source from the ParaView source tree, simply make an +# appropriate link first. For example, +# +# ln -s ParaView-5.1.0/VTK VTK-7.1.0 +# +#------------------------------------------------------------------------------ +# run from third-party directory only +cd ${0%/*} || exit 1 +wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || { + echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR" + echo " The environment variables are inconsistent with the installation." + echo " Check the OpenFOAM entries in your dot-files and source them." + exit 1 +} +. etc/tools/ThirdPartyFunctions +. etc/tools/ParaViewFunctions +. etc/tools/vtkFunctions +#------------------------------------------------------------------------------ +# +# USER OPTIONS: +# ~~~~~~~~~~~~~ + +# MPI support: +# use 0 or unset MPI_MAX_PROCS for no upper-limit +withMPI=false +unset MPI_MAX_PROCS + +# MESA graphics support: +withMESA=false +MESA_INCLUDE="/usr/include/GL" +MESA_LIBRARY="/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so" + +# Set the path to cmake +CMAKE_PATH="" + +# New rendering backend (starting with vtk 7?). +# Default to auto-config based on VTK version +withGL2=auto + + +# +# NO FURTHER EDITING BELOW THIS LINE +# +#----------------------------------------------------------------------------- +Script=${0##*/} + +usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat<