51 Commits
v1606 ... v1612

Author SHA1 Message Date
2461877bf5 BUG: inconsistency in fftw make (closes #14)
- fftw uses the double-precision interface only and thus
  makeFFTW should not have any special single-precision treatment.

- Bug is not apparent if the fftw was previously build with
  double-precision.
2017-01-09 11:23:24 +01:00
0f47e1bc1a Merge branch 'develop' into 'master'
Last-minute fix for typos

See merge request !3
2016-12-23 10:13:32 +00:00
063c34f11f BUG: CC not being properly exported in some make scripts (fixes #12) 2016-12-23 11:08:49 +01:00
4b5eff03fc Merge branch 'develop' into 'master'
Update master prior to v1612 release

See merge request !2
2016-12-20 16:53:45 +00:00
09428646a0 COMP: provide patch for ADIOS 1.11.0, when reading available transformations 2016-12-14 15:30:40 +01:00
c838cae680 CONFIG: adjust clang/llvm link to 3.7.0
- corresponds to the system clang for opensuse leap 42.1, which has
  been used extensively during the development process.
2016-12-14 10:14:26 +01:00
391a6b24ca CONFIG: update patches for paraview 5.0.1, 5.1.0, 5.1.2
- also avoid issues with '+' being treated as a list separator
  (already patched in 5.2)

--
STYLE: reformat version check output (in makeParaView)
2016-12-14 10:14:25 +01:00
4a71fbb426 ENH: retain backup copies when patching files
- allows the user to inspect what has been patched.
- also use fuzzy patching (ignore whitespace) for a bit more robustness
2016-12-13 17:23:22 +01:00
852e88b495 STYLE: align makeParaView with other make scripts
- obtain version by sourcing the coresponding OpenFOAM config file

STYLE: update build documents
2016-11-29 13:01:48 +01:00
fb4a0ee7cd ENH: ensure adios_config information reflects installation and is moveable 2016-11-28 11:27:09 +01:00
74b42821eb STYLE: minor adjustment for documentation
- remove extra scotch readme, already mentioned in regular
  BUILD/README files

- additional sources.txt to note which versions have been shipped.
2016-11-27 18:50:27 +01:00
318e249542 STYLE: reference the location of sources via the sourceBASE variable
- in the future it may be useful to locate all the sources under a
  sub-directory instead
2016-11-27 18:47:06 +01:00
cc2161856b ENH: improve third-party make with central installations
- initial attempt for building CGAL as headers-only, and without
  gmp/mpfr
2016-11-27 16:00:43 +01:00
0f5e1d6732 ENH: initial support for building ParaView with QT5
- still issues with the required version
  eg, system has qt-5.5, but ParaView tries to use qt-5.6
2016-11-23 16:01:55 +01:00
ed0c63889e Merge branch 'master' into develop 2016-11-23 13:30:05 +01:00
a76e575503 STYLE: split up detailed information into a BUILD.md
- this makes the README.md easier to read at a glance
2016-11-23 13:14:57 +01:00
8400503c5f STYLE: report path of cmake,qmake being used
- makes it easier to diagnose problems
2016-11-23 13:14:57 +01:00
a7a5eab921 ENH: provide more detailed description as README.md file (issue #11)
- include comments about building Qt etc.
2016-11-22 01:56:21 +01:00
8688694af0 COMP: Ensure makeQt work (issue #11) 2016-11-22 01:55:46 +01:00
e5f3d03715 ENH: provide more detailed description as README.md file (issue #11)
- include comments about building Qt etc.
2016-11-22 01:51:32 +01:00
9c1fb023c7 COMP: Ensure makeQt work (issue #11) 2016-11-21 23:29:30 +01:00
ba2c04d454 ENH: also support compilation of ParaView-vX.Y.Z source directories (issue #10)
- The ParaView sources mostly unpack into ParaView-v5.2.0, so support
  this directly without forcing people to rename the directory first.
2016-11-21 23:29:10 +01:00
d23b9bf968 CONFIG: use metis 'native' size for float/double
- this follows the change to metisDecomp
2016-11-13 20:26:43 +01:00
223718a8f2 COMP: ensure min compiler versions are properly noted.
- update makeLLVM to build latest clang (3.9.0), which needs cmake.
2016-11-11 19:20:27 +01:00
e2534597e0 COMP: Ensure makeParaView works for current and upcoming paraview (issue #10)
- minor patching is still required for 5.1.2 (July 2016 release).

- no patching is currently needed for 5.2.0-RC4.
  We have supplied the necessary patches upstream.

    - https://gitlab.kitware.com/paraview/paraview/merge_requests/1022
    - https://gitlab.kitware.com/paraview/paraview/merge_requests/1024
2016-11-11 18:56:30 +01:00
ecab02b5aa DEFEATURE: remove make scripts for paraview 3.x (issue #9)
- With paraview 3.14 (Feb 2012) and paraview 3.98 (Dec 2012)
  experience unresolvable build issues. Can no longer compile.
2016-11-11 13:16:07 +01:00
06b4a31573 ENH: provide makeTecio for newest tecplot library
- installs headers and static library into

  ThirdParty/platforms/$WM_ARCH$WM_COMPILER/tecio
2016-11-11 09:56:31 +01:00
0e474dcd51 STYLE: adjust comment to reflect change to wmRefresh 2016-11-10 16:26:26 +01:00
363691ff97 STYLE: inconsistency in scotch, metis library locations
- avoid leaving any duplicate run-time libraries about that are
  not part of the LD_LIBRARY_PATH.

- incorrect ADIOS library path reported
2016-11-04 21:24:45 +01:00
6b8eecffbd BUG: missing check for boost, CGAL lib64/ in Allwmake
- Non-critical since makeCGAL still caught things anyhow.

- Also report the correct locations.
2016-11-04 21:05:43 +01:00
cb7d48b428 DOC: update notes for makeMesa
- building with 12.x still seems not to work
2016-11-04 14:41:06 +01:00
1e75ef584d ENH: update building of ADIOS
- ADIOS source packages now include mxml, which means that it doesn't
  need to be built separately.

- Use OpenFOAM config.sh/ADIOS (if it exists), or explicitly define
  the version to compile. Eg, ./makeADIOS ADIOS-1.10.0
2016-11-04 11:41:12 +01:00
7623d184cd CONFIG: build boost, CGAL into lib64/ (issue #8)
- On 64-bit systems, the library locations for boost, CGAL are changing.

* Boost 1_62_0 and older build into 'lib/'.
* CGAL-4.9 builds into 'lib64/', older versions into 'lib/'.

Future-proof things by using lib$WM_COMPILER_LIB_ARCH for boost and
CGAL targets.
2016-11-04 11:29:47 +01:00
1fd3d5ab4f ENH: make compiler reference general in examples 2016-11-04 11:12:04 +01:00
da8f0c6452 Merge branch 'update-master' into 'master'
Update master

Update master to include stable development changes and bugfixes.

See merge request !1
2016-11-04 09:49:58 +00:00
5bfb563dcc ERRATA: add missing vtkFunctions file
- should have been in commit cd07d9f6bc
2016-11-04 08:31:51 +01:00
26dc62a51f MISC: update README to foundation information 2016-11-03 16:16:49 +01:00
d07150e20e BUG: Allclean removes platforms/ instead of build/ (closes #7)
- Now only cleans the build/ directory.

- Add -all, -current options etc for also removing platforms,
  if wishing a complete clean.
2016-10-14 17:52:56 +02:00
105e8a0d50 BUG: need -lrt when linking scotch on some systems (issue #6) 2016-10-07 11:00:33 +02:00
375de7066d COMP: simplify scotch makefiles
As per patch provided by Bruno Santos @wyldckat to support Raspbian.
http://bugs.openfoam.org/view.php?id=2051

STYLE: drop unneeded linkage against old POSIX librt.so
2016-09-14 10:12:03 +02:00
85180484c3 CONFIG: update cmake variables for paraview with python (issue #5)
- replace PYTHON_INCLUDE_PATH with PYTHON_INCLUDE_DIRS
  (changed in paraview 2014-10-30)

- add check for Python.h for earlier failure.
  Eg, when development headers are missing on the system.
2016-09-14 10:11:03 +02:00
f8e0b17acb ENH: provide makeParaView.example (mpi + mesa)
- an example of compiling for pvserver

- make upper-limit on MPI processes command-line configurable for
  makeParaView and add MPI support into makeVTK
2016-09-08 11:28:33 +02:00
8f68d51717 CONFIG: change default library target for ccm to be static
- Makes it easier to locate for compiling/linking and lets us
  wrap away in a C++ interface to hide low-level C routines.
2016-08-09 09:54:11 +02:00
a5ab962792 STYLE: allow argument passing in makeVTK.example 2016-08-04 16:02:09 +02:00
2453d95ef7 ENH: provide makeADIOS script 2016-08-01 11:26:49 +02:00
cd07d9f6bc ENH: provide makeMesa and makeVTK scripts 2016-08-01 10:45:10 +02:00
5dd6900492 ENH: relocate common functions into ThirdPartyFunctions
- Qualify some paraview-specific functions with 'ParaView' in the name.
  This helps with code-reuse.

STYLE: use lib$WM_COMPILER_LIB_ARCH instead of explicit lib64
2016-07-27 20:14:18 +02:00
5de10e0e5a ENH: improve flexibility of makeGcc for non-gcc builds
- ThirdParty GMP/MPFR may be needed when making CGAL, but previously
  no convenient means of compiling them without also compiling a
  ThirdParty GCC.

  Now support the combination of building GMP or MPFR, without needing
  to build GCC as well. This could benefit people using clang.

- add a '-no-theadsafe' option when building MPFR via the makeGcc
  script. This may help avoid conflicts with existing, older,
  non-thread-safe system MPFR libraries.
2016-07-27 17:38:34 +02:00
b36e02052b CONFIG: enable shared libraries when building clang 2016-07-27 17:02:28 +02:00
c20c2c2509 CONFIG: update paraview patch for paraview-5.1.0
ENH: include ThirdParty platforms when searching for cmake
2016-07-14 09:44:29 +02:00
f3ef77b946 ENH: remove reliance on ParaView_VERSION env variable
- as per the other build scripts, use the OpenFOAM config
  files for the base settings and command-line arguments
  for refinement.

  Note that the $ParaView_DIR (the installation path) contains
  the paraview version information. So there is no need to
  keep a second variable just for that purpose.
2016-07-13 09:42:00 +02:00
40 changed files with 2909 additions and 1338 deletions

125
Allclean
View File

@ -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 <http://www.gnu.org/licenses/>.
#
# 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<<USAGE
Usage: $Script [OPTION] [<platform> [ ... <platformN> ]]
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-*
do
[ -d "$i" ] && ( set -x; cd $i && make distclean )
done
Cleanup intermediate build directories.
Optionally remove specified platform(s) from the ThirdParty platforms
directory $WM_THIRD_PARTY_DIR/platforms
USAGE
exit 1
}
# clean various packages via 'realclean'
for i in scotch*/src
do
[ -d "$i" ] && ( set -x; cd $i && make realclean )
done
# clean out-of-source build directories
[ -d platforms ] && ( set -x; rm -rf platforms/* )
# Print help message
if [ "$1" = "-h" -o "$1" = "-help" ]; then
usage
fi
#------------------------------------------------------------------------------
# Clean various packages via 'distclean'
for i in openmpi-* ADIOS-* metis-*
do
[ -d "$i" ] && (
echo
echo "${i%/*}"
echo " make distclean"
echo
cd $i && make distclean
)
done
# Clean various packages via 'realclean'
for i in scotch*/src
do
[ -d "$i" ] && (
echo
echo "${i%/*}"
echo " make realclean"
echo
cd $i && make realclean
)
done
# 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
}
# 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
#------------------------------------------------------------------------------

166
Allwmake
View File

@ -29,7 +29,7 @@
# Build script for ThirdParty
#
#------------------------------------------------------------------------------
# run from third-party directory only
# 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"
@ -44,14 +44,32 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# export WM settings in a form that GNU configure recognizes
# Export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
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
}
#------------------------------------------------------------------------------
echo
echo ========================================
echo Start ThirdParty Allwmake
@ -89,7 +107,7 @@ OPENMPI)
# end of configuration options
# ----------------------------
mpiPACKAGE="${MPI_ARCH_PATH##*/}"
sourceDIR=$WM_THIRD_PARTY_DIR/$mpiPACKAGE
sourceDIR=$sourceBASE/$mpiPACKAGE
buildDIR=$buildBASE/$mpiPACKAGE
cd $sourceDIR || exit 1
@ -132,9 +150,11 @@ MPICH)
(
# WARNING: unmaintained build code:
# ---------------------------------
set -x
cd $MPI_HOME || exit 1 # change to mpich-VERSION
mpiPACKAGE="${MPI_ARCH_PATH##*/}"
sourceDIR=$sourceBASE/$mpiPACKAGE
cd $sourceDIR || exit 1
set -x
[ -e Makefile ] && make distclean 2>/dev/null
rm -rf $MPI_ARCH_PATH
rm -rf util/machines/machines.*
@ -186,9 +206,9 @@ esac
#------------------------------------------------------------------------------
# building scotch is still a bit of a pain
# Building scotch is still a bit of a pain
# get SCOTCH_VERSION, SCOTCH_ARCH_PATH
# Get SCOTCH_VERSION, SCOTCH_ARCH_PATH
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch)
then
. $settings
@ -203,8 +223,10 @@ 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
SCOTCH_SOURCE_DIR=$sourceBASE/$SCOTCH_VERSION
# This needs generalizing, but works fairly well
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 \
@ -212,10 +234,12 @@ if [ -f $SCOTCH_ARCH_PATH/include/scotch.h \
then
echo " scotch header in $SCOTCH_ARCH_PATH/include"
echo " scotch libs in $FOAM_EXT_LIBBIN"
elif [ -d "$SCOTCH_VERSION" ]
elif [ -d "$SCOTCH_SOURCE_DIR" ]
then
(
cd $SCOTCH_VERSION/src || exit 1
cd $SCOTCH_SOURCE_DIR/src || exit 1
rm -rf $SCOTCH_ARCH_PATH
applyPatch $SCOTCH_VERSION .. # patch at parent-level
prefixDIR=$SCOTCH_ARCH_PATH
@ -248,15 +272,16 @@ then
# cleanup, could also remove Makefile.inc
make realclean 2>/dev/null
)
) || warnBuildIssues SCOTCH
else
echo " Optional component (SCOTCH) was not found"
warnNotFound SCOTCH
fi
# build ptscotch if MPI (ThirdParty or system) is available
# and there is a scotch include available (ie, normal scotch was built)
# Build ptscotch if MPI (ThirdParty or system) is available
# and normal scotch was build (has include and library)
if [ "${FOAM_MPI:-dummy}" != dummy ] && \
[ -f $SCOTCH_ARCH_PATH/include/scotch.h ] || \
[ -f $SCOTCH_ARCH_PATH/include/scotch.h \
-a -r $FOAM_EXT_LIBBIN/libscotch.so ] || \
{
echo
echo " WARNING: skipping pt-scotch - 'scotch.h' include file not found!"
@ -276,18 +301,17 @@ then
echo " ptscotch libs in $FOAM_EXT_LIBBIN/$FOAM_MPI"
else
(
cd $SCOTCH_SOURCE_DIR/src || exit 1
echo
set -x
cd $SCOTCH_VERSION/src || exit 1
prefixDIR=$SCOTCH_ARCH_PATH
libDIR=$FOAM_EXT_LIBBIN/$FOAM_MPI
incDIR=$SCOTCH_ARCH_PATH/include/$FOAM_MPI
libDIR=$FOAM_EXT_LIBBIN/$FOAM_MPI
mkdir -p $prefixDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
configOpt="prefix=$prefixDIR libdir=$libDIR includedir=$incDIR"
configOpt="prefix=$prefixDIR includedir=$incDIR libdir=$libDIR"
if [ -f $scotchMakefile ]
then
@ -314,7 +338,7 @@ then
)
fi
# verify existence of scotch include
# verify existence of ptscotch include
[ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h ] || {
echo
echo " WARNING: required include file 'ptscotch.h' not found!"
@ -334,87 +358,61 @@ if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis)
then
. $settings
fi
if [ -d "$METIS_VERSION" ]
METIS_SOURCE_DIR=$sourceBASE/$METIS_VERSION
if [ -f $METIS_ARCH_PATH/include/metis.h \
-a -r $FOAM_EXT_LIBBIN/libmetis.so ]
then
echo " metis header in $METIS_ARCH_PATH/include"
echo " metis libs in $FOAM_EXT_LIBBIN"
echo
elif [ -d "$METIS_SOURCE_DIR" ]
then
(
cd $METIS_SOURCE_DIR || exit 1
rm -rf $METIS_ARCH_PATH
if [ -f $METIS_ARCH_PATH/include/metis.h \
-a -r $FOAM_EXT_LIBBIN/libmetis.so ]
then
echo " metis header in $METIS_ARCH_PATH/include"
echo " metis libs in $FOAM_EXT_LIBBIN"
echo
else
(
set -x
cd $METIS_VERSION || exit 1
# Adjust metis integer size to match OpenFOAM label-size
sed -i -e 's=\(#define IDXTYPEWIDTH\).*=\1 '$WM_LABEL_SIZE'=' \
include/metis.h
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
# No config option for the library location.
# - build normally and use mv to relocate it
# 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 \
&& mv $METIS_ARCH_PATH/lib/libmetis.so $FOAM_EXT_LIBBIN
make config shared=1 prefix=$METIS_ARCH_PATH
make -j $WM_NCOMPPROCS install
cp $METIS_ARCH_PATH/lib/libmetis.so $FOAM_EXT_LIBBIN
)
fi
rmdir $METIS_ARCH_PATH/lib 2>/dev/null || true # failure is not critical
) || warnBuildIssues METIS
else
echo " Optional component (METIS) was not found"
warnNotFound METIS
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 [ -d "$CGAL_ARCH_PATH/include" \
-a -r "$CGAL_ARCH_PATH/lib/libCGAL.so" ]
-a -r "$CGAL_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libCGAL.so" ]
then
# first some information about boost
if [ -d "$BOOST_ARCH_PATH/include/boost" \
-a -r "$BOOST_ARCH_PATH/lib/libboost_system.so" ]
then
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
for root in "$BOOST_ARCH_PATH" /usr
do
if [ -d "$root/include/boost" \
-a -r "$root/lib$WM_COMPILER_LIB_ARCH/libboost_system.so" ]
then
echo " BOOST headers in $root/include"
echo " BOOST libs in $root/lib$WM_COMPILER_LIB_ARCH"
break
fi
done
echo " CGAL headers in $CGAL_ARCH_PATH/include"
echo " CGAL libs in $CGAL_ARCH_PATH/lib"
echo " CGAL libs in $CGAL_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
elif [ -n "$CGAL_ARCH_PATH" ]
then
./makeCGAL || warnBuildIssues CGAL

442
BUILD.md Normal file
View File

@ -0,0 +1,442 @@
<!--
|--------------------------------------------------------------------------|
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | |
| \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. |
| \\/ M anipulation | |
|--------------------------------------------------------------------------|
-->
---
# OpenFOAM&reg; ThirdParty Build
OpenFOAM depends to a certain extent on third-party libraries
(*opensource only*). It also provides some interfaces to *opensource* or
*proprietary* libraries. This third-party package contains configurations and
scripts for building third-party packages. It should normally only be used in
conjunction with the corresponding OpenFOAM version.
## Organization
The ThirdParty directory contains a number of build scripts as well as
some directories:
| Directory | Contains
|-------------------|--------------------------------------------
| etc/ | auxiliary scripts used for the build process
| build/ | intermediate build objects
| platforms/ | the installation directories
## Configuration of Third-Party Versions
For most of the build scripts, the default software version
is provided by an appropriate OpenFOAM `etc/config.sh/...` entry.
This approach avoids duplicate entries for the default versions and
ensures the best overall consistency between the OpenFOAM installation
and its corresponding third-party installation.
Nonethess, the distributed make scripts can generally be used for a
variety of versions of the third-party libraries, with the software
version specified on the command-line. For example,
$ ./makeFFTW -help
usage: makeFFTW [OPTION] [fftw-VERSION]
---
## Before Starting
0. Review the [system requirements](http://www.openfoam.com/documentation/system-requirements.php)
and decide on the following:
* compiler type/version - if the system compiler is not relatively recent,
you will need a [third-party compiler](#makeGcc) installation.
* MPI type/version.
* ParaView type/version.
* CMake type/version, ...
1. If you are using a system MPI (eg, openmpi), ensure that this environment
has also been properly activated for your user.
Often (but not always) a `mpi-selector` command is available for this purpose.
You may need to open a new shell afterwards for the change to take effect.
Using the following command may help diagnosing things:
which mpicc
2. Adjust the OpenFOAM `etc/bashrc`, `etc/config.sh/...` or equivalent
`prefs.sh` files to reflect your preferred configuration.
For many config files, there are several configuration possibilities:
- Define a particular third-party version.
- Use a system installation.
- Disable use of an optional component.
- Define an alternative site-wide central location.
- After making the desired changes, use `wmRefresh` or equivalent to use the configurations.
---
## Building
Many components of ThirdParty are *optional* or are invoked
automatically as part of the top-level OpenFOAM `Allwmake`.
Nonetheless it may be necessary or useful to build various
ThirdParty components prior to building OpenFOAM itself.
### Build Sequence
1. `makeGcc` _or_ `makeLLVM` <a name="makeGcc"></a> *(optional)*
- Makes a third-party [gcc](#gcc-compiler) or [clang](#clang-compiler) installation,
which is needed if the system gcc is [too old](#gcc-compiler).
If your system compiler is recent enough, you can skip this step.
- If you do use this option, you will need the following adjustments to the
OpenFOAM `etc/bashrc` or your equivalent `prefs.sh` file:
- `WM_COMPILER_TYPE=ThirdParty`
- `WM_COMPILER=Gcc48` (for example)
- or `WM_COMPILER=Clang` and adjust the `clang_version` entry in the OpenFOAM
`etc/config.sh/compiler` or equivalent.
- More description is contained in the header comments of the
`makeGcc` and `makeLLVM` files.
- *Attention*: If you are building a newer version of clang, you may need to
update your CMake beforehand.
2. `makeCmake` *(optional)*
- Makes a third-party [CMake](#general-packages) installation, which is
needed if a system CMake does not exist or is [too old](#min-cmake),
- Note that CMake is being used by an number of third-party packages
(CGAL, LLVM, ParaView, VTK, ...)
so this may become an increasingly important aspect of the build.
3. `Allwmake`
- This will be automatically invoked by the top-level OpenFOAM `Allwmake`, but
can also be invoked directly to find possible build errors.
- Builds an mpi library (openmpi or mpich), scotch decomposition, boost, CGAL, FFTW.
- If the optional metis directory is found, it will also be compiled.
4. `makeParaView` *(optional but highly recommended)*
- This is optional, but extremely useful for visualization and for
run-time post-processing function objects.
You can build this at a later point in time, but then you should
remember to rebuild the post-processing function objects and the
reader module as well.
5. Make any additional optional components
#### Optional Components
`makeCGAL`
- Builds third-party boost and CGAL.
Automatically invoked from the ThirdParty `Allwmake`,
but can be invoked directly to resolve possible build errors.
`makeFFTW`
- Builds third-party FFTW.
Automatically invoked from the ThirdParty `Allwmake`,
but can be invoked directly to resolve possible build errors.
`makeCCMIO`
- Only required for conversion to/from STARCD/STARCCM+ files.
`makeTecio`
- Only required for conversion of results to Tecplot format.
`makeMesa`, `makeVTK`
- Additional support for building offscreen rendering components.
Useful if you want to render on computer servers without graphics cards.
The `makeParaView.example` and `makeVTK.example` files provide some useful
suggestions about compiling such a configuration.
`makeQt`
- Script to build a [third-party installation of Qt](#makeQt), including qmake.
- Possibly needed for `makeParaView`.
`makeGperftools`
- Build gperftools (originally Google Performance Tools)
`minCmake`
- Scour specified directories for CMakeLists.txt and their cmake_minimum.
Report in sorted order.
`Allclean`
- After building, this script may be used to remove intermediate build information
and save some disk space.
## Build Notes
### Scotch
- The zlib library and zlib development headers are required.
### Mesa
- Needed for off-screen rendering.
- Building with [mesa-11][older mesa] is fine and [mesa-13][link mesa] also seems to be okay.
- Building with mesa-12 is not possible since it fails to create
the necessary `include/GL` directory and `osmesa.h` file.
### VTK
- Needed for off-screen rendering and run-time post-processing without
ParaView.
- Rather than downloading VTK separately, it is easy to reuse the VTK
sources that are bundled with ParaView.
For example, by using a symbolic link:
ln -s ParaView-5.0.1/VTK VTK-7.1.0
The appropriate VTK version number can be found from the contents of
the `vtkVersion.cmake` file.
For example,
$ cat ParaView-5.0.1/VTK/CMake/vtkVersion.cmake
# VTK version number components.
set(VTK_MAJOR_VERSION 7)
set(VTK_MINOR_VERSION 1)
set(VTK_BUILD_VERSION 0)
### ParaView
- **ParaView-5.0.1** is the last version for which the OpenFOAM reader
modules (eg, to visualize a `blockMeshDict`) work in their present form.
- Building ParaView requires CMake, qmake and a `qt` development files.
Use the `-cmake`, `-qmake` and `-qt-*` options for `makeParaView` as
required.
See additional notes below about [making Qt](#makeQt) if necessary.
#### 5.2.0
- Compiles without patching, but the OpenFOAM reader modules
(eg, to visualize a `blockMeshDict`) have not yet been migrated
to this version.
#### 4.4.0/5.0.0/5.0.1/5.1.2
- When using `makeParaView`, the following patches will be automatically
applied (see the `etc/patches` directory):
- Bugfix for STL reader - affects 4.4.0 only.
- Broken installation (ui_pqExportStateWizard.h) - affects 4.4.0/5.0.0/5.0.1/5.1.x
- Building with gcc-6.1.0 - affects 4.4.0/5.0.0/5.0.1 (patch applied for 5.0.1)
- 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.
### Making Qt <a name="makeQt"></a>
- Building a third-party Qt installation (prior to building ParaView) requires
some additional effort, but should nonetheless work smoothly.
1. Download a [*qt-everywhere-opensource-src*][link Qt] package and
unpack in the third-party directory.
2. Use the `makeQt` script with the QT version number. For example,
./makeQt 4.8.7
3. Build ParaView using this third-party QT. For example,
./makeParaView -qt-4.8.7 5.0.1
- ParaView does not yet support QT5.
- If you relocate the third-party directory to another location
(eg, you built in your home directory, but want to install it in a
central location), you will need to use the `etc/relocateQt` script
afterwards.
---
## Versions
### Gcc Compiler <a name="gcc-compiler"></a>
The minimum version of gcc required is 4.8.0.
| Name | Location
|-------------------|--------------------------------------------
| [gcc][page gcc] | [releases][link gcc]
| [gmp][page gmp] | system is often ok, otherwise [download][link gmp]
| [mpfr][page mpfr] | system is often ok, otherwise [download][link mpfr]
| [mpc][page mpc] | system is often ok, otherwise [download][link mpc]
#### Potential MPFR conflicts
If you elect to use a third-party version of mpfr, you may experience
conflicts with your installed system mpfr.
On some systems, mpfr is compiled as *non-threaded*, whereas the
third-party will use *threaded* by default.
This can cause some confusion at the linker stage, since it may
resolve the system mpfr first (and find that it is *non-threaded*).
You can avoid this by one of two means:
1. Use system components for gmp/mpfr/mpc: `makeGcc -system ...`
2. Use third-party mpfr, but without threading: `makeGcc -no-threadsafe ...`
#### 32-bit build (on 64-bit)
If you have a 64-bit system, but wish to have a 32-bit compiler, you
will need to enable multi-lib support for Gcc: `makeGcc -multilib`,
which is normally disabled, since many (most?) 64-bit systems do not
install the 32-bit development libraries by default.
### Clang Compiler <a name="clang-compiler"></a>
The minimum version of clang required is 3.3.
*Attention*: If you are building a newer version of clang, you may need to
update your CMake beforehand.
GNU *configure* can only be used prior to clang version 3.9.
| Name | Location
|-----------------------|------------------------
| [clang][page clang] | [download][link clang]
| [llvm][page llvm] | [download][link llvm]
### Parallel Processing <a name="parallel"></a>
| Name | Location
|-----------------------|------------------------
| [adios][page adios] | [repo][repo adios] or [github download][link adios] or [alt download][altlink adios]
| [scotch, ptscotch][page scotch] | [download][link scotch]
| [openmpi][page openmpi] | [download][link openmpi]
### General <a name="general-packages"></a>
| Name | Location
|-----------------------|------------------------
| [CMake][page cmake] | [download][link cmake]
| [boost][page boost] | [download][link boost]
| [CGAL][page CGAL] | [download][link CGAL] or [older][older CGAL]
| [FFTW][page FFTW] | [download][link FFTW]
| [ADF/CGNS][page CGNS], ccm | [link ccmio][link ccmio]
| [tecio][page tecio] | [link tecio][link tecio]
| gperftools | [repo][repo gperftools] or [download][link gperftools]
### Visualization <a name="viz-version"></a>
| Name | Location
|-----------------------|------------------------
| [MESA][page mesa] | [download][link mesa] or [older][older mesa]
| [ParaView][page ParaView] | [download][link ParaView]. The reader modules do not yet work with the newest paraview versions.
| [Qt][page Qt] | [repo][repo Qt] or [download][link Qt]. The newer [Qt5][newer Qt5] is **not** currently supported by ParaView.
### CMake Minimum Requirements <a name="min-cmake"></a>
The minimum CMake requirements for building various components.
2.8 llvm-3.4.2
2.8.8 ParaView-5.0.1
2.8.11 CGAL-4.9
2.8.12.2 llvm-3.7.0
2.8.12.2 llvm-3.8.0
2.8.4 cmake-3.6.0
3.3 ParaView-5.1.2
3.3 ParaView-5.2.0
3.4.3 llvm-3.9.0.src
3.5 ParaView-5.1.0
### GCC Minimum Requirements <a name="min-gcc"></a>
The minimum gcc/g++ requirements for building various components.
4.7 llvm-3.7.0
4.7 llvm-3.6.2
4.7 llvm-3.5.2
4.4 llvm-3.4.2
<!-- gcc-related -->
[page gcc]: http://gcc.gnu.org/releases.html
[page gmp]: http://gmplib.org/
[page mpfr]: http://www.mpfr.org/
[page mpc]: http://www.multiprecision.org/
[link gcc]: http://gcc.gnu.org/releases.html
[link gmp]: ftp://ftp.gnu.org/gnu/gmp/gmp-6.1.0.tar.bz2
[link mpfr]: ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.4.tar.bz2
[link mpc]: ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
<!-- clang-related -->
[page clang]: http://llvm.org/
[page llvm]: http://llvm.org/
[link clang]: http://llvm.org/releases/3.7.0/cfe-3.7.0.src.tar.xz
[link llvm]: http://llvm.org/releases/3.7.0/llvm-3.7.0.src.tar.xz
[newer clang]: http://llvm.org/releases/3.9.0/cfe-3.9.0.src.tar.xz
[newer llvm]: http://llvm.org/releases/3.9.0/llvm-3.9.0.src.tar.xz
<!-- parallel -->
[page adios]: https://www.olcf.ornl.gov/center-projects/adios/
[repo adios]: https://github.com/ornladios/ADIOS
[link adios]: https://github.com/ornladios/ADIOS/archive/v1.11.0.tar.gz
[altlink adios]: http://users.nccs.gov/%7Epnorbert/adios-1.11.0.tar.gz
[page zfp]: http://computation.llnl.gov/projects/floating-point-compression/zfp-versions
[page scotch]: https://www.labri.fr/perso/pelegrin/scotch/
[link scotch]: https://gforge.inria.fr/frs/download.php/file/34099/scotch_6.0.3.tar.gz
[page openmpi]: http://www.open-mpi.org/
[link openmpi]: http://www.open-mpi.org/software/ompi/v1.10/downloads/openmpi-1.10.4.tar.bz2
[newer openmpi]: https://www.open-mpi.org/software/ompi/v2.0/downloads/openmpi-2.0.1.tar.bz2
<!-- general -->
[page cmake]: http://www.cmake.org/
[link cmake]: http://www.cmake.org/files/v3.5/cmake-3.5.2.tar.gz
[page boost]: http://boost.org
[link boost]: https://sourceforge.net/projects/boost/files/boost/1.62.0/boost_1_62_0.tar.bz2
[page CGAL]: http://cgal.org
[link CGAL]: https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.9/CGAL-4.9.tar.xz
[older CGAL]: https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.8.2/CGAL-4.8.2.tar.xz
[page FFTW]: http://www.fftw.org/
[link FFTW]: http://www.fftw.org/fftw-3.3.5.tar.gz
[page cgns]: http://cgns.github.io/
[link ccmio]: http://portal.nersc.gov/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz (check usage conditions)
[page tecio]: http://www.tecplot.com/
[link tecio]: http://www.tecplot.com/my/tecio-library/ (needs registration)
[repo gperftools]: https://github.com/gperftools/gperftools
[link gperftools]: https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz
<!-- Visualization -->
[page ParaView]: http://www.paraview.org/
[link ParaView]: http://www.paraview.org/files/v5.0/ParaView-v5.0.1-source.tar.gz
[older ParaView-44]: http://www.paraview.org/files/v4.4/ParaView-v4.4.0-source.tar.gz
[newer ParaView-51]: http://www.paraview.org/files/v5.1/ParaView-v5.1.2-source.tar.gz
[newer ParaView-52]: http://www.paraview.org/files/v5.2/ParaView-v5.2.0.tar.gz
[page mesa]: http://mesa3d.org/
[link mesa]: ftp://ftp.freedesktop.org/pub/mesa/13.0.1/mesa-13.0.1.tar.xz
[older mesa]: ftp://ftp.freedesktop.org/pub/mesa/11.2.2/mesa-11.2.2.tar.xz
[page Qt]: https://www.qt.io/download-open-source/
[repo Qt]: http://code.qt.io/cgit/qt-creator/qt-creator.git
[link Qt]: http://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz
[newer Qt5]: http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.tar.gz
<!-- Standard Footer -->
## Additional OpenFOAM Links
- [Download](http://www.openfoam.com/releases) and
[installation instructions](http://www.openfoam.com/download/installation.php)
- [Documentation](http://www.openfoam.com/documentation)
- [Reporting bugs/issues (including bugs/suggestions/feature requests) in OpenFOAM+](http://www.openfoam.com/code/bug-reporting.php)
- [Collaborative and Community-based Developments](http://www.openfoam.com/services/community-projects.php)
- [Contacting OpenCFD](http://www.openfoam.com/contact)
---
Copyright 2016 OpenCFD Ltd

83
README.md Normal file
View File

@ -0,0 +1,83 @@
<!--
|--------------------------------------------------------------------------|
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | |
| \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. |
| \\/ M anipulation | |
|--------------------------------------------------------------------------|
-->
---
# OpenFOAM&reg; ThirdParty
OpenFOAM depends to a certain extent on third-party libraries
(*opensource only*). It also provides some interfaces to *opensource* or
*proprietary* libraries. This third-party package contains configurations and
scripts for building third-party packages. It should normally only be used in
conjunction with the corresponding OpenFOAM version.
## Configuration of Third-Party Versions
For most of the build scripts, the default software version
is provided by an appropriate OpenFOAM `etc/config.sh/...` entry.
This approach avoids duplicate entries for the default versions and
ensures the best overall consistency between the OpenFOAM installation
and its corresponding third-party installation.
Nonethess, the distributed make scripts can generally be used for a
variety of versions of the third-party libraries, with the software
version specified on the command-line.
---
## Before Starting
0. Review the [system requirements](http://www.openfoam.com/documentation/system-requirements.php)
and decide on the following:
* compiler type/version (you may need a third-party compiler installation).
* MPI type/version.
* ParaView type/version.
* CMake type/version, ...
1. Adjust the OpenFOAM `etc/bashrc`, `etc/config.sh/...` or equivalent
`prefs.sh` files to reflect your preferred configuration.
2. Source the updated OpenFOAM environment
---
## Building
Many components of ThirdParty are *optional* or are invoked
automatically as part of the top-level OpenFOAM `Allwmake`.
Nonetheless it may be necessary or useful to build particular
ThirdParty components prior to building OpenFOAM itself.
### Build Sequence
1. `makeGcc` _or_ `makeLLVM` *(optional)*
2. `makeCmake` *(optional)*
3. `Allwmake`
- This will be automatically invoked by the top-level OpenFOAM `Allwmake`.
4. `makeParaView` *(optional but highly recommended)*
5. Any other additional optional components
### Build Details
More details can be found the ThirdParty ./BUILD.md information.
<!-- Standard Footer -->
## Additional OpenFOAM Links
- [Download](http://www.openfoam.com/releases) and
[installation instructions](http://www.openfoam.com/download/installation.php)
- [Documentation](http://www.openfoam.com/documentation)
- [Reporting bugs/issues (including bugs/suggestions/feature requests) in OpenFOAM+](http://www.openfoam.com/code/bug-reporting.php)
- [Collaborative and Community-based Developments](http://www.openfoam.com/services/community-projects.php)
- [Contacting OpenCFD](http://www.openfoam.com/contact)
---
Copyright 2016 OpenCFD Ltd

View File

@ -1,96 +0,0 @@
# -*- mode: org; -*-
#
#+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) 2014-2016 OpenFOAM Foundation.
# Copyright (c) 2016 OpenCFD Ltd.
* Description
Scripts for building third-party packages.
* 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)
+ 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-6.1.0.tar.bz2
+ mpfr http://www.mpfr.org/
ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.4.tar.bz2
+ mpc http://www.multiprecision.org/
ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
*** Parallel Processing
***** 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.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.8/CGAL-4.8.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/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"
DESTINATION "${VTK_INSTALL_INCLUDE_DIR}")
endif()
#+end_src
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.
(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
change to the vtkXOpenGLRenderWindow.cxx file in ParaView: Uncomment line 30
#define GLX_GLXEXT_LEGACY
# --------------------------------------------------------------------------

12
etc/patches/ADIOS-1.11.0 Normal file
View File

@ -0,0 +1,12 @@
--- ADIOS-1.11.0/src/core/adios_transform_methods.c.orig 2016-11-17 19:46:11.000000000 +0100
+++ ADIOS-1.11.0/src/core/adios_transform_methods.c 2016-12-14 15:19:39.870832445 +0100
@@ -7,6 +7,9 @@
ADIOS_AVAILABLE_TRANSFORM_METHODS * adios_available_transform_methods()
{
+ /* Ensure the transforms are initialized before accessing */
+ adios_transform_read_init();
+
int i, n;
n = 0;
for (i = (int)adios_transform_none; i < num_adios_transform_types; i++) {

1
etc/patches/adios-1.11.0 Symbolic link
View File

@ -0,0 +1 @@
ADIOS-1.11.0

View File

@ -2,12 +2,26 @@
# simple script to generate patches
paraview=ParaView-5.0.1
if [ "$#" -gt 0 ]
then
paraview="${1%%/}"
fi
[ -d "$paraview" ] || {
echo "No directory '$paraview'" 1>&2
exit 2
}
for i in \
$paraview/VTK/CMake/vtkCompilerExtras.cmake \
$paraview/VTK/CMake/GenerateExportHeader.cmake \
$paraview/Qt/Components/CMakeLists.txt \
$paraview/CMake/generate_qhp.cmake \
$paraview/CMake/ParaViewMacros.cmake \
$paraview/CMake/generate_proxydocumentation.cmake \
;
do
diff -uw $i.orig $i
done
# -----------------------------------------------------------------------------

View File

@ -16,7 +16,7 @@
ERROR_VARIABLE _gcc_version_info)
- string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]*"
+ string (REGEX MATCH "[3-6]\\.[0-9]\\.[0-9]*"
+ string (REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]*"
_gcc_version "${_gcc_version_info}")
if(NOT _gcc_version)
string (REGEX REPLACE ".*\\(GCC\\).*([34]\\.[0-9]).*" "\\1.0"
@ -27,24 +27,18 @@
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]*"
+ string(REGEX MATCH "[3-9]\\.[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 @@
@@ -640,7 +640,7 @@
#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
+if(PARAVIEW_INSTALL_DEVELOPMENT_FILES AND PARAVIEW_ENABLE_PYTHON)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h"
DESTINATION "${VTK_INSTALL_INCLUDE_DIR}")
endif()

1
etc/patches/paraview-5.0.0 Symbolic link
View File

@ -0,0 +1 @@
paraview-5.0.1

View File

@ -1,39 +1,87 @@
--- 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
+++ ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake 2016-12-13 17:21:25.382720945 +0100
@@ -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]*"
+ string (REGEX MATCH "[3-9]\\.[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
+++ ParaView-5.0.1/VTK/CMake/GenerateExportHeader.cmake 2016-12-13 17:21:25.382720945 +0100
@@ -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]*"
+ string(REGEX MATCH "[3-9]\\.[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 @@
--- ParaView-5.0.1/Qt/Components/CMakeLists.txt.orig 2016-03-28 17:07:03.000000000 +0200
+++ ParaView-5.0.1/Qt/Components/CMakeLists.txt 2016-12-13 17:38:42.713553032 +0100
@@ -656,7 +656,7 @@
#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(PARAVIEW_INSTALL_DEVELOPMENT_FILES AND PARAVIEW_ENABLE_PYTHON)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h"
DESTINATION "${VTK_INSTALL_INCLUDE_DIR}")
endif()
--- ParaView-5.0.1/CMake/generate_qhp.cmake.orig 2016-03-28 17:06:22.000000000 +0200
+++ ParaView-5.0.1/CMake/generate_qhp.cmake 2016-12-13 17:21:25.382720945 +0100
@@ -44,7 +48,9 @@
message(FATAL_ERROR "Missing one of the required arguments!!")
endif ()
-string (REPLACE "+" ";" file_patterns "${file_patterns}")
+# Recover original ';' separated list.
+string(REPLACE "_s" ";" file_patterns "${file_patterns}")
+string(REPLACE "_u" "_" file_patterns "${file_patterns}")
get_filename_component(working_dir "${output_file}" PATH)
--- ParaView-5.0.1/CMake/ParaViewMacros.cmake.orig 2016-03-28 17:07:03.000000000 +0200
+++ ParaView-5.0.1/CMake/ParaViewMacros.cmake 2016-12-13 17:21:25.382720945 +0100
@@ -219,15 +226,21 @@
set (xmls_string "")
foreach (xml ${xmls})
get_filename_component(xml "${xml}" ABSOLUTE)
- set (xmls_string "${xmls_string}${xml}+")
+ set (xmls_string "${xmls_string}${xml};")
endforeach()
set (gui_xmls_string "")
foreach (gui_xml ${gui_xmls})
get_filename_component(gui_xml "${gui_xml}" ABSOLUTE)
- set (gui_xmls_string "${gui_xmls_string}${gui_xml}+")
+ set (gui_xmls_string "${gui_xmls_string}${gui_xml};")
endforeach()
+ # Escape ';' in lists
+ string(REPLACE "_" "_u" xmls_string "${xmls_string}")
+ string(REPLACE ";" "_s" xmls_string "${xmls_string}")
+ string(REPLACE "_" "_u" gui_xmls_string "${gui_xmls_string}")
+ string(REPLACE ";" "_s" gui_xmls_string "${gui_xmls_string}")
+
set (all_xmls ${xmls} ${gui_xmls})
list (GET all_xmls 0 first_xml)
if (NOT first_xml)
--- ParaView-5.0.1/CMake/generate_proxydocumentation.cmake.orig 2016-03-28 17:06:22.000000000 +0200
+++ ParaView-5.0.1/CMake/generate_proxydocumentation.cmake 2016-12-13 17:21:25.382720945 +0100
@@ -21,8 +21,10 @@
endif()
# input_xmls is a pseudo-list. Convert it to a real CMake list.
-string(REPLACE "+" ";" input_xmls "${input_xmls}")
-string(REPLACE "+" ";" input_gui_xmls "${input_gui_xmls}")
+string(REPLACE "_s" ";" input_xmls "${input_xmls}")
+string(REPLACE "_u" "_" input_xmls "${input_xmls}")
+string(REPLACE "_s" ";" input_gui_xmls "${input_gui_xmls}")
+string(REPLACE "_u" "_" input_gui_xmls "${input_gui_xmls}")
set (xslt_xml)
#IF (NOT PV_INSTALL_NO_DEVELOPMENT)
# # Headers

1
etc/patches/paraview-5.1.0 Symbolic link
View File

@ -0,0 +1 @@
paraview-5.1.2

View File

@ -0,0 +1,65 @@
--- ParaView-5.1.2/Qt/Components/CMakeLists.txt.orig 2016-07-26 21:52:16.000000000 +0200
+++ ParaView-5.1.2/Qt/Components/CMakeLists.txt 2016-12-13 17:38:42.713553032 +0100
@@ -591,7 +591,7 @@
#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)
+if(PARAVIEW_INSTALL_DEVELOPMENT_FILES AND PARAVIEW_ENABLE_PYTHON)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h"
DESTINATION "${VTK_INSTALL_INCLUDE_DIR}")
endif()
--- ParaView-5.1.2/CMake/generate_qhp.cmake.orig 2016-03-28 17:06:22.000000000 +0200
+++ ParaView-5.1.2/CMake/generate_qhp.cmake 2016-12-13 17:21:25.382720945 +0100
@@ -44,7 +48,9 @@
message(FATAL_ERROR "Missing one of the required arguments!!")
endif ()
-string (REPLACE "+" ";" file_patterns "${file_patterns}")
+# Recover original ';' separated list.
+string(REPLACE "_s" ";" file_patterns "${file_patterns}")
+string(REPLACE "_u" "_" file_patterns "${file_patterns}")
get_filename_component(working_dir "${output_file}" PATH)
--- ParaView-5.1.2/CMake/ParaViewMacros.cmake.orig 2016-03-28 17:07:03.000000000 +0200
+++ ParaView-5.1.2/CMake/ParaViewMacros.cmake 2016-12-13 17:21:25.382720945 +0100
@@ -219,15 +226,21 @@
set (xmls_string "")
foreach (xml ${xmls})
get_filename_component(xml "${xml}" ABSOLUTE)
- set (xmls_string "${xmls_string}${xml}+")
+ set (xmls_string "${xmls_string}${xml};")
endforeach()
set (gui_xmls_string "")
foreach (gui_xml ${gui_xmls})
get_filename_component(gui_xml "${gui_xml}" ABSOLUTE)
- set (gui_xmls_string "${gui_xmls_string}${gui_xml}+")
+ set (gui_xmls_string "${gui_xmls_string}${gui_xml};")
endforeach()
+ # Escape ';' in lists
+ string(REPLACE "_" "_u" xmls_string "${xmls_string}")
+ string(REPLACE ";" "_s" xmls_string "${xmls_string}")
+ string(REPLACE "_" "_u" gui_xmls_string "${gui_xmls_string}")
+ string(REPLACE ";" "_s" gui_xmls_string "${gui_xmls_string}")
+
set (all_xmls ${xmls} ${gui_xmls})
list (GET all_xmls 0 first_xml)
if (NOT first_xml)
--- ParaView-5.1.2/CMake/generate_proxydocumentation.cmake.orig 2016-03-28 17:06:22.000000000 +0200
+++ ParaView-5.1.2/CMake/generate_proxydocumentation.cmake 2016-12-13 17:21:25.382720945 +0100
@@ -21,8 +21,10 @@
endif()
# input_xmls is a pseudo-list. Convert it to a real CMake list.
-string(REPLACE "+" ";" input_xmls "${input_xmls}")
-string(REPLACE "+" ";" input_gui_xmls "${input_gui_xmls}")
+string(REPLACE "_s" ";" input_xmls "${input_xmls}")
+string(REPLACE "_u" "_" input_xmls "${input_xmls}")
+string(REPLACE "_s" ";" input_gui_xmls "${input_gui_xmls}")
+string(REPLACE "_u" "_" input_gui_xmls "${input_gui_xmls}")
set (xslt_xml)

View File

@ -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.
@ -26,12 +26,13 @@
# etc/relocateQt
#
# Description
# Change prefix when relocating qt installation
# Change prefix when relocating QT installation
#
#------------------------------------------------------------------------------
qtVERSION=4.7.2
qtVERSION=4.8.7
#------------------------------------------------------------------------------
# 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."
@ -49,15 +50,18 @@ usage() {
usage: ${0##*/} [OPTION] [VERSION]
options:
-force create qt.conf and edit pkgconfig to use \${prefix}
-force Create qt.conf and edit pkgconfig to use \${prefix}
-help
Adjust prefix in qt.conf and pkgconfig files after relocating third-party
with a QT installation.
* adjust relocation prefix for $qtVERSION
USAGE
exit 1
}
#------------------------------------------------------------------------------
unset forceOpt
# parse options
@ -70,9 +74,10 @@ do
-f | -force)
forceOpt=true
;;
[1-9]* | qt-[1-9]*)
-qt-[1-9]* | [1-9]* | qt-*)
# -qt-VERSION, VERSION, qt-VERSION, qt-everywhere-opensource-src-VERSION
qtVERSION="${1%%/}";
qtVERSION="${qtVERSION#qt-}"
qtVERSION="${qtVERSION##*-}"
;;
*)
die "unknown option/argument: '$1'"
@ -82,9 +87,12 @@ do
done
#------------------------------------------------------------------------------
prefixDIR=$installBASE/qt-$qtVERSION
QT_ARCH_PATH=$installBASE/qt-$qtVERSION
[ "${forceOpt:-false}" = true ] && finalizeQt
if [ "${forceOpt:-false}" = true ]
then
finalizeQt
fi
changePrefix

View File

@ -1,502 +0,0 @@
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/tools/ParaViewFunctions
#
# Description
# ParaView make/install helper functions
#
#------------------------------------------------------------------------------
# buildBASE, installBASE defined from tools/ThirdPartyFunctions
#
# 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()
{
ParaView_SOURCE_DIR=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
[ -d "$ParaView_SOURCE_DIR" ] || {
echo "did not find ParaView-$ParaView_VERSION in these directories:"
echo " WM_THIRD_PARTY_DIR=$WM_THIRD_PARTY_DIR"
echo
echo "abort build"
exit 1
}
# ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION-$OBJ_ADD
ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION
# ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION-$OBJ_ADD
ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION
export ParaView_SOURCE_DIR ParaView_BINARY_DIR ParaView_DIR
echo
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
#
# $1 can contain something something like 4.4.0, paraview-4.4.0, ParaView-4.0.0
#
setVersion()
{
[ $# -gt 0 ] || {
echo "Error: function setVersion() called without an argument"
exit 1
}
ParaView_VERSION="${1##*-}"
# The major version is "<digits>.<digits>"
ParaView_MAJOR=$(echo $ParaView_VERSION | \
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
export ParaView_VERSION ParaView_MAJOR
}
#------------------------------------------------------------------------------
#
# 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=$(
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:-NONE}"
fi
}
#
# Set CMake cache variables
#
addCMakeVariable()
{
while [ -n "$1" ]
do
CMAKE_VARIABLES="$CMAKE_VARIABLES -D$1"
shift
done
}
#
# Verbose makefiles
#
addVerbosity()
{
if [ "${withVERBOSE:=false}" = true ]
then
addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE"
fi
}
#
# Define options for mpi support
#
addMpiSupport()
{
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"
}
#
# Define options for python support
#
addPythonSupport()
{
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
if [ ! -e "$PYTHON_LIBRARY" ]
then
echo "*** Error: libpython not found at location specified " \
"by -pythnon-lib input: PYTHON_LIBRARY=$PYTHON_LIBRARY"
fi
else
# Try to get $PYTHON_LIBRARY from dynamically linked binary
PYTHON_LIBRARY=$(ldd $pythonBin | \
sed -ne '/libpython/s/.* => \(.*\) (.*/\1/p')
[ -e "$PYTHON_LIBRARY" ] || {
echo "*** Error: Unable to determine path to python library."
}
fi
[ -e "$PYTHON_LIBRARY" ] || {
echo " Please set the full path to the python library "
echo " (including libpython) using the -python-lib option, "
echo " or deactivate python support by not using the -python "
echo " option"
exit 1
}
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" ] || {
echo " No python headers found in $pythonInclude/"
echo " Please install python headers or deactivate "
echo " python support by not using the -python option"
exit 1
}
addCMakeVariable "PARAVIEW_ENABLE_PYTHON=ON"
addCMakeVariable "PYTHON_INCLUDE_PATH=$pythonInclude"
addCMakeVariable "PYTHON_LIBRARY=$PYTHON_LIBRARY"
echo "----"
echo "Python information:"
echo " executable : $pythonBin"
echo " version : $pythonMajor"
echo " include path : $pythonInclude"
echo " library : $PYTHON_LIBRARY"
unset pythonBin pythonInclude pythonMajor
else
echo "*** Error: python not found"
echo "*** Deactivate python support by not using the -python "
echo "*** option"
exit 1
fi
}
#
# Define options for mesa support
#
addMesaSupport()
{
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 "OSMESA_INCLUDE_DIR=$MESA_INCLUDE"
addCMakeVariable "OSMESA_LIBRARY=$MESA_LIBRARY"
else
echo "*** Error: no MESA information found"
echo "*** Deactivate MESA support by not using the -mesa option, "
echo "*** or set the correct paths for:"
echo "*** -mesa-include ($MESA_INCLUDE)"
echo "*** -mesa-lib ($MESA_LIBRARY)"
exit 1
fi
}
addQtSupport()
{
QtVersion=none
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
# Check qmake can be found
if type $qmakeExe >/dev/null 2>&1
then
# Check the Qt version selected
# parse -> "Using Qt version X.Y.Z in ..."
QtVersion=$($qmakeExe -query QT_VERSION)
# Split Major.Minor.Revision - could also use IFS hacking
set -- $(echo "$QtVersion" | sed -e 's/\./ /g')
QtMajor=$1
QtMinor=$2
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 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"
exit 1
fi
else
echo "*** Error: cannot find qmake either at \$QMAKE_PATH or in current \$PATH"
exit 1
fi
}
#
# 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
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
if [ -z "$cmakeExe" ]
then
cmakeExe=cmake
fi
# Remove any existing build folder and recreate
if [ -d $ParaView_BINARY_DIR ]
then
echo "removing old build directory"
echo " $ParaView_BINARY_DIR"
rm -rf $ParaView_BINARY_DIR
fi
mkdir -p $ParaView_BINARY_DIR
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 "----"
echo
echo "$cmakeExe" \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_SOURCE_DIR
echo
echo "----"
echo
# Run cmake to create Makefiles
$cmakeExe -Wno-dev \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_SOURCE_DIR
}
#
# Invoke make
# also link bin/ to lib/paraview-* for development without installation
#
makeParaView()
{
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
# (how this was previously handled before 'make install' worked)
if [ -L lib ]
then
rm lib 2>/dev/null
fi
}
#
# Install the program
#
installParaView()
{
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
Now update the environment by running:
wmREFRESH
---
INFO
}
#------------------------------------------------------------------------------
# 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
# 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:BOOL=ON"
# Don't build test tree
addCMakeVariable "BUILD_TESTING:BOOL=OFF"
# remove dependency on WebKit
# addCMakeVariable VTK_QT_USE_WEBKIT:BOOL=OFF
#------------------------------------------------------------------------------

View File

@ -29,7 +29,7 @@
#
#------------------------------------------------------------------------------
# buildBASE, installBASE defined from tools/ThirdPartyFunctions
# sourceBASE, buildBASE, installBASE defined in tools/ThirdPartyFunctions
#
# Where things are or should be put
@ -39,22 +39,32 @@
# 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
set -- "ParaView-$ParaView_VERSION" "ParaView-v$ParaView_VERSION"
unset ParaView_SOURCE_DIR
for i
do
ParaView_SOURCE_DIR="$sourceBASE/$i"
[ -d "$ParaView_SOURCE_DIR" ] && break
done
[ -d "$ParaView_SOURCE_DIR" ] || {
echo "did not find ParaView-$ParaView_VERSION in these directories:"
echo " WM_THIRD_PARTY_DIR=$WM_THIRD_PARTY_DIR"
echo "Did not locate ParaView version:"
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
echo
echo "In the directory:"
echo " $sourceBASE"
echo
echo "abort build"
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
@ -74,10 +84,10 @@ setDirs()
#
# $1 can contain something something like 4.4.0, paraview-4.4.0, ParaView-4.0.0
#
setVersion()
setParaViewVersion()
{
[ $# -gt 0 ] || {
echo "Error: function setVersion() called without an argument"
echo "Error: function setParaViewVersion() called without an argument"
exit 1
}
@ -107,9 +117,9 @@ checkVersion()
if [ "$ParaView_VERSION" != "$ver" ]
then
echo "MISMATCH!"
echo " specified $ParaView_VERSION"
echo " found ${ver:-NONE}"
echo "(${ver:-none}) mismatch?"
else
echo "(${ver:-none})"
fi
}
@ -151,7 +161,10 @@ addMpiSupport()
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
}
@ -199,7 +212,7 @@ addPythonSupport()
pythonInclude=/usr/include/python$pythonMajor
# Note - we could also allow for a PYTHON_INCLUDE variable ...
[ -d "$pythonInclude" ] || {
[ -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"
@ -207,7 +220,7 @@ addPythonSupport()
}
addCMakeVariable "PARAVIEW_ENABLE_PYTHON=ON"
addCMakeVariable "PYTHON_INCLUDE_PATH=$pythonInclude"
addCMakeVariable "PYTHON_INCLUDE_DIRS=$pythonInclude"
addCMakeVariable "PYTHON_LIBRARY=$PYTHON_LIBRARY"
echo "----"
@ -241,7 +254,7 @@ addMesaSupport()
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"
@ -279,72 +292,46 @@ addQtSupport()
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
set -- $(echo "$QtVersion" | sed -e 's/\./ /g')
case "$QtVersion" in
3.* | 4.[0-4]*)
# QT is too old
cat <<ERROR
----
Error: ${0##*/}
QtMajor=$1
QtMinor=$2
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 "*** e.g."
echo "*** -qmake /usr/local/qt-4.6.2/bin/qmake"
echo "*** -qmake $installBASE/qt-4.6.2/bin/qmake"
QT version ($QtVersion) provided < 4.5
Please use the -qmake option to specify the location of a newer QT version
For example,
... -qmake /usr/local/qt-4.6.2/bin/qmake
... -qmake $installBASE/qt-4.6.2/bin/qmake
----
ERROR
exit 1
fi
;;
5.*)
# QT4 is the default, must specify QT5 explicitly
addCMakeVariable "PARAVIEW_QT_VERSION:STRING=5"
;;
esac
else
echo "*** Error: cannot find qmake either at \$QMAKE_PATH or in current \$PATH"
echo "Error: cannot find qmake either at \$QMAKE_PATH or in current \$PATH"
echo
exit 1
fi
}
@ -364,44 +351,7 @@ patchParaView()
#
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
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
if [ -z "$cmakeExe" ]
then
cmakeExe=cmake
fi
local cmake=$(findCMake)
# Remove any existing build folder and recreate
if [ -d $ParaView_BINARY_DIR ]
@ -427,9 +377,10 @@ configParaView()
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
@ -438,7 +389,7 @@ configParaView()
echo
# Run cmake to create Makefiles
$cmakeExe \
$cmake \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_SOURCE_DIR
@ -476,10 +427,13 @@ installParaView()
make install
cat<< INFO
---
Installation complete for paraview-$ParaView_VERSION
Now update the environment by running:
wmREFRESH
ParaView_DIR=$ParaView_DIR
You may need to update the OpenFOAM environment by running:
wmRefresh
---
INFO
}

View File

@ -3,7 +3,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.
@ -30,41 +30,41 @@
#------------------------------------------------------------------------------
#
# create a qt.conf file in the QT bin/
# this can be modified easily if the qt installation gets relocated
# Create a qt.conf file in the QT bin/
# - this can be modified easily if the qt installation is relocated
#
createQtConf()
{
echo "create:"
echo " $prefixDIR/bin/qt.conf"
echo " $QT_ARCH_PATH/bin/qt.conf"
[ -n "$prefixDIR" -a -d "$prefixDIR/bin" ] || {
echo "Error: prefixDIR not correctly set"
[ -n "$QT_ARCH_PATH" -a -d "$QT_ARCH_PATH/bin" ] || {
echo "Error: QT_ARCH_PATH not correctly set"
return
}
echo "[Paths]" > $prefixDIR/bin/qt.conf
echo "Prefix=$prefixDIR" >> $prefixDIR/bin/qt.conf
echo "[Paths]" > $QT_ARCH_PATH/bin/qt.conf
echo "Prefix=$QT_ARCH_PATH" >> $QT_ARCH_PATH/bin/qt.conf
}
#
# adjust pkgconfig information
# Adjust pkgconfig information
# to generalize *location=, -L/... and -I/...
# to use ${prefix}
#
adjustPkgConfig()
{
echo "edit pkgconfig:"
echo " $prefixDIR/lib/pkgconfig/*.pc"
echo " $QT_ARCH_PATH/lib/pkgconfig/*.pc"
[ -n "$prefixDIR" -a -d "$prefixDIR/lib/pkgconfig" ] || {
echo "Error: prefixDIR not correctly set"
[ -n "$QT_ARCH_PATH" -a -d "$QT_ARCH_PATH/lib/pkgconfig" ] || {
echo "Error: QT_ARCH_PATH not correctly set"
return
}
(
cd $prefixDIR/lib/pkgconfig || exit
cd $QT_ARCH_PATH/lib/pkgconfig || exit
unset nfiles
for i in *.pc
@ -73,8 +73,8 @@ adjustPkgConfig()
then
nfiles="x$nfiles"
sed -i \
-e 's@\(location=\)'"$prefixDIR/"'@\1${prefix}/@' \
-e 's@\(-[IL]\)'"$prefixDIR/"'@\1${prefix}/@g' \
-e 's@\(location=\)'"$QT_ARCH_PATH/"'@\1${prefix}/@' \
-e 's@\(-[IL]\)'"$QT_ARCH_PATH/"'@\1${prefix}/@g' \
$i
fi
done
@ -84,29 +84,29 @@ adjustPkgConfig()
#
# change prefix=... and Prefix=... to use ${prefix}
# Change prefix=... and Prefix=... to use ${prefix}
#
changePrefix()
{
echo "relocate QT installation to new prefix directory:"
echo " $prefixDIR"
echo " $QT_ARCH_PATH"
echo "edit:"
echo " $prefixDIR/bin/qt.conf"
echo " $prefixDIR/lib/pkgconfig/*.pc"
echo " $QT_ARCH_PATH/bin/qt.conf"
echo " $QT_ARCH_PATH/lib/pkgconfig/*.pc"
[ -n "$prefixDIR" -a -d "$prefixDIR/bin" -a -d "$prefixDIR/lib/pkgconfig" ] || {
echo "Error: prefixDIR not correctly set"
[ -n "$QT_ARCH_PATH" -a -d "$QT_ARCH_PATH/bin" -a -d "$QT_ARCH_PATH/lib/pkgconfig" ] || {
echo "Error: QT_ARCH_PATH not correctly set"
return
}
# adjust qt.conf
for i in $prefixDIR/bin/qt.conf
for i in $QT_ARCH_PATH/bin/qt.conf
do
if [ -f "$i" ]
then
nfiles="x$nfiles"
sed -i \
-e 's@^\([Pp]refix=\).*$@\1'"$prefixDIR@" \
-e 's@^\([Pp]refix=\).*$@\1'"$QT_ARCH_PATH@" \
$i
echo " edited 1 file"
fi
@ -114,7 +114,7 @@ changePrefix()
# adjust pkgconfig files
(
cd $prefixDIR/lib/pkgconfig || exit
cd $QT_ARCH_PATH/lib/pkgconfig || exit
unset nfiles
for i in *.pc
@ -123,7 +123,7 @@ changePrefix()
then
nfiles="x$nfiles"
sed -i \
-e 's@^\([Pp]refix=\).*$@\1'"$prefixDIR@" \
-e 's@^\([Pp]refix=\).*$@\1'"$QT_ARCH_PATH@" \
$i
fi
done

View File

@ -31,11 +31,11 @@
# Define WM_NCOMPPROCS always.
#------------------------------------------------------------------------------
# Define the normal build and prefix directories
# The normal locations for source, build and installation (prefix-dir)
sourceBASE=$WM_THIRD_PARTY_DIR
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
#
# Mostly building without wmake
# - disable wmakeScheduler variables
@ -85,6 +85,150 @@ _foamIsSystem()
}
#
# try to locate cmake according to the CMAKE_PATH
# or just use what is found in the path
#
unset CMAKE_PATH # clear when first loaded
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 "Using cmake=$foundExe" 1>&2
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 to use the path, try resolving (so we know what we are using)
foundExe=$(command -v cmake 2> /dev/null) || foundExe=cmake
echo "Using cmake=${foundExe:-NotFound}" 1>&2
echo "${foundExe:-cmake}"
}
#
# try to locate qmake according to the QMAKE_PATH
# or just use what is found in the path
#
unset QMAKE_PATH # clear when first loaded
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 "Using qmake=$foundExe" 1>&2
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 to use the path, try resolving (so we know what we are using)
foundExe=$(command -v qmake 2> /dev/null) || foundExe=qmake
echo "Using qmake=${foundExe:-NotFound}" 1>&2
echo "${foundExe:-qmake}"
}
#
# Download file $1 from url $2 into download/ directory
#
@ -181,7 +325,7 @@ applyPatch()
else
echo "apply patch for $pkg"
touch "$sentinel"
patch -p1 < $patch 2>&1 | tee $sentinel
patch -b -l -p1 < $patch 2>&1 | tee $sentinel
fi
)
else

214
etc/tools/vtkFunctions Normal file
View File

@ -0,0 +1,214 @@
#---------------------------------*- 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 <http://www.gnu.org/licenses/>.
#
# File
# etc/tools/vtkFunctions
#
# Description
# VTK (library) make/install helper functions.
# To be loaded *after* etc/tools/ParaViewFunctions
#
#------------------------------------------------------------------------------
# sourceBASE, buildBASE, installBASE defined in 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()
{
set -- "VTK-$VTK_VERSION" "VTK-v$VTK_VERSION"
unset VTK_SOURCE_DIR
for i
do
VTK_SOURCE_DIR="$sourceBASE/$i"
[ -d "$VTK_SOURCE_DIR" ] && break
done
[ -d "$VTK_SOURCE_DIR" ] || {
echo "Did not locate VTK version:"
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
echo
echo "In the directory:"
echo " $sourceBASE"
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 "<digits>.<digits>"
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"
#------------------------------------------------------------------------------

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

368
makeADIOS Executable file
View File

@ -0,0 +1,368 @@
#!/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 <http://www.gnu.org/licenses/>.
#
# Script
# makeADIOS
#
# Description
# Build script for ADIOS
#
#------------------------------------------------------------------------------
# Get version info
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ADIOS)
adiosPACKAGE=${adios_version:-adios-none}
#------------------------------------------------------------------------------
# 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<<USAGE
usage: ${0##*/} [OPTION] [adios-VERSION]
options:
-cmake PATH With cmake from the path given
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-help
* Build ADIOS
$adiosPACKAGE
USAGE
exit 1
}
#------------------------------------------------------------------------------
# Export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
shift
;;
ADIOS-[1-9]* | adios-[1-9]* | ADIOS-git* | adios-git*)
adiosPACKAGE="${1%%/}"
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$adiosPACKAGE" ] || die "The adios-VERSION was not specified"
# nothing to build
if _foamIsNone "$adiosPACKAGE"
then
echo "Using adios-none (skip ThirdParty build of ADIOS)"
exit 0
elif _foamIsSystem "$adiosPACKAGE"
then
echo "Using adios-system"
exit 0
fi
#------------------------------------------------------------------------------
#
# Build ADIOS
# ADIOS_SOURCE_DIR : location of the original sources
# ADIOS_ARCH_PATH : installation directory
ADIOS_SOURCE_DIR=$sourceBASE/$adiosPACKAGE
ADIOS_ARCH_PATH=$installBASE/$adiosPACKAGE
: ${FOAM_MPI:=dummy}
echo
echo ========================================
echo "Build adios library $adiosPACKAGE for $FOAM_MPI"
echo
#
# Manual adjustments to adios config
#
adjustADIOS()
{
# Rename libraries according to FOAM_MPI
(
cd $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH || exit 1
if [ "$FOAM_MPI" != dummy ]
then
\mv -f libadios.a libadios_$FOAM_MPI.a
\mv -f libadiosread.a libadiosread_$FOAM_MPI.a
fi
\mv -f libadios_nompi.a libadios_dummy.a
\mv -f libadiosread_nompi.a libadiosread_dummy.a
echo
echo "ADIOS library renamed to libadios_$FOAM_MPI"
echo
)
# We don't need/use XML things
\rm -f $ADIOS_ARCH_PATH/bin/adios_lint
# Replace resolved paths with variables
echo "Adjust prefix for ADIOS"
for i in \
$ADIOS_ARCH_PATH/bin/adios_config \
$ADIOS_ARCH_PATH/etc/adios_config.flags \
;
do
[ -f "$i" ] || {
echo " no such file - '$i'"
continue
}
if sed -i -e 's|'"$WM_THIRD_PARTY_DIR"'|$WM_THIRD_PARTY_DIR|g' $i
then
echo " '$i'"
else
echo " problems with '$i'"
fi
done
# Adjust the config flags file:
# * Remove references to Fortran libraries (disabled in configure)
# * Remove references to deprecated version 1 API
# * Cleanup excessive whitespace
# * Handle renamed libraries:
# - libadios -> libadios_$FOAM_MPI
# - libadios_nompi -> libadios_dummy
#
echo "Adjust library names for ADIOS"
for i in \
$ADIOS_ARCH_PATH/etc/adios_config.flags \
;
do
[ -f "$i" ] || {
echo " no such file - '$i'"
continue
}
if sed -i \
-e '/_FLIB=/d' \
-e '/_V1_INC=/d' \
-e 's| *| |g' \
-e 's|\(-ladios[a-z]*_\)nompi |\1dummy |g' \
$i
then
echo " '$i'"
else
echo " problems with '$i'"
fi
if [ "$FOAM_MPI" != dummy ]
then
sed -i -e 's|\(-ladios[a-z]*\) |\1_'"$FOAM_MPI |g" $i || \
echo " problems with '$i'"
fi
done
}
#
# List ADIOS methods/configuration
#
listMethods()
{
[ -f $ADIOS_ARCH_PATH/bin/adios_config ] || {
echo "Warning: no adios_config"
return 1
}
echo "==============="
# May have problems listing parallel methods (eg, transport key missing)
if $ADIOS_ARCH_PATH/bin/adios_config -m >/dev/null 2>&1
then
$ADIOS_ARCH_PATH/bin/adios_config -m 2>/dev/null
else
echo "Warning: could not list parallel methods"
# Fallback to serial methods
$ADIOS_ARCH_PATH/bin/adios_config -s -m 2>/dev/null
fi || echo "Warning: could not list configured methods"
echo "==============="
}
# Needs future adjustment
# - for shared library
# - for mpi-specific library locations
if [ -f $ADIOS_ARCH_PATH/include/adios.h \
-a -r $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios_${FOAM_MPI}.a ]
then
echo " ADIOS header in $ADIOS_ARCH_PATH/include"
### echo " ADIOS libs in $FOAM_EXT_LIBBIN" # dynamic
echo " ADIOS libs in $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" # static
listMethods
elif [ -z "$CMAKE_PATH" ]
then
echo "Starting build: $adiosPACKAGE (using configure)"
echo
(
# configuration options:
unset configOpt
# Add InfiniBand support
ibDir=/usr/local/ofed
if [ -d "$ibDir" -a "$FOAM_MPI" != dummy ]
then
configOpt="$configOpt --with-infiniband=$ibDir"
fi
# Transport layers
if [ -f "/usr/include/bzlib.h" ]
then
configOpt="$configOpt --with-bzip2"
fi
if [ -f "/usr/include/zlib.h" ]
then
configOpt="$configOpt --with-zlib"
fi
# Other types of support
## $configOpt="$configOpt --with-hdf5=..."
## $configOpt="$configOpt --with-lustre=..."
## configOpt="$configOpt --enable-research-transports"
# end of configuration options
# ----------------------------
buildDIR=$buildBASE/$adiosPACKAGE
cd $ADIOS_SOURCE_DIR || exit 1
[ -e Makefile ] && make distclean 2>/dev/null
export GIT_DIR=$ADIOS_SOURCE_DIR/.git
applyPatch $adiosPACKAGE $ADIOS_SOURCE_DIR
# Remove any existing build folder and recreate
rm -rf $ADIOS_ARCH_DIR
rm -rf $buildDIR 2>/dev/null
mkdir -p $buildDIR
[ -f configure ] || {
echo "no configure for $adiosPACKAGE ... trying autogen"
./autogen.sh
}
# May not work properly with FOAM_MPI = dummy
if [ "$FOAM_MPI" = dummy ]
then
configOpt="$configOpt --without-mpi"
else
CC=mpicc
CXX=mpicxx
fi
# Install into lib64/
cd $buildDIR && $ADIOS_SOURCE_DIR/configure \
--prefix=$ADIOS_ARCH_PATH \
--libdir=$ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--disable-fortran \
--with-pic \
--without-fastbit \
$configOpt \
&& make -j $WM_NCOMPPROCS all \
&& make install \
&& echo "Built: $adiosPACKAGE" \
&& adjustADIOS \
&& listMethods
) || {
echo "Error building: $adiosPACKAGE"
}
else
# CMake options often lag the configure ones
echo "Starting build: $adiosPACKAGE (using cmake)"
echo
(
buildDIR=$buildBASE/$adiosPACKAGE
cd $ADIOS_SOURCE_DIR || exit 1
export GIT_DIR=$ADIOS_SOURCE_DIR/.git
applyPatch $adiosPACKAGE $ADIOS_SOURCE_DIR
# Remove any existing build folder and recreate
rm -rf $ADIOS_ARCH_DIR
rm -rf $buildDIR 2>/dev/null
mkdir -p $buildDIR
# May not work properly with FOAM_MPI = dummy
if [ "$FOAM_MPI" = dummy ]
then
configOpt="$configOpt --without-mpi"
else
CC=mpicc
CXX=mpicxx
fi
cmake=$(findCMake)
# Install into lib64/
cd $buildDIR && $cmake \
-DCMAKE_INSTALL_PREFIX=$ADIOS_ARCH_PATH \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_FORTRAN:BOOL=FALSE \
$ADIOS_SOURCE_DIR \
&& make -j $WM_NCOMPPROCS all \
&& make install \
&& echo "Built: $adiosPACKAGE" \
&& adjustADIOS \
&& listMethods
) || {
echo "Error building: $adiosPACKAGE"
}
fi
# ----------------------------------------------------------------- end-of-file

View File

@ -29,16 +29,15 @@
# 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=libso
targetType=lib
#------------------------------------------------------------------------------
# run from third-party directory only
# 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"
@ -53,7 +52,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage()
{
exec 1>&2
@ -79,6 +77,7 @@ options:
USAGE
exit 1
}
#------------------------------------------------------------------------------
# Parse options
@ -102,10 +101,10 @@ do
done
# assert: directory must be available
[ -d "${ccmioPACKAGE}" ] || die "missing source directory '$ccmioPACKAGE'"
[ -d "$ccmioPACKAGE" ] || die "missing source directory '$ccmioPACKAGE'"
#------------------------------------------------------------------------------
CCMIO_SOURCE_DIR=$sourceBASE/$ccmioPACKAGE
CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE
#
@ -113,7 +112,7 @@ CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE
#
echo "---------------"
(
cd $ccmioPACKAGE || exit 1
cd $CCMIO_SOURCE_DIR || exit 1
incDIR=$CCMIO_ARCH_PATH/include/libccmio
libDIR=$CCMIO_ARCH_PATH/lib
@ -135,5 +134,4 @@ echo "---------------"
fi
)
#------------------------------------------------------------------------------

169
makeCGAL
View File

@ -35,13 +35,14 @@
# makeCGAL boost-system gmp-system
#
#------------------------------------------------------------------------------
# Get CGAL, boost and gmp/mpfr versions
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
unset BOOST_ARCH_PATH CGAL_ARCH_PATH # purge current values
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL)
# compiler first, let CGAL config override GMP (eg, when there is no GMP)
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL)
boostPACKAGE=${boost_version:-boost-system}
gmpPACKAGE=${gmp_version:-gmp-system}
@ -59,7 +60,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
Script="${0##*/}"
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
@ -67,7 +67,9 @@ usage() {
usage: $Script [OPTION] [CGAL-VERSION] [boost-VERSION] [gmp-VERSION] [mpfr-VERSION]
options:
-cmake PATH with cmake from the path given
-gcc force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-no-lib compile CGAL for use in headers only mode (since CGAL 4.9)
-system use system versions for boost/gmp/mpfr
-help
@ -82,15 +84,18 @@ To override this behaviour (and use the system boost and/or gmp/mpfr),
simply specify a 'system' version. For example,
$Script boost-system gmp-system
Use gmp-none to disable use of gmp/mpfr (eg, not available)
USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CCX"
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
unset optHeadersOnly
# Parse options
while [ "$#" -gt 0 ]
do
@ -105,22 +110,33 @@ do
export CC=gcc # use gcc/g++
export CXX=g++
;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
shift
;;
-sys*)
gmpPACKAGE="gmp-system"
mpfrPACKAGE="mpfr-system"
boostPACKAGE="boost-system"
unset BOOST_ARCH_PATH # avoid inconsistency
;;
gmp-[4-9]* | gmp-system)
-no-lib)
optHeadersOnly=true
;;
gmp-[4-9]* | gmp-system | gmp-none)
gmpPACKAGE="${1%%/}"
;;
mpfr-[2-9]* | mpfr-system)
mpfr-[2-9]* | mpfr-system | mpfr-none)
mpfrPACKAGE="${1%%/}"
;;
CGAL-[0-9]*)
cgalPACKAGE="${1%%/}"
unset CGAL_ARCH_PATH # avoid inconsistency
;;
boost-[0-9]* | boost_[0-9]* | boost-system )
boostPACKAGE="${1%%/}"
unset BOOST_ARCH_PATH # avoid inconsistency
;;
*)
die "unknown option/argument: '$1'"
@ -131,13 +147,13 @@ done
[ -n "$cgalPACKAGE" ] || die "The cgal-VERSION was not specified"
# nothing to build
if _foamIsNone "$boostPACKAGE"
# Nothing to build
if _foamIsNone $boostPACKAGE
then
echo "Using boost-none (skip ThirdParty build of BOOST/CGAL)"
exit 0
fi
if _foamIsNone "$cgalPACKAGE"
if _foamIsNone $cgalPACKAGE
then
echo "Using cgal-none (skip ThirdParty build of CGAL)"
exit 0
@ -146,31 +162,37 @@ fi
#------------------------------------------------------------------------------
#
# Build Boost
# For 64-bit
# - Third-Party builds into 'lib'
# For 64-bit:
# - system is normally built into 'lib64'
# - use Third-Party 'lib64' for consistency.
# Boost 1_62_0 and older normally build into 'lib'.
#
# BOOST_ARCH_PATH : installation directory
# BOOST_SOURCE_DIR : location of the original sources
BOOST_ARCH_PATH=$installBASE/$boostPACKAGE
BOOST_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$boostPACKAGE
BOOST_SOURCE_DIR=$sourceBASE/$boostPACKAGE
: ${BOOST_ARCH_PATH:=$installBASE/$boostPACKAGE} # Fallback
if [ -d "$BOOST_ARCH_PATH" ]
then
boostInc="$BOOST_ARCH_PATH/include"
boostLib="$BOOST_ARCH_PATH/lib"
elif _foamIsSystem $BOOST_ARCH_PATH
boostInc="$BOOST_ARCH_PATH/include"
boostLib="$BOOST_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
if _foamIsSystem $boostPACKAGE
then
echo "Using boost-system (skip ThirdParty build of BOOST)"
boostInc="/usr/include"
boostLib="/usr/lib$WM_COMPILER_LIB_ARCH"
else
echo "Starting build: boost"
echo
# Tagged as 'system' but could actually point to a central location
[ -d "$BOOST_ARCH_PATH/include" ] || {
boostInc="/usr/include"
boostLib="/usr/lib$WM_COMPILER_LIB_ARCH"
}
boostInc="$BOOST_ARCH_PATH/include"
boostLib="$BOOST_ARCH_PATH/lib"
elif [ -f "$boostInc/boost/version.hpp" ]
then
echo "Using $boostPACKAGE"
else
echo "Starting build: $boostPACKAGE"
echo
# Absolute path for --libdir
(
cd $BOOST_SOURCE_DIR || exit 1
@ -179,6 +201,7 @@ else
./bootstrap.sh \
--prefix=$BOOST_ARCH_PATH \
--libdir=$boostLib \
--with-libraries=thread \
--with-libraries=system \
&& ./bjam toolset=$WM_CC -j $WM_NCOMPPROCS install \
@ -190,7 +213,7 @@ else
fi
# nothing left to build
if _foamIsSystem "$cgalPACKAGE"
if _foamIsSystem $cgalPACKAGE
then
echo "Using cgal-system (skip ThirdParty build of CGAL)"
exit 0
@ -225,26 +248,37 @@ SUMMARY
#------------------------------------------------------------------------------
#
# Build CGAL
# For 64-bit
# - Third-Party builds into 'lib'
# For 64-bit:
# - system is normally built into 'lib64'
# - use Third-Party 'lib64' for consistency.
# CGAL-4.9 normally builds into 'lib64', older versions into 'lib'.
#
# CGAL_SOURCE_DIR : location of the original sources
# CGAL_BINARY_DIR : location of the build
# CGAL_DIR : location of the installed program
# CGAL_ARCH_PATH : installation directory
CGAL_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$cgalPACKAGE
CGAL_SOURCE_DIR=$sourceBASE/$cgalPACKAGE
CGAL_BINARY_DIR=$buildBASE/$cgalPACKAGE
CGAL_ARCH_PATH=$installBASE/$cgalPACKAGE
CGAL_DIR=$CGAL_ARCH_PATH
: ${CGAL_ARCH_PATH:=$installBASE/$cgalPACKAGE} # Fallback
#
# gmp/mpfr installed without compiler name
# gmp/mpfr are installed without compiler name
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
# Enable/disable gmp/mpfr together
if _foamIsNone $gmpPACKAGE || _foamIsNone $mpfrPACKAGE
then
GMP_ARCH_PATH=none
MPFR_ARCH_PATH=none
elif _foamIsSystem $GMP_ARCH_PATH || _foamIsSystem $MPFR_ARCH_PATH
then
GMP_ARCH_PATH=system # for an accurate record
MPFR_ARCH_PATH=system
fi
#
# build information recorded for later use
#
@ -255,12 +289,18 @@ recordCGALinfo()
CGAL_VERSION=$(sed -ne 's/^ *# *define *CGAL_VERSION_NR *\([0-9][0-9]*\).*$/\1/p' $CGAL_ARCH_PATH/include/CGAL/version.h 2>/dev/null)
cat<<BUILD_INFO > $buildInfoFile
# Information from OpenFOAM build on '$(date)'
#
CGAL=${CGAL_ARCH_PATH##*/}
BOOST=${BOOST_ARCH_PATH##*/}
GMP=${GMP_ARCH_PATH##*/}
MPFR=${MPFR_ARCH_PATH##*/}
CGAL_VERSION=$CGAL_VERSION
BOOST_VERSION=$BOOST_VERSION
CGAL_lib=lib$WM_COMPILER_LIB_ARCH
BOOST_lib=lib$WM_COMPILER_LIB_ARCH
CGAL_HEADER_ONLY=${optHeadersOnly:-false}
BUILD_INFO
}
@ -287,6 +327,8 @@ cgalIsCurrent()
local info=$(cat $buildInfoFile 2>/dev/null)
[ -n "$info" ] || return 1
local libDirName="lib$WM_COMPILER_LIB_ARCH"
echo "checking information from existing build ..."
echo " ${CGAL_ARCH_PATH}"
@ -295,10 +337,13 @@ cgalIsCurrent()
infoValueEq GMP "${GMP_ARCH_PATH##*/}" "$info" || return 1
infoValueEq MPFR "${MPFR_ARCH_PATH##*/}" "$info" || return 1
infoValueEq BOOST_VERSION "${BOOST_VERSION}" "$info" || return 1
infoValueEq CGAL_lib "$libDirName" "$info" || return 1
infoValueEq BOOST_lib "$libDirName" "$info" || return 1
return 0
}
if cgalIsCurrent
then
echo " ${CGAL_ARCH_PATH##*/} build appears to be up-to-date - skipping"
@ -323,10 +368,21 @@ fi
echo "Configuring $cgalPACKAGE with boost $BOOST_VERSION"
echo " Source : $CGAL_SOURCE_DIR"
echo " Build : $CGAL_BINARY_DIR"
echo " Target : $CGAL_DIR"
echo " Target : $CGAL_ARCH_PATH"
if [ -d "$BOOST_ARCH_PATH" ]
# See http://doc.cgal.org/latest/Manual/installation.html
if _foamIsSystem $boostPACKAGE
then
echo " system : boost"
# Tagged as 'system' but could actually point to a central location
if [ -d "$BOOST_ARCH_PATH/include" ]
then
configBoost="-DBOOST_ROOT=$BOOST_ARCH_PATH"
fi
## For system - possible that /usr/lib64 not being found?
## configBoost="-DBoost_LIBRARY_DIRS=$boostLib"
elif [ -d "$BOOST_ARCH_PATH" ]
then
echo " ThirdParty : boost"
configBoost=$(cat <<CMAKE_OPTIONS
@ -338,16 +394,17 @@ fi
-DBoost_SYSTEM_LIBRARY_RELEASE=$boostLib/libboost_system.so
-DBoost_VERSION=$BOOST_VERSION
CMAKE_OPTIONS
)
else
echo " system : boost"
configBoost=$(cat <<CMAKE_OPTIONS
-DBOOST_LIBRARYDIR=$boostLib
CMAKE_OPTIONS
)
fi
if [ -d "$GMP_ARCH_PATH" ]
if _foamIsSystem $GMP_ARCH_PATH
then
echo " system : gmp"
elif _foamIsNone $GMP_ARCH_PATH
then
echo " disabled : gmp"
configGmp="-DCGAL_DISABLE_GMP:BOOL=TRUE" # Also used for mpfr
elif [ -d "$GMP_ARCH_PATH" ]
then
echo " ThirdParty : gmp"
configGmp=$(cat <<CMAKE_OPTIONS
@ -359,10 +416,17 @@ CMAKE_OPTIONS
CMAKE_OPTIONS
)
else
echo " system : gmp"
echo " system : gmp (did not find $GMP_ARCH_PATH)"
fi
if [ -d "$MPFR_ARCH_PATH" ]
if _foamIsSystem $MPFR_ARCH_PATH
then
echo " system : mpfr"
elif _foamIsNone $MPFR_ARCH_PATH
then
echo " disabled : mpfr"
configGmp="-DCGAL_DISABLE_GMP:BOOL=TRUE" # Also used for mpfr
elif [ -d "$MPFR_ARCH_PATH" ]
then
echo " ThirdParty : mpfr"
configMpfr=$(cat <<CMAKE_OPTIONS
@ -372,19 +436,26 @@ CMAKE_OPTIONS
CMAKE_OPTIONS
)
else
echo " system : mpfr"
echo " system : mpfr (did not find $MPFR_ARCH_PATH)"
fi
cmake=$(findCMake)
# For CGAL < 4.9, for installation into lib64/, not lib/
# Name only (not path) for CGAL_INSTALL_LIB_DIR
echo "----"
set -x
cmake \
$cmake \
-DCMAKE_INSTALL_PREFIX=$CGAL_ARCH_PATH \
-DCGAL_INSTALL_LIB_DIR=lib$WM_COMPILER_LIB_ARCH \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_CGAL_Qt5=OFF \
${optHeadersOnly:+-DCGAL_HEADER_ONLY=TRUE} \
$configBoost $configGmp $configMpfr \
$CGAL_SOURCE_DIR \
&& make -j $WM_NCOMPPROCS \
&& make install || exit 1
set +x
echo "----"
echo "create '\$CGAL_ARCH_PATH/share/files'"

View File

@ -29,11 +29,11 @@
# Build script for cmake
#
#------------------------------------------------------------------------------
# Special purpose script, no default cmake version.
# Special purpose script, no default version.
unset cmakePACKAGE
#------------------------------------------------------------------------------
# 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."
@ -42,13 +42,12 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [cmake-VERSION]
usage: ${0##*/} [OPTION] cmake-VERSION
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-help
@ -60,12 +59,11 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# ensure CMake gets the correct C/CC++ compiler
# Ensure CMake gets the correct C/CC++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
# parse options
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
@ -89,36 +87,38 @@ done
[ -n "$cmakePACKAGE" ] || die "The cmake-VERSION was not specified"
#------------------------------------------------------------------------------
CMAKE_ARCH_PATH=$installBASE/$cmakePACKAGE
#
# Build CMAKE
#
echo "---------------"
# CMAKE_SOURCE_DIR : location of the original sources
# CMAKE_ARCH_PATH : installation directory
CMAKE_SOURCE_DIR=$sourceBASE/$cmakePACKAGE
CMAKE_ARCH_PATH=$installBASE/$cmakePACKAGE
if [ -d "$CMAKE_ARCH_PATH" -a -r "$CMAKE_ARCH_PATH/bin/cmake" ]
then
echo "Already built: $cmakePACKAGE"
else
echo "Starting build: $cmakePACKAGE"
(
sourceDIR=$WM_THIRD_PARTY_DIR/$cmakePACKAGE
buildDIR=$buildBASE/$cmakePACKAGE
(
buildDIR=$buildBASE/$cmakePACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
cd $CMAKE_SOURCE_DIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
$sourceDIR/bootstrap --prefix=$CMAKE_ARCH_PATH \
&& time make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $cmakePACKAGE"
) || {
echo "Error building: $cmakePACKAGE"
exit 1
}
$CMAKE_SOURCE_DIR/bootstrap \
--prefix=$CMAKE_ARCH_PATH \
&& time make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $cmakePACKAGE"
) || {
echo "Error building: $cmakePACKAGE"
exit 1
}
fi
#------------------------------------------------------------------------------

View File

@ -29,7 +29,6 @@
# Build script for FFTW
#
#------------------------------------------------------------------------------
# Get FFTW versions
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
@ -48,14 +47,12 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
Script="${0##*/}"
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: $Script [OPTION] [fftw-VERSION]
usage: ${0##*/} [OPTION] [fftw-VERSION]
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-help
@ -67,8 +64,7 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# ensure configure gets the correct C/C++ compiler
# Ensure configure gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
@ -98,14 +94,12 @@ done
[ -n "$fftwPACKAGE" ] || die "The fftw-VERSION was not specified"
# nothing to build
# Nothing to build
if _foamIsNone "$fftwPACKAGE"
then
echo "Using fftw-none (skip ThirdParty build of FFTW)"
exit 0
fi
if _foamIsSystem "$fftwPACKAGE"
elif _foamIsSystem "$fftwPACKAGE"
then
echo "Using fftw-system (skip ThirdParty build of FFTW)"
exit 0
@ -121,9 +115,10 @@ fi
# - system is normally built into 'lib64'
#
# FFTW_SOURCE_DIR : location of the original sources
# FFTW_ARCH_PATH : installation directory
FFTW_SOURCE_DIR=$sourceBASE/$fftwPACKAGE
FFTW_ARCH_PATH=$installBASE/$fftwPACKAGE
FFTW_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$fftwPACKAGE
if [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3.so" ]
then
@ -133,17 +128,6 @@ else
echo
(
# configuration options:
unset configOpt
# Single-precision needed?
if [ "${WM_PRECISION_OPTION}" = SP ]
then
configOpt="$configOpt --enable-single"
fi
# end of configuration options
# ----------------------------
buildDIR=$buildBASE/$fftwPACKAGE
cd $FFTW_SOURCE_DIR || exit 1
@ -159,7 +143,6 @@ else
--libdir=$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--enable-shared --disable-static \
--disable-fortran \
$configOpt \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built $fftwPACKAGE"
@ -169,5 +152,4 @@ else
}
fi
#------------------------------------------------------------------------------

75
makeGcc
View File

@ -4,7 +4,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -74,6 +74,7 @@ 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
@ -87,9 +88,9 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# build 32-bit libraries on 64-bit systems (normally not needed)
# Build 32-bit libraries on 64-bit systems (normally not needed)
optMultilib=disable
unset optThreadSafe # unset=auto
# Parse options
while [ "$#" -gt 0 ]
@ -104,6 +105,9 @@ do
-no-multi*)
optMultilib=disable
;;
-no-thread*)
optThreadSafe=disable
;;
-sys*)
gmpPACKAGE="gmp-system"
mpfrPACKAGE="mpfr-system"
@ -118,7 +122,7 @@ do
mpc-[0-9]* | mpc-system)
mpcPACKAGE="${1%%/}"
;;
gcc-[4-9]*)
gcc-[4-9]* | gcc-system)
gccPACKAGE="${1%%/}"
;;
*)
@ -176,7 +180,7 @@ else
echo "Starting build: $gmpPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gmpPACKAGE
sourceDIR=$sourceBASE/$gmpPACKAGE
buildDIR=$buildBASE/$gmpPACKAGE
cd $sourceDIR || exit 1
@ -203,6 +207,14 @@ fi
if [ -d "$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" ]
then
_foamAddLib "$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
configGMP=$(cat <<CONFIG_OPTIONS
--with-gmp-include=$GMP_ARCH_PATH/include
--with-gmp-lib=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
CONFIG_OPTIONS
)
else
unset configGMP
fi
@ -220,7 +232,7 @@ else
echo "Starting build: $mpfrPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpfrPACKAGE
sourceDIR=$sourceBASE/$mpfrPACKAGE
buildDIR=$buildBASE/$mpfrPACKAGE
cd $sourceDIR || exit 1
@ -230,12 +242,15 @@ else
mkdir -p $buildDIR
cd $buildDIR
unset configOpt
# explicitly enable/disable thread-safe
[ -n "$optThreadSafe" ] && configOpt="--${optThreadSafe}-thread-safe"
set -x
$sourceDIR/configure ABI=$ABI \
--prefix=$MPFR_ARCH_PATH \
--libdir=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--with-gmp-include=$GMP_ARCH_PATH/include \
--with-gmp-lib=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--prefix=$MPFR_ARCH_PATH \
--libdir=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
$configGMP $configOpt \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpfrPACKAGE"
@ -248,6 +263,14 @@ fi
if [ -d "$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" ]
then
_foamAddLib "$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
configMPFR=$(cat <<CONFIG_OPTIONS
--with-mpfr-include=$MPFR_ARCH_PATH/include \
--with-mpfr-lib=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
CONFIG_OPTIONS
)
else
unset configMPFR
fi
@ -265,7 +288,7 @@ else
echo "Starting build: $mpcPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpcPACKAGE
sourceDIR=$sourceBASE/$mpcPACKAGE
buildDIR=$buildBASE/$mpcPACKAGE
cd $sourceDIR || exit 1
@ -279,10 +302,7 @@ else
$sourceDIR/configure ABI=$ABI \
--prefix=$MPC_ARCH_PATH \
--libdir=$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--with-gmp-include=$GMP_ARCH_PATH/include \
--with-gmp-lib=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--with-mpfr-include=$MPFR_ARCH_PATH/include \
--with-mpfr-lib=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
$configGMP $configMPFR \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpcPACKAGE"
@ -295,6 +315,14 @@ fi
if [ -d "$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" ]
then
_foamAddLib "$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
configMPC=$(cat <<CONFIG_OPTIONS
--with-mpc-include=$MPC_ARCH_PATH/include \
--with-mpc-lib=$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
CONFIG_OPTIONS
)
else
unset configMPC
fi
@ -309,11 +337,14 @@ echo "---------------"
if [ -d $GCC_ARCH_PATH ]
then
echo "Already built: $gccPACKAGE"
elif _foamIsSystem $GCC_ARCH_PATH
then
echo "Using gcc-system"
else
echo "Starting build: $gccPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gccPACKAGE
sourceDIR=$sourceBASE/$gccPACKAGE
buildDIR=$buildBASE/$gccPACKAGE
cd $sourceDIR || exit 1
@ -323,10 +354,6 @@ else
mkdir -p $buildDIR
cd $buildDIR
_foamIsSystem "$GMP_ARCH_PATH" && GMP_ARCH_PATH=/usr # revert to system
_foamIsSystem "$MPFR_ARCH_PATH" && MPFR_ARCH_PATH=/usr # revert to system
_foamIsSystem "$MPC_ARCH_PATH" && MPC_ARCH_PATH=/usr # revert to system
unset configOpt
# with/without multi-lib (32-bit support on 64-bit systems)
[ -n "$optMultilib" ] && configOpt="--${optMultilib}-multilib"
@ -334,18 +361,12 @@ else
set -x
$sourceDIR/configure \
--prefix=$GCC_ARCH_PATH \
--with-gmp-include=$GMP_ARCH_PATH/include \
--with-gmp-lib=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--with-mpfr-include=$MPFR_ARCH_PATH/include \
--with-mpfr-lib=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--with-mpc-include=$MPC_ARCH_PATH/include \
--with-mpc-lib=$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--with-pkgversion=OpenFOAM \
--enable-languages=c,c++ \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--with-system-zlib \
$configOpt \
$configGMP $configMPFR $configMPC $configOpt \
MAKEINFO=missing \
&& make -j $WM_NCOMPPROCS \
&& make install \

View File

@ -4,7 +4,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -28,14 +28,17 @@
# Description
# Build script for gperftools
#
# Note
#
#------------------------------------------------------------------------------
# Get gperftools version
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
gperftoolsPACKAGE=gperftools-svn
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools)
gperftoolsPACKAGE=${gperftools_version:-gperftools-system}
#------------------------------------------------------------------------------
# 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."
@ -44,13 +47,15 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [gperftools-VERSION]
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-help
* build gperftools
$gperftoolsPACKAGE
@ -58,16 +63,23 @@ usage: ${0##*/} [gperftools-VERSION]
USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure configure gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
# parse options
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
gperftools-[0-9]* | gperftools-svn*)
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
gperftools-[0-9]* | gperftools-svn* | gperftools-git)
gperftoolsPACKAGE="${1%%/}"
;;
*)
@ -77,42 +89,54 @@ do
shift
done
#------------------------------------------------------------------------------
# build/install without compiler name
prefixDIR=$installBASE/$gperftoolsPACKAGE
[ -n "$gperftoolsPACKAGE" ] || die "The gperftools-VERSION was not specified"
# Nothing to build
if _foamIsNone $gperftoolsPACKAGE
then
echo "Using gperftools-none (skip ThirdParty build of gperftools)"
exit 0
elif _foamIsSystem $gperftoolsPACKAGE
then
echo "Using gperftools-system (skip ThirdParty build of gperftools)"
exit 0
fi
#------------------------------------------------------------------------------
#
# Build gperftools
#
GPERFTOOLS_SOURCE_DIR=$sourceBASE/$gperftoolsPACKAGE
GPERFTOOLS_ARCH_PATH=$installBASE/$gperftoolsPACKAGE
echo "---------------"
if [ -d "$prefixDIR" ]
if [ -d "$GPERFTOOLS_ARCH_PATH" ]
then
echo "Already built: $gperftoolsPACKAGE"
else
echo "Starting build: $gperftoolsPACKAGE"
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gperftoolsPACKAGE
buildDIR=$buildBASE/$gperftoolsPACKAGE
(
buildDIR=$buildBASE/$gperftoolsPACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
cd $GPERFTOOLS_SOURCE_DIR || exit 1
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
make distclean 2>/dev/null
# remove old junk
rm -rf $prefixDIR
rm -rf $GPERFTOOLS_ARCH_PATH
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
$sourceDIR/configure \
--prefix=$prefixDIR \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gperftoolsPACKAGE" \
) || {
echo "Error building: $gperftoolsPACKAGE"
exit 1
}
set -x
$GPERFTOOLS_SOURCE_DIR/configure \
--prefix=$GPERFTOOLS_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gperftoolsPACKAGE" \
) || {
echo "Error building: $gperftoolsPACKAGE"
exit 1
}
fi
#------------------------------------------------------------------------------

122
makeLLVM
View File

@ -4,7 +4,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -51,8 +51,8 @@
# mv cfe-3.8.0.src llvm-3.8.0/tools/clang
#
#------------------------------------------------------------------------------
# get default llvm/clang version
WM_COMPILER_TYPE="ThirdParty" # ensure we get the correct compiler settings
# 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
@ -70,15 +70,15 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
Script=${0##*/}
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: $Script [OPTION] [llvm-VERSION]
usage: ${0##*/} [OPTION] [llvm-VERSION]
options:
-cmake PATH with cmake from the path given
-gcc force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-help
* build llvm/clang
@ -87,17 +87,27 @@ options:
USAGE
exit 1
}
#-----------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
# parse options
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
shift
;;
llvm-[0-9]* | llvm-svn*)
llvmPACKAGE="${1%%/}"
;;
@ -111,20 +121,19 @@ done
[ -n "$llvmPACKAGE" ] || die "The llvm-VERSION was not specified"
#------------------------------------------------------------------------------
# build/install without compiler name
# Build/install locations without a compiler name
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
LLVM_ARCH_PATH=$installBASE/$llvmPACKAGE
# Build LLVM (clang)
# LLVM_SOURCE_DIR : location of the original sources
# LLVM_BINARY_DIR : location of the build
# LLVM_ARCH_PATH : location of the installed program
# - Strip any trailing '.src' from the proper names
# name of source directory
# - may have a llvm/ subdirectory, depending on how the sources were fetched
#
sourceDIR=$WM_THIRD_PARTY_DIR/$llvmPACKAGE
if [ -f $sourceDIR/llvm/configure ]
then
sourceDIR=$sourceDIR/llvm
fi
LLVM_SOURCE_DIR=$sourceBASE/$llvmPACKAGE
LLVM_BINARY_DIR=$buildBASE/${llvmPACKAGE%%.src}
LLVM_ARCH_PATH=$installBASE/${llvmPACKAGE%%.src}
#
# Build LLVM
@ -133,30 +142,63 @@ echo "---------------"
if [ -d $LLVM_ARCH_PATH ]
then
echo "Already built: $llvmPACKAGE"
else
echo "Starting build: $llvmPACKAGE"
elif [ -z "$CMAKE_PATH" ] && $LLVM_SOURCE_DIR/configure -help >/dev/null 2>&1
then
# configure can be used prior to 3.9.0
# but use cmake if someone explicitly mentioned -cmake on the command-line
echo "Starting build: $llvmPACKAGE (using configure)"
echo
(
cd $sourceDIR || exit 1
make distclean 2>/dev/null
(
cd $LLVM_SOURCE_DIR || exit 1
make distclean 2>/dev/null
buildDIR=$buildBASE/$llvmPACKAGE
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
rm -rf $LLVM_BINARY_DIR
mkdir -p $LLVM_BINARY_DIR
cd $LLVM_BINARY_DIR
set -x
$LLVM_SOURCE_DIR/configure \
--prefix=$LLVM_ARCH_PATH \
--with-gcc-toolchain=$(which gcc | sed s%/bin/gcc%%) \
--enable-optimized \
--enable-shared \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $llvmPACKAGE"
) || {
echo "Error building: $llvmPACKAGE"
exit 1
}
else
# CMake used with 3.9.0 and later
echo "Starting build: $llvmPACKAGE (using cmake)"
echo
(
cd $LLVM_SOURCE_DIR || exit 1
rm -rf $LLVM_BINARY_DIR
mkdir -p $LLVM_BINARY_DIR
cd $LLVM_BINARY_DIR
cmake=$(findCMake)
set -x
$cmake \
-DCMAKE_INSTALL_PREFIX=$LLVM_ARCH_PATH \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS:BOOL=ON \
$LLVM_SOURCE_DIR \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $llvmPACKAGE"
) || {
echo "Error building: $llvmPACKAGE"
exit 1
}
set -x
$sourceDIR/configure \
--prefix=$LLVM_ARCH_PATH \
--with-gcc-toolchain=$(which gcc | sed s%/bin/gcc%%) \
--enable-optimized \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $llvmPACKAGE"
) || {
echo "Error building: $llvmPACKAGE"
exit 1
}
fi
#------------------------------------------------------------------------------

199
makeMesa Executable file
View File

@ -0,0 +1,199 @@
#!/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 <http://www.gnu.org/licenses/>.
#
# Script
# makeMesa
#
# Description
# Build script for Mesa
#
# Note
# Building with mesa-12.x.x fails to create an include/GL directory and
# an "osmesa.h" file. Both make it fairly useless for off-screen VTK.
#
# Building with mesa-11.x is fine and mesa-13.x also seems to be okay.
#
#------------------------------------------------------------------------------
# Special purpose script, no default version.
unset mesaPACKAGE
#------------------------------------------------------------------------------
# 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() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] mesa-VERSION
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-help
* build Mesa with
${mesaPACKAGE:-'unspecified MESA version'}
USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure configure gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
# Non-standard location for clang?
unset thirdPartyClang
if [ "$WM_COMPILER_TYPE" = ThirdParty -a "$WM_COMPILER" = Clang ]
then
thirdPartyClang=true
fi
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
unset thirdPartyClang
;;
mesa-*)
mesaPACKAGE="${1%%/}"
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$mesaPACKAGE" ] || die "The mesa-VERSION was not specified"
# Nothing to build
if _foamIsNone "$mesaPACKAGE"
then
echo "Using mesa-none (skip ThirdParty build of MESA)"
exit 0
elif _foamIsSystem "$mesaPACKAGE"
then
echo "Using mesa-system (skip ThirdParty build of MESA)"
exit 0
fi
#------------------------------------------------------------------------------
# Locate third-party clang as required
if [ "$thirdPartyClang" = true ]
then
thirdPartyClang=$(command -v clang) || {
echo "Error: could not properly locate clang"
exit 2
}
# root installation directory
thirdPartyClang=${thirdPartyClang%/bin/clang}
[ -d "$thirdPartyClang" ] || {
echo "Error: could not properly locate clang"
exit 2
}
fi
#------------------------------------------------------------------------------
#
# Build MESA
# For 64-bit
# - MESA itself will normally build into 'lib64'.
#
# MESA_SOURCE_DIR : location of the original sources
# MESA_ARCH_DIR : installation directory
MESA_SOURCE_DIR=$sourceBASE/$mesaPACKAGE
MESA_ARCH_PATH=$installBASE/$mesaPACKAGE
(
# configuration options:
unset configOpt
if [ -d "$thirdPartyClang" ]
then
configOpt="$configOpt --with-llvm-prefix=$thirdPartyClang"
fi
# end of configuration options
# ----------------------------
buildDIR=$buildBASE/$mesaPACKAGE
cd $MESA_SOURCE_DIR || exit 1
# remove any existing build
rm -rf $MESA_ARCH_PATH
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
echo "----"
echo "Building $mesaPACKAGE"
echo " Source : $MESA_SOURCE_DIR"
echo " Target : $MESA_ARCH_PATH"
if [ -d "$thirdPartyClang" ]
then
echo " Clang : $thirdPartyClang"
fi
echo "----"
# possibly for older mesa versions (see paraview wiki)
# CXXFLAGS="-O2 -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
# CFLAGS="-O2 -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
## autoreconf -fi
set -x
$MESA_SOURCE_DIR/configure \
--prefix=$MESA_ARCH_PATH \
--disable-xvmc \
--disable-glx \
--disable-dri \
--disable-egl \
--enable-texture-float \
--enable-gallium-osmesa --with-gallium-drivers=swrast \
$configOpt \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built $mesaPACKAGE"
) || {
echo "Error building: MESA"
exit 1
}
# ----------------------------------------------------------------- end-of-file

View File

@ -26,10 +26,23 @@
# makeParaView
#
# Description
# Make and install paraview 4 or 5
# - place the paraview source under $WM_THIRD_PARTY_DIR/ParaView-VERSION
# (note capitalisation)
# Make and install ParaView 4 or 5.
# The ParaView sources should be located under one of these locations:
# - $WM_THIRD_PARTY_DIR/ParaView-VERSION
# - $WM_THIRD_PARTY_DIR/ParaView-vVERSION
#
# Note the capitalization of ParaView in the directory names.
#
#------------------------------------------------------------------------------
# Get ParaView_VERSION location from OpenFOAM config file
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib # get settings only
unset ParaView_VERSION # purge current values
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview)
: ${ParaView_VERSION##*-}
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} || exit 1
@ -47,6 +60,7 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
# ~~~~~~~~~~~~~
# MPI support:
# use 0 or unset MPI_MAX_PROCS for no upper-limit
withMPI=false
MPI_MAX_PROCS=32
@ -55,12 +69,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
@ -80,8 +94,8 @@ withGL2=auto
#
#-----------------------------------------------------------------------------
Script=${0##*/}
usage() {
: ${ParaView_VERSION:=none} # some dummy value for usage information
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
@ -92,8 +106,10 @@ options:
-gl2 with new rendering backend (if not already enabled)
-mesa with mesa (if not already enabled)
-mpi with mpi (if not already enabled)
-mpi=NPROCS with mpi and max 'NPROCS' processes. NPROCS=0 for no
upper-limit on processes.
-python with python (if not already enabled)
-cmake PATH with the cmake version corresponding to the cmake path given
-cmake PATH with cmake from the path given
-qmake PATH with the Qt version corresponding to the qmake path given
-qt with extra Qt gui support (if not already enabled)
-qt-VER with Qt version corresponding to
@ -103,8 +119,8 @@ options:
-version VER specify an alternative version (current value: $ParaView_VERSION)
-major VER specify an alternative major version for special builds
-buildType NAME specify the build type (default: Release)
-mesa-include DIR
location of mesa headers (current value: ${MESA_INCLUDE:-none})
-mesa-prefix DIR location of mesa installation (sets -mesa-include, -mesa-lib)
-mesa-include DIR location of mesa headers (current value: ${MESA_INCLUDE:-none})
-mesa-lib PATH path to mesa library (current value: ${MESA_LIBRARY:-none})
-python-lib PATH path to python library (current value: ${PYTHON_LIBRARY:-none})
-help
@ -133,18 +149,18 @@ For example,
./makeParaview 4.4.0
Or change the \$WM_PROJECT_DIR/etc/config.sh/paraview settings.
USAGE
exit 1
}
#------------------------------------------------------------------------------
# ensure CMake gets the correct C/C++ compiler
# Ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
#
# add options based on script name:
# Add options based on script name:
#
case "$Script" in *-mesa*) withMESA=true;; esac
case "$Script" in *-mpi*) withMPI=true;; esac
@ -152,16 +168,16 @@ case "$Script" in *-python*) withPYTHON=true;; esac
case "$Script" in *-qt*) withQT=true;; esac
# Set initial ParaView_MAJOR based on current value of ParaView_VERSION
setVersion ${ParaView_VERSION:-none}
setParaViewVersion ${ParaView_VERSION:-none}
#
# various building stages
# Various building stages
#
unset runPATCH runCONFIG runMAKE runINSTALL
runDEFAULT=true
buildType=Release
# parse options
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
@ -169,7 +185,7 @@ do
usage
;;
[0-9]* | paraview-[0-9]* | ParaView-[0-9]*) # paraview version
setVersion "${1%%/}"
setParaViewVersion "${1%%/}"
;;
[A-Z]*=*) # cmake variables
addCMakeVariable "$1"
@ -223,19 +239,30 @@ do
-no-mesa)
withMESA=false
;;
-mesa-prefix)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
withMESA=true
MESA_INCLUDE="${2%%/}/include"
MESA_LIBRARY="${2%%/}/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so"
shift
;;
-mesa-include)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
MESA_INCLUDE="$2"
MESA_INCLUDE="${2%%/}"
shift
;;
-mesa-lib)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
MESA_LIBRARY="$2"
MESA_LIBRARY="${2%%/}"
shift
;;
-mpi)
withMPI=true
;;
-mpi=[0-9]*) # mpi and max mpi processes
withMPI=true
MPI_MAX_PROCS="${1##*=}"
;;
-no-mpi)
withMPI=false
;;
@ -247,17 +274,17 @@ do
;;
-python-lib)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
PYTHON_LIBRARY="$2"
PYTHON_LIBRARY="${2%%/}"
shift
;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH=$2
CMAKE_PATH="${2%%/}"
shift
;;
-qmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
QMAKE_PATH=$2
QMAKE_PATH="${2%%/}"
shift
;;
-qt)
@ -274,7 +301,7 @@ do
;;
-version)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
setVersion "${2%%/}"
setParaViewVersion "${2%%/}"
shift
;;
-major)
@ -332,7 +359,7 @@ addMesaSupport # set MESA-specific options
addGL2Support # new rendering backend
addQtSupport # add extra Qt support
setDirs # where things are or should be put
setParaViewDirs # where things are or should be put
# Build and install
@ -354,10 +381,9 @@ Features selected
---------------------
Version information
qt ${QtVersion:-none}
version ${ParaView_VERSION:-unknown}
version ${ParaView_VERSION:-unknown} $(checkVersion)
major ${ParaView_MAJOR:-unknown}
build ${buildType:-Release}
$(checkVersion)
---------------------
SUMMARY

14
makeParaView.example Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
# An example for building particular combinations of ParaView with
# - mpi (0 = no upper-limit on processes)
# - off-screen mesa
mesa=mesa-11.2.2
# mesa=mesa-13.0.2
./makeParaView \
-mpi=0 \
-mesa-prefix $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mesa \
"$@"
#------------------------------------------------------------------------------

135
makeQt
View File

@ -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.
@ -26,13 +26,14 @@
# makeQt
#
# Description
# Build script for qt-everywhere-opensource-src
# Build script for QT (the qt-everywhere-opensource-src package)
#
#------------------------------------------------------------------------------
qtVERSION=4.7.3
qtVERSION=4.8.7
qtTYPE=qt-everywhere-opensource-src
#------------------------------------------------------------------------------
# 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."
@ -42,7 +43,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
. etc/tools/ThirdPartyFunctions
. etc/tools/QtFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
@ -59,12 +59,13 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
# Export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
# ensure configure gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
# parse options
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
@ -75,9 +76,10 @@ do
export CC=gcc # use gcc/g++
export CXX=g++
;;
[1-9]* | qt-[1-9]*)
-qt-[1-9]* | [1-9]* | qt-*)
# -qt-VERSION, VERSION, qt-VERSION, qt-everywhere-opensource-src-VERSION
qtVERSION="${1%%/}";
qtVERSION="${qtVERSION#qt-}"
qtVERSION="${qtVERSION##*-}"
;;
*)
die "unknown option/argument: '$1'"
@ -85,56 +87,91 @@ do
esac
shift
done
qtPACKAGE=$qtTYPE-$qtVERSION
# nothing to build
if _foamIsNone "$qtPACKAGE"
then
echo "Using qt-none (skip ThirdParty build of QT)"
exit 0
elif _foamIsSystem "$qtPACKAGE"
then
echo "Using qt-system"
exit 0
fi
#------------------------------------------------------------------------------
qtPACKAGE=$qtTYPE-$qtVERSION
prefixDIR=$installBASE/qt-$qtVERSION
#
# Build QT
#
echo "---------------"
if [ -d "$prefixDIR" -a -r "$prefixDIR/bin/qmake" ]
QT_SOURCE_DIR=$sourceBASE/$qtPACKAGE
QT_ARCH_PATH=$installBASE/qt-$qtVERSION
echo
echo ========================================
echo "Build Qt $qtPACKAGE"
echo
if [ -d "$QT_ARCH_PATH" -a -r "$QT_ARCH_PATH/bin/qmake" ]
then
echo "Already built: Qt-$qtVERSION"
else
echo "Starting build: Qt-$qtVERSION"
(
sourceDIR=$WM_THIRD_PARTY_DIR/$qtPACKAGE
buildDIR=$buildBASE/$qtPACKAGE
(
# Configuration options:
unset configOpt
configOpt="$configOpt -nomake examples"
cd $sourceDIR || exit 1
make distclean 2>/dev/null
case "$qtVERSION" in
4*) # QT-4
# Without demos.
configOpt="$configOpt -nomake demos"
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
# Without old qt3 transition code
configOpt="$configOpt -no-qt3support"
# remove old junk
rm -rf $prefixDIR
# Without WebKit - uses std:tr1 and does not compile with c++11
# Fortunately WebKit is now optional for ParaView
configOpt="$configOpt -no-webkit"
;;
# remove any remnants from a previous shadow build
rm -f "$sourceDIR/.qmake.cache" 2>/dev/null
rm -f "$sourceDIR/src/corelib/global/qconfig.h" 2>/dev/null
rm -f "$sourceDIR/src/corelib/global/qconfig.cpp" 2>/dev/null
*) # QT-5
# Avoid too many X11 system dependencies.
configOpt="$configOpt -qt-xcb"
;;
esac
# compile as opensource, accepting LGPL conditions
echo "yes" | \
$sourceDIR/configure \
--prefix=$prefixDIR \
-opensource \
-nomake demos \
-nomake examples \
&& time make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: Qt-$qtVERSION" \
&& finalizeQt
) || {
echo "Error building: Qt-$qtVERSION"
exit 1
}
# end of configuration options
# ----------------------------
buildDIR=$buildBASE/$qtPACKAGE
cd $QT_SOURCE_DIR || exit 1
[ -e Makefile ] && make distclean 2>/dev/null
# Remove any existing build folder and recreate
rm -rf $QT_ARCH_DIR
rm -rf $buildDIR 2>/dev/null
mkdir -p $buildDIR
# Remove any remnants from a previous shadow build
rm -f "$QT_SOURCE_DIR/.qmake.cache" 2>/dev/null
rm -f "$QT_SOURCE_DIR/src/corelib/global/qconfig.h" 2>/dev/null
rm -f "$QT_SOURCE_DIR/src/corelib/global/qconfig.cpp" 2>/dev/null
cd $buildDIR || exit 1
# Compile as opensource, accepting LGPL conditions (yes)
echo yes | $QT_SOURCE_DIR/configure \
-prefix $QT_ARCH_PATH \
-opensource \
$configOpt \
&& time make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: Qt-$qtVERSION" \
&& finalizeQt
) || {
echo "Error building: Qt-$qtVERSION"
exit 1
}
fi
# ----------------------------------------------------------------- end-of-file

206
makeTecio Executable file
View File

@ -0,0 +1,206 @@
#!/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 <http://www.gnu.org/licenses/>.
#
# Script
# makeTecio
#
# Description
# Build Tecplot library
#
#------------------------------------------------------------------------------
# Get boost version (headers only)
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL)
boostPACKAGE=${boost_version:-boost-system}
tecioPACKAGE=tecio
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<<USAGE
Usage: ${0##*/} [OPTION] [boost-VERSION] [tecio-VERSION]
options:
-cmake PATH With cmake from the path given
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-help
* Compile the proprietary libtecio library
$tecioPACKAGE
with $boostPACKAGE
USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
shift
;;
boost-[0-9]* | boost_[0-9]* | boost-system )
boostPACKAGE="${1%%/}"
;;
tecio*)
tecioPACKAGE="${1%%/}"
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
# assert: directory must be available
[ -d "$tecioPACKAGE" ] || die "missing source directory '$tecioPACKAGE'"
#------------------------------------------------------------------------------
#
# Get Boost information
# - only headers are required
: ${BOOST_ARCH_PATH:=$installBASE/$boostPACKAGE} # Fallback
boostInc="$BOOST_ARCH_PATH/include"
if _foamIsSystem $boostPACKAGE
then
echo "Using boost-system"
# Tagged as 'system' but could actually point to a central location
[ -d "$BOOST_ARCH_PATH/include" ] || {
boostInc="/usr/include"
}
elif [ -f "$boostInc/boost/version.hpp" ]
then
echo "Using $boostPACKAGE"
fi
# Build TECIO library
#
# TECIO_SOURCE_DIR : location of the original sources
# TECIO_BINARY_DIR : location of the build
# TECIO_ARCH_PATH : location of the installed program
TECIO_SOURCE_DIR=$sourceBASE/$tecioPACKAGE/teciosrc
TECIO_BINARY_DIR=$buildBASE/$tecioPACKAGE
TECIO_ARCH_PATH=$installBASE/$tecioPACKAGE
if [ -d "$TECIO_SOURCE_DIR" ]
then
(
# Remove any existing build folder and recreate
if [ -d $TECIO_BINARY_DIR ]
then
echo "removing old build directory"
echo " $TECIO_BINARY_DIR"
rm -rf $TECIO_BINARY_DIR
fi
mkdir -p $TECIO_BINARY_DIR
rm -rf $TECIO_ARCH_PATH
unset configBoost
echo "----"
echo "Configuring $tecioPACKAGE with boost $BOOST_VERSION"
echo " Source : $TECIO_SOURCE_DIR"
echo " Build : $TECIO_BINARY_DIR"
echo " Target : $TECIO_ARCH_PATH"
if [ -d "$BOOST_ARCH_PATH" ]
then
echo " Boost : ThirdParty (${BOOST_ARCH_PATH##*/})"
else
echo " Boost : system"
fi
cmake=$(findCMake)
echo "----"
set -x
cd $TECIO_BINARY_DIR && $cmake \
-DCMAKE_INSTALL_PREFIX=$TECIO_ARCH_PATH \
-DCMAKE_BINARY_TYPE=Release \
-DBoost_INCLUDE_DIR=$boostInc \
$TECIO_SOURCE_DIR \
&& make -j $WM_NCOMPPROCS \
&& { \
# Tecio doesn't offer to install, but fortunately only a few files,
# so just install in a single directory
mkdir -p $TECIO_ARCH_PATH 2>/dev/null
/bin/cp -pv \
$TECIO_BINARY_DIR/libtecio.a \
$TECIO_SOURCE_DIR/TECIO.h \
$TECIO_SOURCE_DIR/tecio_Exports.h \
$TECIO_ARCH_PATH
chmod 0644 $TECIO_ARCH_PATH/*
} \
&& echo "Built: $tecioPACKAGE"
) || {
echo "Error building: $tecioPACKAGE"
}
fi
#------------------------------------------------------------------------------

View File

@ -3,8 +3,8 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -23,12 +23,18 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeParaView3
# makeVTK
#
# Description
# Make and install paraview for version 3.14.1 and higher
# - place the paraview source under $WM_THIRD_PARTY_DIR/ParaView-VERSION
# (note capitalisation)
# Make and install VTK.
# The VTK sources should be located under one of these locations:
# - $WM_THIRD_PARTY_DIR/ParaView-VERSION
# - $WM_THIRD_PARTY_DIR/ParaView-vVERSION
#
# To use the VTK source from the ParaView source tree, simply make an
# appropriate link first. For example,
#
# (cd $WM_THIRD_PARTY_DIR && ln -s ParaView-v5.2.0/VTK VTK-7.1.0)
#
#------------------------------------------------------------------------------
# Run from third-party directory only
@ -40,75 +46,65 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
exit 1
}
. etc/tools/ThirdPartyFunctions
. etc/tools/ParaView3Functions
. etc/tools/ParaViewFunctions
. etc/tools/vtkFunctions
#------------------------------------------------------------------------------
#
# USER OPTIONS:
# ~~~~~~~~~~~~~
# MPI support:
# use 0 or unset MPI_MAX_PROCS for no upper-limit
withMPI=false
MPI_MAX_PROCS=32
# Python support:
# note: script will try to determine the appropriate python library.
# If it fails, specify the path using the PYTHON_LIBRARY variable
withPYTHON=false
PYTHON_LIBRARY=""
# PYTHON_LIBRARY="/usr/lib64/libpython2.6.so.1.0"
unset MPI_MAX_PROCS
# MESA graphics support:
withMESA=false
MESA_INCLUDE="/usr/include/GL"
MESA_LIBRARY="/usr/lib64/libOSMesa.so"
# extra QT gui support (useful for some third party apps)
withQT=true
# Set the path to the Qt-4.5 (or later) qmake if the system Qt is older
QMAKE_PATH=""
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<<USAGE
usage: $Script [OPTION] [paraview-VERSION] [CMAKE-OPTION]
usage: $Script [OPTION] [vtk-VERSION] [CMAKE-OPTION]
options:
-rebuild for repeated builds (-make -install) *use with caution*
-gl2 with new rendering backend (if not already enabled)
-mesa with mesa (if not already enabled)
-mpi with mpi (if not already enabled)
-python with python (if not already enabled)
-cmake PATH with the cmake version corresponding to the cmake path given
-qmake PATH with the Qt version corresponding to the qmake path given
-qt with extra Qt gui support (if not already enabled)
-qt-VER with Qt version corresponding to
\$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/qt-VER/bin/qmake
-gcc force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-mpi=NPROCS with mpi and max 'NPROCS' processes. NPROCS=0 for no
upper-limit on processes.
-osmesa with off-screen mesa only
-cmake PATH with cmake from the path given
-gcc force g++ instead of the value from \$WM_CXX
-verbose verbose output in Makefiles
-version VER specify an alternative version (current value: $ParaView_VERSION)
-major VER specify an alternative major version for special builds
-mesa-include DIR
location of mesa headers (current value: ${MESA_INCLUDE:-none})
-version VER specify an alternative version (current value: $VTK_VERSION)
-buildType NAME specify the build type (default: Release)
-mesa-prefix DIR location of mesa installation
-mesa-include DIR location of mesa headers (current value: ${MESA_INCLUDE:-none})
-mesa-lib PATH path to mesa library (current value: ${MESA_LIBRARY:-none})
-python-lib PATH path to python library (current value: ${PYTHON_LIBRARY:-none})
-help
The -no-FEATURE option can be used to forcibly disable these features:
mesa mpi python qt
The -no-FEATURE option can be disable these features (if not already disabled):
mesa mpi
CMake options start with a capital letter and contain an '='.
For example,
$Script BUILD_TESTING=ON PARAVIEW_GENERATE_PROXY_DOCUMENTATION=OFF
$Script BUILD_TESTING=ON
to add tests and avoid building documentation
For finer control, the build stages can be selected or deselected individually:
@ -117,51 +113,35 @@ For finer control, the build stages can be selected or deselected individually:
-install -no-install
* Make and install paraview-$ParaView_VERSION located under
\$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION
To make a different paraview version, simply specify on the command-line.
For example,
./makeParaview 3.14.1
* Make and install VTK-$VTK_VERSION located under
\$WM_THIRD_PARTY_DIR/VTK-$VTK_VERSION
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/VTK-$VTK_VERSION
USAGE
exit 1
}
#------------------------------------------------------------------------------
# ensure CMake gets the correct C/C++ compiler
# Ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
#
# add options based on script name:
# Various building stages
#
case "$Script" in *-mesa*) withMESA=true;; esac
case "$Script" in *-mpi*) withMPI=true;; esac
case "$Script" in *-python*) withPYTHON=true;; esac
case "$Script" in *-qt*) withQT=true;; esac
# Set initial ParaView_MAJOR based on current value of ParaView_VERSION
setVersion ${ParaView_VERSION:-none}
#
# various building stages
#
unset runCONFIG runMAKE runINSTALL
unset runPATCH runCONFIG runMAKE runINSTALL
runDEFAULT=true
buildType=Release
withOSMESA=false
# parse options
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
[0-9]* | paraview-[0-9]* | ParaView-[0-9]*) # paraview version
setVersion "${1%%/}"
[0-9]* | vtk-[0-9]* | VTK-[0-9]*) # VTK version
setVtkVersion "${1%%/}"
;;
[A-Z]*=*) # cmake variables
addCMakeVariable "$1"
@ -196,69 +176,67 @@ do
runINSTALL=true
unset runDEFAULT
;;
-gl2)
withGL2=true
;;
-no-gl2)
withGL2=false
;;
-mesa)
withMESA=true
;;
-osmesa)
withMESA=true
withOSMESA=true
;;
-no-mesa)
withMESA=false
withOSMESA=false
;;
-mesa-prefix)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
withMESA=true
MESA_INCLUDE="${2%%/}/include"
MESA_LIBRARY="${2%%/}/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so"
shift
;;
-mesa-include)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
MESA_INCLUDE="$2"
MESA_INCLUDE="${2%%/}"
shift
;;
-mesa-lib)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
MESA_LIBRARY="$2"
MESA_LIBRARY="${2%%/}"
shift
;;
-mpi)
withMPI=true
;;
-mpi=[0-9]*) # mpi and max mpi processes
withMPI=true
MPI_MAX_PROCS="${1##*=}"
;;
-no-mpi)
withMPI=false
;;
-python)
withPYTHON=true
;;
-no-python)
withPYTHON=false
;;
-python-lib)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
PYTHON_LIBRARY="$2"
shift
;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH=$2
CMAKE_PATH="${2%%/}"
shift
;;
-qmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
QMAKE_PATH=$2
shift
;;
-qt)
withQT=true
;;
-no-qt)
withQT=false
;;
-qt-[1-9]*)
QMAKE_PATH="$installBASE/${1##-}"
;;
-verbose)
withVERBOSE=true
;;
-version)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
setVersion "${2%%/}"
setVtkVersion "${2%%/}"
VTK_VERSION="${2%%/}"
shift
;;
-major)
-buildType)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
export ParaView_MAJOR="$2"
buildType="$2"
shift
;;
*)
@ -268,17 +246,23 @@ do
shift
done
[ -n "$ParaView_VERSION" ] || die "The paraview-VERSION was not specified"
[ -n "$VTK_VERSION" ] || die "The vtk-VERSION was not specified"
# nothing to build
if _foamIsNone "$ParaView_VERSION"
# Version-specific adjustments
if [ "$withGL2" = auto ]
then
echo "Using paraview-none (skip ThirdParty build of ParaView)"
exit 0
if [ "${VTK_VERSION%%.*}" -lt 7 ]
then
withGL2=false
else
withGL2=true
fi
fi
if [ "$runDEFAULT" = true ]
then
: ${runPATCH:=true}
: ${runCONFIG:=true}
: ${runMAKE:=true}
: ${runINSTALL:=true}
@ -289,11 +273,20 @@ fi
#~~~~~~~~~~~~~~~~~~~~~~
addVerbosity # verbose makefiles
addMpiSupport # set MPI-specific options
addPythonSupport # set Python-specific options
addMesaSupport # set MESA-specific options
addQtSupport # add extra Qt support
addGL2Support # new rendering backend
setDirs # where things are or should be put
# set off-screen only options
if [ "$withOSMESA" = true ]
then
addCMakeVariable "VTK_USE_X:BOOL=OFF"
addCMakeVariable "OPENGL_INCLUDE_DIR=$MESA_INCLUDE"
addCMakeVariable "OPENGL_xmesa_INCLUDE_DIR=$MESA_INCLUDE"
addCMakeVariable "OPENGL_gl_LIBRARY=$MESA_LIBRARY"
addCMakeVariable "OPENGL_glu_LIBRARY=$MESA_LIBRARY"
fi
setVtkDirs # where things are or should be put
# Build and install
@ -302,6 +295,7 @@ cat<<SUMMARY
Build stages selected
---------------------
-patch ${runPATCH:-false}
-config ${runCONFIG:-false}
-make ${runMAKE:-false}
-install ${runINSTALL:-false}
@ -309,20 +303,17 @@ Build stages selected
Features selected
mesa ${withMESA:-false}
mpi ${withMPI:-false}
python ${withPYTHON:-false}
qt ${withQT:-false}
---------------------
Version information
qt ${QtVersion:-none}
version ${ParaView_VERSION:-unknown}
major ${ParaView_MAJOR:-unknown}
$(checkVersion)
version ${VTK_VERSION:-unknown}
build ${buildType:-Release}
---------------------
SUMMARY
[ "$runCONFIG" = true ] && configParaView
[ "$runMAKE" = true ] && makeParaView
[ "$runINSTALL" = true ] && installParaView
[ "$runPATCH" = true ] && patchVTK
[ "$runCONFIG" = true ] && configVTK
[ "$runMAKE" = true ] && makeVTK
[ "$runINSTALL" = true ] && installVTK
echo
echo Done

15
makeVTK.example Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
# An example for building particular combinations of VTK with
# - off-screen mesa
vtk=VTK-7.1.0
# mesa=mesa-11.2.2
mesa=mesa-13.0.1
./makeVTK \
$vtk \
-osmesa \
-mesa-prefix $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mesa \
"$@"
#------------------------------------------------------------------------------

97
minCmake Executable file
View File

@ -0,0 +1,97 @@
#!/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 <http://www.gnu.org/licenses/>.
#
# Script
# minCmake
#
# Description
# Scour CMakeLists.txt files to report the cmake_minimum required.
#
#------------------------------------------------------------------------------
# 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
}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [dir1 ... dirN]
options:
-help
* Scour specified directories for CMakeLists.txt and their cmake_minimum.
* Without any arguments, select all first level directories.
USAGE
exit 1
}
#------------------------------------------------------------------------------
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-*)
usage "unknown option: '$1'"
;;
*)
break
;;
esac
shift
done
# Nothing specified - use first level of unpacked directories
[ "$#" -gt 0 ] || set -- $(find -mindepth 1 -maxdepth 1 -type d)
for dir
do
dir="${dir#./}" # Remove leading "./"
dir="${dir%/}" # Remove trailing "/"
min=$(sed -n \
-e 's/^.*cmake_minimum.*VERSION *\([0-9.][0-9.]*\).*/\1/p' \
"$dir/CMakeLists.txt" \
2>/dev/null)
if [ -n "$min" ]
then
# Remove trailing ".0" from version
echo "${min%.0}" "${dir#sources/}"
fi
done \
| sort -n -k 1 \
| xargs printf " %-10s %s\n"
# Use 4 leading spaces for easier pasting as Markdown
#------------------------------------------------------------------------------

38
sources.txt Normal file
View File

@ -0,0 +1,38 @@
Third-Party Sources
===================
OpenFOAM+ v1612
---------------
CGAL-4.9
ParaView-5.0.1
boost_1_62_0
fftw-3.3.5
openmpi-1.10.4
scotch_6.0.3
OpenFOAM+ v1606
---------------
CGAL-4.8
ParaView-5.0.1
boost_1_61_0
fftw-3.3.4
openmpi-1.10.2
scotch_6.0.3
OpenFOAM+ v3.0
---------------
CGAL-4.7
ParaView-4.4.0
openmpi-1.10.0
scotch_6.0.3
OpenFOAM+ 2.4
---------------
CGAL-4.6
ParaView-4.1.0
cmake-2.8.12.1
openmpi-1.8.5
scotch_6.0.3