131 Commits
v1612 ... v2006

Author SHA1 Message Date
bdd4266e2f ENH: delay testing of FOAM_EXT_LIBBIN
- only test in the packages that actually require it.
  State as a requirement.

ENH: skip build of packages with known mingw issues

- primarily kahip and pt-scotch.
  Others may also have issues, but for these we tend to use system
  packages anyhow.

ENH: add '-force' option to various scripts

- overrides some _lazy_ build logic
2020-06-24 14:32:26 +02:00
36f89097d8 STYLE: fix typo in PETSc help, add download info for HYPRE 2020-06-22 12:25:09 +02:00
78819144d3 DOC: add hint about scotch gitlab repo and paraview requirements (#52)
- add download hints for -help of various make scripts
2020-06-19 00:38:03 +02:00
348b8cd4f4 CONFIG: support inplace petsc installations 2020-06-19 00:38:03 +02:00
b9ace75da8 DOC: update download links 2020-06-15 21:18:59 +02:00
aa2523ee63 DOC: update BUILD and SOURCES information 2020-06-15 20:41:05 +02:00
6e03e1ecb4 CONFIG: simplify version range
- accept [0-9]* instead of attempting more restrictive specifications

CONFIG: makePETSC without fortran
2020-06-15 20:30:22 +02:00
7958c7e4c1 BUG: shell syntax error in makePETSC 2020-06-05 15:02:17 +02:00
67093bfb2f CONFIG: add -with-lib options for makeCGAL
- if not otherwise specified:
  - OpenFOAM-v1912 and older are implicitly `-with-lib`
  - new versions are implicitly `-no-lib`
2020-06-05 14:06:39 +02:00
9de516d315 CONFIG: incremental improvement for scotch + mingw
- linkage errors for ptscotch not yet solved

CONFIG: add -I. for ThirdParty wmake Make/options

- some <headers> might otherwise be missed with the change to
  '-iquote' for general wmake rules
2020-05-14 16:16:40 +02:00
69de80cd08 ENH: use OpenFOAM etc/config.sh/cmake (if it exists) for finding cmake 2020-05-02 21:09:21 +02:00
60d3922681 ENH: support build of scotch executables
- improve library checks to avoid unnecessary rebuild when
  cross-compiling
2020-04-15 20:33:22 +02:00
a4ba6b72f5 CONFIG: support updated location of wmkdepend binaries
- initialise some commonly used variables

- add library function for checking library existence that also
  accounts for windows cross-compilation targets
2020-04-15 20:32:39 +02:00
0c7c86faa6 COMP: skip build of ADIOS2 examples
- may fail to find mpi.h with ThirdParty openmpi

- remove makeAdios1 (ADIOS1 considered defunct for our purposes)
2020-01-20 14:50:49 +01:00
cd811d9b28 BUG: shell quoting needed for dash (fixes #48)
- arguments passed to stripCompilerFlags caused the misbehaviour
2020-01-20 14:50:29 +01:00
03f529f3bd DOC: update list of software versions 2019-12-17 07:53:39 +01:00
cb75d01584 ENH: improve toolset naming
- if passed things like "clang-9", strip down to the base name "clang"
2019-12-15 13:54:12 +01:00
baae61e0ec DOC: update internal repo links 2019-12-09 13:15:26 +01:00
714cddd6ca DOC: update links and replicate patches for scotch 2019-11-20 12:32:05 +01:00
c8a7f46db2 STYLE: regularize quoting and exit on failed 'cd' 2019-11-19 16:17:01 +01:00
e51f92f2f1 COMP: add error code to makeAdios2 to cascade error information to caller 2019-11-12 16:51:02 +01:00
a0d0ee36af DOC: add note about LIBGL_DEBUG env variable 2019-11-11 11:53:51 +01:00
074481b2f0 CONFIG: updates for kahip and scotch 2019-10-28 12:56:09 +01:00
a856a5fcad STYLE: remove unused branch in makeAdios2 2019-10-28 11:51:29 +01:00
c41b591b30 COMP: adjust makeParaView for paraview-5.7.0 (uses python3) 2019-10-02 17:16:20 +02:00
a9f5058557 ENH: more forgiving if scotch is missing, provide download hints (#45)
- include makeAdios2 into the Allwmake list (as optional component)
2019-08-16 15:50:08 +02:00
54d6b7994d CONFIG: harmonize makeAdios1, makeAdios2 files
- remove old dependency of adios2 on the adios1 library
2019-07-31 16:16:10 +02:00
17a443a557 BUG: export minimal compiler flags for VTK, ParaView (fixes #44)
- in 1906, we changed the handling of compiler flags to include the
  exact values as used by OpenFOAM.

  While this is needed for compiling some external programs -- see
  https://develop.openfoam.com/Development/OpenFOAM-plus/issues/1256
  for the discussion -- it appears to bring in flags that upset
  some of the ParaView (and possibly VTK) compilation.

  The culprits are likely to be found in the various '-W' switches,
  but for now we simply extract a mininal set of compiler flags
  that include -std=c++11 -m64 -fPIC, but no optimization flags,
  additional warnings flags or OpenFOAM-specific defines.
2019-07-29 13:55:04 +02:00
b987703b3c STYLE: minor update for README, BUILD information 2019-06-28 09:31:25 +02:00
325f848dc1 CONFIG: makeGcc with -m32/-m64 option instead of old WM_ARCH_OPTION 2019-06-27 18:43:10 +02:00
4c4a11755a DOC: relocated OpenFOAM etc/README.md to doc/Config.md 2019-06-13 18:42:18 +02:00
3c852a8929 DOC: fix links 2019-06-09 19:09:46 +02:00
867d96ec54 DOC: update docs, add initial Requirements information 2019-06-07 13:31:19 +02:00
16b59832cc CONFIG: add comment for compile flags in makeMesa
- add links for newest khaip, scotch (untested)
2019-06-06 23:27:08 +02:00
ddd4176269 ENH: additional tweaks for building boost. Eg armclang 2019-04-29 21:26:31 +02:00
ae5b2326c0 ENH: provide separate makeSCOTCH script for independent use
- improve handling of scotch build toolchain

- relax the test for existence of libscotcherrexit, which can also be
  incorporated into libscotch itself
2019-04-29 18:51:05 +02:00
bbbc7b2953 COMP: force PROJECT_LIBS to be empty
- additional safety when using wmake to generate .so or exe files.
  These third-party libraries must not themselves have a link
  dependency on OpenFOAM.
2019-04-27 17:48:22 +02:00
5ac0e3624f STYLE: trim trailing slash from tested directories 2019-04-25 11:44:53 +02:00
a7c2a4bfb9 STYLE: use EXT_SO instead of SO for consistency with wmake internal naming 2019-04-25 10:46:45 +02:00
c6e6c0abbf COMP: add Makefile patches for scotch_6.0.6
- bypasses generation of executables
2019-04-25 10:46:45 +02:00
fbbb275862 COMP: make libscotch/libptscotch targets instead of scotch/ptscotch
- we do not generally need any of executables, just the libraries.
  This also avoids generating a libscotchmetis too.
2019-04-25 10:46:45 +02:00
770e22bf51 ENH: update handling of compiler and flags
- support use of wmake -show-xyz, as well as older WM_CC, WM_CFLAGS etc.

- add support for Makefile.inc for scotch

- add -toolset= option for making boost and use b2 instead of legacy
  bjam for configuration
2019-04-25 10:46:44 +02:00
830e92194a BOT: reformat headers 2019-04-12 08:54:50 +02:00
8df5d377e7 STYLE: update some examples for mesa-18.3.4
- still needs more testing to determine the best combination of versions
2019-03-11 11:54:02 +01:00
aa9fc0efd2 CONFIG: update makeMPICH and makeMVAPICH
- note: mpich now builds libmpi.so instead of libmpich.so
2019-02-14 18:11:33 +01:00
f968a67362 CONFIG: update link for openmpi 2019-01-21 14:18:15 +01:00
c8135cc48e CONFIG: update download links for adios + kahip 2019-01-21 10:24:41 +01:00
adfe28332e CONFIG: additional llvm configuration for mesa build (#41) 2019-01-21 10:24:15 +01:00
3fe5c2beb5 CONFIG: update link to mpc version 2018-12-14 12:17:49 +01:00
6e0c9f9d8b ENH: makeVTK -mpi also define VTK_Group_MPI=ON
- this pulls in the other bits (Module_vtkParallelMPI,
  Module_vtkRenderingParallel, ...)
2018-12-05 23:37:00 +01:00
013c7154ff STYLE: avoid spurious message about non-system qt
- arises when update-alternatives or similar are being used.
2018-12-04 18:33:45 +01:00
28e7982258 ENH: minor build script improvements
- add internal WM_SIZE_OPTIONS variable for reduced typing
- check for wmkdepend and wmkdep for wmake builds
- avoid egrep for getting processor count.
2018-12-03 08:45:29 +01:00
7e5bdfd747 CONFIG: update version information 2018-12-03 08:44:27 +01:00
f64c88a1cf ENH: initial (rudimentary) makeHYPRE, makePETSC scripts 2018-07-31 11:20:37 +02:00
b71a60d122 ENH: add whichMpicxx function for C++ programs 2018-07-30 17:18:32 +02:00
7aee88cf92 COMP: patches for building older gcc versions with gcc-7
- gcc-4.8.5 : oldest currently supported
- gcc-4.9.4 : possibly usable C++11 regex
- gcc-6.3.0 : one generation older than gcc-7
2018-07-27 14:09:27 +02:00
d2334fe051 COMP: patch ParaView macros to find qhelpgenerator-qt5 (issue #40) 2018-07-22 17:47:03 +02:00
a77852ae18 CONFIG: add download link for scotch 6.0.6 2018-07-19 11:02:18 +02:00
0e599b7a64 ENH: add optional -clang flag for building gcc
- can be useful when bootstrapping
2018-07-18 09:39:12 +02:00
1a1c624422 COMP: add vtkhdf5 patch for compiling with gcc-8.1 (closes #39) 2018-07-07 13:35:08 +02:00
2dd42d8c6c CONFIG: disable CGAL_Core
- not required by OpenFOAM, and provokes cmake issues for CGAL-4.12
2018-07-05 14:12:36 +02:00
ff162da2f8 BUG: missing _foamEtc definition (fixes #38)
- this function definition (as per the OpenFOAM functions) is required
  for compatibility when sourcing some config files (eg, mpi).
2018-07-02 07:28:51 +02:00
a91157470d Merge branch 'develop' into 'master'
Final content for 1806 release

Closes #31 and #30

See merge request Development/ThirdParty-plus!6
2018-06-28 09:31:12 +01:00
8a53a789f7 DOC: update versions listed in SOURCES.txt
- update BUILD.md to mention the possible build issues related to Qt.

- additional comments about using binaries for ParaView instead of
  building from source
2018-06-27 17:03:31 +02:00
a42362f8b8 ENH: add paraview file series reader patch from upstream
- https://gitlab.kitware.com/paraview/paraview/merge_requests/2532

- bump ParaView to 5.5.2
2018-06-20 01:57:49 +02:00
4f844dabcf STYLE: use _foamConfig function instead of _foamEtc -config 2018-06-19 20:41:57 +02:00
d446ee8b31 ENH: add makeADIOS2 script 2018-06-19 20:30:19 +02:00
54efaa445a STYLE: additional comments about suffixes
- strip both prefix and suffix for VTK and ParaView builds
2018-06-11 10:19:18 +02:00
dab3042c45 CONFIG: update link and patch for paraview-5.5.1
- add note about building older Qt
2018-06-08 15:07:16 +02:00
52ad71871c CONFIG: add patches for ParaView Catalyst
- resolve problem with working directory:

    https://develop.openfoam.com/Community/catalyst/issues/4
    https://gitlab.kitware.com/paraview/paraview/merge_requests/2436
2018-05-11 12:10:16 +02:00
31ffa9c92c COMP: compilation of scotch on Darwin 2018-04-25 00:10:31 +02:00
5886ce9f65 COMP: add patch for VTKm cmake file
- https://gitlab.kitware.com/paraview/paraview/issues/18116
2018-04-23 12:04:50 +02:00
93b8816b3e COMP: remove makeTecio script
- removed foamToTecplot360 from the OpenFOAM source as not being
  reliably maintainable.
2018-04-23 11:54:45 +02:00
cbea5788a3 ENH: include qmake-qt5 in the search for qt
- some systems (eg, opensuse) use that since it has both qt4 and qt5
  installed. ParaView now needs qt5 (preferrably 5.9).

STYLE: update version information for ParaView and Qt
2018-04-12 10:48:05 +02:00
6d7ef8dc42 COMP: adjust make scripts for systems with .dylib instead of .so 2018-04-11 16:28:32 +02:00
455551b48b COMP: adjust Allwmake to build scotch-6.0.5a (fixes #31)
- only builds properly in serial.
  Allwmake adjusted accordingly, or simply build with '-j 1'
2018-03-05 16:32:38 +01:00
231733bc15 STYLE: use foamEtcFile with -config option instead of config.sh/ 2018-01-22 16:05:19 +01:00
5ecf33d4d8 COMP: compile llvm with openmp if the tools/openmp directory has content 2018-01-22 14:41:05 +01:00
475220cfae COMP: unset ParaView_DIR from PATH, LD_LIBRARY_PATH when building
- potential symbol conflicts and build errors if building from the git
  version since it uses the last major number (eg, 5.4) but may have a
  layout similar to the next release (eg, 5.5) and thus different
  sizes for classes etc.
2018-01-22 11:29:06 +01:00
de7ac04146 COMP: adjustments to makeCGAL for compilation with alternative mpfr/gmp
- document special steps for using ThirdParty mpfr/gmp with clang etc
2018-01-15 13:04:49 +01:00
7419702a85 DOC: note that min clang version 3.5 is required for building CGAL 2018-01-10 18:05:03 +01:00
43cbb24ddd COMP: check for wmake toolchain when building third-party (fixes #30) 2018-01-08 13:43:29 +01:00
f49d26dad5 COMP: more stringent checks for WM compiler settings (issue #29)
- only export the WM_* settings to their plain counterparts

     (eg, export CC=$WM_CC)

  when they actually point to an accessible program

  This helps in particular when bootstrapping builds with third-party
  compilers.
2018-01-03 13:41:12 +01:00
4c049afb40 ENH: add configure options for makeFFTW 2018-01-03 12:43:51 +01:00
ea9c2471a8 Merge branch 'develop' into 'master'
Final content for 1712 release

Closes #20 and #18

See merge request Development/ThirdParty-plus!5
2018-01-03 11:32:29 +00:00
03075ef079 STYLE: update some build comments regarding min gcc for clang 2017-12-19 10:21:07 +01:00
6485db81a9 COMP: use 'cc' instead of 'mpicc' on Cray (issue #28)
- the cray 'cc' handles mpi paths, there is no mpicc
2017-12-17 12:19:55 +01:00
5fcd29aa99 STYLE: remove patches and support for older paraview and adios 2017-12-15 14:39:35 +01:00
816173b7c4 CONFIG: update versions
ENH: add support of additional configure options to some make scripts

- remove hard-coded --verbs from makeOPENMPI in favour of letting the
  user provide it via the command-line for makeOPENMPI.

  eg,  makeOPENMPI openmpi-1.10.6 -- --with-verbs=DIRECTORY ...
2017-12-15 11:21:31 +01:00
491b3390bb ENH: add build scripts for KaHIP and METIS 2017-10-11 12:28:04 +02:00
6f32862d26 ENH: add -memcheck config option for makeOPENMPI 2017-10-09 17:26:40 +02:00
bc7fb08810 STYLE: relocated etc/wmakeFiles as makeFiles 2017-09-29 17:13:20 +02:00
0c7fa1cc7c COMP: have scotch use deterministic behaviour (closes #20) 2017-09-29 13:35:50 +02:00
5112b60e58 Merge remote-tracking branch 'origin/master' into develop 2017-09-28 14:03:08 +02:00
bdfdff11c8 COMP: incorrect verbs library directory used (closes #21) 2017-09-28 14:02:05 +02:00
51435f2e56 COMP: change ordering of statements to prevent premature termination after make
COMP: VTK- prefix not being trimmed from the name
2017-09-28 13:20:45 +02:00
c0de94d846 STYLE: drop -thread/-no-thread option for makeOPENMPI
- made redundant by 19f241f. Multiple threads are needed by the
  collated format and are now always enabled.
2017-09-12 09:58:27 +02:00
19f241fae2 ENH: Updated makeOPENMPI script to support new collocated IO 2017-09-07 14:38:19 +01:00
0f9fe6b863 COMP: paraview mpi config not being passed to vtk backend? 2017-08-03 09:42:33 +02:00
7f4a904b90 COMP: no explicit handling of mpi-profiling for openmpi (fixes #18)
- previously explicitly disabled mpi-profiling, but now let openmpi
  configure it itself.

- add config support for mpi-threads
2017-08-03 09:39:33 +02:00
ec80e1df97 COMP: improve consistency for Intel-MPI and non-icc compilers (issue #524) 2017-07-12 11:33:26 +02:00
092d71c3df COMP: improve support for non-system python locations (issue #17) 2017-07-04 00:11:29 +02:00
54356f8f87 Merge branch 'develop' into 'master'
Merge develop into master for v1706 release

Closes #16 and #15

See merge request !4
2017-06-30 10:05:21 +01:00
4a6ab3779f COMP: handle mesa library in lib64 or lib (fixes #16)
- only addresses -mesa-prefix behaviour.
  The -mesa-lib option makes no assumptions at all.

STYLE: update versions in makeParaView.example, makeVTK.example
2017-06-29 10:49:45 +02:00
458d9dadbf CONFIG: revert to openmpi-1.10.4
- this is the same version as OpenFOAM-1612 shipped with and seems to
  have fewer issues than the newer openmpi-2.1.1
2017-06-28 13:55:26 +02:00
aac32ece63 STYLE: update build notes for paraview 2017-06-22 17:53:24 +01:00
62c8476a4e COMP: Updated link to current openmpi 2.1.1 2017-06-21 20:38:48 +01:00
4a0f78084b CONFIG: update links for paraview, qt 2017-06-14 15:25:24 +02:00
986d9120fd CONFIG: update links for boost, CGAL 2017-05-29 17:16:59 +02:00
43cffa29db COMP: update compilation for mesa-17.1.1 2017-05-29 10:53:11 +02:00
ce4c19c717 COMP: adjust to use non-gcc compilers for scotch and ptscotch 2017-04-24 09:49:29 +02:00
c291d5742d CONFIG: update version information for llvm 2017-04-24 09:49:16 +02:00
d2da5b440e ENH: provide make script for MGridGen
- follow the standard *_ARCH_PATH style
2017-04-18 18:37:16 +02:00
59be96faed ENH: remove reliance on OpenFOAM etc/config.sh/functions file.
- similar functionality in etc/tools/ThirdPartyFunctions to improve
  the independence of ThirdParty while reducing clutter in the callers.

- add useGcc function for convenience
- mask seeing our own git-repo when building

STYLE: various items

- eliminate old user-editable configuration in files - now command-line only.
- use *_BUILD_DIR instead of *_BINARY_DIR for more clarity of the purpose
- drop use of '-q' option for wmakeCheckPwd (already has stderr redirect)
- drop checkVersion for makeParaView since it stopped working properly
  with newer paraview version

CONFIG: update list of versions
2017-03-20 12:42:44 +01:00
5d592841fd COMP: update makeMPICH for mpich-3.2
- not necessarily supported by OpenFOAM, but at least the build script
  works again, and the build is now out-of-source.
2017-03-14 15:12:57 +01:00
493d4b01ac ENH: provide -link option for makeCmake
- this creates a cmake-system link to the given cmake version, which
  is a simple means of providing an updated cmake version for the
  OpenFOAM build without actually needing to edit the
  etc/config.sh/paraview file
2017-02-01 17:48:59 +00:00
1189ff23c9 BUG: pkgconfigPrefix calling the incorrect backend
ENH: avoid editing pkgconfig symlinks
2017-02-01 09:49:05 +00:00
5c09a6433f COMP: avoid building CGAL ImageIO lib (fixes #15)
- OpenFOAM doesn't use any of the CGAL image library and the ImageIO
  library adds in an unnecessary OpenGL dependency (reported to fail
  on kubuntu-14.04)

STYLE: adjust documented link to main (non-svn) VisIt project directory
2017-01-25 08:16:14 +01:00
9f6a77a1ab ENH: introduce a separate makeOPENMPI
- makes is easier to quickly build different versions and reduces
  clutter in Allwmake.

- provide some quick '-test' options for makeCGAL, makeFFTW etc
  to reduce duplication of logic in Allwmake.
2017-01-20 16:02:25 +01:00
59432b7b2d ENH: use pkgconfigAdjust when compiling software that has pkgconfig files
- simplifies relocation at a later stage
2017-01-20 14:55:18 +01:00
82595ca823 ENH: provide etc/pkgconfigAdjust etc/pkgconfigPrefix wrappers
- both can operate on several directories, which means that the
  following is possible when relocating an entire third-party
  directory:

     etc/pkgconfigPrefix $(find platforms -type d -name pkgconfig)
2017-01-20 13:32:31 +01:00
d55ae084d4 ENH: generalize and improve pkgconfig editing
- now handles both lib/pkgconfig and lib64/pkgconfig locations
- also adjust includedir= and libdir= entries
2017-01-20 13:32:31 +01:00
e3190722e5 STYLE: add build information for ADIOS 2017-01-20 09:23:22 +01:00
1622a46832 STYLE: clearly document which scripts contain user-configurable settings
- unify cd, check for the cwd and error message
2017-01-20 09:00:51 +01:00
9926569ca1 ENH: add -suffix option for makeParaView and makeVTK
- simple means of distinguishing between types of builds
  (mesa, mpi, python).
2017-01-19 18:30:20 +01:00
fc3ea2f182 ENH: add pkgconf editing into ThirdPartyFunctions
- allows reuse for other packages using pkgconf
2017-01-19 18:30:20 +01:00
907e04f35c COMP: adjust makeParaView for build with mesa 2017-01-19 18:30:20 +01:00
ae464766e6 COMP: patch paraview 5.0.1 for building with osmesa
- reference: https://gitlab.kitware.com/vtk/vtk/merge_requests/1642
2017-01-19 18:30:19 +01:00
45caecb85b COMP: ensure GLES(1) includes are not installed with mesa 2017-01-19 18:30:19 +01:00
705556c3eb ENH: support building of paraview with Qt5
- this is the upcoming default Qt version
2017-01-19 18:30:19 +01:00
122ee3386e COMP: remove ccm fortran bindings as being unnecessary 2017-01-11 10:42:55 +01:00
70 changed files with 6726 additions and 2803 deletions

View File

@ -3,52 +3,41 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# Allclean
#
# Description
# Clean script for third-party applications and libraries
# Clean script for ThirdParty applications/libraries
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# 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."
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
# . etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
Script=${0##*/}
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
Usage: $Script [OPTION] [<platform> [ ... <platformN> ]]
Usage: ${0##*/} [OPTION] [platform [ ... platformN]]
options:
-all remove all platforms directories.
-current clean the current platform ($WM_OPTIONS).
-all remove all platforms directories
-current clean the current platform ($WM_OPTIONS)
-help print the usage
Cleanup intermediate build directories.
@ -60,35 +49,62 @@ USAGE
}
# Print help message
if [ "$1" = "-h" -o "$1" = "-help" ]; then
case "$1" in
(-h | -help*)
usage
fi
;;
esac
#------------------------------------------------------------------------------
# Clean various packages via 'distclean'
for i in openmpi-* ADIOS-* metis-*
for i in \
openmpi-* metis-* adios-* ADIOS-* gperftools-* qt-* \
gmp-* mpfr-* mpc-* gcc-* llvm-* \
;
do
[ -d "$i" ] && (
if [ -d "$i" ]
then
(
echo
echo "${i%/*}"
echo " make distclean"
echo
cd $i && make distclean
)
fi
done
# Clean various packages via 'realclean'
for i in scotch*/src
do
[ -d "$i" ] && (
if [ -d "$i" ]
then
(
echo
echo "${i%/*}"
echo " make realclean"
echo
cd $i && make realclean
)
fi
done
# Clean various packages via 'wclean'
for i in libccmio*/Make kahip*/lib/Make
do
if [ -d "$i" ]
then
(
echo
echo "${i%/Make}"
echo " wclean"
echo
cd ${i%/Make} && wclean
)
fi
done
@ -105,26 +121,25 @@ 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" ]
if [ -n "$platform" ] && [ -d "platforms/$platform" ]
then
echo
echo "Cleaning platform '$platform'"
\rm -rf "platforms/$platform"
rm -rf "platforms/$platform"
else
echo
echo "Platform '$platform' not built"
fi
}
if [ "$#" -ge 1 ]
then
echo
echo "Clean platforms/sub-directories"
fi
# Optionally cleanup platforms specified from the arguments
while [ "$#" -ge 1 ]
@ -134,7 +149,7 @@ do
echo
echo "Removing all platforms/sub-directories"
echo
\rm -rf platforms/*
rm -rf platforms/*
break
;;

446
Allwmake
View File

@ -3,70 +3,36 @@
# ========= |
# \\ / 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 | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# Allwmake
# ThirdParty Allwmake
#
# Description
# Build script for ThirdParty
# Build script for ThirdParty applications/libraries
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# 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."
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# 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
}
exportCompiler true # Compiler info + flags for CMake/configure
exportLinker # Linker flags for CMake/configure
useGccFlag $@ # Scan arguments for a '-gcc' option
#------------------------------------------------------------------------------
@ -74,367 +40,97 @@ echo
echo ========================================
echo Start ThirdParty Allwmake
echo ========================================
echo "using: $CC $CFLAGS"
echo "using: $CXX $CXXFLAGS"
echo
echo ========================================
echo Build MPI libraries if required
echo " $MPI_ARCH_PATH"
case "$WM_MPLIB" in
OPENMPI)
if [ -r $MPI_ARCH_PATH/lib${WM_COMPILER_LIB_ARCH}/libmpi.so ]
then
echo " have $WM_MPLIB shared library ($FOAM_MPI)"
echo
elif [ -r $MPI_ARCH_PATH/lib${WM_COMPILER_LIB_ARCH}/libmpi.a ]
then
echo " have $WM_MPLIB static library ($FOAM_MPI)"
echo
else
(
# configuration options:
# Start with GridEngine support - builds without external libraries
configOpt="--with-sge"
# Add InfiniBand support
ibDir=/usr/local/ofed
ibLib=$infbDIR/lib${WM_COMPILER_LIB_ARCH}
if [ -d "$ibDir" -a -d "$ibLib" ]
then
configOpt="$configOpt --with-verbs=$ibDir --with-verbs-lib=$ibLib"
fi
# end of configuration options
# ----------------------------
mpiPACKAGE="${MPI_ARCH_PATH##*/}"
sourceDIR=$sourceBASE/$mpiPACKAGE
buildDIR=$buildBASE/$mpiPACKAGE
cd $sourceDIR || exit 1
[ -e Makefile ] && make distclean 2>/dev/null
rm -rf $MPI_ARCH_PATH
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure \
--prefix=$MPI_ARCH_PATH \
--disable-orterun-prefix-by-default \
--enable-shared --disable-static \
--libdir=$MPI_ARCH_PATH/lib${WM_COMPILER_LIB_ARCH} \
--enable-mpi-fortran=none \
--disable-mpi-profile \
$configOpt \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpiPACKAGE"
) || {
echo "Error building: $mpiPACKAGE"
exit 1
}
fi
(OPENMPI | MPICH)
./make"$WM_MPLIB" -test "$MPI_ARCH_PATH" || ./make"$WM_MPLIB"
;;
MPICH)
if [ -r $MPI_ARCH_PATH/lib/libmpich.so ]
then
echo " have $WM_MPLIB shared library ($FOAM_MPI)"
echo
elif [ -r $MPI_ARCH_PATH/lib/libmpich.a ]
then
echo " have $WM_MPLIB static library ($FOAM_MPI)"
echo
else
(
# WARNING: unmaintained build code:
# ---------------------------------
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.*
./configure \
--prefix=$MPI_ARCH_PATH \
--without-mpe \
--disable-f77 \
--disable-f90 \
--disable-f90modules \
--disable-mpedbg \
--disable-devdebug \
--disable-debug \
--enable-sharedlib=$MPI_ARCH_PATH/lib \
--with-device=ch_p4 \
;
# For MPICH2 below 1.5a1 uncomment this line and comment next
# make && make install
# For MPICH2 1.5a1 or above
make -j $WM_NCOMPPROCS && make install
make distclean
if [ -r $MPI_ARCH_PATH ]
then
cd $MPI_ARCH_PATH/bin
for file in *
do
sed s%$MPI_ARCH_PATH%'$MPI_ARCH_PATH'%g $file > temp.$$
mv temp.$$ $file
chmod 0755 $file
done
cd $MPI_ARCH_PATH/lib
if [ -r libmpich.so.1.0 ]
then
rm *.so
ln -s libmpich.so.1.0 libmpich.so
fi
fi
)
fi
;;
esac
#------------------------------------------------------------------------------
# Building scotch is still a bit of a pain
# Get SCOTCH_VERSION, SCOTCH_ARCH_PATH
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch)
then
. $settings
else
echo
echo "Error: no config.sh/scotch settings"
echo
fi
echo
echo ========================================
echo "Build Scotch decomposition library $SCOTCH_VERSION"
echo " $SCOTCH_ARCH_PATH"
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 \
-a -r $FOAM_EXT_LIBBIN/libscotcherrexit.so ]
then
echo " scotch header in $SCOTCH_ARCH_PATH/include"
echo " scotch libs in $FOAM_EXT_LIBBIN"
elif [ -d "$SCOTCH_SOURCE_DIR" ]
then
(
cd $SCOTCH_SOURCE_DIR/src || exit 1
rm -rf $SCOTCH_ARCH_PATH
applyPatch $SCOTCH_VERSION .. # patch at parent-level
prefixDIR=$SCOTCH_ARCH_PATH
libDIR=$FOAM_EXT_LIBBIN
mkdir -p $prefixDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
configOpt="prefix=$prefixDIR libdir=$libDIR"
if [ -f $scotchMakefile ]
then
rm -f Makefile.inc
ln -s $scotchMakefile Makefile.inc
fi
[ -f Makefile.inc ] || {
echo " Error: scotch needs an appropriate Makefile.inc"
exit 1
}
# handle non-gcc compilers
unset configEnv
[ "${WM_CC:-gcc}" != gcc ] && configEnv="CC=$WM_CC CCS=$WM_CC"
make realclean 2>/dev/null # for safety
make -j $WM_NCOMPPROCS $configEnv scotch \
&& make $configOpt install
# cleanup, could also remove Makefile.inc
make realclean 2>/dev/null
) || warnBuildIssues SCOTCH
else
warnNotFound SCOTCH
fi
# 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 \
-a -r $FOAM_EXT_LIBBIN/libscotch.so ] || \
{
echo
echo " WARNING: skipping pt-scotch - 'scotch.h' include file not found!"
false
}
then
echo
echo ========================================
echo "Build pt-scotch decomposition library $SCOTCH_VERSION (with $FOAM_MPI)"
echo " $SCOTCH_ARCH_PATH"
if [ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h \
-a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libptscotch.so \
-a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libptscotcherrexit.so ]
then
echo " ptscotch header in $SCOTCH_ARCH_PATH/include/$FOAM_MPI"
echo " ptscotch libs in $FOAM_EXT_LIBBIN/$FOAM_MPI"
else
(
cd $SCOTCH_SOURCE_DIR/src || exit 1
echo
prefixDIR=$SCOTCH_ARCH_PATH
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 includedir=$incDIR libdir=$libDIR"
if [ -f $scotchMakefile ]
then
rm -f Makefile.inc
ln -s $scotchMakefile Makefile.inc
fi
[ -f Makefile.inc ] || {
echo " Error: scotch needs an appropriate Makefile.inc"
exit 1
}
# handle non-gcc compilers
unset configEnv
[ "${WM_CC:-gcc}" != gcc ] && configEnv="CC=$WM_CC CCS=$WM_CC"
make realclean 2>/dev/null # for safety
make -j $WM_NCOMPPROCS $configEnv ptscotch \
&& make $configOpt install
# cleanup, could also remove Makefile.inc
make realclean 2>/dev/null
)
fi
# verify existence of ptscotch include
[ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h ] || {
echo
echo " WARNING: required include file 'ptscotch.h' not found!"
}
fi
# Treat as optional, but really isn't if anyone wants parallel calculations
./makeSCOTCH || warnBuildIssues SCOTCH
#------------------------------------------------------------------------------
# Metis is optional
echo
echo ========================================
echo Build Metis decomposition
# Get KAHIP_ARCH_PATH
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/kahip)
then
. $settings
fi
if [ -n "$KAHIP_ARCH_PATH" ]
then
echo KAHIP decomposition
./makeKAHIP -test "$KAHIP_ARCH_PATH" || \
./makeKAHIP || warnBuildIssues KAHIP
else
warnNotFound KAHIP # is optional
fi
# get METIS_VERSION, METIS_ARCH_PATH
#------------------------------------------------------------------------------
echo
echo ========================================
# Get METIS_ARCH_PATH
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis)
then
. $settings
fi
METIS_SOURCE_DIR=$sourceBASE/$METIS_VERSION
if [ -f $METIS_ARCH_PATH/include/metis.h \
-a -r $FOAM_EXT_LIBBIN/libmetis.so ]
if [ -n "$METIS_ARCH_PATH" ]
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
# Adjust metis integer size to match OpenFOAM label-size
sed -i -e 's=\(#define IDXTYPEWIDTH\).*=\1 '$WM_LABEL_SIZE'=' \
include/metis.h
# No config option for the library location.
# - build normally and use mv to relocate it
make config shared=1 prefix=$METIS_ARCH_PATH \
&& make -j $WM_NCOMPPROCS install \
&& mv $METIS_ARCH_PATH/lib/libmetis.so $FOAM_EXT_LIBBIN
rmdir $METIS_ARCH_PATH/lib 2>/dev/null || true # failure is not critical
) || warnBuildIssues METIS
echo METIS decomposition
./makeMETIS -test "$METIS_ARCH_PATH" || \
./makeMETIS || warnBuildIssues METIS
else
warnNotFound METIS
warnNotFound METIS # is optional
fi
#------------------------------------------------------------------------------
# CGAL is optional
echo
echo ========================================
echo Build CGAL
if [ -d "$CGAL_ARCH_PATH/include" \
-a -r "$CGAL_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libCGAL.so" ]
then
# first some information about boost
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$WM_COMPILER_LIB_ARCH"
elif [ -n "$CGAL_ARCH_PATH" ]
if [ -n "$CGAL_ARCH_PATH" ]
then
echo "cgal/boost"
./makeCGAL -test "$CGAL_ARCH_PATH" "$BOOST_ARCH_PATH" || \
./makeCGAL || warnBuildIssues CGAL
else
warnNotFound CGAL
warnNotFound CGAL # is optional
fi
# FFTW is optional
#------------------------------------------------------------------------------
echo
echo ========================================
echo Build FFTW
if [ -d "$FFTW_ARCH_PATH/include" \
-a -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3.so" ]
then
echo " FFTW headers in $FFTW_ARCH_PATH/include"
echo " FFTW libs in $FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
elif [ -n "$FFTW_ARCH_PATH" ]
if [ -n "$FFTW_ARCH_PATH" ]
then
echo FFTW
./makeFFTW -test "$FFTW_ARCH_PATH" || \
./makeFFTW || warnBuildIssues FFTW
else
warnNotFound FFTW
warnNotFound FFTW # is optional
fi
#------------------------------------------------------------------------------
echo
echo ========================================
# Get ADIOS2_ARCH_PATH
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/adios2)
then
. $settings
fi
if [ -n "$ADIOS2_ARCH_PATH" ]
then
echo ADIOS2
./makeAdios2 -test "$ADIOS2_ARCH_PATH" || \
./makeAdios2 || warnBuildIssues ADIOS2
else
warnNotFound ADIOS2 # is optional
fi

496
BUILD.md
View File

@ -1,31 +1,19 @@
<!--
|--------------------------------------------------------------------------|
| ========= | |
| \\ / 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
*proprietary* libraries. This third-party collection contains configurations and
scripts for building third-party packages. It will normally only be used in
conjunction with the corresponding OpenFOAM version.
## Organization
## Directory 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
|-------------------|-------------------------------------------------------
| etc/ | auxiliary tools and content used for the build process
| build/ | intermediate build objects
| platforms/ | the installation directories
@ -38,18 +26,19 @@ 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
Nonetheless, 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]
```
$ ./makeFFTW -help
usage: makeFFTW [OPTION] [fftw-VERSION]
```
---
## Before Starting
0. Review the [system requirements](http://www.openfoam.com/documentation/system-requirements.php)
0. Review the [system requirements][link openfoam-require]
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.
@ -61,17 +50,21 @@ version specified on the command-line. For example,
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
```
which mpicc
```
2. Adjust the OpenFOAM `etc/bashrc`, `etc/config.sh/...` or equivalent
`prefs.sh` files to reflect your preferred configuration.
the `etc/prefs.{csh,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.
See the [OpenFOAM configuration information][link openfoam-config]
for more details.
After making the desired changes, use the `wmRefresh` alias
or equivalent to enable the configuration.
---
@ -83,9 +76,9 @@ 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.
### Bootstrapping *(optional)*
### Build Sequence
1. `makeGcc` _or_ `makeLLVM` <a name="makeGcc"></a> *(optional)*
* `makeGcc` _or_ `makeLLVM` <a name="makeGcc"></a>
- 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.
@ -93,59 +86,127 @@ ThirdParty components prior to building OpenFOAM itself.
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
- `WM_COMPILER=Clang40` (for example)
- or `WM_COMPILER=Clang` and adjust `clang_version` 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)*
* `makeCmake`
- 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`
Note that the order of the bootstrapping process may need to be
reversed, or even require a few loops. For example, if you may need a
newer version of CMake before being able to build LLVM/Clang and
subsequently use the newly build clang to create a newer version of
CMake in the desired location.
Additionally, if you are using clang but with ThirdParty locations for
gmp/mpfr you will need some extra work. Here is an example:
* Compile a new ThirdParty clang version:
```
./makeLLVM llvm-4.0.1
```
* Now adjust the OpenFOAM `prefs.sh` to use the new compiler settings,
and update the OpenFOAM environment (eg, `wmRefresh`)
* Next use (abuse) the `makeGcc` script to compile gmp/mpfr libraries.
It is best to pass the desired versions explicitly, and necessary
to set the CC/CXX variables so that the correct compiler is used:
```
CC=clang CXX=clang++ ./makeGcc gmp-6.1.2 mpfr-4.0.0 gcc-system
```
specifying `gcc-system` effectively disables building of gcc,
but will build the gmp/mpfr components.
* As a final step, it will be necessary to add the ThirdParty
gmp/mpfr locations in the OpenFOAM config files since they are
normally only used in combination with a ThirdParty gcc.
The location to make these changes is in the `etc/config.sh/CGAL`,
since this is the component that uses the mpfr library.
For example,
```
gmp_version=gmp-6.1.2
mpfr_version=mpfr-4.0.0
export GMP_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
export GMP_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
```
* Update update the OpenFOAM environment (eg, `wmRefresh`) again.
### Build Sequence
1. `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
- If the optional kahip or metis directories are found, they will also be compiled.
2. `makeParaView` *(optional)*
- Can be useful for visualization and for run-time post-processing function objects.
You can build this at a later point in time, and rebuild the visualization modules.
3. Make any additional optional components
#### Optional Components
`makeAdios2`
- Only required for [ADIOS](#parallel) support.
`makeCGAL`
- Builds third-party boost and CGAL.
- Builds [boost](#general-packages) and [CGAL](#general-packages).
Automatically invoked from the ThirdParty `Allwmake`,
but can be invoked directly to resolve possible build errors.
`makeFFTW`
- Builds third-party FFTW.
- Builds [FFTW](#general-packages).
Automatically invoked from the ThirdParty `Allwmake`,
but can be invoked directly to resolve possible build errors.
`makeKAHIP`
- Builds [KaHIP](#parallel) decomposition library.
Automatically invoked from the ThirdParty `Allwmake`,
but can be invoked directly to resolve possible build errors.
`makeOPENMPI`
- Builds [OPENMPI](#parallel) library.
`makePETSC`
- Only required for [PETSC](#general-packages) support.
`makeMETIS`
- Builds [METIS](#parallel) decomposition library.
Automatically invoked from the ThirdParty `Allwmake`,
but can be invoked directly to resolve possible build errors.
`makeSCOTCH`
- Builds [scotch, ptscotch](#parallel) decomposition libraries.
Automatically invoked from the ThirdParty `Allwmake`,
but can be invoked directly for special configurations
or to resolve possible build errors.
`makeMGridGen`
- Optional agglomeration routines.
`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
The `makeParaView.example` and `makeVTK.example` files offer some
suggestions about compiling such a configuration.
`makeQt`
- Script to build a [third-party installation of Qt](#makeQt), including qmake.
- Script to build a [Qt](#makeQt), including qmake.
- Possibly needed for `makeParaView`.
- The associated `etc/relocateQt` may be of independent use.
Read the file for more details.
`makeGperftools`
- Build gperftools (originally Google Performance Tools)
@ -155,19 +216,23 @@ ThirdParty components prior to building OpenFOAM itself.
Report in sorted order.
`Allclean`
- After building, this script may be used to remove intermediate build information
and save some disk space.
- After building, this script may be used to remove intermediate build
information and save some disk space.
## Build Notes
### CGAL
- The [zlib][page zlib] library and development headers are required.
### Scotch
- The zlib library and zlib development headers are required.
- The [zlib][page zlib] library and 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-11][link mesa11] and [mesa-13][link mesa13] both
seem okay, as does building with [mesa-17][link mesa].
- Building with mesa-12 is not possible since it fails to create
the necessary `include/GL` directory and `osmesa.h` file.
@ -177,72 +242,124 @@ and save some disk space.
- 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
```
ln -s ParaView-v5.6.0/VTK VTK-8.2.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)
```
$ cat ParaView-v5.6.0/VTK/CMake/vtkVersion.cmake
```
contains this type of information
```
# VTK version number components.
set(VTK_MAJOR_VERSION 8)
set(VTK_MINOR_VERSION 2)
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.
**NOTE** this step may not be entirely successful for your particular
system. Building ParaView itself is generally not a significant problem
but its dependency on particular Qt versions can be a problem.
#### 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.
If you fail at this step due to Qt dependencies, you may have success
building a slightly older Qt version. Another alternative may be to
use the ParaView-5.4 sources that were included in the ThirdParty-v1712
source pack. This, however, has never been tested in combination with
the OpenFOAM Catalyst insitu visualization.
If you encounter problems starting paraview (eg, segmentation fault)
it could be related to the graphics libraries not being properly found.
The `LIBGL_DEBUG` environment variable can be used to obtain more
detailed information:
```
$ export LIBGL_DEBUG=verbose
```
The call to paraview now emits this information:
```
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib64/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib64/dri/swrast_dri.so
...
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
```
Indicating that the drivers are probably not correctly installed.
The `/var/log/Xorg.0.log` file or the `dmesg` command may yield more
information to the cause.
In this particular case, the Nvidia drivers had a client/server
version mismatch.
#### 5.6.x, 5.5.x binary packages
For general functionality, the paraview version distributed with
the operating system or a [binary package][download ParaView]
may be sufficient for your needs.
- No known issues with the native OpenFOAM reader.
Using a binary package does mean you miss these elements (which may or
may not be important for you):
- cannot visualize a `blockMeshDict`
- cannot build Catalyst insitu visualization
- no alternative OpenFOAM reader module for some special features not
found in the native OpenFOAM reader.
#### 5.5.x
- Requires patching for the vtk-m configuration (on some systems).
- Recommended patching for ParaView Catalyst.
- Recommended patching for file series
No known issues with the native OpenFOAM reader.
#### 5.4.x
- Compiles without patching.
No known issues with the native OpenFOAM reader.
#### 5.3.0 and older are neither recommended nor supported
- Various compilation issues and known bugs.
### 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
1. Download a [*qt-everywhere-opensource-src*][link Qt5] package and
unpack in the third-party directory.
2. Use the `makeQt` script with the QT version number. For example,
./makeQt 4.8.7
```
./makeQt 5.9.3
```
3. Build ParaView using this third-party QT. For example,
./makeParaView -qt-4.8.7 5.0.1
- ParaView does not yet support QT5.
```
./makeParaView -qt-5.9.3 5.6.0
```
- ParaView versions prior to 5.3.0 do not properly 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.
*Note* On some older systems it can be quite difficult to build the
latest QT. In these cases, it is sometimes possible to build a
slightly older QT (eg, [qt-5.6.3][link Qt56]) instead.
---
## Versions
### Gcc Compiler <a name="gcc-compiler"></a>
The minimum version of gcc required is 4.8.0.
The minimum version of gcc required is **4.8.5**
| Name | Location
|-------------------|--------------------------------------------
@ -276,26 +393,22 @@ install the 32-bit development libraries by default.
### Clang Compiler <a name="clang-compiler"></a>
The minimum version of clang required is 3.3.
The minimum version of clang required is **3.7**
*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.
update your CMake beforehand since GNU *configure* can only be used prior
to clang version 3.9.
If your system gcc is particularly old
(see [minimum gcc requirements for clang](#min-gcc))
you may have additional hurdles to using the newest versions of clang.
| 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]
| [clang][page clang] | [download][link clang] or [newer][newer clang]
| [llvm][page llvm] | [download][link llvm] or [newer][newer llvm]
| [openmp][page omp] | [download][link omp] or [newer][newer omp]
### General <a name="general-packages"></a>
@ -304,46 +417,82 @@ GNU *configure* can only be used prior to clang version 3.9.
|-----------------------|------------------------
| [CMake][page cmake] | [download][link cmake]
| [boost][page boost] | [download][link boost]
| [CGAL][page CGAL] | [download][link CGAL] or [older][older CGAL]
| [CGAL][page CGAL] | [download][link CGAL]
| [FFTW][page FFTW] | [download][link FFTW]
| [PETSC][page PETSC] | [download][link PETSC]
| [HYPRE][page HYPRE] | [repo][repo HYPRE] or [download][link HYPRE]
| [ADF/CGNS][page CGNS], ccm | [link ccmio][link ccmio]
| [tecio][page tecio] | [link tecio][link tecio]
| gperftools | [repo][repo gperftools] or [download][link gperftools]
### Parallel Processing <a name="parallel"></a>
| Name | Location
|-----------------------|------------------------
| [openmpi][page openmpi] | [download][link openmpi]. ***Some openmpi2/openmpi3 versions exhibit [stability issues](https://github.com/open-mpi/ompi/issues/5375)***
| [adios][page adios] | [repo][repo adios] or [github download][link adios]
| [scotch, ptscotch][page scotch] | [repo][repo scotch] or [download][link scotch] or [older][older scotch] or [even older][oldest scotch]
| [kahip][page kahip] | [download][link kahip] or [older][older kahip]
| [metis][page metis] | [download][link metis]
### 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.
| [MESA][page mesa] | [download][link mesa] or [older 13][link mesa13], [older 11][link mesa11]
| [ParaView][page ParaView] | [download][link ParaView] or older [paraview-56][link ParaView56], [paraview-55][link ParaView55] or [binaries][download ParaView]
| [Qt][page Qt] | [QT5][link Qt5] for ParaView-5.3.0 and later, or the [older qt-56][link Qt56] for older systems.
### 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
```
2.8 llvm-3.4.2
2.8.11 CGAL-4.9
2.8.11 CGAL-4.11
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.6.3
3.10 ParaView-5.7.0 - ParaView-5.8.0
3.4.3 llvm-3.9.1
3.4.3 llvm-4.0.0 - llvm-6.0.0
3.6 ADIOS2
```
### 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
```
4.7 llvm-3.7.0
4.7 llvm-3.6.2
4.7 llvm-3.5.2
4.4 llvm-3.4.2
If your system gcc/g++ is too old to build the desired llvm/clang
version, you may need to build a lower llvm/clang version and then use
that clang compiler for building the newer llvm/clang version.
<!-- OpenFOAM, Internal links -->
[link openfoam-readme]: https://develop.openfoam.com/Development/openfoam/blob/develop/README.md
[link openfoam-config]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Config.md
[link openfoam-build]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Build.md
[link openfoam-require]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Requirements.md
[link third-readme]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/README.md
[link third-build]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/BUILD.md
[link third-require]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/Requirements.md
## Software Links
If you have access to this information file in its raw form, you will
note that most of the software pages and download links are listed as
a collection at the end of the file. This is designed to make it
easier to use `grep` and find the relevant pages and links.
<!-- gcc-related -->
@ -353,90 +502,105 @@ The minimum gcc/g++ requirements for building various components.
[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
[link gmp]: ftp://ftp.gnu.org/gnu/gmp/gmp-6.2.0.tar.xz
[link mpfr]: ftp://ftp.gnu.org/gnu/mpfr/mpfr-4.0.2.tar.xz
[link mpc]: ftp://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
<!-- clang-related -->
[page clang]: http://llvm.org/
[page llvm]: http://llvm.org/
[page clang]: http://clang.llvm.org/
[page omp]: http://openmp.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
[link clang]: http://llvm.org/releases/3.7.1/cfe-3.7.1.src.tar.xz
[link llvm]: http://llvm.org/releases/3.7.1/llvm-3.7.1.src.tar.xz
[link omp]: http://llvm.org/releases/3.7.1/openmp-3.7.1.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
[newer clang]: http://llvm.org/releases/4.0.1/cfe-4.0.1.src.tar.xz
[newer llvm]: http://llvm.org/releases/4.0.1/llvm-4.0.1.src.tar.xz
[newer omp]: http://llvm.org/releases/4.0.1/openmp-4.0.1.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 adios]: https://csmd.ornl.gov/software/adios2
[repo adios]: https://github.com/ornladios/ADIOS2
[link adios]: https://github.com/ornladios/ADIOS2/archive/v2.4.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
[repo scotch]: https://gitlab.inria.fr/scotch/scotch
[link scotch]: https://gforge.inria.fr/frs/download.php/file/38187/scotch_6.0.9.tar.gz
[older scotch]: https://gforge.inria.fr/frs/download.php/file/38114/scotch_6.0.8.tar.gz
[oldest scotch]: https://gforge.inria.fr/frs/download.php/file/37622/scotch_6.0.6.tar.gz
[page kahip]: http://algo2.iti.kit.edu/documents/kahip/
[older kahip]: http://algo2.iti.kit.edu/schulz/software_releases/KaHIP_2.00.tar.gz
[link kahip]: http://algo2.iti.kit.edu/schulz/software_releases/KaHIP_2.12.tar.gz
[page metis]: http://glaros.dtc.umn.edu/gkhome/metis/metis/overview
[link metis]: http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.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
[older openmpi]: https://download.open-mpi.org/release/open-mpi/v1.10/openmpi-1.10.7.tar.bz2
[link openmpi]: https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.bz2
[page mpich]: http://www.mpich.org/
[link mpich]: http://www.mpich.org/static/downloads/3.3/mpich-3.3.tar.gz
[page mvpapich]: http://mvapich.cse.ohio-state.edu/
[link mvpapich]: http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.3.tar.gz
<!-- general -->
[page cmake]: http://www.cmake.org/
[link cmake]: http://www.cmake.org/files/v3.5/cmake-3.5.2.tar.gz
[link cmake]: https://cmake.org/files/v3.8/cmake-3.8.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
[link boost]: https://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_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
[link CGAL]: https://github.com/CGAL/cgal/releases/download/releases/CGAL-4.12.2/CGAL-4.12.2.tar.xz
[page FFTW]: http://www.fftw.org/
[link FFTW]: http://www.fftw.org/fftw-3.3.5.tar.gz
[link FFTW]: http://www.fftw.org/fftw-3.3.7.tar.gz
[page petsc]: https://www.mcs.anl.gov/petsc/
[link petsc]: http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.2.tar.gz
[page hypre]: https://computing.llnl.gov/projects/hypre-scalable-linear-solvers-multigrid-methods/
[repo hypre]: https://github.com/hypre-space/hypre/
[link hypre]: https://github.com/hypre-space/hypre/archive/v2.19.0.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)
[link ccmio]: http://portal.nersc.gov/project/visit/third_party/libccmio-2.6.1.tar.gz (check usage conditions)
[altlink ccmio]: http://portal.nersc.gov/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz (check usage conditions)
[repo gperftools]: https://github.com/gperftools/gperftools
[link gperftools]: https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz
[page zlib]: https://www.zlib.net/
[link zlib]: https://sourceforge.net/projects/libpng/files/zlib/1.2.11/zlib-1.2.11.tar.xz
<!-- 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
[download ParaView]: https://www.paraview.org/download/
[link ParaView54]: http://www.paraview.org/files/v5.4/ParaView-v5.4.1.tar.gz
[link ParaView55]: http://www.paraview.org/files/v5.5/ParaView-v5.5.2.tar.gz
[link ParaView56]: http://www.paraview.org/files/v5.6/ParaView-v5.6.3.tar.gz
[link ParaView]: http://www.paraview.org/files/v5.7/ParaView-v5.7.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
[link mesa]: ftp://ftp.freedesktop.org/pub/mesa/mesa-17.1.1.tar.xz
[link mesa13]: ftp://ftp.freedesktop.org/pub/mesa/13.0.6/mesa-13.0.6.tar.xz
[link mesa11]: ftp://ftp.freedesktop.org/pub/mesa/older-versions/11.x/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)
[link Qt56]: http://download.qt.io/official_releases/qt/5.6/5.6.3/single/qt-everywhere-opensource-src-5.6.3.tar.xz
[link Qt5]: http://download.qt.io/official_releases/qt/5.9/5.9.3/single/qt-everywhere-opensource-src-5.9.3.tar.xz
---
Copyright 2016 OpenCFD Ltd
Copyright 2016-2020 OpenCFD Ltd

View File

@ -1,15 +1,3 @@
<!--
|--------------------------------------------------------------------------|
| ========= | |
| \\ / 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
@ -34,14 +22,14 @@ version specified on the command-line.
## Before Starting
0. Review the [system requirements](http://www.openfoam.com/documentation/system-requirements.php)
0. Review the [system requirements][link openfoam-require]
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.
`prefs.sh` files to reflect your preferred [configuration][link openfoam-config].
2. Source the updated OpenFOAM environment
---
@ -53,31 +41,82 @@ 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
### 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)*
4. `makeParaView` *(optional)*
5. Any other additional optional components
If the `Allwmake` is being invoked directly (not from the OpenFOAM `Allwmake`),
it may be necessary to bootstrap the binary parts of the `wmake` toolchain
manually before proceeding. This is done with the following command:
```
$WM_PROJECT_DIR/wmake/src/Allmake
```
### Build Details
**It normally advisable to skip the ParaView compilation initially**.
More details can be found the ThirdParty ./BUILD.md information.
Building ParaView from source tends to be the most difficult part of
any third-party compilation.
For general functionality, the paraview version distributed with
the operating system or a [binary package][download ParaView]
may be sufficient for your needs.
<!-- Standard Footer -->
## Additional OpenFOAM Links
### Details
- [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)
- More details can be found the [ThirdParty BUILD.md][link third-build] information.
- Some configuration details can be found in the
[OpenFOAM doc/Config.md][link openfoam-config] information.
### Other
When building other libraries directly, with autoconfig or cmake, it
will be useful or necessary to use the same compiler and compiler
settings as are used by OpenFOAM itself. These are obtained from the
`wmake` show options and can be used to set corresponding environment
variables. For example,
```
CC="$(wmake -show-c)" CFLAGS="$(wmake -show-cflags)" ./configure
```
Here is the correspondence to commonly used environment variables
| Env variable | Obtaining from wmake | Meaning |
|-------------------|---------------------------|-----------------------|
| CC | `wmake -show-c` | C compiler |
| CFLAGS | `wmake -show-cflags` | C compiler flags |
| CXX | `wmake -show-cxx` | C++ compiler |
| CXXFLAGS | `wmake -show-cxxflags` | C++ compiler flags |
| | `wmake -show-cflags-arch` | Architecture information when linking |
| | `wmake -show-cxxflags-arch` | Architecture information when linking |
In some situations it can also be useful to have the compiler and flags
together (similar to `mpicc -show` and `mpicxx -show`):
```
wmake -show-compile-c
wmake -show-compile-cxx
```
<!-- Quick links -->
[download ParaView]: https://www.paraview.org/download/
<!-- OpenFOAM -->
[link openfoam-readme]: https://develop.openfoam.com/Development/openfoam/blob/develop/README.md
[link openfoam-config]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Config.md
[link openfoam-build]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Build.md
[link openfoam-require]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Requirements.md
[link third-readme]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/README.md
[link third-build]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/BUILD.md
[link third-require]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/Requirements.md
---
Copyright 2016 OpenCFD Ltd
Copyright 2016-2019 OpenCFD Ltd

72
Requirements.md Normal file
View File

@ -0,0 +1,72 @@
## OpenFOAM&reg; ThirdParty System Requirements
For building some particular third-party libraries from source,
the normal [OpenFOAM System Requirements][link openfoam-require]
may not be sufficient.
This is most notably the case for ParaView and/or QT compilation.
As duly noted in [BUILD][link third-build] and [README][link third-readme] information,
building ParaView from source tends to be the most difficult part of
any third-party compilation.
For general functionality, the paraview version distributed with
the operating system or a [binary package][download ParaView]
is likely adequate for your needs.
***Please help us with keeping the information here up-to-date and accurate.***
### Ubuntu
The full dependency list for building ParaView can be found from the
corresponding [debian/control][debian control] file.
A ***quick*** way to get these dependencies on to your system is to
use the paraview development package:
```
sudo apt install paraview-dev
```
Depending on your setup, the following subset may also be enough:
```
sudo apt install cmake qt5base-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev libqt5x11extras5-dev libxt-dev
```
### openSUSE
The full dependency list for building ParaView can be found from the
corresponding [rpm spec][suse spec] file.
A ***quick*** way to get these dependencies on to your system is to
use the paraview development package:
```
sudo zypper install paraview-devel
```
Depending on your setup, the following subset may also be enough:
```
sudo zypper install Mesa-libEGL-devel
sudo zypper install libqt5-qtbase-devel libqt5-qtsvg-devel libqt5-qttools-devel libqt5-qtx11extras
sudo zypper install libXt-devel
```
<!-- Quick links -->
[download ParaView]: https://www.paraview.org/download/
[debian control]: https://salsa.debian.org/science-team/paraview/-/blob/master/debian/control
[suse spec]: https://build.opensuse.org/package/view_file/science/paraview/paraview.spec
<!-- OpenFOAM -->
[link openfoam-readme]: https://develop.openfoam.com/Development/openfoam/blob/develop/README.md
[link openfoam-config]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Config.md
[link openfoam-build]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Build.md
[link openfoam-require]: https://develop.openfoam.com/Development/openfoam/blob/develop/doc/Requirements.md
[link third-readme]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/README.md
[link third-build]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/BUILD.md
[link third-require]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/Requirements.md
---
Copyright 2019-2020 OpenCFD Ltd

130
SOURCES.txt Normal file
View File

@ -0,0 +1,130 @@
Third-party software versions for recent OpenFOAM versions
OpenFOAM-2006
---------------
ADIOS-2.4.0
CGAL-4.12.2 *update*
ParaView-5.6.3
boost_1_66_0 *update*
fftw-3.3.7
openmpi-4.0.3 *update*
scotch_6.0.9
kahip-2.12
OpenFOAM-1912
---------------
ADIOS-2.4.0 *new*
CGAL-4.9.1
ParaView-5.6.3 *minor*
boost_1_64_0
fftw-3.3.7
openmpi-1.10.7 *minor*
scotch_6.0.9 *minor*
kahip-2.12 *update*
OpenFOAM-1906
---------------
CGAL-4.9.1
ParaView-5.6.0
boost_1_64_0
fftw-3.3.7
openmpi-1.10.7 *minor*
scotch_6.0.6
kahip-2.00d
OpenFOAM-1812
---------------
CGAL-4.9.1
ParaView-5.6.0 *update*
boost_1_64_0
fftw-3.3.7
openmpi-1.10.4
scotch_6.0.6 *minor*
kahip-2.00d
OpenFOAM-1806
---------------
CGAL-4.9.1
ParaView-5.5.2 *update*
boost_1_64_0
fftw-3.3.7
openmpi-1.10.4
scotch_6.0.3
kahip-2.00d
OpenFOAM-1712
---------------
CGAL-4.9.1
ParaView-5.4.1 *minor*
boost_1_64_0
fftw-3.3.7 *minor*
openmpi-1.10.4
scotch_6.0.3
kahip-2.00d *new*
OpenFOAM-1706
---------------
CGAL-4.9.1 *minor*
ParaView-5.4.0 *update*
boost_1_64_0 *update*
fftw-3.3.6-pl1 *minor*
openmpi-1.10.4
scotch_6.0.3
OpenFOAM-1612
---------------
CGAL-4.9 *update*
ParaView-5.0.1 *update*
boost_1_62_0 *update*
fftw-3.3.5 *minor*
openmpi-1.10.4 *minor*
scotch_6.0.3
OpenFOAM-1606
---------------
CGAL-4.8 *update*
ParaView-5.0.1 *update*
boost_1_61_0 *new*
fftw-3.3.4 *new*
openmpi-1.10.2 *minor*
scotch_6.0.3
OpenFOAM-1601 (3.0+)
---------------
CGAL-4.7 *update*
ParaView-4.4.0 *update*
openmpi-1.10.0 *update*
scotch_6.0.3
OpenFOAM-2.4
---------------
CGAL-4.6 *update*
ParaView-4.1.0
openmpi-1.8.5 *update*
scotch_6.0.3 *update*
---------------
OpenFOAM-2.3
---------------
CGAL-4.3
ParaView-4.1.0
openmpi-1.6.5
scotch_6.0.0
---------------

70
etc/makeFiles/kahip/files Normal file
View File

@ -0,0 +1,70 @@
/* NOTE: make any changes to this file in etc/wmakeFiles/ */
interface/kaHIP_interface.cpp
/* List obtained from SConscript, libkaffpa_files = [ ... ] entry */
data_structure/graph_hierarchy.cpp
algorithms/strongly_connected_components.cpp
algorithms/topological_sort.cpp
algorithms/push_relabel.cpp
io/graph_io.cpp
tools/quality_metrics.cpp
tools/random_functions.cpp
tools/graph_extractor.cpp
tools/misc.cpp
tools/partition_snapshooter.cpp
partition/graph_partitioner.cpp
partition/w_cycles/wcycle_partitioner.cpp
partition/coarsening/coarsening.cpp
partition/coarsening/contraction.cpp
partition/coarsening/edge_rating/edge_ratings.cpp
partition/coarsening/matching/matching.cpp
partition/coarsening/matching/random_matching.cpp
partition/coarsening/matching/gpa/path.cpp
partition/coarsening/matching/gpa/gpa_matching.cpp
partition/coarsening/matching/gpa/path_set.cpp
partition/coarsening/clustering/node_ordering.cpp
partition/coarsening/clustering/size_constraint_label_propagation.cpp
partition/initial_partitioning/initial_partitioning.cpp
partition/initial_partitioning/initial_partitioner.cpp
partition/initial_partitioning/initial_partition_bipartition.cpp
partition/initial_partitioning/initial_refinement/initial_refinement.cpp
partition/initial_partitioning/bipartition.cpp
partition/initial_partitioning/initial_node_separator.cpp
partition/uncoarsening/uncoarsening.cpp
partition/uncoarsening/separator/area_bfs.cpp
partition/uncoarsening/separator/vertex_separator_algorithm.cpp
partition/uncoarsening/separator/vertex_separator_flow_solver.cpp
partition/uncoarsening/refinement/cycle_improvements/greedy_neg_cycle.cpp
partition/uncoarsening/refinement/cycle_improvements/problem_factory.cpp
partition/uncoarsening/refinement/cycle_improvements/augmented_Qgraph.cpp
partition/uncoarsening/refinement/mixed_refinement.cpp
partition/uncoarsening/refinement/label_propagation_refinement/label_propagation_refinement.cpp
partition/uncoarsening/refinement/refinement.cpp
partition/uncoarsening/refinement/quotient_graph_refinement/2way_fm_refinement/two_way_fm.cpp
partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement/two_way_flow_refinement.cpp
partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement/boundary_bfs.cpp
partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement/flow_solving_kernel/cut_flow_problem_solver.cpp
partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement/most_balanced_minimum_cuts/most_balanced_minimum_cuts.cpp
partition/uncoarsening/refinement/quotient_graph_refinement/quotient_graph_refinement.cpp
partition/uncoarsening/refinement/quotient_graph_refinement/complete_boundary.cpp
partition/uncoarsening/refinement/quotient_graph_refinement/partial_boundary.cpp
partition/uncoarsening/refinement/quotient_graph_refinement/quotient_graph_scheduling/quotient_graph_scheduling.cpp
partition/uncoarsening/refinement/quotient_graph_refinement/quotient_graph_scheduling/simple_quotient_graph_scheduler.cpp
partition/uncoarsening/refinement/quotient_graph_refinement/quotient_graph_scheduling/active_block_quotient_graph_scheduler.cpp
partition/uncoarsening/refinement/kway_graph_refinement/kway_graph_refinement.cpp
partition/uncoarsening/refinement/kway_graph_refinement/kway_graph_refinement_core.cpp
partition/uncoarsening/refinement/kway_graph_refinement/kway_graph_refinement_commons.cpp
partition/uncoarsening/refinement/cycle_improvements/augmented_Qgraph_fabric.cpp
partition/uncoarsening/refinement/cycle_improvements/advanced_models.cpp
partition/uncoarsening/refinement/kway_graph_refinement/multitry_kway_fm.cpp
partition/uncoarsening/refinement/node_separators/greedy_ns_local_search.cpp
partition/uncoarsening/refinement/node_separators/fm_ns_local_search.cpp
partition/uncoarsening/refinement/node_separators/localized_fm_ns_local_search.cpp
algorithms/cycle_search.cpp
partition/uncoarsening/refinement/cycle_improvements/cycle_refinement.cpp
partition/uncoarsening/refinement/tabu_search/tabu_search.cpp
LIB = $(FOAM_EXT_LIBBIN)/libkahip

View File

@ -0,0 +1,18 @@
/*
* NOTE: make any changes to this file in etc/wmakeFiles/
* Must use -DNDEBUG to disable kahip debug mode.
* Using -DMODE_NODESEP is not strictly required for building the library.
*/
EXE_INC = \
${c++LESSWARN} \
${COMP_OPENMP} \
-DNDEBUG -DMODE_NODESEP \
-I. \
-I$(KAHIP_LIB_SRC) \
-I$(KAHIP_LIB_SRC)/partition \
-I$(KAHIP_LIB_SRC)/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement
LIB_LIBS =
PROJECT_LIBS =

View File

@ -0,0 +1,22 @@
/* NOTE: make any changes to this file in etc/makeFiles/ */
libadf/ADF_interface.c
libadf/ADF_internals.c
libccmio/ccmio.c
libccmio/ccmiocore.c
libccmio/ccmioprivate.c
libccmio/ccmioutility.c
libccmio/ccmioversion.c
/*
* CGNS library not needed by ccmio, retain for documentation purposes only
*
libcgns/adf_cond.c
libcgns/adf_ftoc.c
libcgns/cgns_error.c
libcgns/cgns_internals.c
libcgns/cgnslib.c
*/
LIB = $(FOAM_EXT_LIBBIN)/libccmio

View File

@ -0,0 +1,5 @@
/* NOTE: make any changes to this file in etc/makeFiles/ */
EXE_INC = -I.
LIB_LIBS =
PROJECT_LIBS =

View File

@ -0,0 +1,56 @@
#-------------------------------*- makefile -*---------------------------------
#
# Prior to OpenFOAM-v1906, these were always part of the environment
#
# - WM_CFLAGS : with -m32 / -m64 and -fPIC
# - WM_LDFLAGS : with -m32 / -m64
#
# With OpenFOAM-v1906 and later
#
# - wmake -show-cflags : with -m32 / -m64
# - wmake -show-cflags-arch : with -m32 / -m64
#
# Pass these in via the environment since using '$(shell ...)' here does not
# always work well.
#
# Notes:
# - compiled without pthread
#
# Normally set CCS, CCP by caller
#------------------------------------------------------------------------------
EXE =
LIB = .dylib
OBJ = .o
AR = $(CC)
ARFLAGS = $(WM_CFLAGS) -dynamiclib -undefined dynamic_lookup -o
CCS ?= $(CC)
CCP ?= mpicc
CCD = $(CCP)
CFLAGS = $(WM_CFLAGS) -fPIC -O3 \
-DCOMMON_FILE_COMPRESS_GZ \
-DCOMMON_RANDOM_FIXED_SEED \
-DSCOTCH_DETERMINISTIC \
-DSCOTCH_RENAME \
-Drestrict=__restrict
# 32-bit vs. 64-bit labels
ifeq ($(WM_LABEL_SIZE),64)
CFLAGS += -DINTSIZE64
endif
CLIBFLAGS =
LDFLAGS = $(WM_LDFLAGS) -lz -lm
MAKE = make
CP = cp
CAT = cat
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = echo
LEX = flex -Pscotchyy -olex.yy.c
YACC = bison -pscotchyy -y -b y
#------------------------------------------------------------------------------

View File

@ -0,0 +1,73 @@
#-------------------------------*- makefile -*---------------------------------
#
# Prior to OpenFOAM-v1906, these were always part of the environment
#
# - WM_CFLAGS : with -m32 / -m64 and -fPIC
# - WM_LDFLAGS : with -m32 / -m64
#
# With OpenFOAM-v1906 and later
#
# - wmake -show-cflags : with -m32 / -m64
# - wmake -show-cflags-arch : with -m32 / -m64
#
# Pass these in via the environment since using '$(shell ...)' here does not
# always work well.
#
# Notes:
# - compiled without pthread
#
# Normally set CCS, CCP by caller
#------------------------------------------------------------------------------
EXE =
LIB = .dll
OBJ = .o
# Separate the cross-compilation flags from regular CFLAGS to ensure that
# system gcc does not use them for the scotch build toolchain
CFLAGS_CROSS = -DCOMMON_WINDOWS -DCOMMON_STUB_FORK
# Flags for including windows MPI information (MSMPI)
CFLAGS_WINMPI = -I$(MPI_ARCH_PATH)/include \
-DMSMPI_NO_SAL -DMSMPI_NO_DEPRECATE_20 \
-D_MPICH_DLL_
AR = x86_64-w64-mingw32-gcc
ARFLAGS = $(CFLAGS) -shared -Wl,--output-def,libscotch.def,--out-implib,libscotch.a,--enable-auto-import,--strip-all -o
CC = x86_64-w64-mingw32-gcc $(CFLAGS_CROSS)
CCS = x86_64-w64-mingw32-gcc $(CFLAGS_WINMPI)
CCP = x86_64-w64-mingw32-gcc $(CFLAGS_WINMPI)
CCD = gcc $(CFLAGS_WINMPI)
CFLAGS = $(WM_CFLAGS) -fPIC -O3 \
-DCOMMON_PTHREAD_FILE \
-UCOMMON_FILE_COMPRESS \
-DCOMMON_RANDOM_FIXED_SEED \
-DSCOTCH_DETERMINISTIC \
-DSCOTCH_RENAME \
-DSCOTCH_PTHREAD \
-Drestrict=__restrict
# 32-bit vs. 64-bit labels
ifeq ($(WM_LABEL_SIZE),64)
CFLAGS += -DINTSIZE64
endif
# Non-standard "__stdcall" in MSMPI <mpi.h>
CCDFLAGS = $(CFLAGS) -D__stdcall=''
CLIBFLAGS = -shared
LDFLAGS =
MAKE = make
CP = cp
CAT = cat
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = echo
LEX = flex -Pscotchyy -olex.yy.c
YACC = bison -pscotchyy -y -b y
#------------------------------------------------------------------------------

View File

@ -0,0 +1,56 @@
#-------------------------------*- makefile -*---------------------------------
#
# Prior to OpenFOAM-v1906, these were always part of the environment
#
# - WM_CFLAGS : with -m32 / -m64 and -fPIC
# - WM_LDFLAGS : with -m32 / -m64
#
# With OpenFOAM-v1906 and later
#
# - wmake -show-cflags : with -m32 / -m64
# - wmake -show-cflags-arch : with -m32 / -m64
#
# Pass these in via the environment since using '$(shell ...)' here does not
# always work well.
#
# Notes:
# - compiled without pthread
#
# Normally set CCS, CCP by caller
#------------------------------------------------------------------------------
EXE =
LIB = .so
OBJ = .o
AR = $(CC)
ARFLAGS = $(WM_CFLAGS) -shared -o
CCS ?= $(CC)
CCP ?= mpicc
CCD = $(CCP)
CFLAGS = $(WM_CFLAGS) -fPIC -O3 \
-DCOMMON_FILE_COMPRESS_GZ \
-DCOMMON_RANDOM_FIXED_SEED \
-DSCOTCH_DETERMINISTIC \
-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
MAKE = make
CP = cp
CAT = cat
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = echo
LEX = flex -Pscotchyy -olex.yy.c
YACC = bison -pscotchyy -y -b y
#------------------------------------------------------------------------------

View File

@ -1,12 +0,0 @@
--- 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++) {

View File

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

View File

@ -0,0 +1,155 @@
#
# Patch for building older gcc versions with gcc-7
#
--- gcc-4.8.5/gcc/cp/cfns.gperf.orig 2013-01-10 21:38:27.000000000 +0100
+++ gcc-4.8.5/gcc/cp/cfns.gperf 2016-02-25 16:36:41.000000000 +0100
@@ -1,5 +1,7 @@
+%language=C++
+%define class-name libc_name
%{
-/* Copyright (C) 2000-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2014 Free Software Foundation, Inc.
This file is part of GCC.
@@ -16,14 +18,6 @@
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int hash (const char *, unsigned int);
-#ifdef __GNUC__
-__inline
-#endif
-const char * libc_name_p (const char *, unsigned int);
%}
%%
# The standard C library functions, for feeding to gperf; the result is used
--- gcc-4.8.5/gcc/cp/cfns.h.orig 2013-01-10 21:38:27.000000000 +0100
+++ gcc-4.8.5/gcc/cp/cfns.h 2016-02-25 16:36:41.000000000 +0100
@@ -1,5 +1,5 @@
-/* ANSI-C code produced by gperf version 3.0.3 */
-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */
+/* C++ code produced by gperf version 3.0.4 */
+/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
@@ -28,9 +28,9 @@
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
-#line 1 "cfns.gperf"
+#line 3 "cfns.gperf"
-/* Copyright (C) 2000-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2014 Free Software Foundation, Inc.
This file is part of GCC.
@@ -47,25 +47,18 @@
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int hash (const char *, unsigned int);
-#ifdef __GNUC__
-__inline
-#endif
-const char * libc_name_p (const char *, unsigned int);
/* maximum key range = 391, duplicates = 0 */
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-hash (register const char *str, register unsigned int len)
+class libc_name
+{
+private:
+ static inline unsigned int hash (const char *str, unsigned int len);
+public:
+ static const char *libc_name_p (const char *str, unsigned int len);
+};
+
+inline unsigned int
+libc_name::hash (register const char *str, register unsigned int len)
{
static const unsigned short asso_values[] =
{
@@ -122,14 +115,8 @@
return hval + asso_values[(unsigned char)str[len - 1]];
}
-#ifdef __GNUC__
-__inline
-#ifdef __GNUC_STDC_INLINE__
-__attribute__ ((__gnu_inline__))
-#endif
-#endif
const char *
-libc_name_p (register const char *str, register unsigned int len)
+libc_name::libc_name_p (register const char *str, register unsigned int len)
{
enum
{
--- gcc-4.8.5/gcc/cp/except.c.orig 2013-10-25 15:49:48.000000000 +0200
+++ gcc-4.8.5/gcc/cp/except.c 2018-07-27 13:11:11.825369497 +0200
@@ -1025,7 +1025,7 @@
unless the system headers are playing rename tricks, and if
they are, we don't want to be confused by them. */
id = DECL_NAME (fn);
- return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
+ return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
}
/* Returns nonzero if an exception of type FROM will be caught by a
--- gcc-4.8.5/libgcc/config/i386/linux-unwind.h.orig 2013-02-04 20:06:20.000000000 +0100
+++ gcc-4.8.5/libgcc/config/i386/linux-unwind.h 2018-07-27 12:51:18.305390871 +0200
@@ -58,7 +58,7 @@
if (*(unsigned char *)(pc+0) == 0x48
&& *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
{
- struct ucontext *uc_ = context->cfa;
+ ucontext_t *uc_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
because it does not alias anything. */
@@ -138,7 +138,7 @@
siginfo_t *pinfo;
void *puc;
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
} *rt_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
--- gcc-4.8.5/libsanitizer/asan/asan_linux.cc.orig 2013-01-23 12:41:33.000000000 +0100
+++ gcc-4.8.5/libsanitizer/asan/asan_linux.cc 2018-07-27 12:51:45.641390381 +0200
@@ -25,6 +25,7 @@
#include <sys/types.h>
#include <fcntl.h>
#include <pthread.h>
+#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <unwind.h>
--- gcc-4.8.5/libsanitizer/tsan/tsan_platform_linux.cc.orig 2013-02-21 11:57:10.000000000 +0100
+++ gcc-4.8.5/libsanitizer/tsan/tsan_platform_linux.cc 2018-07-27 13:17:32.417362682 +0200
@@ -292,7 +292,7 @@
#ifndef TSAN_GO
int ExtractResolvFDs(void *state, int *fds, int nfd) {
int cnt = 0;
- __res_state *statp = (__res_state*)state;
+ struct __res_state *statp = (struct __res_state*)state;
for (int i = 0; i < MAXNS && cnt < nfd; i++) {
if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
fds[cnt++] = statp->_u._ext.nssocks[i];

View File

@ -0,0 +1,87 @@
#
# Patch for building older gcc versions with gcc-7
#
--- gcc-4.9.4/libgcc/config/i386/linux-unwind.h.orig 2014-01-02 23:25:22.000000000 +0100
+++ gcc-4.9.4/libgcc/config/i386/linux-unwind.h 2018-07-27 10:43:46.021527909 +0200
@@ -58,7 +58,7 @@
if (*(unsigned char *)(pc+0) == 0x48
&& *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
{
- struct ucontext *uc_ = context->cfa;
+ ucontext_t *uc_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
because it does not alias anything. */
@@ -138,7 +138,7 @@
siginfo_t *pinfo;
void *puc;
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
} *rt_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
--- gcc-4.9.4/libsanitizer/asan/asan_linux.cc.orig 2013-12-05 10:18:38.000000000 +0100
+++ gcc-4.9.4/libsanitizer/asan/asan_linux.cc 2018-07-27 11:11:52.085497715 +0200
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <fcntl.h>
#include <pthread.h>
+#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <unwind.h>
--- gcc-4.9.4/libsanitizer/sanitizer_common/sanitizer_linux.cc.orig 2013-12-05 10:18:38.000000000 +0100
+++ gcc-4.9.4/libsanitizer/sanitizer_common/sanitizer_linux.cc 2018-07-27 10:43:02.405528690 +0200
@@ -599,8 +599,7 @@
return internal_syscall(__NR_prctl, option, arg2, arg3, arg4, arg5);
}
-uptr internal_sigaltstack(const struct sigaltstack *ss,
- struct sigaltstack *oss) {
+uptr internal_sigaltstack(const void *ss, void *oss) {
return internal_syscall(__NR_sigaltstack, (uptr)ss, (uptr)oss);
}
--- gcc-4.9.4/libsanitizer/sanitizer_common/sanitizer_linux.h.orig 2013-12-05 10:18:38.000000000 +0100
+++ gcc-4.9.4/libsanitizer/sanitizer_common/sanitizer_linux.h 2018-07-27 10:42:29.845529273 +0200
@@ -18,7 +18,6 @@
#include "sanitizer_platform_limits_posix.h"
struct link_map; // Opaque type returned by dlopen().
-struct sigaltstack;
namespace __sanitizer {
// Dirent structure for getdents(). Note that this structure is different from
@@ -28,8 +27,7 @@
// Syscall wrappers.
uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
-uptr internal_sigaltstack(const struct sigaltstack* ss,
- struct sigaltstack* oss);
+uptr internal_sigaltstack(const void* ss, void* oss);
uptr internal_sigaction(int signum, const __sanitizer_kernel_sigaction_t *act,
__sanitizer_kernel_sigaction_t *oldact);
uptr internal_sigprocmask(int how, __sanitizer_kernel_sigset_t *set,
--- gcc-4.9.4/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc.orig 2013-12-05 11:28:59.000000000 +0100
+++ gcc-4.9.4/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc 2018-07-27 10:41:32.053530308 +0200
@@ -238,7 +238,7 @@
// Alternate stack for signal handling.
InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
- struct sigaltstack handler_stack;
+ stack_t handler_stack;
internal_memset(&handler_stack, 0, sizeof(handler_stack));
handler_stack.ss_sp = handler_stack_memory.data();
handler_stack.ss_size = kHandlerStackSize;
--- gcc-4.9.4/libsanitizer/tsan/tsan_platform_linux.cc.orig 2013-12-05 10:18:38.000000000 +0100
+++ gcc-4.9.4/libsanitizer/tsan/tsan_platform_linux.cc 2018-07-27 10:40:13.781531710 +0200
@@ -351,7 +351,7 @@
// closes within glibc. The code is a pure hack.
int ExtractResolvFDs(void *state, int *fds, int nfd) {
int cnt = 0;
- __res_state *statp = (__res_state*)state;
+ struct __res_state *statp = (struct __res_state*)state;
for (int i = 0; i < MAXNS && cnt < nfd; i++) {
if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
fds[cnt++] = statp->_u._ext.nssocks[i];

View File

@ -0,0 +1,82 @@
#
# Patch for building older gcc versions with gcc-7
#
diff -u gcc-6.3.0/libgcc/config/i386/linux-unwind.h.orig gcc-6.3.0/libgcc/config/i386/linux-unwind.h
--- gcc-6.3.0/libgcc/config/i386/linux-unwind.h.orig 2016-01-04 23:30:50.000000000 +0900
+++ gcc-6.3.0/libgcc/config/i386/linux-unwind.h 2017-10-29 23:01:21.717240052 +0900
@@ -58,7 +58,7 @@
if (*(unsigned char *)(pc+0) == 0x48
&amp;&amp; *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
{
- struct ucontext *uc_ = context-&gt;cfa;
+ ucontext_t *uc_ = context-&gt;cfa;
/* The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
because it does not alias anything. */
@@ -138,7 +138,7 @@
siginfo_t *pinfo;
void *puc;
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
} *rt_ = context-&gt;cfa;
/* The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
diff -u gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cc.orig gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cc
--- gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cc.orig 2015-11-23 18:07:18.000000000 +0900
+++ gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cc 2017-10-29 23:09:00.490577558 +0900
@@ -546,8 +546,7 @@
}
#endif
-uptr internal_sigaltstack(const struct sigaltstack *ss,
- struct sigaltstack *oss) {
+uptr internal_sigaltstack(const void *ss, void *oss) {
return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss);
}
diff -u gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_linux.h.orig gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_linux.h
--- gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_linux.h.orig 2015-10-21 16:32:45.000000000 +0900
+++ gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_linux.h 2017-10-29 23:09:43.907244619 +0900
@@ -19,7 +19,6 @@
#include "sanitizer_platform_limits_posix.h"
struct link_map; // Opaque type returned by dlopen().
-struct sigaltstack;
namespace __sanitizer {
// Dirent structure for getdents(). Note that this structure is different from
@@ -28,8 +27,7 @@
// Syscall wrappers.
uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
-uptr internal_sigaltstack(const struct sigaltstack* ss,
- struct sigaltstack* oss);
+uptr internal_sigaltstack(const void* ss, void* oss);
uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
__sanitizer_sigset_t *oldset);
void internal_sigfillset(__sanitizer_sigset_t *set);
diff -u gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc.orig gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
--- gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc.orig 2015-10-21 16:32:45.000000000 +0900
+++ gcc-6.3.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc 2017-10-29 23:08:07.260577074 +0900
@@ -267,7 +267,7 @@
// Alternate stack for signal handling.
InternalScopedBuffer&lt;char&gt; handler_stack_memory(kHandlerStackSize);
- struct sigaltstack handler_stack;
+ stack_t handler_stack;
internal_memset(&amp;handler_stack, 0, sizeof(handler_stack));
handler_stack.ss_sp = handler_stack_memory.data();
handler_stack.ss_size = kHandlerStackSize;
diff -u gcc-6.3.0/libsanitizer/tsan/tsan_platform_linux.cc.orig gcc-6.3.0/libsanitizer/tsan/tsan_platform_linux.cc
--- gcc-6.3.0/libsanitizer/tsan/tsan_platform_linux.cc.orig 2016-08-12 17:53:46.000000000 +0900
+++ gcc-6.3.0/libsanitizer/tsan/tsan_platform_linux.cc 2017-10-29 23:10:38.817245120 +0900
@@ -291,7 +291,7 @@
int ExtractResolvFDs(void *state, int *fds, int nfd) {
#if SANITIZER_LINUX
int cnt = 0;
- __res_state *statp = (__res_state*)state;
+ struct __res_state *statp = (struct __res_state*)state;
for (int i = 0; i &lt; MAXNS &amp;&amp; cnt &lt; nfd; i++) {
if (statp-&gt;_u._ext.nsaddrs[i] &amp;&amp; statp-&gt;_u._ext.nssocks[i] != -1)
fds[cnt++] = statp-&gt;_u._ext.nssocks[i];

View File

@ -1,27 +0,0 @@
#!/bin/sh
# 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

@ -1,44 +0,0 @@
--- ParaView-4.4.0/VTK/IO/Geometry/vtkSTLReader.cxx.orig 2015-09-11 19:59:24.000000000 +0200
+++ ParaView-4.4.0/VTK/IO/Geometry/vtkSTLReader.cxx 2016-06-19 12:59:50.769770143 +0200
@@ -448,7 +448,7 @@
done = done || (fscanf(fp,"%s", line)==EOF);
}
}
- if (!done)
+ else if (!done)
{
done = (fgets(line, 255, fp) == 0);
lineCount++;
--- ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake.orig 2016-03-28 17:07:10.000000000 +0200
+++ ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake 2016-06-11 15:10:14.820958942 +0200
@@ -32,7 +32,7 @@
OUTPUT_VARIABLE _gcc_version_info
ERROR_VARIABLE _gcc_version_info)
- string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]*"
+ string (REGEX MATCH "[3-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
@@ -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-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
@@ -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)
+if(PARAVIEW_INSTALL_DEVELOPMENT_FILES AND PARAVIEW_ENABLE_PYTHON)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h"
DESTINATION "${VTK_INSTALL_INCLUDE_DIR}")
endif()

View File

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

View File

@ -1,87 +0,0 @@
--- 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-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-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-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-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-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)
+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)

View File

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

View File

@ -1,65 +0,0 @@
--- 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)

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

@ -0,0 +1 @@
paraview-5.5.2

780
etc/patches/paraview-5.5.2 Normal file
View File

@ -0,0 +1,780 @@
--- ParaView-git/CMake/ParaViewMacros.cmake.orig 2018-07-22 17:38:33.933614131 +0200
+++ ParaView-git/CMake/ParaViewMacros.cmake 2018-07-22 17:42:12.457612519 +0200
@@ -353,8 +353,9 @@
set(qt_binary_dir_hints "${Qt5_DIR}/../../../bin")
endif()
+ # The qhelpgenerator program may be installed as qhelpgenerator-qt5
find_program(QT_HELP_GENERATOR
- qhelpgenerator
+ NAMES qhelpgenerator qhelpgenerator-qt5
HINTS "${qt_binary_dir_hints}"
DOC "qhelpgenerator used to compile Qt help project files")
mark_as_advanced(QT_HELP_GENERATOR)
--- ParaView-v5.5.2/VTK/ThirdParty/hdf5/vtkhdf5/src/H5detect.c.orig 2018-06-15 21:09:45.000000000 +0200
+++ ParaView-v5.5.2/VTK/ThirdParty/hdf5/vtkhdf5/src/H5detect.c 2018-07-07 13:20:40.641815285 +0200
@@ -1360,8 +1360,8 @@
*
*-------------------------------------------------------------------------
*/
-static void
-detect_C89_integers(void) HDF_NO_UBSAN
+static void HDF_NO_UBSAN
+detect_C89_integers(void)
{
DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++;
DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++;
@@ -1388,8 +1388,8 @@
*
*-------------------------------------------------------------------------
*/
-static void
-detect_C89_floats(void) HDF_NO_UBSAN
+static void HDF_NO_UBSAN
+detect_C89_floats(void)
{
DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++;
DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++;
@@ -1410,8 +1410,8 @@
*
*-------------------------------------------------------------------------
*/
-static void
-detect_C99_integers8(void) HDF_NO_UBSAN
+static void HDF_NO_UBSAN
+detect_C99_integers8(void)
{
#if H5_SIZEOF_INT8_T>0
#if H5_SIZEOF_INT8_T==1
@@ -1472,8 +1472,8 @@
*
*-------------------------------------------------------------------------
*/
-static void
-detect_C99_integers16(void) HDF_NO_UBSAN
+static void HDF_NO_UBSAN
+detect_C99_integers16(void)
{
#if H5_SIZEOF_INT16_T>0
DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++;
@@ -1510,8 +1510,8 @@
*
*-------------------------------------------------------------------------
*/
-static void
-detect_C99_integers32(void) HDF_NO_UBSAN
+static void HDF_NO_UBSAN
+detect_C99_integers32(void)
{
#if H5_SIZEOF_INT32_T>0
DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++;
@@ -1548,8 +1548,8 @@
*
*-------------------------------------------------------------------------
*/
-static void
-detect_C99_integers64(void) HDF_NO_UBSAN
+static void HDF_NO_UBSAN
+detect_C99_integers64(void)
{
#if H5_SIZEOF_INT64_T>0
DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++;
@@ -1599,8 +1599,8 @@
*
*-------------------------------------------------------------------------
*/
-static void
-detect_C99_integers(void) HDF_NO_UBSAN
+static void HDF_NO_UBSAN
+detect_C99_integers(void)
{
/* break it down to more subroutines so that each module subroutine */
/* is smaller and takes less time to compile with optimization on. */
@@ -1625,8 +1625,8 @@
*
*-------------------------------------------------------------------------
*/
-static void
-detect_C99_floats(void) HDF_NO_UBSAN
+static void HDF_NO_UBSAN
+detect_C99_floats(void)
{
#if H5_SIZEOF_DOUBLE == H5_SIZEOF_LONG_DOUBLE
/*
@@ -1656,8 +1656,8 @@
*
*-------------------------------------------------------------------------
*/
-static void
-detect_alignments(void) HDF_NO_UBSAN
+static void HDF_NO_UBSAN
+detect_alignments(void)
{
/* Detect structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */
DETECT_M(void *, POINTER, m_g[na_g]); na_g++;
@@ -1744,8 +1744,8 @@
*
*-------------------------------------------------------------------------
*/
-int
-main(void) HDF_NO_UBSAN
+int HDF_NO_UBSAN
+main(void)
{
#if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS)
--- ParaView-v5.5.0/VTK/ThirdParty/vtkm/vtk-m/CMake/VTKmDetermineVersion.cmake.orig 2018-04-06 22:03:33.000000000 +0200
+++ ParaView-v5.5.0/VTK/ThirdParty/vtkm/vtk-m/CMake/VTKmDetermineVersion.cmake 2018-04-23 12:00:23.708544206 +0200
@@ -51,6 +51,8 @@
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE)
+ else()
+ set(output)
endif()
else()
set(result 0)
@@ -75,7 +77,7 @@
# Extracts components from a version string. See determine_version() for usage.
function(extract_version_components version_string var_prefix)
- string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)"
+ string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)$"
version_matches "${version_string}")
if(CMAKE_MATCH_0)
set(full ${CMAKE_MATCH_0})
--- ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.cxx.orig 2018-04-06 22:03:33.000000000 +0200
+++ ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.cxx 2018-05-11 12:02:26.894772713 +0200
@@ -38,6 +38,7 @@
#include "vtkStringArray.h"
#include <list>
+#include <vtksys/SystemTools.hxx>
struct vtkCPProcessorInternals
{
@@ -47,12 +48,13 @@
};
vtkStandardNewMacro(vtkCPProcessor);
-vtkMultiProcessController* vtkCPProcessor::Controller = NULL;
+vtkMultiProcessController* vtkCPProcessor::Controller = nullptr;
//----------------------------------------------------------------------------
vtkCPProcessor::vtkCPProcessor()
{
this->Internal = new vtkCPProcessorInternals;
- this->InitializationHelper = NULL;
+ this->InitializationHelper = nullptr;
+ this->WorkingDirectory = nullptr;
}
//----------------------------------------------------------------------------
@@ -61,14 +63,15 @@
if (this->Internal)
{
delete this->Internal;
- this->Internal = NULL;
+ this->Internal = nullptr;
}
if (this->InitializationHelper)
{
this->InitializationHelper->Delete();
- this->InitializationHelper = NULL;
+ this->InitializationHelper = nullptr;
}
+ this->SetWorkingDirectory(nullptr);
}
//----------------------------------------------------------------------------
@@ -95,7 +98,7 @@
{
if (which < 0 || which >= this->GetNumberOfPipelines())
{
- return NULL;
+ return nullptr;
}
int counter = 0;
vtkCPProcessorInternals::PipelineListIterator iter = this->Internal->Pipelines.begin();
@@ -108,7 +111,7 @@
counter++;
iter++;
}
- return NULL;
+ return nullptr;
}
//----------------------------------------------------------------------------
@@ -130,17 +133,41 @@
}
//----------------------------------------------------------------------------
-int vtkCPProcessor::Initialize()
+int vtkCPProcessor::Initialize(const char* workingDirectory)
{
- if (this->InitializationHelper == NULL)
+ if (this->InitializationHelper == nullptr)
{
this->InitializationHelper = this->NewInitializationHelper();
}
+ // make sure the directory exists here so that we only do it once
+ if (workingDirectory)
+ {
+ vtkMultiProcessController* controller = vtkMultiProcessController::GetGlobalController();
+ int success = 1;
+ if (controller == nullptr || controller->GetLocalProcessId() == 0)
+ {
+ success = vtksys::SystemTools::MakeDirectory(workingDirectory) == true ? 1 : 0;
+ if (success == 0)
+ {
+ vtkWarningMacro("Could not make "
+ << workingDirectory << " directory. "
+ << "Results will be generated in current working directory instead.");
+ }
+ }
+ if (controller)
+ {
+ controller->Broadcast(&success, 1, 0);
+ }
+ if (success)
+ {
+ this->SetWorkingDirectory(workingDirectory);
+ }
+ }
return 1;
}
//----------------------------------------------------------------------------
-int vtkCPProcessor::Initialize(vtkMPICommunicatorOpaqueComm& comm)
+int vtkCPProcessor::Initialize(vtkMPICommunicatorOpaqueComm& comm, const char* workingDirectory)
{
#ifdef PARAVIEW_USE_MPI
if (vtkCPProcessor::Controller)
@@ -148,7 +175,7 @@
vtkErrorMacro("Can only initialize with a communicator once per process.");
return 0;
}
- if (this->InitializationHelper == NULL)
+ if (this->InitializationHelper == nullptr)
{
vtkMPICommunicator* communicator = vtkMPICommunicator::New();
communicator->InitializeExternal(&comm);
@@ -157,12 +184,12 @@
this->Controller = controller;
this->Controller->SetGlobalController(controller);
communicator->Delete();
- return this->Initialize();
+ return this->Initialize(workingDirectory);
}
return 1;
#else
static_cast<void>(&comm); // get rid of variable not used warning
- return this->Initialize();
+ return this->Initialize(workingDirectory);
#endif
}
@@ -225,6 +252,13 @@
input->GetFieldData()->AddArray(catalystChannel);
}
}
+
+ std::string originalWorkingDirectory;
+ if (this->WorkingDirectory)
+ {
+ originalWorkingDirectory = vtksys::SystemTools::GetCurrentWorkingDirectory();
+ vtksys::SystemTools::ChangeDirectory(this->WorkingDirectory);
+ }
for (vtkCPProcessorInternals::PipelineListIterator iter = this->Internal->Pipelines.begin();
iter != this->Internal->Pipelines.end(); iter++)
{
@@ -248,6 +282,10 @@
}
}
}
+ if (originalWorkingDirectory.empty() == false)
+ {
+ vtksys::SystemTools::ChangeDirectory(originalWorkingDirectory);
+ }
// we want to reset everything here to make sure that new information
// is properly passed in the next time.
dataDescription->ResetAll();
@@ -259,7 +297,7 @@
{
if (this->Controller)
{
- this->Controller->SetGlobalController(NULL);
+ this->Controller->SetGlobalController(nullptr);
this->Controller->Finalize(1);
this->Controller->Delete();
}
--- ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.h.orig 2018-04-06 22:03:33.000000000 +0200
+++ ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.h 2018-05-11 12:02:26.894772713 +0200
@@ -76,14 +76,16 @@
virtual void RemoveAllPipelines();
/// Initialize the co-processor. Returns 1 if successful and 0
- /// otherwise.
/// otherwise. If Catalyst is built with MPI then Initialize()
/// can also be called with a specific MPI communicator if
/// MPI_COMM_WORLD isn't the proper one. Catalyst is initialized
- /// to use MPI_COMM_WORLD by default.
- virtual int Initialize();
+ /// to use MPI_COMM_WORLD by default. Both methods have an optional
+ /// workingDirectory argument which will set *WorkingDirectory* so
+ /// that files will be put relative to this directory.
+ virtual int Initialize(const char* workingDirectory = nullptr);
#ifndef __WRAP__
- virtual int Initialize(vtkMPICommunicatorOpaqueComm& comm);
+ virtual int Initialize(
+ vtkMPICommunicatorOpaqueComm& comm, const char* workingDirectory = nullptr);
#endif
/// The Catalyst input field data string array name. This array will
@@ -111,6 +113,13 @@
/// implementation an opportunity to clean up, before it is destroyed.
virtual int Finalize();
+ /// Get the current working directory for outputting Catalyst files.
+ /// If not set then Catalyst output files will be relative to the
+ /// current working directory. This will not affect where Catalyst
+ /// looks for Python scripts. *WorkingDirectory* gets set through
+ /// the *Initialize()* methods.
+ vtkGetStringMacro(WorkingDirectory);
+
protected:
vtkCPProcessor();
virtual ~vtkCPProcessor();
@@ -118,6 +127,11 @@
/// Create a new instance of the InitializationHelper.
virtual vtkObject* NewInitializationHelper();
+ /// Set the current working directory for outputting Catalyst files.
+ /// This is a protected method since simulation code adaptors should
+ /// set this through the *Initialize()* methods.
+ vtkSetStringMacro(WorkingDirectory);
+
private:
vtkCPProcessor(const vtkCPProcessor&) = delete;
void operator=(const vtkCPProcessor&) = delete;
@@ -125,6 +139,7 @@
vtkCPProcessorInternals* Internal;
vtkObject* InitializationHelper;
static vtkMultiProcessController* Controller;
+ char* WorkingDirectory;
};
#endif
--- ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPXMLPWriterPipeline.cxx.orig 2018-04-06 22:03:33.000000000 +0200
+++ ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPXMLPWriterPipeline.cxx 2018-05-11 12:02:26.894772713 +0200
@@ -31,6 +31,7 @@
#include <vtkSmartPointer.h>
#include <vtkUnstructuredGrid.h>
+#include <algorithm>
#include <sstream>
#include <string>
@@ -174,7 +175,7 @@
for (unsigned int i = 0; i < dataDescription->GetNumberOfInputDescriptions(); i++)
{
- const char* inputName = dataDescription->GetInputDescriptionName(i);
+ std::string inputName = dataDescription->GetInputDescriptionName(i);
vtkCPInputDataDescription* idd = dataDescription->GetInputDescription(i);
vtkDataObject* grid = idd->GetGrid();
if (grid == nullptr)
@@ -206,6 +207,8 @@
vtkSMStringVectorProperty* fileName =
vtkSMStringVectorProperty::SafeDownCast(writer->GetProperty("FileName"));
+ // If we have a / in the channel name we take it out of the filename we're going to write to
+ inputName.erase(std::remove(inputName.begin(), inputName.end(), '/'), inputName.end());
std::ostringstream o;
if (this->Path.empty() == false)
{
--- ParaView-v5.5.0/Wrapping/Python/paraview/coprocessing.py.orig 2018-04-06 22:03:33.000000000 +0200
+++ ParaView-v5.5.0/Wrapping/Python/paraview/coprocessing.py 2018-05-11 12:02:27.038772408 +0200
@@ -11,22 +11,12 @@
from paraview.vtk.vtkPVVTKExtensionsCore import *
import math
-# -----------------------------------------------------------------------------
-def IsInModulo(timestep, frequencyArray):
- """
- Return True if the given timestep is in one of the provided frequency.
- This can be interpreted as follow::
-
- isFM = IsInModulo(timestep, [2,3,7])
-
- is similar to::
+# If the user created a filename in a location that doesn't exist by default we'll
+# make the directory for them. This can be changed though by setting createDirectoriesIfNeeded
+# to False.
+createDirectoriesIfNeeded = True
- isFM = (timestep % 2 == 0) or (timestep % 3 == 0) or (timestep % 7 == 0)
- """
- for frequency in frequencyArray:
- if frequency > 0 and (timestep % frequency == 0):
- return True
- return False
+# -----------------------------------------------------------------------------
class CoProcessor(object):
"""Base class for co-processing Pipelines.
@@ -68,6 +58,9 @@
self.__CinemaTracks = {}
self.__InitialFrequencies = {}
self.__PrintEnsightFormatString = False
+ self.__TimeStepToStartOutputAt=0
+ self.__ForceOutputAtFirstCall=False
+ self.__FirstTimeStepIndex = None
def SetPrintEnsightFormatString(self, enable):
"""If outputting ExodusII files with the purpose of reading them into
@@ -87,6 +80,17 @@
"Incorrect argument type: %s, must be a dict" % type(frequencies))
self.__InitialFrequencies = frequencies
+ def SetInitialOutputOptions(self, timeStepToStartOutputAt, forceOutputAtFirstCall):
+ """Set the frequencies at which the pipeline needs to be updated.
+ Typically, this is called by the subclass once it has determined what
+ timesteps co-processing will be needed to be done.
+ frequencies is a map, with key->string name of for the simulation
+ input, and value is a list of frequencies.
+ """
+
+ self.__TimeStepToStartOutputAt=timeStepToStartOutputAt
+ self.__ForceOutputAtFirstCall=forceOutputAtFirstCall
+
def EnableLiveVisualization(self, enable, frequency = 1):
"""Call this method to enable live-visualization. When enabled,
DoLiveVisualization() will communicate with ParaView server if possible
@@ -115,7 +119,7 @@
# if this is a time step to do live then all of the inputs
# must be made available. note that we want the pipeline built
# before we do the actual first live connection.
- if self.__EnableLiveVisualization and timestep % self.__LiveVisualizationFrequency == 0 \
+ if self.__EnableLiveVisualization and self.NeedToOutput(timestep, self.__LiveVisualizationFrequency) \
and self.__LiveVisualizationLink:
if self.__LiveVisualizationLink.Initialize(servermanager.ActiveConnection.Session.GetSessionProxyManager()):
num_inputs = datadescription.GetNumberOfInputDescriptions()
@@ -132,13 +136,13 @@
# hasn't been set up yet). If we don't have live enabled
# we know that the output frequencies aren't changed and can
# just use the initial frequencies.
- if self.__InitialFrequencies or not self.__EnableLiveVisualization:
+ if self.__ForceOutputAtFirstCall or self.__InitialFrequencies or not self.__EnableLiveVisualization:
num_inputs = datadescription.GetNumberOfInputDescriptions()
for cc in range(num_inputs):
input_name = datadescription.GetInputDescriptionName(cc)
freqs = self.__InitialFrequencies.get(input_name, [])
- if self.__EnableLiveVisualization or ( self and IsInModulo(timestep, freqs) ):
+ if self.__EnableLiveVisualization or ( self and self.IsInModulo(timestep, freqs) ):
datadescription.GetInputDescription(cc).AllFieldsOn()
datadescription.GetInputDescription(cc).GenerateMeshOn()
else:
@@ -149,15 +153,14 @@
for writer in self.__WritersList:
frequency = writer.parameters.GetProperty(
"WriteFrequency").GetElement(0)
- if (timestep % frequency) == 0 or \
- datadescription.GetForceOutput() == True:
+ if self.NeedToOutput(timestep, frequency) or datadescription.GetForceOutput() == True:
writerinputs = cpstate.locate_simulation_inputs(writer)
for writerinput in writerinputs:
datadescription.GetInputDescriptionByName(writerinput).AllFieldsOn()
datadescription.GetInputDescriptionByName(writerinput).GenerateMeshOn()
for view in self.__ViewsList:
- if (view.cpFrequency and timestep % view.cpFrequency == 0) or \
+ if (view.cpFrequency and self.NeedToOutput(timestep, view.cpFrequency)) or \
datadescription.GetForceOutput() == True:
viewinputs = cpstate.locate_simulation_inputs_for_view(view)
for viewinput in viewinputs:
@@ -192,8 +195,7 @@
for writer in self.__WritersList:
frequency = writer.parameters.GetProperty(
"WriteFrequency").GetElement(0)
- if (timestep % frequency) == 0 or \
- datadescription.GetForceOutput() == True:
+ if self.NeedToOutput(timestep, frequency) or datadescription.GetForceOutput() == True:
fileName = writer.parameters.GetProperty("FileName").GetElement(0)
paddingamount = writer.parameters.GetProperty("PaddingAmount").GetElement(0)
helperName = writer.GetXMLName()
@@ -203,6 +205,23 @@
else:
ts = str(timestep).rjust(paddingamount, '0')
writer.FileName = fileName.replace("%t", ts)
+ if '/' in writer.FileName and createDirectoriesIfNeeded:
+ oktowrite = [1.]
+ import vtk
+ comm = vtk.vtkMultiProcessController.GetGlobalController()
+ if comm.GetLocalProcessId() == 0:
+ import os
+ newDir = writer.FileName[0:writer.FileName.rfind('/')]
+ try:
+ os.makedirs(newDir)
+ except OSError:
+ if not os.path.isdir(newDir):
+ print ("ERROR: Cannot make directory for", writer.FileName, ". No data will be written.")
+ oktowrite[0] = 0.
+ comm.Broadcast(oktowrite, 1, 0)
+ if oktowrite[0] == 0:
+ # we can't make the directory so no reason to update the pipeline
+ return
writer.UpdatePipeline(datadescription.GetTime())
def WriteImages(self, datadescription, rescale_lookuptable=False,
@@ -240,7 +259,7 @@
cinema_dirs = []
for view in self.__ViewsList:
- if (view.cpFrequency and timestep % view.cpFrequency == 0) or \
+ if (view.cpFrequency and self.NeedToOutput(timestep, view.cpFrequency)) or \
datadescription.GetForceOutput() == True:
fname = view.cpFileName
ts = str(timestep).rjust(padding_amount, '0')
@@ -267,6 +286,24 @@
if dirname:
cinema_dirs.append(dirname)
else:
+ if '/' in fname and createDirectoriesIfNeeded:
+ oktowrite = [1.]
+ import vtk
+ comm = vtk.vtkMultiProcessController.GetGlobalController()
+ if comm.GetLocalProcessId() == 0:
+ import os
+ newDir = fname[0:fname.rfind('/')]
+ try:
+ os.makedirs(newDir)
+ except OSError:
+ if not os.path.isdir(newDir):
+ print ("ERROR: Cannot make directory for", fname, ". No image will be output.")
+ oktowrite[0] = 0.
+ comm.Broadcast(oktowrite, 1, 0)
+ if oktowrite[0] == 0:
+ # we can't make the directory so no reason to update the pipeline
+ return
+
if image_quality is None and fname.endswith('png'):
# for png quality = 0 means no compression. compression can be a potentially
# very costly serial operation on process 0
@@ -307,7 +344,7 @@
timeStep = datadescription.GetTimeStep()
- if self.__EnableLiveVisualization and timeStep % self.__LiveVisualizationFrequency == 0:
+ if self.__EnableLiveVisualization and self.NeedToOutput(timeStep, self.__LiveVisualizationFrequency):
if not self.__LiveVisualizationLink.Initialize(servermanager.ActiveConnection.Session.GetSessionProxyManager()):
return
@@ -412,7 +449,7 @@
"""
controller = servermanager.ParaViewPipelineController()
# assume that a client only proxy with the same name as a writer
- # is available in "insitu_writer_paramters"
+ # is available in "insitu_writer_parameters"
# Since coprocessor sometimes pass writer as a custom object and not
# a proxy, we need to handle that. Just creating any arbitrary writer
@@ -666,3 +703,42 @@
#restore what we showed
pv_introspect.restore_visibility(pxystate)
return os.path.basename(vfname)
+
+ def IsInModulo(self, timestep, frequencies):
+ """
+ Return True if the given timestep is in one of the provided frequency.
+ This can be interpreted as follow::
+
+ isFM = IsInModulo(timestep-timeStepToStartOutputAt, [2,3,7])
+
+ is similar to::
+
+ isFM = (timestep-timeStepToStartOutputAt % 2 == 0) or (timestep-timeStepToStartOutputAt % 3 == 0) or (timestep-timeStepToStartOutputAt % 7 == 0)
+
+ The timeStepToStartOutputAt is the first timestep that will potentially be output.
+ """
+ if timestep < self.__TimeStepToStartOutputAt and not self.__ForceOutputAtFirstCall:
+ return False
+ for frequency in frequencies:
+ if frequency > 0 and self.NeedToOutput(timestep, frequency):
+ return True
+
+ return False
+
+
+ def NeedToOutput(self, timestep, frequency):
+ """
+ Return True if we need to output based on the input timestep and frequency. Checks based
+ __FirstTimeStepIndex, __FirstTimeStepIndex, __ForceOutputAtFirstCall and __TimeStepToStartOutputAt
+ member variables.
+ """
+ if self.__FirstTimeStepIndex == None:
+ self.__FirstTimeStepIndex = timestep
+
+ if self.__ForceOutputAtFirstCall and self.__FirstTimeStepIndex == timestep:
+ return True
+
+ if self.__TimeStepToStartOutputAt <= timestep and (timestep-self.__TimeStepToStartOutputAt) % frequency == 0:
+ return True
+
+ return False
--- ParaView-v5.5.1/ParaViewCore/ServerManager/SMApplication/Resources/readers.xml.orig 2018-06-01 21:23:15.000000000 +0200
+++ ParaView-v5.5.1/ParaViewCore/ServerManager/SMApplication/Resources/readers.xml 2018-06-19 20:50:55.128914062 +0200
@@ -3769,7 +3769,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="vtm vtmb"
+ <ReaderFactory extensions="vtm vtm.series vtmb vtmb.series"
file_description="VTK MultiBlock Data Files" />
</Hints>
<!-- end of XMLMultiBlockDataReader -->
@@ -3824,7 +3824,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="vthb vth"
+ <ReaderFactory extensions="vthb vthb.series vth vth.series"
file_description="VTK Hierarchical Box Data Files" />
</Hints>
<!-- end of XMLUniformGridAMRReader -->
@@ -3933,7 +3933,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="vtp"
+ <ReaderFactory extensions="vtp vtp.series"
file_description="VTK PolyData Files" />
</Hints>
</SourceProxy>
@@ -3990,7 +3990,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="vtt"
+ <ReaderFactory extensions="vtt vtt.series"
file_description="VTK Table Files" />
</Hints>
</SourceProxy>
@@ -4050,7 +4050,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="vtu"
+ <ReaderFactory extensions="vtu vtu.series"
file_description="VTK UnstructuredGrid Files" />
</Hints>
</SourceProxy>
@@ -4108,7 +4108,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="vti"
+ <ReaderFactory extensions="vti vti.series"
file_description="VTK ImageData Files" />
</Hints>
</SourceProxy>
@@ -4166,7 +4166,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="vts"
+ <ReaderFactory extensions="vts vts.series"
file_description="VTK StructuredGrid Files" />
</Hints>
</SourceProxy>
@@ -4224,7 +4224,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="vtr"
+ <ReaderFactory extensions="vtr vtr.series"
file_description="VTK RectilinearGrid Files" />
</Hints>
</SourceProxy>
@@ -4284,7 +4284,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="pvtp"
+ <ReaderFactory extensions="pvtp pvtp.series"
file_description="VTK PolyData Files (partitioned)" />
</Hints>
</SourceProxy>
@@ -4346,7 +4346,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="pvtu"
+ <ReaderFactory extensions="pvtu pvtu.series"
file_description="VTK UnstructuredGrid Files (partitioned)" />
</Hints>
</SourceProxy>
@@ -4406,7 +4406,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="pvtt"
+ <ReaderFactory extensions="pvtt pvtt.series"
file_description="VTK Table (partitioned)" />
</Hints>
</SourceProxy>
@@ -4467,7 +4467,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="pvti"
+ <ReaderFactory extensions="pvti pvti.series"
file_description="VTK ImageData Files (partitioned)" />
</Hints>
</SourceProxy>
@@ -4529,7 +4529,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="pvts"
+ <ReaderFactory extensions="pvts pvts.series"
file_description="VTK StructuredGrid Files (partitioned)" />
</Hints>
</SourceProxy>
@@ -4591,7 +4591,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="pvtr"
+ <ReaderFactory extensions="pvtr pvtr.series"
file_description="VTK RectilinearGrid Files (partitioned)" />
</Hints>
</SourceProxy>
@@ -4702,7 +4702,7 @@
Partitioned Legacy VTK reader.</Documentation>
</StringVectorProperty>
<Hints>
- <ReaderFactory extensions="pvtk"
+ <ReaderFactory extensions="pvtk pvtk.series"
file_description="Legacy VTK Files (partitioned)" />
</Hints>
<!-- End pvtkfile -->
@@ -5102,7 +5102,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="ply"
+ <ReaderFactory extensions="ply ply.series"
file_description="PLY Polygonal File Format" />
</Hints>
</SourceProxy>
@@ -5230,7 +5230,7 @@
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
- <ReaderFactory extensions="stl"
+ <ReaderFactory extensions="stl stl.series"
file_description="Stereo Lithography" />
</Hints>
<!-- End stlreader-->

48
etc/patches/scotch_6.0.6 Normal file
View File

@ -0,0 +1,48 @@
--- scotch_6.0.6/src/libscotch/Makefile.orig 2019-04-29 14:59:53.957103493 +0200
+++ scotch_6.0.6/src/libscotch/Makefile 2019-04-29 18:50:42.560080675 +0200
@@ -51,6 +51,12 @@
.PHONY : ptscotch scotch ptinstall install clean realclean
+ifeq ($(WM_OSTYPE),MSwindows)
+
+libscotch : libscotch$(LIB) scotch.h
+
+endif
+
scotch :
$(MAKE) CC="$(CCS)" CCD="$(CCS)" \
scotch.h \
@@ -438,6 +444,11 @@
wgraph_part_zr$(OBJ) \
wgraph_store$(OBJ)
+ifeq ($(WM_OSTYPE),MSwindows)
+## Add into libscotch instead of having a separate library
+LIBSCOTCHDEPS += library_error_exit$(OBJ)
+endif
+
##
## Todo list.
##
--- scotch_6.0.6/src/Makefile.orig 2018-07-14 17:24:49.000000000 +0200
+++ scotch_6.0.6/src/Makefile 2019-04-29 18:39:16.365132864 +0200
@@ -89,9 +89,18 @@
$(mandir)/man1 : $(mandir)
-$(MKDIR) $(mandir)/man1
+ifeq ($(WM_OSTYPE),MSwindows)
+
+libscotch : required
+ (cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) libscotch && $(MAKE) install)
+
+else
+
libscotch : required
(cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
+endif
+
scotch : libscotch
(cd scotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
(cd libscotchmetis ; $(MAKE) scotch && $(MAKE) install)

48
etc/patches/scotch_6.0.7 Normal file
View File

@ -0,0 +1,48 @@
--- scotch_6.0.6/src/libscotch/Makefile.orig 2019-04-29 14:59:53.957103493 +0200
+++ scotch_6.0.6/src/libscotch/Makefile 2019-04-29 18:50:42.560080675 +0200
@@ -51,6 +51,12 @@
.PHONY : ptscotch scotch ptinstall install clean realclean
+ifeq ($(WM_OSTYPE),MSwindows)
+
+libscotch : libscotch$(LIB) scotch.h
+
+endif
+
scotch :
$(MAKE) CC="$(CCS)" CCD="$(CCS)" \
scotch.h \
@@ -438,6 +444,11 @@
wgraph_part_zr$(OBJ) \
wgraph_store$(OBJ)
+ifeq ($(WM_OSTYPE),MSwindows)
+## Add into libscotch instead of having a separate library
+LIBSCOTCHDEPS += library_error_exit$(OBJ)
+endif
+
##
## Todo list.
##
--- scotch_6.0.6/src/Makefile.orig 2018-07-14 17:24:49.000000000 +0200
+++ scotch_6.0.6/src/Makefile 2019-04-29 18:39:16.365132864 +0200
@@ -89,9 +89,18 @@
$(mandir)/man1 : $(mandir)
-$(MKDIR) $(mandir)/man1
+ifeq ($(WM_OSTYPE),MSwindows)
+
+libscotch : required
+ (cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) libscotch && $(MAKE) install)
+
+else
+
libscotch : required
(cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
+endif
+
scotch : libscotch
(cd scotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
(cd libscotchmetis ; $(MAKE) scotch && $(MAKE) install)

48
etc/patches/scotch_6.0.8 Normal file
View File

@ -0,0 +1,48 @@
--- scotch_6.0.6/src/libscotch/Makefile.orig 2019-04-29 14:59:53.957103493 +0200
+++ scotch_6.0.6/src/libscotch/Makefile 2019-04-29 18:50:42.560080675 +0200
@@ -51,6 +51,12 @@
.PHONY : ptscotch scotch ptinstall install clean realclean
+ifeq ($(WM_OSTYPE),MSwindows)
+
+libscotch : libscotch$(LIB) scotch.h
+
+endif
+
scotch :
$(MAKE) CC="$(CCS)" CCD="$(CCS)" \
scotch.h \
@@ -438,6 +444,11 @@
wgraph_part_zr$(OBJ) \
wgraph_store$(OBJ)
+ifeq ($(WM_OSTYPE),MSwindows)
+## Add into libscotch instead of having a separate library
+LIBSCOTCHDEPS += library_error_exit$(OBJ)
+endif
+
##
## Todo list.
##
--- scotch_6.0.6/src/Makefile.orig 2018-07-14 17:24:49.000000000 +0200
+++ scotch_6.0.6/src/Makefile 2019-04-29 18:39:16.365132864 +0200
@@ -89,9 +89,18 @@
$(mandir)/man1 : $(mandir)
-$(MKDIR) $(mandir)/man1
+ifeq ($(WM_OSTYPE),MSwindows)
+
+libscotch : required
+ (cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) libscotch && $(MAKE) install)
+
+else
+
libscotch : required
(cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
+endif
+
scotch : libscotch
(cd scotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
(cd libscotchmetis ; $(MAKE) scotch && $(MAKE) install)

48
etc/patches/scotch_6.0.9 Normal file
View File

@ -0,0 +1,48 @@
--- scotch_6.0.6/src/libscotch/Makefile.orig 2019-04-29 14:59:53.957103493 +0200
+++ scotch_6.0.6/src/libscotch/Makefile 2019-04-29 18:50:42.560080675 +0200
@@ -51,6 +51,12 @@
.PHONY : ptscotch scotch ptinstall install clean realclean
+ifeq ($(WM_OSTYPE),MSwindows)
+
+libscotch : libscotch$(LIB) scotch.h
+
+endif
+
scotch :
$(MAKE) CC="$(CCS)" CCD="$(CCS)" \
scotch.h \
@@ -438,6 +444,11 @@
wgraph_part_zr$(OBJ) \
wgraph_store$(OBJ)
+ifeq ($(WM_OSTYPE),MSwindows)
+## Add into libscotch instead of having a separate library
+LIBSCOTCHDEPS += library_error_exit$(OBJ)
+endif
+
##
## Todo list.
##
--- scotch_6.0.6/src/Makefile.orig 2018-07-14 17:24:49.000000000 +0200
+++ scotch_6.0.6/src/Makefile 2019-04-29 18:39:16.365132864 +0200
@@ -89,9 +89,18 @@
$(mandir)/man1 : $(mandir)
-$(MKDIR) $(mandir)/man1
+ifeq ($(WM_OSTYPE),MSwindows)
+
+libscotch : required
+ (cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) libscotch && $(MAKE) install)
+
+else
+
libscotch : required
(cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
+endif
+
scotch : libscotch
(cd scotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
(cd libscotchmetis ; $(MAKE) scotch && $(MAKE) install)

77
etc/pkgconfigAdjust Executable file
View File

@ -0,0 +1,77 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2017-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# etc/pkgconfigAdjust
#
# Description
# Adjust pkgconfig information to use '${prefix} where possible instead of
# directory paths. This makes it easier when relocating software.
# Adjusts includedir=, libdir=, -I/... and -L/... entries.
#
# The specified directory can be any of the following:
# - base-dir
# - base-dir/bin
# - base-dir/lib
# - base-dir/lib64
# - base-dir/lib/pkgconfig
# - base-dir/lib64/pkgconfig
#
# This allows this type of shell command
#
# etc/pkgconfigAdjust $(find platforms -type d -name pkgconfig)
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : current directory is not \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [directory1 [... directoryN]]
options:
-help
Adjust pkgconfig files after relocating third-party files.
Locates pkgconfig files under the lib/ or lib64/ directories and adjusts them
to use '${prefix}' instead of absolute directory paths where possible.
USAGE
exit 1
}
#------------------------------------------------------------------------------
# Process options/arguments
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
-h | -help*) usage ;;
*)
pkgconfigAdjust "$1"
;;
esac
shift
done
#------------------------------------------------------------------------------

74
etc/pkgconfigPrefix Executable file
View File

@ -0,0 +1,74 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2017-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# etc/pkgconfigPrefix
#
# Description
# Set the prefix= entry for pkgconfig files to account for a new location.
#
# The specified directory can be any of the following:
# - base-dir
# - base-dir/bin
# - base-dir/lib
# - base-dir/lib64
# - base-dir/lib/pkgconfig
# - base-dir/lib64/pkgconfig
#
# This allows this type of shell command
#
# etc/pkgconfigPrefix $(find platforms -name pkgconfig -type d)
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : current directory is not \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [directory1 [... directoryN]]
options:
-help
Set the 'prefix=' entry for pkgconfig files.
The pkgconfig files are located under lib/pkgconfig or lib64/pkgconfig.
USAGE
exit 1
}
#------------------------------------------------------------------------------
# Process options/arguments
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
-h | -help*) usage ;;
*)
pkgconfigNewPrefix "$1"
;;
esac
shift
done
#------------------------------------------------------------------------------

View File

@ -3,24 +3,14 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# etc/relocateQt
@ -28,27 +18,24 @@
# Description
# Change prefix when relocating QT installation
#
#------------------------------------------------------------------------------
qtVERSION=4.8.7
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# 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."
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : current directory is not \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
. etc/tools/QtFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [VERSION]
usage: ${0##*/} [OPTION] [qt-VERSION]
options:
-force Create qt.conf and edit pkgconfig to use \${prefix}
-help
@ -62,19 +49,19 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
unset optForce
unset forceOpt
# parse options
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help*) usage ;;
-f | -force)
forceOpt=true
optForce=true
;;
-qt-[1-9]* | [1-9]* | qt-*)
-qt-[0-9]* | [0-9]* | qt-*)
# -qt-VERSION, VERSION, qt-VERSION, qt-everywhere-opensource-src-VERSION
qtVERSION="${1%%/}";
qtVERSION="${qtVERSION##*-}"
@ -89,11 +76,14 @@ done
#------------------------------------------------------------------------------
QT_ARCH_PATH=$installBASE/qt-$qtVERSION
if [ "${forceOpt:-false}" = true ]
[ -n "$qtVERSION" ] || die "No QT version specified"
[ -d "$QT_ARCH_PATH" ] || die "No QT installation"
if [ "${optForce:-false}" = true ]
then
# Create qt.conf and adjust locations to use '${prefix}' internally
finalizeQt
fi
changePrefix
pkgconfigNewPrefix "$QT_ARCH_PATH"
# ----------------------------------------------------------------- end-of-file
# -----------------------------------------------------------------------------

46
etc/testThirdPartyFunctions Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2019 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# testThirdPartyFunctions
#
# Description
# Simple ad hoc tests of etc/tools/ThirdPartyFunctions
#
#------------------------------------------------------------------------------
echo ========================================
echo "Calling environment"
echo "CC=$CC"
echo "CXX=$CXX"
echo
echo ========================================
. "$WM_THIRD_PARTY_DIR/etc/tools/ThirdPartyFunctions"
#------------------------------------------------------------------------------
echo "CC=$(whichCC)"
echo "CXX=$(whichCXX)"
echo "mpicc=$(whichMpicc)"
echo "mpicxx=$(whichMpicxx)"
exportCompiler
echo ========================================
echo "using: $CC $CFLAGS"
echo "using: $CXX $CXXFLAGS"
echo
echo ========================================
#------------------------------------------------------------------------------

View File

@ -2,24 +2,14 @@
# ========= |
# \\ / 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 | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# File
# etc/tools/ParaViewFunctions
@ -27,16 +17,40 @@
# Description
# ParaView make/install helper functions
#
# Note
# Obtaining paths via 'python-config' may not always resolve properly:
#
# python-config --includes
# >>
# -I/usr/include/python2.7 -I/usr/include/python2.7
#
# python-config --libs
# >>
# -lpython2.7 -lpthread -ldl -lutil -lm
#
#------------------------------------------------------------------------------
# sourceBASE, buildBASE, installBASE defined in tools/ThirdPartyFunctions
# Variables referenced by the functions. Initialization at the end of the file.
unset CMAKE_VARIABLES
unset withVERBOSE
unset withMPI MPI_MAX_PROCS
unset withQT QT_VERSION QMAKE_PATH
unset withMESA MESA_INCLUDE MESA_LIBRARY withOSMESA
unset withPYTHON PYTHON_INCLUDE PYTHON_LIBRARY
unset withPYTHON3
unset withGL2
BUILD_TYPE=Release # The cmake build type
# sourceBASE, buildBASE, installBASE and BUILD_SUFFIX
# are defined in 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_BUILD_DIR : location of the build
# ParaView_DIR : location of the installed program
#
setParaViewDirs()
@ -61,21 +75,17 @@ setParaViewDirs()
exit 1
}
# ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION${OBJ_ADD:+-$OBJ_ADD}
ParaView_BINARY_DIR=$buildBASE/ParaView-$ParaView_VERSION
ParaView_BUILD_DIR=$buildBASE/ParaView-$ParaView_VERSION$BUILD_SUFFIX
ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION$BUILD_SUFFIX
# 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
export ParaView_SOURCE_DIR ParaView_BUILD_DIR ParaView_DIR
echo
echo "ParaView_SOURCE_DIR=$ParaView_SOURCE_DIR"
echo "ParaView_BINARY_DIR=$ParaView_BINARY_DIR"
echo "ParaView_BUILD_DIR=$ParaView_BUILD_DIR"
echo "ParaView_DIR=$ParaView_DIR"
# Forcefully override the .git path for the ParaView source code directory
export GIT_DIR=$ParaView_SOURCE_DIR/.git
export GIT_DIR="$ParaView_SOURCE_DIR/.git" # Mask seeing our own git-repo
}
@ -103,35 +113,15 @@ setParaViewVersion()
#------------------------------------------------------------------------------
#
# Compare version information (specified vs what is found in CMakeLists.txt)
# Parse this type of content:
# set (PARAVIEW_VERSION_FULL "5.0.1")
#
checkVersion()
{
local ver=$(
sed -ne 's/^ *set *( *PARAVIEW_VERSION_FULL[ "]*\([.0-9]*\).*$/\1/ip' \
$ParaView_SOURCE_DIR/CMakeLists.txt
)
if [ "$ParaView_VERSION" != "$ver" ]
then
echo "(${ver:-none}) mismatch?"
else
echo "(${ver:-none})"
fi
}
#
# Set CMake cache variables
#
addCMakeVariable()
{
while [ -n "$1" ]
local i
for i
do
CMAKE_VARIABLES="$CMAKE_VARIABLES -D$1"
shift
[ -n "$i" ] && CMAKE_VARIABLES="$CMAKE_VARIABLES -D$i"
done
}
@ -143,13 +133,13 @@ addVerbosity()
{
if [ "${withVERBOSE:=false}" = true ]
then
addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE"
addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE"
fi
}
#
# Define options for mpi support
# MPI support for PARAVIEW
#
addMpiSupport()
{
@ -158,12 +148,10 @@ addMpiSupport()
return
fi
OBJ_ADD="$OBJ_ADD-mpi"
addCMakeVariable "PARAVIEW_USE_MPI=ON VTK_USE_MPI=ON"
addCMakeVariable "PARAVIEW_USE_MPI=ON"
if [ "${MPI_MAX_PROCS:=0}" -gt 1 ]
then
addCMakeVariable "VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
addCMakeVariable "VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
fi
}
@ -173,70 +161,99 @@ addMpiSupport()
#
addPythonSupport()
{
if [ "${withPYTHON:=false}" != true ]
if [ "${withPYTHON:-false}" != true ]
then
return
fi
OBJ_ADD="$OBJ_ADD-py"
local pythonBin="python"
local pythonConfig="python-config"
local pythonMajor
if pythonBin=$(which python 2>/dev/null)
if [ "$withPYTHON3" = true ]
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')
pythonBin="python3"
pythonConfig="python3-config"
fi
[ -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" -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"
exit 1
}
addCMakeVariable "PARAVIEW_ENABLE_PYTHON=ON"
addCMakeVariable "PYTHON_INCLUDE_DIRS=$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
pythonBin=$(which "$pythonBin" 2>/dev/null) || {
echo "*** Error: python not found"
echo "*** Deactivate python support by not using the -python "
echo "*** option"
exit 1
}
if [ -n "$PYTHON_LIBRARY" ]
then
# PYTHON_LIBRARY set:
[ -e "$PYTHON_LIBRARY" ] || \
echo "*** Error: libpython not found at location specified " \
"by -python-lib : PYTHON_LIBRARY=$PYTHON_LIBRARY"
else
# Fallback: 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
}
# Guess major from library
pythonMajor=$(echo "$PYTHON_LIBRARY" | sed 's/.*libpython\(.*\)\.so.*/\1/')
if [ -n "$PYTHON_INCLUDE" ]
then
# PYTHON_INCLUDE set:
[ -d "$PYTHON_INCLUDE" -a -f "$PYTHON_INCLUDE/Python.h" ] || \
echo "*** Error: Python.h not found at location specified " \
"by -python-include : PYTHON_INCLUDE=$PYTHON_INCLUDE"
elif pythonConfig=$(which "$pythonConfig" 2>/dev/null)
then
# Guess from python-config
# parse '-I/usr/include/python2.7 -I/usr/include/python2.7'
# -> '/usr/include/python2.7'
PYTHON_INCLUDE=$("$pythonConfig" --includes | sed -ne 's/^-I\([^ ][^ ]*\).*$/\1/p')
else
# Fallback to system headers
PYTHON_INCLUDE=/usr/include/python$pythonMajor
fi
[ -d "$PYTHON_INCLUDE" -a -f "$PYTHON_INCLUDE/Python.h" ] || {
echo " No python headers found in $PYTHON_INCLUDE/"
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_DIRS=$PYTHON_INCLUDE"
addCMakeVariable "PYTHON_LIBRARY=$PYTHON_LIBRARY"
echo "----"
echo "Python information:"
echo " executable : $pythonBin"
echo " version : $pythonMajor"
echo " include path : $PYTHON_INCLUDE"
echo " library : $PYTHON_LIBRARY"
}
@ -250,21 +267,19 @@ addMesaSupport()
return
fi
if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ]
if [ -d "$MESA_INCLUDE" ] && [ -f "$MESA_LIBRARY" ]
then
OBJ_ADD="$OBJ_ADD-mesa"
addCMakeVariable "VTK_OPENGL_HAS_OSMESA:BOOL=ON"
addCMakeVariable "OSMESA_INCLUDE_DIR=$MESA_INCLUDE"
addCMakeVariable "OSMESA_LIBRARY=$MESA_LIBRARY"
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
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
}
@ -276,45 +291,42 @@ addGL2Support()
{
if [ "${withGL2:=false}" = true ]
then
addCMakeVariable "VTK_RENDERING_BACKEND=OpenGL2"
addCMakeVariable "VTK_RENDERING_BACKEND=OpenGL2"
fi
}
#
# Qt 4/5 support
#
addQtSupport()
{
QtVersion=none
QT_VERSION=none
: ${withQT:=true} # default is on
if [ "${withQT:=false}" != true ]
if [ "$withQT" = false ]
then
# Explicitly disabled
addCMakeVariable "PARAVIEW_BUILD_QT_GUI=OFF"
return
fi
addCMakeVariable "PARAVIEW_BUILD_QT_GUI=ON"
local qmake qtLib
local qmake=$(findQtMake)
# From somewhere other than in the path
if [ "${qmake:=qmake}" != qmake ]
# Check qmake can be found and handle version differences
qmake=$(findQMake)
if QT_VERSION=$($qmake -query QT_VERSION 2>/dev/null)
then
addCMakeVariable "QT_QMAKE_EXECUTABLE:FILEPATH=$qmake"
fi
addCMakeVariable "PARAVIEW_BUILD_QT_GUI=ON"
# Check qmake can be found
if type $qmake >/dev/null 2>&1
then
# Check the Qt version selected
# parse -> "Using Qt version X.Y.Z in ..."
QtVersion=$($qmake -query QT_VERSION)
case "$QtVersion" in
3.* | 4.[0-4]*)
case "$QT_VERSION" in
(3.* | 4.[0-4]*)
# QT is too old
cat <<ERROR
----
Error: ${0##*/}
QT version ($QtVersion) provided < 4.5
QT version ($QT_VERSION) 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
@ -324,12 +336,32 @@ ERROR
exit 1
;;
5.*)
# QT4 is the default, must specify QT5 explicitly
addCMakeVariable "PARAVIEW_QT_VERSION:STRING=5"
(4.*)
# Default changed to Qt5 with paraview 5.2.1, so specify explicitly
addCMakeVariable "PARAVIEW_QT_VERSION=4"
# Non-system installation - specify location of qmake
if [ "$qmake" != /usr/bin/qmake ]
then
addCMakeVariable "QT_QMAKE_EXECUTABLE=$qmake"
fi
;;
(5.*)
# Default changed to Qt5 with paraview 5.2.1, so specify explicitly
addCMakeVariable "PARAVIEW_QT_VERSION=5"
# Non-system installation - find CMake config files
if [ "$qmake" != /usr/bin/qmake ] \
&& qtLib="$($qmake -query QT_INSTALL_LIBS)/cmake/Qt5" \
&& [ -d "$qtLib" ]
then
addCMakeVariable "Qt5_DIR=$qtLib"
fi
;;
esac
else
QT_VERSION=none
echo "Error: cannot find qmake either at \$QMAKE_PATH or in current \$PATH"
echo
exit 1
@ -354,17 +386,17 @@ configParaView()
local cmake=$(findCMake)
# Remove any existing build folder and recreate
if [ -d $ParaView_BINARY_DIR ]
if [ -d $ParaView_BUILD_DIR ]
then
echo "removing old build directory"
echo " $ParaView_BINARY_DIR"
rm -rf $ParaView_BINARY_DIR
echo " $ParaView_BUILD_DIR"
rm -rf $ParaView_BUILD_DIR
fi
mkdir -p $ParaView_BINARY_DIR
mkdir -p $ParaView_BUILD_DIR
addCMakeVariable "CMAKE_BUILD_TYPE:STRING=$buildType"
addCMakeVariable "CMAKE_BUILD_TYPE=$BUILD_TYPE"
cd $ParaView_BINARY_DIR || exit 1 # Change to build folder
cd "$ParaView_BUILD_DIR" || exit # Change to build folder
echo "----"
echo "Configuring paraview-$ParaView_VERSION (major version: $ParaView_MAJOR)"
@ -372,16 +404,16 @@ configParaView()
echo " Python support : ${withPYTHON:-false}"
echo " MESA support : ${withMESA:-false}"
echo " GL2 rendering : ${withGL2:-false}"
echo " Qt dev support : ${withQT:-false}"
echo " QT dev support : ${withQT:-true}"
echo " Source : $ParaView_SOURCE_DIR"
echo " Build : $ParaView_BINARY_DIR"
echo " Build : $ParaView_BUILD_DIR"
echo " Target : $ParaView_DIR"
echo " Build type : $buildType"
echo " Cmake : $cmake"
echo " cmake : $cmake"
echo " Build suffix : ${BUILD_SUFFIX:-none}"
echo "----"
echo
echo "$cmake" \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
-DCMAKE_INSTALL_PREFIX=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_SOURCE_DIR
echo
@ -390,7 +422,7 @@ configParaView()
# Run cmake to create Makefiles
$cmake \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
-DCMAKE_INSTALL_PREFIX=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_SOURCE_DIR
}
@ -402,7 +434,7 @@ configParaView()
#
makeParaView()
{
cd $ParaView_BINARY_DIR || exit 1 # Change to build folder
cd "$ParaView_BUILD_DIR" || exit # Change to build folder
echo " Starting make"
time make -j $WM_NCOMPPROCS
echo " Done make"
@ -421,43 +453,51 @@ makeParaView()
#
installParaView()
{
cd $ParaView_BINARY_DIR || exit 1 # Change to build folder
cd "$ParaView_BUILD_DIR" || exit # Change to build folder
echo " Installing ParaView to $ParaView_DIR"
make install
cat<< INFO
# System or non-system installation of QT?
local qmake qtLib QT_VERSION
if qmake=$(findQMake 2>/dev/null)
then
qtLib=$($qmake -query QT_INSTALL_LIBS)
QT_VERSION=$($qmake -query QT_VERSION 2>/dev/null)
fi
---
Installation complete for paraview-$ParaView_VERSION
/bin/cat<<INFO
====
Installation complete for paraview-$ParaView_VERSION with qt-${QT_VERSION:-none}
ParaView_DIR=$ParaView_DIR
You may need to update the OpenFOAM environment by running:
wmRefresh
---
You may need to update the OpenFOAM environment by running:
wmRefresh
INFO
# Non-system installation of QT?
case "$qtLib" in (/usr/lib | /usr/lib64) unset qtLib ;; esac
if [ "${qmake%/*}" != /usr/bin ] && [ -d "$qtLib" ]
then
/bin/cat<<INFO
Your LD_LIBRARY_PATH may require adjustment to include the following:
$qtLib
INFO
fi
echo "===="
}
#------------------------------------------------------------------------------
# Clear the referenced variables before using any of the functions
unset withMPI withVERBOSE
unset withQT QMAKE_PATH
unset withMESA MESA_INCLUDE MESA_LIBRARY
unset withPYTHON PYTHON_INCLUDE PYTHON_LIBRARY
unset CMAKE_VARIABLES
unset OBJ_ADD
unset buildType
# Start with these general settings
addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF"
addCMakeVariable "BUILD_SHARED_LIBS=ON" "BUILD_TESTING=OFF"
# Include development files in "make install"
addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON"
# Don't build test tree
addCMakeVariable "BUILD_TESTING:BOOL=OFF"
addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
#------------------------------------------------------------------------------

View File

@ -2,147 +2,64 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# File
# etc/tools/QtFunction
#
# Description
# Functions for helping relocate a QT installation
# To be loaded *after* etc/tools/ThirdPartyFunctions
#
#------------------------------------------------------------------------------
# Qt-related variables. Initialization at the end of the file.
qtTYPE=qt-everywhere-opensource-src
unset qtVERSION # No default version
#------------------------------------------------------------------------------
#
# Create a qt.conf file in the QT bin/
# - this can be modified easily if the qt installation is relocated
#
createQtConf()
{
echo "create:"
echo " $QT_ARCH_PATH/bin/qt.conf"
local confFile="$QT_ARCH_PATH/bin/qt.conf"
[ -n "$QT_ARCH_PATH" -a -d "$QT_ARCH_PATH/bin" ] || {
if [ -n "$QT_ARCH_PATH" ] && [ -d "$QT_ARCH_PATH/bin" ]
then
/bin/cat << QT_CONF > $confFile
[Paths]
Prefix=$QT_ARCH_PATH
QT_CONF
echo " created qt.conf"
else
echo "Error: QT_ARCH_PATH not correctly set"
return
}
echo "[Paths]" > $QT_ARCH_PATH/bin/qt.conf
echo "Prefix=$QT_ARCH_PATH" >> $QT_ARCH_PATH/bin/qt.conf
fi
}
#
# Adjust pkgconfig information
# to generalize *location=, -L/... and -I/...
# to use ${prefix}
#
adjustPkgConfig()
{
echo "edit pkgconfig:"
echo " $QT_ARCH_PATH/lib/pkgconfig/*.pc"
[ -n "$QT_ARCH_PATH" -a -d "$QT_ARCH_PATH/lib/pkgconfig" ] || {
echo "Error: QT_ARCH_PATH not correctly set"
return
}
(
cd $QT_ARCH_PATH/lib/pkgconfig || exit
unset nfiles
for i in *.pc
do
if [ -f "$i" ]
then
nfiles="x$nfiles"
sed -i \
-e 's@\(location=\)'"$QT_ARCH_PATH/"'@\1${prefix}/@' \
-e 's@\(-[IL]\)'"$QT_ARCH_PATH/"'@\1${prefix}/@g' \
$i
fi
done
echo " edited ${#nfiles} files"
)
}
#
# Change prefix=... and Prefix=... to use ${prefix}
#
changePrefix()
{
echo "relocate QT installation to new prefix directory:"
echo " $QT_ARCH_PATH"
echo "edit:"
echo " $QT_ARCH_PATH/bin/qt.conf"
echo " $QT_ARCH_PATH/lib/pkgconfig/*.pc"
[ -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 $QT_ARCH_PATH/bin/qt.conf
do
if [ -f "$i" ]
then
nfiles="x$nfiles"
sed -i \
-e 's@^\([Pp]refix=\).*$@\1'"$QT_ARCH_PATH@" \
$i
echo " edited 1 file"
fi
done
# adjust pkgconfig files
(
cd $QT_ARCH_PATH/lib/pkgconfig || exit
unset nfiles
for i in *.pc
do
if [ -f "$i" ]
then
nfiles="x$nfiles"
sed -i \
-e 's@^\([Pp]refix=\).*$@\1'"$QT_ARCH_PATH@" \
$i
fi
done
echo " edited ${#nfiles} files"
)
}
# ------------------------------------------------------------------------------
#
# create qt.conf and adjustPkgConfig to use ${prefix} internally
# create qt.conf and adjust locations to use ${prefix} internally
#
finalizeQt()
{
echo "Create/Edit files to ease later relocation of a QT installation"
createQtConf
adjustPkgConfig
pkgconfigAdjust $QT_ARCH_PATH
}
# ----------------------------------------------------------------- end-of-file
# -----------------------------------------------------------------------------

View File

@ -2,39 +2,406 @@
# ========= |
# \\ / 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 | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# File
# etc/tools/ThirdPartyFunctions
#
# Description
# Functions for managing the third-party packages
# Various functions used in building ThirdParty packages
#
# Define the standard buildBASE and installBASE for the platform
# Define WM_NCOMPPROCS always.
#
# Compiler and flags are managed via the 'wmake -show-c, -show-cflags, ..'
# but also with WM_CC, WM_CFLAGS,... env variables
#
# Files
# Uses OpenFOAM/etc/config.sh/cmake (if it exists) for the
# CMAKE_ARCH_PATH that may specify a possible cmake/bin directory.
#
#------------------------------------------------------------------------------
# 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
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"
# Commonly used names
unset sourceDIR buildDIR prefixDIR binDIR incDIR libDIR
# Synthetic value combining precision and label size (Eg, DPInt32)
WM_SIZE_OPTIONS="${WM_PRECISION_OPTION}Int${WM_LABEL_SIZE}"
# Dynamic library ending (default is .so)
EXT_SO="$(wmake -show-ext-so 2>/dev/null)"
if [ -z "$EXT_SO" ]
then
EXT_SO=.so
case "$WM_OSTYPE" in
*windows)
EXT_SO=.dll
;;
*)
[ Darwin = "$(uname -s 2>/dev/null)" ] && EXT_SO=.dylib
;;
esac
fi
# Fallback values, needed for our scotch Makefile which uses
# WM_CFLAGS and WM_LDFLAGS for arch information
if [ -z "$WM_CFLAGS" ]
then
export WM_CFLAGS="$(wmake -show-cflags 2>/dev/null)"
fi
if [ -z "$WM_LDFLAGS" ]
then
export WM_LDFLAGS="$(wmake -show-cflags-arch 2>/dev/null)"
fi
unset BUILD_SUFFIX
#------------------------------------------------------------------------------
# Check for existence of shared library (without .so extension)
#
# $1 = The path and library stem
#
haveLibso()
{
if [ -z "$1" ]
then
return 1
elif [ -r "$1$EXT_SO" ]
then
return 0
elif [ "$EXT_SO" = .dll ] && [ -r "$1.dll.a" ]
then
# Including cross-compiling
return 0
fi
return 2
}
#------------------------------------------------------------------------------
# Service routine to strip out OpenFOAM-specific portions from the compiler
# flags (ie, everything after and including "-DOPENFOAM=...")
# while retaining '-fPIC'
#
# $1 = all flags concatenated as a single string
#
stripCompilerFlags()
{
local flags="${1%-DOPENFOAM=*}" # Strip out OpenFOAM-specific
flags="${flags## }" # Trim leading space
flags="${flags%% }" # Trim trailing space
# Retain -fPIC though
case "$flags" in
(*-fPIC*)
# -fPIC already included
;;
(*)
case "$1" in
(*-fPIC*)
# Add -fPIC back in (was after -DOPENFOAM=... content)
flags="$flags${flags+ }-fPIC"
;;
esac
;;
esac
echo "$flags"
}
# Export compiler settings (and flags) for CMake/configure
# based on the values from wmake -show-compile-*
#
# Since "wmake -show-XX" is only available after 1904, continue to support
# the previous env variables method (WM_CC, WM_CFLAGS, WM_CXX, WM_CXXFLAGS)
#
# $1 = "basic|minimal|strip" (optional)
#
# If the option 'basic' is provided, the OpenFOAM-specific portions of
# the flags are stripped out. Ie, everything after "-DOPENFOAM=..."
# but retaining '-fPIC'
#
exportCompiler()
{
local option="$1"
local comp flag
# C compiler and flags
if ! comp="$(wmake -show-c 2>/dev/null)" \
|| ! flag="$(wmake -show-cflags 2>/dev/null)"
then
comp="$WM_CC"
flag="$WM_CFLAGS"
fi
if test -n "$comp" && command -v "$comp" >/dev/null
then
export CC="$comp"
if [ -n "$flag" ]
then
case "$option" in
(basic | minimal | strip)
flag="$(stripCompilerFlags "$flag")"
;;
esac
export CFLAGS="$flag"
fi
fi
# C++ compiler and flags
if ! comp="$(wmake -show-cxx 2>/dev/null)" \
|| ! flag="$(wmake -show-cxxflags 2>/dev/null)"
then
comp="$WM_CXX"
flag="$WM_CXXFLAGS"
fi
if test -n "$comp" && command -v "$comp" >/dev/null
then
export CXX="$comp"
if [ -n "$flag" ]
then
case "$option" in
(basic | minimal | strip)
flag="$(stripCompilerFlags "$flag")"
;;
esac
export CXXFLAGS="$flag"
fi
fi
}
# Export linker settings for CMake/configure
exportLinker()
{
local flag
# Linker flags, actually just the machine arch
flag="$(wmake -show-cflags-arch 2>/dev/null)" || flag="$WM_LDFLAGS"
if test -n "$flag"
then
export LDFLAGS="$flag"
fi
}
# Force use of gcc/g++, but the values of CFLAGS, CXXFLAGS may be incorrect
useGcc()
{
export CC=gcc
export CXX=g++
}
# Scan arguments for a '-gcc' option, forcing gcc/g++ when found
useGccFlag()
{
for i
do
if [ "$i" = "-gcc" ]
then
useGcc
break
fi
done
}
# Return current value of $CC if set or obtain from 'wmake -show-c',
# using $WM_CC (older env variable) as the first level fallback.
# Final fallback is <gcc>
whichCC()
{
local comp="$CC"
if [ -z "$comp" ]
then
comp="$(wmake -show-c 2>/dev/null)" || comp="$WM_CC"
test -n "$comp" && command -v "$comp" >/dev/null || unset comp
fi
echo "${comp:-gcc}"
}
# Return current value of $CXX if set or obtain from 'wmake -show-cxx',
# using $WM_CXX (older env variable) as the first level fallback.
# Final fallback is <g++>
whichCXX()
{
local comp="$CXX"
if [ -z "$comp" ]
then
comp="$(wmake -show-cxx 2>/dev/null)" || comp="$WM_CXX"
test -n "$comp" && command -v "$comp" >/dev/null || unset comp
fi
echo "${comp:-g++}"
}
# Return <mpicc> by default or <mpiicc> if possible for INTELMPI.
# Cray doesn't have <mpicc>, but its <cc> manages mpi paths directly.
# NOTE: could further refine based on "wmake -show-c", but not yet needed
whichMpicc()
{
local comp="$(command -v mpicc)"
case "$WM_MPLIB" in
(INTELMPI)
comp="$(command -v mpiicc)" # Intel <mpiicc> available?
;;
(CRAY-MPI*)
: "${comp:=cc}" # Cray <cc> if there is no <mpicc>
;;
esac
echo "${comp:-mpicc}"
}
# Return <mpicxx> by default or <mpiicpc> if possible for INTELMPI.
# Cray doesn't have <mpicxx>, but its <CC> manages mpi paths directly.
# NOTE: could further refine based on "wmake -show-cxx", but not yet needed
whichMpicxx()
{
local comp="$(command -v mpicxx)"
case "$WM_MPLIB" in
(INTELMPI)
comp="$(command -v mpiicpc)" # Intel <mpiicpc> available?
;;
(CRAY-MPI*)
: "${comp:=CC}" # Cray <CC> if there is no <mpicc>
;;
esac
echo "${comp:-mpicxx}"
}
# Require wmkdepend etc when building with wmake
# before 2020-04-03: wmake/platforms/linux64Gcc
# after 2020-04-03: platforms/tools/linux64Gcc
requireWMakeToolchain()
{
local archName="$WM_ARCH$WM_COMPILER"
local wmDir="${WM_DIR:-$WM_PROJECT_DIR/wmake}"
local archDir1="$wmDir/platforms/$archName"
local archDir2="$WM_PROJECT_DIR/platforms/tools/$archName"
if [ -x "$archDir1/wmkdepend" ] || [ -x "$archDir1/wmkdep" ] || \
[ -x "$archDir2/wmkdepend" ] || [ -x "$archDir2/wmkdep" ]
then
echo "Appear to have {wmkdepend,wmkdep} binary" 1>&2
else
echo "Warning: appear to be missing {wmkdepend,wmkdep} binary ... building" 1>&2
( cd "$wmDir/src" && make -s )
[ -x "$archDir1/wmkdepend" ] || [ -x "$archDir1/wmkdep" ] || \
[ -x "$archDir2/wmkdepend" ] || [ -x "$archDir2/wmkdep" ] || {
exec 1>&2
echo
echo "Error: cannot use wmake build for '${0##*/}"
echo " Missing {wmkdepend,wmkdep} binary"
echo " Please run the top-level OpenFOAM Allwmake first"
echo " or top-level wmake/src/Allmake"
echo
exit 1
}
fi
}
# Require FOAM_EXT_LIBBIN for some compilations
requireExtLibBin()
{
[ -n "$FOAM_EXT_LIBBIN" ] || {
exec 1>&2
echo
echo "Error: \$FOAM_EXT_LIBBIN not set for '${0##*/}"
echo " Check your OpenFOAM environment and installation"
echo
exit 1
}
}
# grep for package http or ftp entries in BUILD.md
# Should be of the form "[link xx]: http://..."
showDownloadHint()
{
local package="$1"
if [ -n "$package" ]
then
echo "Possible download locations for $package :"
if [ -f "$WM_THIRD_PARTY_DIR/BUILD.md" ]
then
grep -i "$package" "$WM_THIRD_PARTY_DIR/BUILD.md" | \
grep -E '(http|ftp)' | sed -ne 's/^ *\[.*\]: */ /p' | \
uniq
fi
fi
}
#------------------------------------------------------------------------------
# Some functions as per OpenFOAM etc/config.sh/functions
unset -f _foamAddLib _foamAddLibAuto _foamAddMan _foamAddPath # Get settings only
unset -f _foamClean _foamConfig
if [ -x "$WM_PROJECT_DIR/bin/foamCleanPath" ]
then
# Cleaning environment variables
_foamClean()
{
local var=$1
shift
eval $($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=$var "$@")
}
else
_foamClean() { echo "No foamCleanPath" 1>&2; }
fi
# Source an etc/config.sh file
_foamConfig() { eval "$($WM_PROJECT_DIR/bin/foamEtcFile -sh -config $@)"; }
# Source an etc file (as per OpenFOAM functions). Eg, for mpi setup.
_foamEtc() { eval "$($WM_PROJECT_DIR/bin/foamEtcFile -sh $@)"; }
#------------------------------------------------------------------------------
#
# Set a suffix for the build
# - eg, for -mpi, or -mesa etc
#
setBuildSuffix()
{
BUILD_SUFFIX="${1##-}"
if [ -n "$BUILD_SUFFIX" ]
then
BUILD_SUFFIX="-${BUILD_SUFFIX}"
else
unset BUILD_SUFFIX
fi
}
#
# Mostly building without wmake
@ -42,20 +409,16 @@ installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
# - use max number of cores for building
#
unset WM_HOSTS WM_SCHEDULER
if [ -r /proc/cpuinfo ]
then
WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
else
WM_NCOMPPROCS=1
fi
WM_NCOMPPROCS=$(getconf _NPROCESSORS_ONLN 2>/dev/null) || WM_NCOMPPROCS=1
: ${WM_NCOMPPROCS:=1}
export WM_NCOMPPROCS
# echo "Building on $WM_NCOMPPROCS cores"
#
# If WM_CONTINUE_ON_ERROR not set activate the shell option "stop on error"
#
if [ -z "${WM_CONTINUE_ON_ERROR}" ]
if [ -z "$WM_CONTINUE_ON_ERROR" ]
then
set -e
fi
@ -72,6 +435,24 @@ die()
exit 1
}
# Warn
warnBuildIssues()
{
echo
echo " ---------------------------------------------------"
echo " Optional component ($1) had build issues"
echo " OpenFOAM will nonetheless remain largely functional"
echo " ---------------------------------------------------"
echo
}
# Warn
warnNotFound()
{
echo "Optional component ($1) was not found"
}
# Test if it matches "*-none"
_foamIsNone()
{
@ -86,45 +467,47 @@ _foamIsSystem()
#
# try to locate cmake according to the CMAKE_PATH
# or just use what is found in the path
# Try to locate cmake according to the CMAKE_PATH.
#
# On success: return the resolved value as output.
# On failure: just report what is found in the path.
#
unset CMAKE_PATH # clear when first loaded
findCMake()
{
local candidate
local foundExe
local config="config.sh/cmake"
local candidate foundExe
if [ -n "$CMAKE_PATH" ]
then
# check as directory
# Check as directory
if [ -d "$CMAKE_PATH" ]
then
for candidate in \
$CMAKE_PATH/cmake \
$CMAKE_PATH/bin/cmake \
"$CMAKE_PATH"/cmake \
"$CMAKE_PATH"/bin/cmake \
;
do
if [ -f "$candidate" -a -x "$candidate" ]
if [ -f "$candidate" ] && [ -x "$candidate" ]
then
foundExe=$candidate
foundExe="$candidate"
break
fi
done
fi
# check as file, include ThirdParty installation in the search
# 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 \
"$CMAKE_PATH" \
"$installBASE/$CMAKE_PATH"/bin/cmake \
"$installBASE/cmake-$CMAKE_PATH"/bin/cmake \
;
do
if [ -f "$candidate" -a -x "$candidate" ]
if [ -f "$candidate" ] && [ -x "$candidate" ]
then
foundExe=$candidate
foundExe="$candidate"
break
fi
done
@ -137,7 +520,6 @@ findCMake()
then
foundExe="$(cd ${foundExe%/cmake} 2>/dev/null && pwd)/cmake"
fi
echo "Using cmake=$foundExe" 1>&2
echo "$foundExe"
return 0
@ -145,58 +527,83 @@ findCMake()
cat << NOT_FOUND 1>&2
'cmake' not found under specified CMAKE_PATH
CMAKE_PATH=$CMAKE_PATH
reverting to using command from path
reverting to using command from $config or 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}"
unset cmake_version CMAKE_ARCH_PATH
if candidate="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config" 2>/dev/null)"
then
. "$candidate"
for candidate in \
"$CMAKE_ARCH_PATH"/bin/cmake \
"$installBASE/$cmake_version"/bin/cmake \
;
do
if [ -f "$candidate" ] && [ -x "$candidate" ]
then
echo "Using cmake=$candidate" 1>&2
echo "$candidate"
return 0
fi
done
fi
# Default to use the path, try resolving (so we know what we are using).
for candidate in cmake
do
foundExe="$(command -v "$candidate" 2>/dev/null)" && break
done
: "${foundExe:=false}"
echo "Using cmake=$foundExe" 1>&2
echo "$foundExe"
}
#
# try to locate qmake according to the QMAKE_PATH
# or just use what is found in the path
# Try to locate qmake or qmake-qt5 according to the QMAKE_PATH
#
# On success: return the resolved value as output.
# On failure: just report what is found in the path.
#
unset QMAKE_PATH # clear when first loaded
findQtMake()
findQMake()
{
local candidate
local foundExe
local candidate foundExe
if [ -n "$QMAKE_PATH" ]
then
# check as directory
# Check as directory
if [ -d "$QMAKE_PATH" ]
then
for candidate in \
$QMAKE_PATH/qmake \
$QMAKE_PATH/bin/qmake \
"$QMAKE_PATH"/qmake \
"$QMAKE_PATH"/bin/qmake \
;
do
if [ -f "$candidate" -a -x "$candidate" ]
if [ -f "$candidate" ] && [ -x "$candidate" ]
then
foundExe=$candidate
foundExe="$candidate"
break
fi
done
fi
# check as file, include ThirdParty installation in the search
# 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 \
"$QMAKE_PATH" \
"$installBASE/$QMAKE_PATH"/bin/qmake \
"$installBASE/qt-$QMAKE_PATH"/bin/qmake \
;
do
if [ -f "$candidate" -a -x "$candidate" ]
if [ -f "$candidate" ] && [ -x "$candidate" ]
then
foundExe=$candidate
foundExe="$candidate"
break
fi
done
@ -209,7 +616,6 @@ findQtMake()
then
foundExe="$(cd ${foundExe%/qmake} 2>/dev/null && pwd)/qmake"
fi
echo "Using qmake=$foundExe" 1>&2
echo "$foundExe"
return 0
@ -217,15 +623,118 @@ findQtMake()
cat << NOT_FOUND 1>&2
'qmake' not found under specified QMAKE_PATH
QMAKE_PATH=$QMAKE_PATH
reverting to using command from 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}"
# Default to use the path, try resolving (so we know what we are using).
# Some systems have qmake-qt5 as well as qmake
for candidate in qmake-qt5 qmake
do
foundExe="$(command -v "$candidate" 2>/dev/null)" && break
done
: "${foundExe:=false}"
echo "Using qmake=$foundExe" 1>&2
echo $foundExe
}
#
# Set a new prefix=... in pkgconfig files
#
pkgconfigNewPrefix()
{
local dir="${1%%/}"
if [ -n "$dir" ] && [ -d "$dir" ]
then
# Require absolute path, but use logical (not physical) location
[ "${dir}" != "${dir#/}" ] || dir=$(cd $dir 2>/dev/null && /bin/pwd -L)
# Strip sub-level
case "$dir" in (*/pkgconfig) dir="${dir%/*}";; esac
# Strip a level
case "$dir" in (*/lib | */lib64 | */bin) dir="${dir%/*}";; esac
fi
# Verify that the prefix path is valid
# Warning (not an error) - thus no special return code
[ -n "$dir" -a -d "$dir" ] || {
echo "Warning: invalid prefix directory: $dir" 1>&2
return 0
}
echo "Set pkgconfig prefix : $dir"
local nfiles
for libdir in lib/pkgconfig lib64/pkgconfig
do
unset nfiles
[ -d "$dir/$libdir" ] || continue
for i in $dir/$libdir/*.pc
do
if [ -f "$i" ] && [ ! -L "$i" ]
then
nfiles="x$nfiles"
sed -i~ -e 's@^\(prefix=\).*$@\1'"$dir@" $i
fi
done
echo " $libdir/*.pc (edited ${#nfiles})"
done
}
#
# Adjust pkgconfig information to use '${prefix} where possible instead
# of directory paths.
#
# Adjusts includedir=, libdir=, -I/... and -L/... and
# any *_location= entries (QT)
#
pkgconfigAdjust()
{
local dir="${1%%/}"
if [ -n "$dir" ] && [ -d "$dir" ]
then
# Require absolute path, but use logical (not physical) location
[ "${dir}" != "${dir#/}" ] || dir=$(cd $dir 2>/dev/null && /bin/pwd -L)
# Strip sub-level
case "$dir" in (*/pkgconfig) dir="${dir%/*}";; esac
# Strip a level
case "$dir" in (*/lib | */lib64 | */bin) dir="${dir%/*}";; esac
fi
# Verify that the prefix path is valid
# Warning (not an error) - thus no special return code
[ -n "$dir" -a -d "$dir" ] || {
echo "Warning: invalid prefix directory: $dir" 1>&2
return 0
}
echo "Adjust pkgconfig locations : $dir"
local nfiles
for libdir in lib/pkgconfig lib64/pkgconfig
do
unset nfiles
[ -d "$dir/$libdir" ] || continue
for i in $dir/$libdir/*.pc
do
if [ -f "$i" ] && [ ! -L "$i" ]
then
nfiles="x$nfiles"
sed -i~ \
-e 's@^\(includedir=\)'"$dir/"'@\1${prefix}/@' \
-e 's@^\(libdir=\)'"$dir/"'@\1${prefix}/@' \
-e 's@\(_location=\)'"$dir/"'@\1${prefix}/@' \
-e 's@\(-[IL]\)'"$dir/"'@\1${prefix}/@g' \
$i
fi
done
echo " $libdir/*.pc (edited ${#nfiles})"
done
}
@ -252,14 +761,12 @@ downloadFile()
#
# Copy Make/{files,options} from etc/wmakeFiles/PACKAGE
# Copy Make/{files,options} from etc/makeFiles/PACKAGE
#
# $1 = PACKAGE
# $2 = TARGET DIRECTORY (optional)
cpMakeFiles()
{
set +x
[ "$#" -eq 1 -o "$#" -eq 2 ] || {
echo "cpMakeFiles called with incorrect number of arguments $@"
return 1
@ -269,7 +776,7 @@ cpMakeFiles()
local dst="${2:-.}"
echo "cpMakeFiles" $pkg $dst
wmakeFiles=$WM_THIRD_PARTY_DIR/etc/wmakeFiles/$pkg
wmakeFiles=$WM_THIRD_PARTY_DIR/etc/makeFiles/$pkg
for i in $(cd $wmakeFiles && find . -type f)
do
@ -291,8 +798,6 @@ cpMakeFiles()
cp $wmakeFiles/$i $dst/$d/Make/$b
fi
done
set -x
}
@ -318,7 +823,7 @@ applyPatch()
if [ -r "$patch" ]
then
(
cd $dst || exit 1
cd "$dst" || exit
if [ -f "$sentinel" ]
then
echo "patch for $pkg was already applied"
@ -333,4 +838,5 @@ applyPatch()
fi
}
#------------------------------------------------------------------------------

View File

@ -2,24 +2,13 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# File
# etc/tools/vtkFunctions
@ -30,14 +19,19 @@
#
#------------------------------------------------------------------------------
# sourceBASE, buildBASE, installBASE defined in tools/ThirdPartyFunctions
# Variables referenced by the functions. Initialization at the end of the file.
unset CMAKE_VARIABLES
# sourceBASE, buildBASE, installBASE and BUILD_SUFFIX
# are 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_BUILD_DIR : location of the build
# VTK_DIR : location of the installed program
#
setVtkDirs()
@ -62,21 +56,17 @@ setVtkDirs()
exit 1
}
# VTK_BINARY_DIR=$buildBASE/VTK-$VTK_VERSION${OBJ_ADD:+-$OBJ_ADD}
VTK_BINARY_DIR=$buildBASE/VTK-$VTK_VERSION
VTK_BUILD_DIR=$buildBASE/VTK-$VTK_VERSION$BUILD_SUFFIX
VTK_DIR=$installBASE/VTK-$VTK_VERSION$BUILD_SUFFIX
# 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
export VTK_SOURCE_DIR VTK_BUILD_DIR VTK_DIR
echo
echo "VTK_SOURCE_DIR=$VTK_SOURCE_DIR"
echo "VTK_BINARY_DIR=$VTK_BINARY_DIR"
echo "VTK_BUILD_DIR=$VTK_BUILD_DIR"
echo "VTK_DIR=$VTK_DIR"
# Forcefully override the .git path for the VTK source code directory
export GIT_DIR=$ParaView_SOURCE_DIR/.git
export GIT_DIR="$VTK_SOURCE_DIR/.git" # Mask seeing our own git-repo
}
@ -121,30 +111,30 @@ configVTK()
local cmake=$(findCMake)
# Remove any existing build folder and recreate
if [ -d $VTK_BINARY_DIR ]
if [ -d $VTK_BUILD_DIR ]
then
echo "removing old build directory"
echo " $VTK_BINARY_DIR"
rm -rf $VTK_BINARY_DIR
echo " $VTK_BUILD_DIR"
rm -rf $VTK_BUILD_DIR
fi
mkdir -p $VTK_BINARY_DIR
mkdir -p $VTK_BUILD_DIR
addCMakeVariable "CMAKE_BUILD_TYPE:STRING=$buildType"
addCMakeVariable "CMAKE_BUILD_TYPE=$BUILD_TYPE"
cd $VTK_BINARY_DIR || exit 1 # change to build folder
cd "$VTK_BUILD_DIR" || exit # 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 " Build : $VTK_BUILD_DIR"
echo " Target : $VTK_DIR"
echo " Build type : $buildType"
echo " Cmake : $cmake"
echo " cmake : $cmake"
echo " Build suffix : ${BUILD_SUFFIX:-none}"
echo "----"
echo
echo "$cmake" \
-DCMAKE_INSTALL_PREFIX:PATH=$VTK_DIR \
-DCMAKE_INSTALL_PREFIX=$VTK_DIR \
$CMAKE_VARIABLES \
$VTK_SOURCE_DIR
echo
@ -153,29 +143,49 @@ configVTK()
# Run cmake to create Makefiles
$cmake \
-DCMAKE_INSTALL_PREFIX:PATH=$VTK_DIR \
-DCMAKE_INSTALL_PREFIX=$VTK_DIR \
$CMAKE_VARIABLES \
$VTK_SOURCE_DIR
}
#
# MPI support for VTK
#
unset -f addMpiSupport 2>/dev/null
addMpiSupport()
{
if [ "${withMPI:=false}" != true ]
then
return
fi
addCMakeVariable "VTK_Group_MPI=ON"
addCMakeVariable "Module_vtkRenderingParallel=ON"
addCMakeVariable "Module_vtkParallelMPI=ON"
if [ "${MPI_MAX_PROCS:=0}" -gt 1 ]
then
addCMakeVariable "VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
fi
}
#
# Invoke make
# also link bin/ to lib/paraview-* for development without installation
#
makeVTK()
{
cd $VTK_BINARY_DIR || exit 1 # change to build folder
cd "$VTK_BUILD_DIR" || exit # 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
[ -L lib ] && rm -f lib 2>/dev/null
echo " Done make" # Last statement for clean return code
}
@ -184,31 +194,25 @@ makeVTK()
#
installVTK()
{
cd $VTK_BINARY_DIR || exit 1 # Change to build folder
cd "$VTK_BUILD_DIR" || exit # Change to build folder
echo " Installing VTK to $VTK_DIR"
make install
cat<< INFO
/bin/cat<<INFO
---
Installation complete for vtk-$VTK_VERSION
====
Installation complete for vtk-$VTK_VERSION as
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"
addCMakeVariable "BUILD_SHARED_LIBS=ON" "BUILD_TESTING=OFF"
#------------------------------------------------------------------------------

View File

@ -1,27 +0,0 @@
/* NOTE: make any changes to this file in etc/wmakeFiles/ */
adf = libadf
$(adf)/ADF_fortran_2_c.c
$(adf)/ADF_interface.c
$(adf)/ADF_internals.c
ccmio = libccmio
$(ccmio)/ccmio.c
$(ccmio)/ccmiocore.c
$(ccmio)/ccmioprivate.c
$(ccmio)/ccmioutility.c
$(ccmio)/ccmioversion.c
/*
* the cgns library is not used by ccmio
* retain for documentation purposes only
*
cgns = libcgns
$(cgns)/adf_cond.c
$(cgns)/adf_ftoc.c
$(cgns)/cgns_error.c
$(cgns)/cgns_internals.c
$(cgns)/cgnslib.c
*/
LIB = $(FOAM_EXT_LIBBIN)/libccmio

View File

@ -1,3 +0,0 @@
/* NOTE: make any changes to this file in etc/wmakeFiles/ */
/* EXE_INC = */

View File

@ -1,33 +0,0 @@
# 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

368
makeADIOS
View File

@ -1,368 +0,0 @@
#!/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

184
makeAdios2 Executable file
View File

@ -0,0 +1,184 @@
#!/bin/sh
#------------------------------------------------------------------------------
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeAdios2
#
# Description
# Build script for ADIOS2
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library ending (default is .so)
[ "$(uname -s)" = Darwin ] && EXT_SO=.dylib || EXT_SO=.so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -d "$dir/include" ] \
&& [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
then
echo " adios2 include: $dir/include"
echo " adios2 library: $dir/lib$WM_COMPILER_LIB_ARCH"
exit 0
else
exit 2
fi
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# ADIOS2 version from OpenFOAM etc/config.sh file:
_foamConfig adios2
adiosPACKAGE=${adios2_version:-adios-none}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [adios-VERSION]
options:
-force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-cmake PATH With cmake from the given path
-help
* Build ADIOS2
$adiosPACKAGE
USAGE
showDownloadHint ADIOS2
exit 1
}
#------------------------------------------------------------------------------
exportCompiler minimal # Minimal compiler info for CMake/configure
unset optForce
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
shift
;;
ADIOS2-[0-9]* | ADIOS2-git* | ADIOS-[0-9]* | ADIOS-git* | \
adios2-[0-9]* | adios2-git* | adios-[0-9]* | adios-git*)
adiosPACKAGE="${1%%/}"
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$adiosPACKAGE" ] || die "The adios2-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
# ADIOS2_SOURCE_DIR : location of the original sources
# ADIOS2_ARCH_PATH : installation directory
ADIOS2_SOURCE_DIR=$sourceBASE/$adiosPACKAGE
ADIOS2_ARCH_PATH=$installBASE/$adiosPACKAGE
: ${FOAM_MPI:=dummy}
echo
echo ========================================
echo "Build adios library $adiosPACKAGE for $FOAM_MPI"
echo
# Needs future adjustment
# - for mpi-specific library locations
if [ -z "$optForce" ] \
&& [ -f "$ADIOS2_ARCH_PATH/include/adios2.h" ] \
&& [ -r "$ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
then
echo " ADIOS2 header in $ADIOS2_ARCH_PATH/include"
echo " ADIOS2 libs in $ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
else
# CMake options often lag the configure ones
echo "Starting build: $adiosPACKAGE (using cmake)"
echo
(
buildDIR=$buildBASE/$adiosPACKAGE
cd "$ADIOS2_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
applyPatch $adiosPACKAGE $ADIOS2_SOURCE_DIR
# Remove any existing build folder and recreate
rm -rf $ADIOS2_ARCH_DIR
rm -rf $buildDIR 2>/dev/null
mkdir -p $buildDIR
# May not work properly with FOAM_MPI = dummy
if [ "$FOAM_MPI" != dummy ]
then
CC=mpicc
CXX=mpicxx
fi
cmake=$(findCMake)
# Install into lib64/
cd $buildDIR && $cmake \
-DCMAKE_INSTALL_PREFIX=$ADIOS2_ARCH_PATH \
-DCMAKE_BUILD_TYPE=Release \
-DADIOS2_USE_Fortran=FALSE \
-DADIOS2_BUILD_EXAMPLES=FALSE \
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
$ADIOS2_SOURCE_DIR \
&& make -j $WM_NCOMPPROCS all \
&& make install \
&& echo "Built: $adiosPACKAGE"
) || {
echo "Error building: $adiosPACKAGE"
exit 1
}
fi
# -----------------------------------------------------------------------------

139
makeCCMIO
View File

@ -3,54 +3,40 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeCCMIO
#
# Description
# Build CD-adapco's ccmio library
# Build the libccmio library
#
#------------------------------------------------------------------------------
# Get version info
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
ccmioPACKAGE=${ccmio_version:-libccmio-2.6.1}
targetType=lib
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# 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."
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# libccmio version from OpenFOAM etc/config.sh file:
_foamConfig ccmio
ccmioPACKAGE=${ccmio_version:-libccmio-2.6.1}
targetType=lib # Default is static linkage
#------------------------------------------------------------------------------
usage()
{
@ -60,13 +46,14 @@ usage()
Usage: ${0##*/} [OPTION] [lib|libso] [libccmio-VERSION]
options:
-gcc Force use of gcc/g++
-help
* Compile the proprietary libccmio library
$ccmioPACKAGE
Users wishing to make use of the library should contact cd-adapco
(Siemens PLM) for possible download and terms of use.
Users wishing to obtain the library should contact Siemens PLM (cd-adapco)
for terms of use.
After obtaining the $ccmioPACKAGE library, place in folder
@ -75,22 +62,23 @@ options:
prior to running this script.
USAGE
showDownloadHint CCMIO
exit 1
}
#------------------------------------------------------------------------------
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
lib|libso)
targetType="$1"
;;
libccmio-[1-9]*)
libccmio-[0-9]*)
ccmioPACKAGE="${1%%/}"
;;
*)
@ -100,38 +88,61 @@ do
shift
done
# assert: directory must be available
[ -d "$ccmioPACKAGE" ] || die "missing source directory '$ccmioPACKAGE'"
requireWMakeToolchain
requireExtLibBin
#------------------------------------------------------------------------------
CCMIO_SOURCE_DIR=$sourceBASE/$ccmioPACKAGE
CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE
#
# Build LIBCCMIO
#
echo "---------------"
(
cd $CCMIO_SOURCE_DIR || exit 1
incDIR=$CCMIO_ARCH_PATH/include/libccmio
libDIR=$CCMIO_ARCH_PATH/lib
CCMIO_SOURCE_DIR=$sourceBASE/$ccmioPACKAGE
CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE
mkdir -p $incDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
# Sources must be available
[ -d "$CCMIO_SOURCE_DIR" ] || die "Missing sources: '$ccmioPACKAGE'"
#
# Manual installation
#
install()
{
# Ensure a clean build next time
wclean
local incdir=$CCMIO_ARCH_PATH/include/libccmio
# Make headers available:
mkdir -m 0755 -p $incdir
/bin/cp -pv libccmio/ccmio*.h $incdir
}
echo "Starting build: $ccmioPACKAGE ($targetType)"
echo
(
cd "$CCMIO_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
rm -rf $CCMIO_ARCH_PATH
rm -f $FOAM_EXT_LIBBIN/libccmio$EXT_SO
libdir=$CCMIO_ARCH_PATH/lib
cpMakeFiles libccmio 2>/dev/null
set +x
if wmake $targetType
then
# make headers available:
/bin/cp -pv libccmio/ccmio*.h $incDIR
# relocate static libraries to sub-directory:
if [ "$targetType" = lib ]
then
/bin/mv -v $FOAM_EXT_LIBBIN/libccmio.a $libDIR
fi
# Place static libraries in sub-directory:
if [ "$targetType" = lib ]
then
mkdir -m 0755 -p $libdir 2>/dev/null
export FOAM_EXT_LIBBIN=$libdir
fi
)
wmake -j $WM_NCOMPPROCS -s $targetType \
&& echo "Built: ccmio" \
&& install
) || {
echo "Error building: ccmio"
exit 1
}
#------------------------------------------------------------------------------

479
makeCGAL
View File

@ -3,24 +3,14 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2012-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeCGAL
@ -34,15 +24,54 @@
# simply specify a 'system' version. For example,
# makeCGAL boost-system gmp-system
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Get CGAL, boost and gmp/mpfr versions
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
unset BOOST_ARCH_PATH CGAL_ARCH_PATH # purge current values
# Dynamic library ending (default is .so)
[ "$(uname -s)" = Darwin ] && EXT_SO=.dylib || EXT_SO=.so
# 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)
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 3 ] || { echo "${0##*/} -test : needs 2 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -d "$dir/include" ] && [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libCGAL$EXT_SO" ]
then
echo " CGAL include: $dir/include"
echo " CGAL library: $dir/lib$WM_COMPILER_LIB_ARCH"
# Additional information about boost
dir="${3%/}" # <- BOOST_ARCH_PATH
for root in "$dir" /usr
do
if [ -d "$root/include/boost" ] \
&& [ -r "$root/lib$WM_COMPILER_LIB_ARCH/libboost_system$EXT_SO" ]
then
echo " boost include: $root/include"
echo " boost library: $root/lib$WM_COMPILER_LIB_ARCH"
break
fi
done
exit 0
else
exit 2
fi
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
unset BOOST_ARCH_PATH CGAL_ARCH_PATH GMP_ARCH_PATH MPFR_ARCH_PATH # Purge old
# CGAL, boost and gmp/mpfr versions from OpenFOAM etc/config.sh files.
# Get compiler first and let CGAL config override GMP and MPFR
_foamConfig compiler
_foamConfig CGAL
boostPACKAGE=${boost_version:-boost-system}
gmpPACKAGE=${gmp_version:-gmp-system}
@ -50,27 +79,19 @@ mpfrPACKAGE=${mpfr_version:-mpfr-system}
cgalPACKAGE=$cgal_version
#------------------------------------------------------------------------------
# Run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
Script="${0##*/}"
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: $Script [OPTION] [CGAL-VERSION] [boost-VERSION] [gmp-VERSION] [mpfr-VERSION]
usage: ${0##*/} [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
-gcc Force use of gcc/g++
-cmake PATH Use cmake from the given path
-no-lib Configure CGAL for headers-only mode (default OpenFOAM >= 2006)
-with-lib Configure CGAL with library
-toolset=NAME Use named toolset in bootstrap
-system Use system versions for boost/gmp/mpfr
-help
* build CGAL with
@ -82,61 +103,63 @@ options:
Normally builds against ThirdParty boost and gmp/mpfr when possible.
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
${0##*/} boost-system gmp-system
Use gmp-none to disable use of gmp/mpfr (eg, not available)
USAGE
showDownloadHint BOOST
showDownloadHint CGAL
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
exportCompiler # Compiler info for CMake/configure
unset optHeadersOnly
unset optHeadersOnly optToolset
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'')
# discard empty arguments
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
shift
;;
-toolset=*)
optToolset="${1#*=}"
;;
-sys*)
gmpPACKAGE="gmp-system"
mpfrPACKAGE="mpfr-system"
boostPACKAGE="boost-system"
unset BOOST_ARCH_PATH # avoid inconsistency
unset BOOST_ARCH_PATH GMP_ARCH_PATH MPFR_ARCH_PATH
;;
-no-lib)
optHeadersOnly=true
;;
gmp-[4-9]* | gmp-system | gmp-none)
-with-lib)
optHeadersOnly=false
;;
gmp-[0-9]* | gmp-system | gmp-none)
gmpPACKAGE="${1%%/}"
unset GMP_ARCH_PATH
;;
mpfr-[2-9]* | mpfr-system | mpfr-none)
mpfr-[0-9]* | mpfr-system | mpfr-none)
mpfrPACKAGE="${1%%/}"
;;
CGAL-[0-9]*)
cgalPACKAGE="${1%%/}"
unset CGAL_ARCH_PATH # avoid inconsistency
unset MPFR_ARCH_PATH
;;
boost-[0-9]* | boost_[0-9]* | boost-system )
boostPACKAGE="${1%%/}"
unset BOOST_ARCH_PATH # avoid inconsistency
unset BOOST_ARCH_PATH
;;
CGAL-[0-9]*)
cgalPACKAGE="${1%%/}"
unset CGAL_ARCH_PATH
;;
*)
die "unknown option/argument: '$1'"
@ -148,17 +171,36 @@ done
[ -n "$cgalPACKAGE" ] || die "The cgal-VERSION was not specified"
# Nothing to build
if _foamIsNone $boostPACKAGE
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
fi
# For OpenFOAM 1912 and earlier, no predefined default.
# Force headers-only *after* starting with OpenFOAM-v2006
if [ -z "$optHeadersOnly" ] && foamVersion=$(wmake -version 2>/dev/null)
then
if [ "${foamVersion:-0}" -gt 1912 ]
then
optHeadersOnly=true
fi
fi
# Headers-only - might be able to avoid gmp/mpfr?
## if [ "${optHeadersOnly:-false}" = true ]
## then
## gmpPACKAGE=none
## mpfrPACKAGE=none
## unset GMP_ARCH_PATH MPFR_ARCH_PATH
## fi
#------------------------------------------------------------------------------
#
# Build Boost
@ -170,41 +212,107 @@ fi
# BOOST_ARCH_PATH : installation directory
# BOOST_SOURCE_DIR : location of the original sources
BOOST_SOURCE_DIR=$sourceBASE/$boostPACKAGE
: ${BOOST_ARCH_PATH:=$installBASE/$boostPACKAGE} # Fallback
BOOST_SOURCE_DIR="$sourceBASE/$boostPACKAGE"
: "${BOOST_ARCH_PATH:=$installBASE/$boostPACKAGE}"
boostInc="$BOOST_ARCH_PATH/include"
boostLib="$BOOST_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
if _foamIsSystem $boostPACKAGE
if _foamIsSystem "$boostPACKAGE"
then
echo "Using boost-system (skip ThirdParty build of BOOST)"
# Tagged as 'system' but could actually point to a central location
[ -d "$BOOST_ARCH_PATH/include" ] || {
if [ -d "$boostInc" ]
then
if BOOST_ARCH_PATH=$(cd "$BOOST_ARCH_PATH" 2>/dev/null && pwd -P)
then
boostPACKAGE="${BOOST_ARCH_PATH##*/}"
else
echo "ERROR: bad path for BOOST_ARCH_PATH"
echo "stopping build"
exit 1
fi
libdir="$BOOST_ARCH_PATH/lib"
else
boostInc="/usr/include"
boostLib="/usr/lib$WM_COMPILER_LIB_ARCH"
}
libdir="/usr/lib"
fi
# Use lib/ when lib64/ does not exist
[ ! -d "$boostLib" -a -d "$libdir" ] && boostLib="$libdir"
elif [ -f "$boostInc/boost/version.hpp" ]
then
echo "Using $boostPACKAGE"
libdir="$BOOST_ARCH_PATH/lib"
# Use lib when lib64 does not exist
[ ! -d "$boostLib" -a -d "$libdir" ] && boostLib="$libdir"
else
echo "Starting build: $boostPACKAGE"
echo
# Absolute path for --libdir
(
cd $BOOST_SOURCE_DIR || exit 1
# Configuration options:
unset buildOpt
cd "$BOOST_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
rm -rf $BOOST_ARCH_PATH
case "$WM_COMPILER" in
(Arm*)
# Toolset for bootstrap
optToolset="gcc"
echo "using clang : arm : $(whichCC) ;" > user-config.jam
echo "using mpi ;" >> user-config.jam
# Toolset for build
buildOpt="--user-config=user-config.jam toolset=clang"
;;
(Mingw*)
# Toolset for bootstrap
optToolset="gcc"
echo "using gcc : mingw : $(whichCC) ;" > user-config.jam
# Toolset for build
buildOpt="--user-config=user-config.jam toolset=gcc"
buildOpt="$buildOpt target-os=windows release"
;;
(*)
# Toolset for bootstrap and build
if [ -z "$optToolset" ]
then
optToolset="$(whichCC)"
# Base names for gcc-8, clang-9 etc.
case "$optToolset" in
(clang*) optToolset=clang;;
(gcc*) optToolset=gcc;;
esac
fi
buildOpt="toolset=$optToolset"
;;
esac
./bootstrap.sh \
--prefix=$BOOST_ARCH_PATH \
--libdir=$boostLib \
--prefix="$BOOST_ARCH_PATH" \
--libdir="$boostLib" \
--with-libraries=thread \
--with-libraries=system \
&& ./bjam toolset=$WM_CC -j $WM_NCOMPPROCS install \
--with-toolset="$optToolset" \
&& ./b2 $buildOpt -j $WM_NCOMPPROCS install \
&& echo "Built: boost"
) || {
echo "Error building: boost"
@ -212,8 +320,9 @@ else
}
fi
# nothing left to build
if _foamIsSystem $cgalPACKAGE
# Nothing left to build
if _foamIsSystem "$cgalPACKAGE"
then
echo "Using cgal-system (skip ThirdParty build of CGAL)"
exit 0
@ -233,6 +342,67 @@ else
exit 1
fi
#------------------------------------------------------------------------------
#
# Build CGAL
# 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_BUILD_DIR : location of the build
# CGAL_ARCH_PATH : installation directory
CGAL_SOURCE_DIR="$sourceBASE/$cgalPACKAGE"
CGAL_BUILD_DIR="$buildBASE/$cgalPACKAGE"
: "${CGAL_ARCH_PATH:=$installBASE/$cgalPACKAGE}"
# gmp/mpfr are installed without compiler name
mpfrBASE="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH"
# Enable/disable gmp/mpfr together
if _foamIsNone "$gmpPACKAGE" || _foamIsNone "$mpfrPACKAGE"
then
GMP_ARCH_PATH=none
MPFR_ARCH_PATH=none
elif _foamIsSystem "$gmpPACKAGE" || _foamIsSystem "$mpfrPACKAGE"
then
# May really be system, but could also by a central installation
# Ensure everything is accurately recorded. Resolve paths etc.
if [ -d "$GMP_ARCH_PATH" ]
then
if GMP_ARCH_PATH=$(cd "$GMP_ARCH_PATH" 2>/dev/null && pwd -P)
then
gmpPACKAGE="${GMP_ARCH_PATH##*/}"
else
echo "ERROR: bad path for GMP_ARCH_PATH"
echo "stopping build"
exit 1
fi
else
GMP_ARCH_PATH=system
fi
if [ -d "$MPFR_ARCH_PATH" ]
then
if MPFR_ARCH_PATH=$(cd "$MPFR_ARCH_PATH" 2>/dev/null && pwd -P)
then
mpfrPACKAGE="${MPFR_ARCH_PATH##*/}"
else
echo "ERROR: bad path for MPFR_ARCH_PATH"
echo "stopping build"
exit 1
fi
else
MPFR_ARCH_PATH=system
fi
else
GMP_ARCH_PATH="$mpfrBASE/$gmpPACKAGE"
MPFR_ARCH_PATH="$mpfrBASE/$mpfrPACKAGE"
fi
#------------------------------------------------------------------------------
cat<<SUMMARY
@ -245,40 +415,6 @@ CGAL configuration
------------------
SUMMARY
#------------------------------------------------------------------------------
#
# Build CGAL
# 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_ARCH_PATH : installation directory
CGAL_SOURCE_DIR=$sourceBASE/$cgalPACKAGE
CGAL_BINARY_DIR=$buildBASE/$cgalPACKAGE
: ${CGAL_ARCH_PATH:=$installBASE/$cgalPACKAGE} # Fallback
# 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
#
@ -300,12 +436,12 @@ BOOST_VERSION=$BOOST_VERSION
CGAL_lib=lib$WM_COMPILER_LIB_ARCH
BOOST_lib=lib$WM_COMPILER_LIB_ARCH
CGAL_HEADER_ONLY=${optHeadersOnly:-false}
CGAL_HEADER_ONLY=${optHeadersOnly:-default}
BUILD_INFO
}
# compare expected vs what is extracted as KEY=... in text
# Compare expected vs what is extracted as KEY=... in text
# $1 = key
# $2 = expected
# $3 = text to extract from
@ -321,10 +457,11 @@ infoValueEq()
fi
}
# needs build
# Needs build
cgalIsCurrent()
{
local info=$(cat $buildInfoFile 2>/dev/null)
# Only need VAR=... (also avoids embedded '#' that bothers some shells)
local info=$(sed -n -e '/^[A-Z]/p' $buildInfoFile 2>/dev/null)
[ -n "$info" ] || return 1
local libDirName="lib$WM_COMPILER_LIB_ARCH"
@ -353,94 +490,135 @@ fi
(
# Remove any existing build folder and recreate
if [ -d $CGAL_BINARY_DIR ]
if [ -d "$CGAL_BUILD_DIR" ]
then
echo "removing old build directory"
echo " $CGAL_BINARY_DIR"
rm -rf $CGAL_BINARY_DIR
echo " $CGAL_BUILD_DIR"
rm -rf "$CGAL_BUILD_DIR"
fi
mkdir -p $CGAL_BINARY_DIR
mkdir -p "$CGAL_BUILD_DIR"
cd $CGAL_BINARY_DIR || exit 1
cd "$CGAL_BUILD_DIR" || exit
export GIT_DIR="$CGAL_SOURCE_DIR/.git" # Mask seeing our own git-repo
unset configBoost configGmp configMpfr
echo "----"
echo "Configuring $cgalPACKAGE with boost $BOOST_VERSION"
echo " Source : $CGAL_SOURCE_DIR"
echo " Build : $CGAL_BINARY_DIR"
echo " Build : $CGAL_BUILD_DIR"
echo " Target : $CGAL_ARCH_PATH"
# See http://doc.cgal.org/latest/Manual/installation.html
if _foamIsSystem $boostPACKAGE
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
echo " boost : ${BOOST_ARCH_PATH##*/}"
configBoost="-DBOOST_ROOT=$BOOST_ARCH_PATH"
else
echo " boost : system"
fi
## For system - possible that /usr/lib64 not being found?
## configBoost="-DBoost_LIBRARY_DIRS=$boostLib"
elif [ -d "$BOOST_ARCH_PATH" ]
then
echo " ThirdParty : boost"
echo " boost : $boostPACKAGE"
configBoost=$(cat <<CMAKE_OPTIONS
-DBoost_INCLUDE_DIR=$boostInc
-DBoost_LIBRARY_DIRS=$boostLib
-DBoost_THREAD_LIBRARY=$boostLib/libboost_thread.so
-DBoost_THREAD_LIBRARY_RELEASE=$boostLib/libboost_thread.so
-DBoost_SYSTEM_LIBRARY=$boostLib/libboost_system.so
-DBoost_SYSTEM_LIBRARY_RELEASE=$boostLib/libboost_system.so
-DBoost_THREAD_LIBRARY=$boostLib/libboost_thread$EXT_SO
-DBoost_THREAD_LIBRARY_RELEASE=$boostLib/libboost_thread$EXT_SO
-DBoost_SYSTEM_LIBRARY=$boostLib/libboost_system$EXT_SO
-DBoost_SYSTEM_LIBRARY_RELEASE=$boostLib/libboost_system$EXT_SO
-DBoost_VERSION=$BOOST_VERSION
CMAKE_OPTIONS
)
fi
if _foamIsSystem $GMP_ARCH_PATH
if _foamIsSystem "$GMP_ARCH_PATH"
then
echo " system : gmp"
elif _foamIsNone $GMP_ARCH_PATH
echo " gmp : system"
elif _foamIsNone "$GMP_ARCH_PATH"
then
echo " disabled : gmp"
configGmp="-DCGAL_DISABLE_GMP:BOOL=TRUE" # Also used for mpfr
echo " gmp : disabled"
configGmp="-DCGAL_DISABLE_GMP=TRUE" # Also used for mpfr
elif [ -d "$GMP_ARCH_PATH" ]
then
echo " ThirdParty : gmp"
configGmp=$(cat <<CMAKE_OPTIONS
echo " gmp : $gmpPACKAGE"
for libdir in \
$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
$GMP_ARCH_PATH/lib \
;
do
if [ -f "$libdir/libgmp$EXT_SO" ]
then
configGmp=$(cat <<CMAKE_OPTIONS
-DGMP_INCLUDE_DIR=$GMP_ARCH_PATH/include
-DGMP_LIBRARIES_DIR=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
-DGMP_LIBRARIES=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libgmp.so
-DGMPXX_INCLUDE_DIR=$GMP_ARCH_PATH/include
-DGMPXX_LIBRARIES=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libgmpxx.so
-DGMP_LIBRARIES_DIR=$libdir
-DGMP_LIBRARIES=$libdir/libgmp$EXT_SO
CMAKE_OPTIONS
)
break
fi
done
else
echo " system : gmp (did not find $GMP_ARCH_PATH)"
fi
if _foamIsSystem $MPFR_ARCH_PATH
if _foamIsSystem "$MPFR_ARCH_PATH"
then
echo " system : mpfr"
elif _foamIsNone $MPFR_ARCH_PATH
echo " mpfr : system"
elif _foamIsNone "$MPFR_ARCH_PATH"
then
echo " disabled : mpfr"
configGmp="-DCGAL_DISABLE_GMP:BOOL=TRUE" # Also used for mpfr
echo " mpfr : disabled"
configGmp="-DCGAL_DISABLE_GMP=TRUE" # Also used for mpfr
elif [ -d "$MPFR_ARCH_PATH" ]
then
echo " ThirdParty : mpfr"
configMpfr=$(cat <<CMAKE_OPTIONS
echo " mpfr : $mpfrPACKAGE"
for libdir in \
$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
$MPFR_ARCH_PATH/lib \
;
do
if [ -f "$libdir/libmpfr$EXT_SO" ]
then
configMpfr=$(cat <<CMAKE_OPTIONS
-DMPFR_INCLUDE_DIR=$MPFR_ARCH_PATH/include
-DMPFR_LIBRARIES_DIR=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
-DMPFR_LIBRARIES=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpfr.so
-DMPFR_LIBRARIES_DIR=$libdir
-DMPFR_LIBRARIES=$libdir/libmpfr$EXT_SO
CMAKE_OPTIONS
)
break
fi
done
else
echo " system : mpfr (did not find $MPFR_ARCH_PATH)"
echo " mpfr : system (did not find $MPFR_ARCH_PATH)"
fi
cmake=$(findCMake)
unset cmakeDefs
case "$WM_COMPILER" in
(Mingw*)
cmakeDefs="$cmakeDefs -DCMAKE_SYSTEM_NAME=Windows"
cmakeDefs="$cmakeDefs -DCMAKE_C_COMPILER=$(wmake -show-c)"
cmakeDefs="$cmakeDefs -DCMAKE_CXX_COMPILER=$(wmake -show-cxx)"
;;
esac
# Headers/library decision
case "$optHeadersOnly" in
(true | false)
cmakeDefs="$cmakeDefs -DCGAL_HEADER_ONLY=${optHeadersOnly}"
;;
esac
# For CGAL < 4.9, for installation into lib64/, not lib/
# Name only (not path) for CGAL_INSTALL_LIB_DIR
echo "----"
@ -449,13 +627,16 @@ CMAKE_OPTIONS
-DCMAKE_INSTALL_PREFIX=$CGAL_ARCH_PATH \
-DCGAL_INSTALL_LIB_DIR=lib$WM_COMPILER_LIB_ARCH \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_CGAL_Core=OFF \
-DWITH_CGAL_ImageIO=OFF \
-DWITH_CGAL_Qt5=OFF \
${optHeadersOnly:+-DCGAL_HEADER_ONLY=TRUE} \
$cmakeDefs \
$configBoost $configGmp $configMpfr \
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
$CGAL_SOURCE_DIR \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install || exit 1
set +x
echo "----"
echo "create '\$CGAL_ARCH_PATH/share/files'"
@ -472,7 +653,7 @@ CMAKE_OPTIONS
fi
done
# record our build-status
# Record our build-status
recordCGALinfo
echo "Done CGAL"

101
makeCmake
View File

@ -3,44 +3,40 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeCmake
#
# Description
# Build script for cmake
# Build script for cmake.
#
#------------------------------------------------------------------------------
# Special purpose script, no default version.
unset cmakePACKAGE
# The '-link' option can be used to create a 'cmake-system' pointing
# to this version.
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# 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."
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# Special purpose script - no default version.
unset cmakePACKAGE
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -49,32 +45,34 @@ usage() {
usage: ${0##*/} [OPTION] cmake-VERSION
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-force Force compilation, even if binary already exists
-gcc Force use of gcc/g++
-link Create additional symlink as 'cmake-system'
-help
* build cmake
${cmakePACKAGE:-'unspecified version'}
${cmakePACKAGE:-'unspecified'}
USAGE
showDownloadHint CMAKE
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/CC++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
exportCompiler # Compiler info for CMake/configure
unset optForce optLink
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
cmake-[1-9]*)
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
-link) optLink=true ;;
cmake-[0-9]*)
cmakePACKAGE="${1%%/}"
;;
*)
@ -86,6 +84,11 @@ done
[ -n "$cmakePACKAGE" ] || die "The cmake-VERSION was not specified"
if _foamIsSystem "$cmakePACKAGE"
then
unset optLink # basic sanity - cannot
fi
#------------------------------------------------------------------------------
#
# Build CMAKE
@ -95,7 +98,9 @@ done
CMAKE_SOURCE_DIR=$sourceBASE/$cmakePACKAGE
CMAKE_ARCH_PATH=$installBASE/$cmakePACKAGE
if [ -d "$CMAKE_ARCH_PATH" -a -r "$CMAKE_ARCH_PATH/bin/cmake" ]
if [ -z "$optForce" ] \
&& [ -d "$CMAKE_ARCH_PATH" ] \
&& [ -r "$CMAKE_ARCH_PATH/bin/cmake" ]
then
echo "Already built: $cmakePACKAGE"
else
@ -103,7 +108,8 @@ else
(
buildDIR=$buildBASE/$cmakePACKAGE
cd $CMAKE_SOURCE_DIR || exit 1
cd "$CMAKE_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $buildDIR
@ -121,4 +127,19 @@ else
}
fi
if [ "$optLink" = true ] && [ -x "$CMAKE_ARCH_PATH/bin/cmake" ]
then
(
cd "${CMAKE_ARCH_PATH%/*}" || exit
if [ -L cmake-system ]
then
rm cmake-system
elif [ -d cmake-system ]
then
exit 2
fi
ln -svf "$cmakePACKAGE" cmake-system
)
fi
#------------------------------------------------------------------------------

115
makeFFTW
View File

@ -3,24 +3,13 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeFFTW
@ -28,60 +17,77 @@
# Description
# Build script for FFTW
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Get FFTW versions
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW)
fftwPACKAGE=${fftw_version:-fftw-system}
# Dynamic library ending (default is .so)
[ "$(uname -s)" = Darwin ] && EXT_SO=.dylib || EXT_SO=.so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -d "$dir/include" ] \
&& [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ]
then
echo " fftw include: $dir/include"
echo " fftw library: $dir/lib$WM_COMPILER_LIB_ARCH"
exit 0
else
exit 2
fi
fi
#------------------------------------------------------------------------------
# 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."
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# FFTW version from OpenFOAM etc/config.sh file:
_foamConfig FFTW
fftwPACKAGE=${fftw_version:-fftw-system}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [fftw-VERSION]
usage: ${0##*/} [OPTION] [fftw-VERSION] [-- configure-options]
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-help
* build FFTW with
${fftwPACKAGE:-'unspecified FFTW version'}
USAGE
showDownloadHint FFTW
exit 1
}
#------------------------------------------------------------------------------
# Ensure configure gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
exportCompiler # Compiler info for CMake/configure
unset optForce
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'')
# discard empty arguments
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
fftw-[0-9]* | fftw_[0-9]* | fftw-system )
fftwPACKAGE="${1%%/}"
;;
@ -120,7 +126,8 @@ fi
FFTW_SOURCE_DIR=$sourceBASE/$fftwPACKAGE
FFTW_ARCH_PATH=$installBASE/$fftwPACKAGE
if [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3.so" ]
if [ -z "$optForce" ] \
&& [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ]
then
echo "Already has FFTW shared library"
else
@ -128,9 +135,22 @@ else
echo
(
# Configuration options:
unset configOpt
# Additional configure options
if [ "$1" = "--" ]
then
shift
configOpt="$configOpt $@"
fi
# End of configuration options
# ----------------------------
buildDIR=$buildBASE/$fftwPACKAGE
cd $FFTW_SOURCE_DIR || exit 1
cd "$FFTW_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
rm -rf $FFTW_ARCH_PATH
rm -rf $buildDIR
@ -143,9 +163,12 @@ else
--libdir=$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--enable-shared --disable-static \
--disable-fortran \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built $fftwPACKAGE"
$configOpt \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built $fftwPACKAGE" \
&& pkgconfigAdjust $FFTW_ARCH_PATH
) || {
echo "Error building: FFTW"
exit 1

156
makeGcc
View File

@ -3,24 +3,14 @@
# ========= |
# \\ / 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 | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeGcc
@ -40,13 +30,25 @@
#
# WM_COMPILER=Gcc51 ./makeGcc -system
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# get default GCC, mpfr, gmp and mpc versions
WM_COMPILER_TYPE=ThirdParty # ensure we get the correct compiler settings
: ${WM_COMPILER:=Gcc} # this will still fail if 'Clang' was set
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
unset GMP_ARCH_PATH MPFR_ARCH_PATH # Purge old
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
[ "${WM_COMPILER#Gcc}" = "$WM_COMPILER" ] && WM_COMPILER=Gcc # Force gcc
WM_COMPILER_TYPE=ThirdParty # Ensure we get the correct settings
# Default GCC, mpfr, gmp and mpc versions from OpenFOAM etc/config.sh file:
_foamConfig compiler
gmpPACKAGE=${gmp_version:-gmp-system}
mpfrPACKAGE=${mpfr_version:-mpfr-system}
@ -54,24 +56,15 @@ mpcPACKAGE=${mpc_version:-mpc-system}
gccPACKAGE=$gcc_version
#------------------------------------------------------------------------------
# Run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
Script=${0##*/}
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: $Script [OPTION] [gcc-VERSION] [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION]
usage: ${0##*/} [OPTION] [gcc-VERSION] [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION]
options:
-clang Force clang/clang++ for building
-m32 | -m64 32-bit or 64-bit (default) ABI
-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)
@ -85,9 +78,15 @@ options:
${gccPACKAGE:-'unspecified GCC version'}
USAGE
showDownloadHint GCC
showDownloadHint GMP
showDownloadHint MPFR
showDownloadHint MPC
exit 1
}
#------------------------------------------------------------------------------
optArch=64 # Use 64-bit ABI
# Build 32-bit libraries on 64-bit systems (normally not needed)
optMultilib=disable
unset optThreadSafe # unset=auto
@ -96,8 +95,15 @@ unset optThreadSafe # unset=auto
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
'') ;; # Ignore empty
-h | -help) usage ;;
-clang) # Force use of clang/clang++ for building
export CC=clang
export CXX=clang++
;;
-m32 | -m64)
optArch="${1#*m}"
;;
-multi*)
optMultilib=enable
@ -112,19 +118,25 @@ do
gmpPACKAGE="gmp-system"
mpfrPACKAGE="mpfr-system"
mpcPACKAGE="mpc-system"
unset GMP_ARCH_PATH MPFR_ARCH_PATH
;;
gmp-[4-9]* | gmp-system)
gmp-[0-9]* | gmp-system)
gmpPACKAGE="${1%%/}"
unset GMP_ARCH_PATH
;;
mpfr-[2-9]* | mpfr-system)
mpfr-[0-9]* | mpfr-system)
mpfrPACKAGE="${1%%/}"
unset MPFR_ARCH_PATH
;;
mpc-[0-9]* | mpc-system)
mpcPACKAGE="${1%%/}"
;;
gcc-[4-9]* | gcc-system)
gcc-[0-9]* | gcc-system)
gccPACKAGE="${1%%/}"
;;
[0-9]*)
gccPACKAGE="gcc-${1%%/}"
;;
*)
die "unknown option/argument: '$1'"
;;
@ -138,23 +150,15 @@ cat<<SUMMARY
GCC configuration
------------------
GCC = $gccPACKAGE
ABI = $optArch
GMP = $gmpPACKAGE
MPFR = $mpfrPACKAGE
MPC = $mpcPACKAGE
------------------
Using CC = $CC $CFLAGS
Using CXX = $CXX $CXXFLAGS
SUMMARY
# Set 32 or 64 bit ABI
case "$WM_ARCH_OPTION" in
32 | 64)
ABI=$WM_ARCH_OPTION
;;
*)
die "The WM_ARCH_OPTION ($WM_ARCH_OPTION) must be 32 or 64"
;;
esac
#------------------------------------------------------------------------------
# Build/install without compiler name
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
@ -165,12 +169,24 @@ GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
# Prefix <dir> to LD_LIBRARY_PATH, if it exists. 0 on success, 1 on failure
addLib()
{
if [ -d "$1" ]
then
export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
return 0
else
return 1
fi
}
# ================
# Build GMP
# ================
echo "---------------"
if [ -d $GMP_ARCH_PATH ]
if [ -d "$GMP_ARCH_PATH" ]
then
echo "Already built: $gmpPACKAGE"
elif _foamIsSystem $GMP_ARCH_PATH
@ -183,7 +199,8 @@ else
sourceDIR=$sourceBASE/$gmpPACKAGE
buildDIR=$buildBASE/$gmpPACKAGE
cd $sourceDIR || exit 1
cd "$sourceDIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $buildDIR
@ -191,10 +208,11 @@ else
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
$sourceDIR/configure ABI=$optArch \
--prefix=$GMP_ARCH_PATH \
--libdir=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--enable-cxx \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gmpPACKAGE"
@ -204,10 +222,8 @@ else
}
fi
if [ -d "$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" ]
if addLib "$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
@ -222,7 +238,7 @@ fi
# Build MPFR
# ================
echo "---------------"
if [ -d $MPFR_ARCH_PATH ]
if [ -d "$MPFR_ARCH_PATH" ]
then
echo "Already built: $mpfrPACKAGE"
elif _foamIsSystem $MPFR_ARCH_PATH
@ -235,7 +251,8 @@ else
sourceDIR=$sourceBASE/$mpfrPACKAGE
buildDIR=$buildBASE/$mpfrPACKAGE
cd $sourceDIR || exit 1
cd "$sourceDIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $buildDIR
@ -247,10 +264,11 @@ else
[ -n "$optThreadSafe" ] && configOpt="--${optThreadSafe}-thread-safe"
set -x
$sourceDIR/configure ABI=$ABI \
$sourceDIR/configure ABI=$optArch \
--prefix=$MPFR_ARCH_PATH \
--libdir=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
$configGMP $configOpt \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpfrPACKAGE"
@ -260,10 +278,8 @@ else
}
fi
if [ -d "$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" ]
if addLib "$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
@ -278,7 +294,7 @@ fi
# Build MPC
# ================
echo "---------------"
if [ -d $MPC_ARCH_PATH ]
if [ -d "$MPC_ARCH_PATH" ]
then
echo "Already built: $mpcPACKAGE"
elif _foamIsSystem $MPC_ARCH_PATH
@ -291,7 +307,8 @@ else
sourceDIR=$sourceBASE/$mpcPACKAGE
buildDIR=$buildBASE/$mpcPACKAGE
cd $sourceDIR || exit 1
cd "$sourceDIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $buildDIR
@ -299,10 +316,11 @@ else
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
$sourceDIR/configure ABI=$optArch \
--prefix=$MPC_ARCH_PATH \
--libdir=$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
$configGMP $configMPFR \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpcPACKAGE"
@ -312,10 +330,8 @@ else
}
fi
if [ -d "$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" ]
if addLib "$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
@ -334,7 +350,7 @@ fi
# or specify -no-multilib on the command-line
#
echo "---------------"
if [ -d $GCC_ARCH_PATH ]
if [ -d "$GCC_ARCH_PATH" ]
then
echo "Already built: $gccPACKAGE"
elif _foamIsSystem $GCC_ARCH_PATH
@ -347,7 +363,8 @@ else
sourceDIR=$sourceBASE/$gccPACKAGE
buildDIR=$buildBASE/$gccPACKAGE
cd $sourceDIR || exit 1
cd "$sourceDIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $buildDIR
@ -368,6 +385,7 @@ else
--with-system-zlib \
$configGMP $configMPFR $configMPC $configOpt \
MAKEINFO=missing \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gccPACKAGE"

View File

@ -3,24 +3,14 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2012 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeGperftools
@ -28,24 +18,24 @@
# Description
# Build script for gperftools
#
#------------------------------------------------------------------------------
# Get gperftools version
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools)
gperftoolsPACKAGE=${gperftools_version:-gperftools-system}
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# 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."
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# Gperftools version from OpenFOAM etc/config.sh file:
_foamConfig gperftools
gperftoolsPACKAGE=${gperftools_version:-gperftools-system}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -54,31 +44,27 @@ usage() {
usage: ${0##*/} [gperftools-VERSION]
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-gcc Force use of gcc/g++
-help
* build gperftools
$gperftoolsPACKAGE
USAGE
showDownloadHint GPERFTOOLS
exit 1
}
#------------------------------------------------------------------------------
# Ensure configure gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
exportCompiler # Compiler info for CMake/configure
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
gperftools-[0-9]* | gperftools-svn* | gperftools-git)
gperftoolsPACKAGE="${1%%/}"
;;
@ -118,9 +104,9 @@ else
(
buildDIR=$buildBASE/$gperftoolsPACKAGE
cd $GPERFTOOLS_SOURCE_DIR || exit 1
make distclean 2>/dev/null
cd "$GPERFTOOLS_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
[ -e Makefile ] && make distclean 2>/dev/null
rm -rf $GPERFTOOLS_ARCH_PATH
rm -rf $buildDIR
@ -130,6 +116,7 @@ else
set -x
$GPERFTOOLS_SOURCE_DIR/configure \
--prefix=$GPERFTOOLS_ARCH_PATH \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $gperftoolsPACKAGE" \

154
makeHYPRE Executable file
View File

@ -0,0 +1,154 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeHYPRE
#
# Description
# Build script for HYPRE
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
_foamConfig hypre
hyprePACKAGE="${hypre_version:-hypre-system}"
targetType=libso
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [lib|libso] [HYPRE-VERSION] [-- configure-options]
options:
-force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-help
* build HYPRE with
${hyprePACKAGE:-'unspecified hypre version'}
USAGE
showDownloadHint HYPRE
exit 1
}
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
unset optForce
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
lib|libso)
targetType="$1"
;;
hypre-[0-9]* | hypre-git)
hyprePACKAGE="${1%%/}"
unset HYPRE_ARCH_PATH # Avoid inconsistency
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$hyprePACKAGE" ] || die "The hypre-VERSION was not specified"
# Nothing to build
if _foamIsNone "$hyprePACKAGE"
then
echo "Using hypre-none (skip ThirdParty build of HYPRE)"
exit 0
elif _foamIsSystem "$hyprePACKAGE"
then
echo "Using hypre-system"
exit 0
fi
#------------------------------------------------------------------------------
#
# Build HYPRE
#
# HYPRE_ARCH_PATH : installation directory
# HYPRE_SOURCE_DIR : location of the original sources
HYPRE_SOURCE_DIR="$sourceBASE/$hyprePACKAGE"
: "${HYPRE_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$hyprePACKAGE}"
[ -d "$HYPRE_SOURCE_DIR" ] || {
echo "Missing sources: '$hyprePACKAGE'"
showDownloadHint HYPRE
exit 1
}
# Compilers
CC="$(whichMpicc)"
CXX="$(whichMpicxx)"
echo "Starting build: $hyprePACKAGE ($targetType)"
echo
(
# Configuration options
unset configOpt
# Additional configure options
if [ "$1" = "--" ]
then
shift
configOpt="$configOpt $@"
fi
cd "$HYPRE_SOURCE_DIR/src" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
rm -rf "$HYPRE_ARCH_PATH"
[ -e Makefile ] && make distclean 2>/dev/null
./configure \
--prefix="$HYPRE_ARCH_PATH" \
--disable-fortran \
--enable-shared \
$configOpt \
&& make -j $WM_NCOMPPROCS \
&& echo "Built: hypre" \
&& make install \
&& echo "Installed: hypre"
) || {
echo "Error building: hypre"
exit 1
}
#------------------------------------------------------------------------------

234
makeKAHIP Executable file
View File

@ -0,0 +1,234 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2017-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeKAHIP
#
# Description
# Build the KaHIP library (int32 only).
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library ending (default is .so)
[ "$(uname -s)" = Darwin ] && EXT_SO=.dylib || EXT_SO=.so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -d "$dir/include" ]
then
for lib in \
$FOAM_EXT_LIBBIN/libkahip$EXT_SO \
$dir/lib/libkahip.a \
$dir/lib/libkahip$EXT_SO \
$dir/lib$WM_COMPILER_LIB_ARCH/libkahip.a \
$dir/lib$WM_COMPILER_LIB_ARCH/libkahip$EXT_SO \
;
do
if [ -r "$lib" ]
then
echo " kahip include: $dir/include"
echo " kahip library: ${lib%/*}"
exit 0
fi
done
fi
exit 2
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
_foamConfig kahip
kahipPACKAGE=${KAHIP_VERSION:-kahip-system}
targetType=libso
#------------------------------------------------------------------------------
usage()
{
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
/bin/cat<<USAGE
Usage: ${0##*/} [OPTION] [lib|libso] [kahip-VERSION]
options:
-gcc Force use of gcc/g++
-force Force build attempt (mingw)
-cmake PATH With cmake from the given path
-help
* Compile KaHIP
$kahipPACKAGE
USAGE
showDownloadHint KAHIP
exit 1
}
#------------------------------------------------------------------------------
exportCompiler minimal # Minimal compiler info for CMake/configure
unset optForce
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
shift
;;
lib|libso)
targetType="$1"
;;
kahip-[0-9]* | kahip-git | KaHIP_* | KaHIP-[0-9]*)
kahipPACKAGE="${1%%/}"
unset KAHIP_ARCH_PATH # Avoid inconsistency
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$kahipPACKAGE" ] || die "The kahip-VERSION was not specified"
# Nothing to build
if _foamIsNone $kahipPACKAGE
then
echo "Using kahip-none (skip ThirdParty build of KAHIP)"
exit 0
elif _foamIsSystem $kahipPACKAGE
then
echo "Using kahip-system"
exit 0
fi
# Known build issues for mingw (uses some non-portable headers)
case "$WM_COMPILER" in
(Mingw*)
if [ "$optForce" = true ]
then
echo "Warning: kahip - known compilation issues with $WM_COMPILER"
else
echo "Skipping kahip - known compilation issues with $WM_COMPILER"
exit 0
fi
;;
esac
requireWMakeToolchain
requireExtLibBin
#------------------------------------------------------------------------------
#
# Build KaHIP
#
# KAHIP_ARCH_PATH : installation directory
# KAHIP_SOURCE_DIR : location of the original sources
KAHIP_SOURCE_DIR=$sourceBASE/$kahipPACKAGE
KAHIP_ARCH_PATH=$installBASE/$kahipPACKAGE
[ -d "$KAHIP_SOURCE_DIR" ] || {
echo "Missing sources: '$kahipPACKAGE'"
showDownloadHint KAHIP
exit 2
}
#
# Manual installation
#
install()
{
# Ensure a clean build next time
wclean
local bindir=$KAHIP_ARCH_PATH/bin
local incdir=$KAHIP_ARCH_PATH/include
local libdir=$KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
mkdir -m 0755 -p $incdir
/bin/cp -pv \
$KAHIP_SOURCE_DIR/interface/kaHIP_interface.h \
$incdir
}
# Newer KAHIP (>= 2.11) uses CMake,
# but unfortunately does not install include/
# nor pass through flags for 64bit indices in the header.
withCmake=true
version=$(echo "$kahipPACKAGE" | sed -e 's/^kahip[-_]*//i')
case "$version" in 2.0*) unset withCmake;; esac
if true
then
(
echo "Starting build: $kahipPACKAGE ($targetType) using wmake"
echo
cd "$KAHIP_SOURCE_DIR/lib" || exit
export GIT_DIR="$KAHIP_SOURCE_DIR/.git" # Mask seeing our own git-repo
rm -rf "$KAHIP_ARCH_PATH"
rm -f "$FOAM_EXT_LIBBIN/libkahip$EXT_SO"
libdir=$KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
cpMakeFiles kahip 2>/dev/null
if [ -e ../interface ] && [ ! -e interface ]
then
ln -s ../interface interface
fi
# Place static libraries in sub-directory:
if [ "$targetType" = lib ]
then
mkdir -m 0755 -p $libdir 2>/dev/null
export FOAM_EXT_LIBBIN=$libdir
fi
# Location of lib sources for wmake
export KAHIP_LIB_SRC=$PWD
wmake -j $WM_NCOMPPROCS -s $targetType \
&& echo "Built: kahip" \
&& install
) || {
echo "Error building: kahip"
exit 1
}
fi
#------------------------------------------------------------------------------

142
makeLLVM
View File

@ -3,24 +3,14 @@
# ========= |
# \\ / 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 | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeLLVM
@ -30,45 +20,43 @@
#
# Note
# - Ensure that you always use matching versions between llvm and clang.
# - The LLVM components reside in the LLVM tools/ subdirectory
# - LLVM components such as clang reside in the LLVM tools/ subdirectory
#
# Example, building from svn repository:
# 1) Checkout LLVM:
# svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm-svn
# For example, when building from tar files (version 4.0.0)
#
# 2) Checkout Clang, in the correct location
# cd llvm-svn/tools
# svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
# cd -
# 1) Unpack LLVM:
# tar -xJf llvm-4.0.1.src.tar.xz
# mv llvm-4.0.1.src llvm-4.0.1
#
# Example, building from tar files (version 3.8.0)
# - Unpack LLVM:
# tar -Jvf llvm-3.8.0.src.tar.xz
# mv llvm-3.8.0.src llvm-3.8.0
# 2) Unpack Clang (also know as cfe):
# tar -xJf cfe-4.0.1.src.tar.xz
# mv cfe-4.0.1.src llvm-4.0.1/tools/clang
#
# - Unpack Clang (also know as cfe):
# tar -Jvf cfe-3.8.0.src.tar.xz
# mv cfe-3.8.0.src llvm-3.8.0/tools/clang
# 3) Unpack openmp (optional):
# tar -xJf openmp-4.0.1.src.tar.xz
# mv openmp-4.0.1.src llvm-4.0.1/tools/openmp
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Get default llvm/clang version
WM_COMPILER_TYPE=ThirdParty # ensure we get the correct compiler settings
WM_COMPILER=Clang # force values for 'clang'
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
llvmPACKAGE=$clang_version
#------------------------------------------------------------------------------
# run from third-party directory only
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."
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
[ "${WM_COMPILER#Clang}" = "$WM_COMPILER" ] && WM_COMPILER=Clang # Force clang
WM_COMPILER_TYPE=ThirdParty # Ensure we get the correct settings
# LLVM/Clang version from OpenFOAM etc/config.sh file:
_foamConfig compiler
llvmPACKAGE=$clang_version
#------------------------------------------------------------------------------
usage() {
exec 1>&2
@ -77,32 +65,28 @@ usage() {
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
-gcc Force use of gcc/g++
-cmake PATH with cmake from the given path
-help
* build llvm/clang
${llvmPACKAGE:-'unspecified LLVM version'}
USAGE
showDownloadHint LLVM
exit 1
}
#-----------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
CMAKE_PATH="${2%%/}"
@ -111,6 +95,9 @@ do
llvm-[0-9]* | llvm-svn*)
llvmPACKAGE="${1%%/}"
;;
[0-9]*)
llvmPACKAGE="llvm-${1%%/}"
;;
*)
die "unknown option/argument: '$1'"
;;
@ -127,12 +114,12 @@ installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
# Build LLVM (clang)
# LLVM_SOURCE_DIR : location of the original sources
# LLVM_BINARY_DIR : location of the build
# LLVM_BUILD_DIR : location of the build
# LLVM_ARCH_PATH : location of the installed program
# - Strip any trailing '.src' from the proper names
LLVM_SOURCE_DIR=$sourceBASE/$llvmPACKAGE
LLVM_BINARY_DIR=$buildBASE/${llvmPACKAGE%%.src}
LLVM_BUILD_DIR=$buildBASE/${llvmPACKAGE%%.src}
LLVM_ARCH_PATH=$installBASE/${llvmPACKAGE%%.src}
#
@ -150,19 +137,21 @@ then
echo "Starting build: $llvmPACKAGE (using configure)"
echo
(
cd $LLVM_SOURCE_DIR || exit 1
cd "$LLVM_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
make distclean 2>/dev/null
rm -rf $LLVM_BINARY_DIR
mkdir -p $LLVM_BINARY_DIR
cd $LLVM_BINARY_DIR
rm -rf $LLVM_BUILD_DIR
mkdir -p $LLVM_BUILD_DIR
cd $LLVM_BUILD_DIR
set -x
$LLVM_SOURCE_DIR/configure \
--prefix=$LLVM_ARCH_PATH \
--with-gcc-toolchain=$(which gcc | sed s%/bin/gcc%%) \
--with-gcc-toolchain="$(command -v gcc | sed 's%/bin/gcc%%')" \
--enable-optimized \
--enable-shared \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $llvmPACKAGE"
@ -177,11 +166,20 @@ else
echo "Starting build: $llvmPACKAGE (using cmake)"
echo
(
cd $LLVM_SOURCE_DIR || exit 1
# Configuration options:
unset configOpt
rm -rf $LLVM_BINARY_DIR
mkdir -p $LLVM_BINARY_DIR
cd $LLVM_BINARY_DIR
cd "$LLVM_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
if [ -f tools/openmp/CMakeLists.txt ]
then
configOpt="$configOpt -DLLVM_TOOL_OPENMP_BUILD=ON"
fi
rm -rf $LLVM_BUILD_DIR
mkdir -p $LLVM_BUILD_DIR
cd $LLVM_BUILD_DIR
cmake=$(findCMake)
@ -189,8 +187,10 @@ else
$cmake \
-DCMAKE_INSTALL_PREFIX=$LLVM_ARCH_PATH \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_SHARED_LIBS=ON \
$configOpt \
$LLVM_SOURCE_DIR \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $llvmPACKAGE"

191
makeMETIS Executable file
View File

@ -0,0 +1,191 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2017-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeMETIS
#
# Description
# Build script for METIS
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library ending (default is .so)
[ "$(uname -s)" = Darwin ] && EXT_SO=.dylib || EXT_SO=.so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -d "$dir/include" ]
then
for lib in \
$FOAM_EXT_LIBBIN/libmetis$EXT_SO \
$dir/lib/libmetis.a \
$dir/lib/libmetis$EXT_SO \
$dir/lib$WM_COMPILER_LIB_ARCH/libmetis.a \
$dir/lib$WM_COMPILER_LIB_ARCH/libmetis$EXT_SO \
;
do
if [ -r "$lib" ]
then
echo " metis include: $dir/include"
echo " metis library: ${lib%/*}"
exit 0
fi
done
fi
exit 2
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
_foamConfig metis
metisPACKAGE=${METIS_VERSION:-metis-system}
targetType=libso
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [lib|libso] [METIS-VERSION]
options:
-gcc Force use of gcc/g++
-help
* build METIS with
${metisPACKAGE:-'unspecified metis version'}
USAGE
showDownloadHint METIS
exit 1
}
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
lib|libso)
targetType="$1"
;;
metis-[0-9]*)
metisPACKAGE="${1%%/}"
unset METIS_ARCH_PATH # Avoid inconsistency
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$metisPACKAGE" ] || die "The metis-VERSION was not specified"
# Nothing to build
if _foamIsNone $metisPACKAGE
then
echo "Using metis-none (skip ThirdParty build of METIS)"
exit 0
elif _foamIsSystem $metisPACKAGE
then
echo "Using metis-system"
exit 0
fi
requireExtLibBin
#------------------------------------------------------------------------------
#
# Build METIS
#
# METIS_ARCH_PATH : installation directory
# METIS_SOURCE_DIR : location of the original sources
METIS_SOURCE_DIR=$sourceBASE/$metisPACKAGE
: "${METIS_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$metisPACKAGE}"
[ -d "$METIS_SOURCE_DIR" ] || {
echo "Missing sources: '$metisPACKAGE'"
showDownloadHint METIS
exit 2
}
#
# Manual installation (of library)
#
install()
{
local libdir=$METIS_ARCH_PATH/lib
if [ "$targetType" = libso ]
then
\mv $libdir/libmetis$EXT_SO $FOAM_EXT_LIBBIN
rmdir $libdir 2>/dev/null # Failed rmdir is uncritical
echo "Installing: $FOAM_EXT_LIBBIN/libmetis$EXT_SO"
fi
return 0
}
echo "Starting build: $metisPACKAGE ($targetType)"
echo
(
# Configuration options:
unset configOpt
if [ "$targetType" = libso ]
then
configOpt="shared=1"
fi
cd "$METIS_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
rm -rf $METIS_ARCH_PATH
rm -f $FOAM_EXT_LIBBIN/libmetis$EXT_SO
# Adjust metis integer size to match OpenFOAM label-size
sed -i -e 's=\(#define IDXTYPEWIDTH\).*=\1 '$WM_LABEL_SIZE'=' \
include/metis.h
# No config option for the library location.
# - build normally and use mv to relocate it
make config $configOpt prefix=$METIS_ARCH_PATH \
&& make -j $WM_NCOMPPROCS install \
&& echo "Built: metis" \
&& install
) || {
echo "Error building: metis"
exit 1
}
#------------------------------------------------------------------------------

178
makeMGridGen Executable file
View File

@ -0,0 +1,178 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2017-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeMGridGen
#
# Description
# Build script for MGridGen (serial)
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from ThirdParty directory only
cd "${0%/*}" || exit
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
#------------------------------------------------------------------------------
# mgridgen version from OpenFOAM etc/config.sh file:
_foamConfig mgridgen
mgridgenPACKAGE=${MGRIDGEN_VERSION:-mgridgen-none}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [mgridgen-VERSION]
options:
-force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-help
* Build MGridGen
$mgridgenPACKAGE
USAGE
# showDownloadHint GRIDGEN
exit 1
}
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
unset optForce
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
mgridgen-[0-9]* | MGridGen-[0-9]* | parmgridgen-[0-9]* | ParMGridGen-[0-9]*)
mgridgenPACKAGE="${1%%/}"
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$mgridgenPACKAGE" ] || die "The mgridgen-VERSION was not specified"
# Nothing to build
if _foamIsNone "$mgridgenPACKAGE"
then
echo "Using mgridgen-none (skip ThirdParty build of MGridGen)"
exit 0
elif _foamIsSystem "$mgridgenPACKAGE"
then
echo "Using mgridgen-system"
exit 0
fi
#------------------------------------------------------------------------------
#
# Build MGridGen
# MGRIDGEN_SOURCE_DIR : location of the original sources
# MGRIDGEN_ARCH_PATH : installation directory
MGRIDGEN_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$mgridgenPACKAGE
MGRIDGEN_ARCH_PATH="$installBASE$WM_SIZE_OPTIONS/$mgridgenPACKAGE"
: ${FOAM_MPI:=dummy}
echo
echo ========================================
echo "Build mgridgen library $mgridgenPACKAGE"
echo
#
# Manual installation
#
install()
{
echo "Install into $MGRIDGEN_ARCH_PATH"
local bindir=$MGRIDGEN_ARCH_PATH/bin
local incdir=$MGRIDGEN_ARCH_PATH/include
local libdir=$MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
for dir in $MGRIDGEN_ARCH_PATH $bindir $incdir $libdir
do
mkdir -m 0755 -p $dir
done
cp -vf mgridgen.h $incdir
cp -vf libmgrid.a $libdir
cp -vf mgridgen $bindir
chmod -R 0644 $incdir/* $libdir/*
chmod -R 0755 $bindir/*
}
# Needs future adjustment
# - for shared library
# - for mpi-specific library locations
if [ -z "$optForce" ] \
&& [ -f "$MGRIDGEN_ARCH_PATH/include/mgridgen.h" \
&& [ -r "$MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmgrid.a" ]
then
echo " MGridGen header in $MGRIDGEN_ARCH_PATH/include"
echo " MGridGen libs in $MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" # static
echo
else
(
cd "$MGRIDGEN_SOURCE_DIR" || exit
[ -e Makefile ] && make realclean 2>/dev/null
# Remove any existing build folder and recreate
rm -rf $MGRIDGEN_ARCH_PATH
serial="$(whichCC)" # CC (serial compiler) default=gcc
# parallel=$(whichMpicc) # PARCC (parallel compiler) default=mpicc
# PARCC=$parallel
# PARLD=$parallel
# PARLIBS="-L../.. -lparmgrid -lmgrid -lm"
make \
COPTIONS="-fPIC" \
LDOPTIONS="-fPIC" \
CC="$serial" \
LD="$serial" \
LIBDIR="-L../.." \
LIBS="-L../.. -lmgrid -lm" \
make=make \
serial \
&& install \
&& echo "Built: $mgridgenPACKAGE"
) || {
echo "Error building: $mgridgenPACKAGE"
exit 1
}
fi
#------------------------------------------------------------------------------

190
makeMPICH Executable file
View File

@ -0,0 +1,190 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2017-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeMPICH
#
# Description
# Build script for mpich [unmaintained]
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library ending (default is .so)
[ "$(uname -s)" = Darwin ] && EXT_SO=.dylib || EXT_SO=.so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Have mpich shared library (${dir##*/})"
exit 0
elif [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo "Have mpich static library (${dir##*/})"
exit 0
else
echo "No mpich libraries found: ${dir:-not-specified}"
exit 2
fi
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
# Transition
# ~~~~~~~~~~
_foamAddLib() { true; }
_foamAddMan() { true; }
_foamAddPath() { true; }
#------------------------------------------------------------------------------
WM_MPLIB=MPICH # Ensure we get the correct MPI
# mpich version from OpenFOAM etc/config.sh file:
_foamConfig mpi
mpiPACKAGE=${FOAM_MPI:-mpich-system}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [mpich-VERSION] [-- configure-options]
options:
-force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-help
* build mpich with
${mpiPACKAGE:-'unspecified mpich version'}
USAGE
showDownloadHint MPICH
exit 1
}
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
unset optForce
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
mpich*)
mpiPACKAGE="${1%%/}"
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$mpiPACKAGE" ] || die "The mpich-VERSION was not specified"
# Nothing to build
if _foamIsNone "$mpiPACKAGE"
then
echo "Using mpich-none (skip ThirdParty build of mpich)"
exit 0
elif _foamIsSystem "$mpiPACKAGE"
then
echo "Using mpich-system (skip ThirdParty build of mpich)"
exit 0
fi
#------------------------------------------------------------------------------
#
# Build mpich
#
# MPI_SOURCE_DIR : location of the original sources
# MPI_ARCH_PATH : installation directory
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
if [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Already has shared library"
elif [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo "Already has static library"
else
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
echo
(
# Configuration options:
unset configOpt
# Additional configure options
if [ "$1" = "--" ]
then
shift
configOpt="$configOpt $@"
fi
# End of configuration options
# ----------------------------
buildDIR=$buildBASE/$mpiPACKAGE
cd "$MPI_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
[ -e Makefile ] && make distclean 2>/dev/null
rm -rf $MPI_ARCH_PATH
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$MPI_SOURCE_DIR/configure \
--prefix=$MPI_ARCH_PATH \
--disable-fortran --disable-g \
--libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--enable-shared --disable-static \
$configOpt \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpiPACKAGE" \
&& pkgconfigAdjust $MPI_ARCH_PATH
) || {
echo "Error building: $mpiPACKAGE"
exit 1
}
fi
#------------------------------------------------------------------------------

194
makeMVAPICH Executable file
View File

@ -0,0 +1,194 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2019-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeMVAPICH2
#
# Description
# Build script for mvapich2 [unmaintained]
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library ending (default is .so)
[ "$(uname -s)" = Darwin ] && EXT_SO=.dylib || EXT_SO=.so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Have mpich shared library (${dir##*/})"
exit 0
elif [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo "Have mpich static library (${dir##*/})"
exit 0
else
echo "No mpich libraries found: ${dir:-not-specified}"
exit 2
fi
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
# Transition
# ~~~~~~~~~~
_foamAddLib() { true; }
_foamAddMan() { true; }
_foamAddPath() { true; }
#------------------------------------------------------------------------------
WM_MPLIB=MV2MPI # Ensure we get the correct MPI
# mvapich2 version from OpenFOAM etc/config.sh file:
_foamConfig mpi
mpiPACKAGE=${FOAM_MPI:-mvapich2-system}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [mvapich2-VERSION] [-- configure-options]
options:
-force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-help
* build mvapich2 with
${mpiPACKAGE:-'unspecified mpich version'}
The additional configure-options could include, for example,
${0##*/} -- --disable-mcast
USAGE
showDownloadHint MVAPICH
exit 1
}
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
unset optForce
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
mvapich*)
mpiPACKAGE="${1%%/}"
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$mpiPACKAGE" ] || die "The mvapich-VERSION was not specified"
# Nothing to build
if _foamIsNone "$mpiPACKAGE"
then
echo "Using mvapich-none (skip ThirdParty build of mvapich)"
exit 0
elif _foamIsSystem "$mpiPACKAGE"
then
echo "Using mvapich-system (skip ThirdParty build of mvapich)"
exit 0
fi
#------------------------------------------------------------------------------
#
# Build mvapich
#
# MPI_SOURCE_DIR : location of the original sources
# MPI_ARCH_PATH : installation directory
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
if [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Already has shared library"
elif [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo "Already has static library"
else
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
echo
(
# Configuration options:
unset configOpt
# Additional configure options
if [ "$1" = "--" ]
then
shift
configOpt="$configOpt $@"
fi
# End of configuration options
# ----------------------------
buildDIR=$buildBASE/$mpiPACKAGE
cd "$MPI_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
[ -e Makefile ] && make distclean 2>/dev/null
rm -rf $MPI_ARCH_PATH
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$MPI_SOURCE_DIR/configure \
--prefix=$MPI_ARCH_PATH \
--disable-fortran --disable-g \
--libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--enable-shared --disable-static \
$configOpt \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpiPACKAGE" \
&& pkgconfigAdjust $MPI_ARCH_PATH
) || {
echo "Error building: $mpiPACKAGE"
exit 1
}
fi
#------------------------------------------------------------------------------

204
makeMesa
View File

@ -3,24 +3,13 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2016-2019 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeMesa
@ -32,62 +21,90 @@
# 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.
# Building with mesa-11.x, mesa-13.x and mesa-17.x seems to be okay.
#
#------------------------------------------------------------------------------
# Special purpose script, no default version.
unset mesaPACKAGE
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# 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."
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
unset vtk_version mesa_version mesa_llvm # Purge current values
# mesa version from OpenFOAM etc/config.sh file:
_foamConfig vtk
mesaPACKAGE=$mesa_version
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] mesa-VERSION
usage: ${0##*/} [OPTION] mesa-VERSION [-- configure-options]
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-gcc Force use of gcc/g++
-llvm VER llvm version (in ThirdParty) or 'system' to use system
-help
* build Mesa with
${mesaPACKAGE:-'unspecified MESA version'}
USAGE
showDownloadHint MESA
exit 1
}
#------------------------------------------------------------------------------
# Ensure configure gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
exportCompiler # Compiler info for CMake/configure
unset withLLVM
# Non-standard location for clang?
unset thirdPartyClang
if [ "$WM_COMPILER_TYPE" = ThirdParty -a "$WM_COMPILER" = Clang ]
then
thirdPartyClang=true
fi
case "$WM_COMPILER_TYPE-$WM_COMPILER" in
(ThirdParty-Clang*)
withLLVM=true # 'true' means find on path
;;
(system-Clang*)
withLLVM=system # 'system' means find on path
;;
(*)
if _foamIsNone "$mesa_llvm"
then
withLLVM=false
elif _foamIsSystem "$mesa_llvm"
then
withLLVM=system # 'system' means find on path
else
withLLVM="$mesa_llvm" # Take value from mesa config
fi
;;
esac
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
unset thirdPartyClang
useGcc
unset withLLVM
;;
-llvm)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
withLLVM="$2"
shift
;;
llvm-*)
withLLVM="$1"
;;
mesa-*)
mesaPACKAGE="${1%%/}"
@ -114,27 +131,43 @@ fi
#------------------------------------------------------------------------------
# Locate third-party clang as required
if [ "$thirdPartyClang" = true ]
then
thirdPartyClang=$(command -v clang) || {
echo "Error: could not properly locate clang"
case "$withLLVM" in
(true | system)
LLVM_ARCH_PATH="$(command -v clang)" || {
echo "Error: could not properly locate llvm/clang"
exit 2
}
# root installation directory
thirdPartyClang=${thirdPartyClang%/bin/clang}
# Root installation directory
LLVM_ARCH_PATH="${LLVM_ARCH_PATH%/bin/clang}"
[ -d "$thirdPartyClang" ] || {
echo "Error: could not properly locate clang"
[ -d "$LLVM_ARCH_PATH" ] || {
echo "Error: could not properly locate llvm/clang"
exit 2
}
fi
;;
('' | none | false)
withLLVM=none
echo "No llvm"
;;
(llvm-*)
echo "check llvm = $withLLVM"
LLVM_ARCH_PATH="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH/$withLLVM"
[ -d "$LLVM_ARCH_PATH" ] || {
echo "Error: could not properly locate llvm/clang"
exit 2
}
;;
esac
#------------------------------------------------------------------------------
#
# Build MESA
# For 64-bit
# - MESA itself will normally build into 'lib64'.
# - MESA itself will normally build into 'lib64' (depends on autoconfig).
#
# MESA_SOURCE_DIR : location of the original sources
# MESA_ARCH_DIR : installation directory
@ -142,22 +175,47 @@ fi
MESA_SOURCE_DIR=$sourceBASE/$mesaPACKAGE
MESA_ARCH_PATH=$installBASE/$mesaPACKAGE
(
# configuration options:
unset configOpt
#
# Manual adjustments to mesa
# - avoid GLES (GLES1) since <GLES/gl.h> may mask the <GL/gl.h> header
adjustMESA()
{
pkgconfigAdjust $MESA_ARCH_PATH
if [ -d "$thirdPartyClang" ]
\rm -rf $MESA_ARCH_PATH/include/GLES $MESA_ARCH_PATH/include/GLES1
echo "removed all gles1 includes"
}
(
# Configuration options:
unset configOpt compFlags
# Sometimes for LLVM issues
# compFlags="-D_GLIBCXX_USE_CXX11_ABI=0"
# Possibly for older mesa versions (see paraview wiki)
# compFlags="-O2 -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
if [ -d "$LLVM_ARCH_PATH" ]
then
configOpt="$configOpt --with-llvm-prefix=$thirdPartyClang"
configOpt="$configOpt --with-llvm-prefix=$LLVM_ARCH_PATH"
fi
# end of configuration options
# Additional configure options
if [ "$1" = "--" ]
then
shift
configOpt="$configOpt $@"
fi
# End of configuration options
# ----------------------------
buildDIR=$buildBASE/$mesaPACKAGE
cd $MESA_SOURCE_DIR || exit 1
cd "$MESA_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
# remove any existing build
# Remove any existing build
rm -rf $MESA_ARCH_PATH
rm -rf $buildDIR
mkdir -p $buildDIR
@ -165,17 +223,19 @@ MESA_ARCH_PATH=$installBASE/$mesaPACKAGE
echo "----"
echo "Building $mesaPACKAGE"
echo " Source : $MESA_SOURCE_DIR"
echo " Target : $MESA_ARCH_PATH"
if [ -d "$thirdPartyClang" ]
echo " Source : $MESA_SOURCE_DIR"
echo " Target : $MESA_ARCH_PATH"
if [ -d "$LLVM_ARCH_PATH" ]
then
echo " Clang : $thirdPartyClang"
echo " llvm : $LLVM_ARCH_PATH"
fi
echo "----"
# possibly for older mesa versions (see paraview wiki)
# CXXFLAGS="-O2 -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
# CFLAGS="-O2 -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
if [ -n "$compFlags" ]
then
CFLAGS="$CFLAGS $compFlags"
CXXFLAGS="$CXXFLAGS $compFlags"
fi
## autoreconf -fi
set -x
@ -184,16 +244,20 @@ MESA_ARCH_PATH=$installBASE/$mesaPACKAGE
--disable-xvmc \
--disable-glx \
--disable-dri \
--disable-gbm \
--disable-egl \
--disable-gles1 \
--enable-texture-float \
--enable-gallium-osmesa --with-gallium-drivers=swrast \
$configOpt \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built $mesaPACKAGE"
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built $mesaPACKAGE" \
&& adjustMESA
) || {
echo "Error building: MESA"
exit 1
}
# ----------------------------------------------------------------- end-of-file
# -----------------------------------------------------------------------------

12
makeMesa.example Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
# An example for building mesa with llvm
mesa=mesa-18.3.4
llvm=llvm-4.0.1
set -x
./makeMesa \
$mesa $llvm
"$@"
#------------------------------------------------------------------------------

209
makeOPENMPI Executable file
View File

@ -0,0 +1,209 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2017-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeOPENMPI
#
# Description
# Build script for openmpi
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library ending (default is .so)
[ "$(uname -s)" = Darwin ] && EXT_SO=.dylib || EXT_SO=.so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo " Have openmpi shared library (${dir##*/})"
exit 0
elif [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo " Have openmpi static library (${dir##*/})"
exit 0
else
echo "No openmpi libraries found: ${dir:-not-specified}"
exit 2
fi
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
# Transition
# ~~~~~~~~~~
_foamAddLib() { true; }
_foamAddMan() { true; }
_foamAddPath() { true; }
#------------------------------------------------------------------------------
WM_MPLIB=OPENMPI # Ensure we get the correct MPI
# openmpi version from OpenFOAM etc/config.sh file:
_foamConfig mpi
mpiPACKAGE=${FOAM_MPI:-openmpi-system}
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [openmpi-VERSION] [-- configure-options]
options:
-force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-memcheck Configure with --enable-memcheck (requires valgrind.h)
-threaded Configure with --enable-mpi-thread-multiple
-no-threaded Configure with --disable-mpi-thread-multiple
-help
* build openmpi with
${mpiPACKAGE:-'unspecified openmpi version'}
USAGE
showDownloadHint OPENMPI
exit 1
}
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
unset optForce optMemchecker optThreaded
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
-memcheck*) optMemchecker=true ;;
-thread*) optThreaded=enable ;;
-no-thread*) optThreaded=disable ;;
openmpi-[0-9]* | openmpi_[0-9]* | openmpi-system )
mpiPACKAGE="${1%%/}"
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$mpiPACKAGE" ] || die "The openmpi-VERSION was not specified"
# Nothing to build
if _foamIsNone "$mpiPACKAGE"
then
echo "Using openmpi-none (skip ThirdParty build of openmpi)"
exit 0
elif _foamIsSystem "$mpiPACKAGE"
then
echo "Using openmpi-system (skip ThirdParty build of openmpi)"
exit 0
fi
#------------------------------------------------------------------------------
#
# Build openmpi
#
# MPI_SOURCE_DIR : location of the original sources
# MPI_ARCH_PATH : installation directory
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
if [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Already has shared library: $MPI_ARCH_PATH"
elif [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo "Already has static library: $MPI_ARCH_PATH"
else
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
echo
(
# Configuration options:
# Start with GridEngine support - builds without external libraries
configOpt="--with-sge"
if [ -n "$optMemchecker" ]
then
configOpt="$configOpt --enable-memchecker --with-valgrind"
fi
# --enable-mpi-thread-multiple / --disable-mpi-thread-multiple
if [ -n "$optThreaded" ]
then
configOpt="$configOpt --${optThreaded}-mpi-thread-multiple"
fi
# Additional configure options
if [ "$1" = "--" ]
then
shift
configOpt="$configOpt $@"
fi
# End of configuration options
# ----------------------------
buildDIR=$buildBASE/$mpiPACKAGE
cd "$MPI_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
[ -e Makefile ] && make distclean 2>/dev/null
rm -rf $MPI_ARCH_PATH
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$MPI_SOURCE_DIR/configure \
--prefix=$MPI_ARCH_PATH \
--libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--disable-orterun-prefix-by-default \
--enable-shared --disable-static \
--enable-mpi-fortran=none \
$configOpt \
&& set +x \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $mpiPACKAGE" \
&& pkgconfigAdjust $MPI_ARCH_PATH
) || {
echo "Error building: $mpiPACKAGE"
exit 1
}
fi
#------------------------------------------------------------------------------

14
makeOPENMPI.example Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
# An example for building OPENMPI with particular settings
openmpi=openmpi-1.10.6
# InfiniBand support
verbs="--with-verbs=/usr/local/ofed --with-verbs-lib=/usr/local/ofed/lib64"
# unset verbs
./makeOPENMPI $openmpi -- \
$verbs \
"$@"
#------------------------------------------------------------------------------

254
makePETSC Executable file
View File

@ -0,0 +1,254 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makePETSC
#
# Description
# Build script for PETSC
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
_foamConfig hypre
_foamConfig petsc
hyprePACKAGE="${hypre_version:-hypre-none}"
petscPACKAGE="${petsc_version:-petsc-system}"
targetType=libso
# Should be possible to build with download, but seems to fail
# hypreURL="https://github.com/hypre-space/hypre/archive/v2.14.0.tar.gz"
unset hypreURL
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [lib|libso] [HYPRE-VERSION] [PETSC-VERSION] [-- configure-options]
options:
-force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-inplace Build/install inplace (expert option)
-no-hypre Disable automatic hypre detection
-help
* build PETSC with
${petscPACKAGE:-'unspecified petsc version'}
USAGE
showDownloadHint PETSC
echo
echo "Many people who have downloaded PETSC have also downloaded HYPRE :"
showDownloadHint HYPRE
exit 1
}
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
unset optForce optInplace
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
-inplace) optInplace=true ;;
lib|libso)
targetType="$1"
;;
-no-hypre)
unset hyprePACKAGE hypreURL
unset HYPRE_ARCH_PATH
;;
hypre-[0-9]* | hypre-git)
hyprePACKAGE="${1%%/}"
unset hypreURL
unset HYPRE_ARCH_PATH # Avoid inconsistency
;;
petsc-[0-9]* | petsc-git)
petscPACKAGE="${1%%/}"
unset PETSC_ARCH_PATH # Avoid inconsistency
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$petscPACKAGE" ] || die "The petsc-VERSION was not specified"
# Nothing to build
if _foamIsNone "$petscPACKAGE"
then
echo "Using petsc-none (skip ThirdParty build of PETSC)"
exit 0
elif _foamIsSystem "$petscPACKAGE"
then
echo "Using petsc-system"
exit 0
fi
#------------------------------------------------------------------------------
# Integrations
# No hypre
if _foamIsNone "$hyprePACKAGE"
then
:
elif [ -n "$hyprePACKAGE" ]
then
# Clunky
: "${HYPRE_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$hyprePACKAGE}"
fi
#------------------------------------------------------------------------------
#
# Build PETSC
#
# PETSC_ARCH_PATH : installation directory
# PETSC_SOURCE_DIR : location of the original sources
PETSC_SOURCE_DIR="$sourceBASE/$petscPACKAGE"
: "${PETSC_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$petscPACKAGE}"
[ -d "$PETSC_SOURCE_DIR" ] || {
echo "Missing sources: '$petscPACKAGE'"
showDownloadHint PETSC
exit 2
}
# PETSC arch - same root as WM_OPTIONS (eg, DPInt32)
archOpt="$WM_SIZE_OPTIONS"
if [ -n "$optInplace" ]
then
unset installPrefix
# No install stage requires
makeInstall() { true; }
else
# Regular installation location
installPrefix="$PETSC_ARCH_PATH"
makeInstall() {
make PETSC_DIR="$PETSC_SOURCE_DIR" PETSC_ARCH="$archOpt" install
}
fi
echo "Starting build: $petscPACKAGE ($targetType)"
echo
(
# Configuration options
configOpt="--with-cc=$(whichMpicc) --with-cxx=$(whichMpicxx)"
# Normally want hypre but this is really clunky
if [ -f "$HYPRE_ARCH_PATH/include/HYPRE.h" ]
then
echo "Has installed hypre: $hyprePACKAGE"
configOpt="$configOpt --with-hypre-dir=$HYPRE_ARCH_PATH"
elif [ -n "$urlHypre" ]
then
configOpt="$configOpt --download-hypre=$urlHypre"
fi
# Additional configure options
if [ "$1" = "--" ]
then
shift
configOpt="$configOpt $@"
fi
if [ "$targetType" = libso ]
then
configOpt="$configOpt --with-shared-libraries"
fi
if [ "$WM_LABEL_SIZE" = 64 ]
then
configOpt="$configOpt --with-64-bit-indices=1"
else
configOpt="$configOpt --with-64-bit-indices=0"
fi
if [ "$WM_PRECISION_OPTION" = SP ]
then
configOpt="$configOpt --with-precision=single"
else
configOpt="$configOpt --with-precision=double"
fi
# We export compiler settings (above) but actually use the
# --with-cc and --with-cxx. So ignore them and flags
unset CC CXX
unset CFLAGS CXXFLAGS
cd "$PETSC_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
rm -rf "$PETSC_ARCH_PATH"
# No clean here, if we have multiple arch in the same directory
## without tests? --testdir=..
## configOpt="$configOpt --download-f2cblaslapack=1"
set -x
./configure \
${installPrefix:+--prefix="$installPrefix"} \
--PETSC_DIR="$PETSC_SOURCE_DIR" \
--with-petsc-arch="$archOpt" \
--with-clanguage=C \
--with-fc=0 \
--with-scalapack=0 \
--with-superlu_dist=0 \
--with-suitesparse=0 \
--with-x=0 \
$configOpt \
&& set +x \
&& echo "Configured: petsc" \
&& make ${WM_NCOMPPROCS:+-j $WM_NCOMPPROCS} \
PETSC_DIR="$PETSC_SOURCE_DIR" PETSC_ARCH="$archOpt" all \
&& echo "Built: petsc" \
&& makeInstall \
&& echo "Installed: petsc - may require etc/pkgconfigPrefix to relocate"
) || {
echo "Error building: petsc"
exit 1
}
#------------------------------------------------------------------------------

View File

@ -3,134 +3,108 @@
# ========= |
# \\ / 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 | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeParaView
#
# Description
# Make and install ParaView 4 or 5.
# Make and install ParaView.
# 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##*-}
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# 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."
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
. etc/tools/ParaViewFunctions
#------------------------------------------------------------------------------
#
# USER OPTIONS:
# ~~~~~~~~~~~~~
# MPI support:
# use 0 or unset MPI_MAX_PROCS for no upper-limit
withMPI=false
MPI_MAX_PROCS=32
unset ParaView_VERSION # Purge current values
# 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/lib$WM_COMPILER_LIB_ARCH/libpython2.6.so.1.0"
# ParaView_VERSION from etc/config.sh file:
_foamConfig paraview
# MESA graphics support:
withMESA=false
MESA_INCLUDE="/usr/include/GL"
MESA_LIBRARY="/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so"
# Avoid any potential conflicts (especially if building from git)
if [ -d "$ParaView_DIR" ]
then
_foamClean PATH "$ParaView_DIR"
_foamClean LD_LIBRARY_PATH "$ParaView_DIR"
fi
unset ParaView_DIR ParaView_INCLUDE_DIR PV_PLUGIN_PATH
# extra QT gui support (useful for some third party apps)
withQT=true
case "$ParaView_VERSION" in
[Pp]*)
ParaView_VERSION="${ParaView_VERSION##*-}" # Without "ParaView-" prefix
;;
esac
ParaView_VERSION="${ParaView_VERSION%%-*}" # Without suffix (eg, -python)
# Set the path to the Qt-4.5 (or later) qmake if the system Qt is older
QMAKE_PATH=""
# Set the path to cmake
CMAKE_PATH=""
# Set initial ParaView_MAJOR based on current value of ParaView_VERSION
setParaViewVersion ${ParaView_VERSION:-none}
# New rendering backend (starting with paraview 5.0).
# Default to auto-config based on paraview version
withGL2=auto
withGL2=auto # auto-config based on version
#
# NO FURTHER EDITING BELOW THIS LINE
#
#-----------------------------------------------------------------------------
Script=${0##*/}
#------------------------------------------------------------------------------
usage() {
: ${ParaView_VERSION:=none} # some dummy value for usage information
exec 1>&2
: ${ParaView_VERSION:=none} # some dummy value for usage information
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: $Script [OPTION] [paraview-VERSION] [CMAKE-OPTION]
usage: ${0##*/} [OPTION] [paraview-VERSION] [CMAKE-OPTION]
options:
-gcc Force use of gcc/g++
-cmake PATH with cmake from the given path
-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)
-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 cmake from the path given
-qmake PATH with the Qt version corresponding to the qmake path given
-gl2 with new rendering backend (default: auto)
-mesa with mesa
-mesa-prefix DIR location of mesa installation (sets -mesa-include, -mesa-lib)
-mesa-include DIR location of mesa headers (current: ${MESA_INCLUDE:-none})
-mesa-lib PATH path to mesa library (current: ${MESA_LIBRARY:-none})
-mpi with mpi
-mpi=N with max 'N' mpi processes. N=0 for no upper-limit.
-python | -python2 | -python3
with python
-python-include DIR
location of python headers (current: ${PYTHON_INCLUDE:-none})
-python-lib PATH path to python library (current: ${PYTHON_LIBRARY:-none})
-qmake PATH with QT version corresponding to the qmake in given path
-qt with extra Qt gui support (if not already enabled)
-qt-VER with Qt version corresponding to
-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
-verbose verbose output in Makefiles
-version VER specify an alternative version (current value: $ParaView_VERSION)
-version VER specify an alternative version (current: $ParaView_VERSION)
-major VER specify an alternative major version for special builds
-buildType NAME specify the build type (default: Release)
-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})
-suffix NAME specify a suffix to distinguish the build
-help
The -no-FEATURE option can be used to forcibly disable these features:
mesa mpi python qt
-no-gl2 | -no-mesa | -no-mpi | -no-python | -no-qt
CMake options start with a capital letter and contain an '='.
For example,
$Script BUILD_TESTING=ON
${0##*/} BUILD_TESTING=ON
to add tests
For finer control, the build stages can be selected or deselected individually:
@ -142,58 +116,40 @@ For finer control, the build stages can be selected or deselected individually:
* 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
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION$BUILD_SUFFIX
To make a different paraview version, simply specify on the command-line.
For example,
./makeParaview 4.4.0
./makeParaview 5.4.1
Or change the \$WM_PROJECT_DIR/etc/config.sh/paraview settings.
USAGE
showDownloadHint PARAVIEW
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
exportCompiler minimal # Minimal compiler info for CMake/configure
#
# Add options based on script name:
#
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
setParaViewVersion ${ParaView_VERSION:-none}
#
# Various building stages
#
unset runPATCH runCONFIG runMAKE runINSTALL
runDEFAULT=true
buildType=Release
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
[0-9]* | paraview-[0-9]* | ParaView-[0-9]*) # paraview version
setParaViewVersion "${1%%/}"
;;
[A-Z]*=*) # cmake variables
addCMakeVariable "$1"
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
-patch) # stage 0: patch sources
runPATCH=true
unset runDEFAULT
@ -236,23 +192,35 @@ do
-mesa)
withMESA=true
;;
-osmesa)
echo
echo "The -osmesa option is currently ignored"
echo
# 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"
# Could be under (lib64 | lib)
MESA_LIBRARY="${2%%/}/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so"
[ -f "$MESA_LIBRARY" ] || MESA_LIBRARY="${2%%/}/lib/libOSMesa.so"
shift
;;
-mesa-include)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
withMESA=true
MESA_INCLUDE="${2%%/}"
shift
;;
-mesa-lib)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
withMESA=true
MESA_LIBRARY="${2%%/}"
shift
;;
@ -269,11 +237,24 @@ do
-python)
withPYTHON=true
;;
-python2)
withPYTHON=true; withPYTHON3=false
;;
-python3)
withPYTHON=true; withPYTHON3=true
;;
-no-python)
withPYTHON=false
withPYTHON=false; unset withPYTHON3
;;
-python-include)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
withPYTHON=true
PYTHON_INCLUDE="${2%%/}"
shift
;;
-python-lib)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
withPYTHON=true
PYTHON_LIBRARY="${2%%/}"
shift
;;
@ -293,7 +274,8 @@ do
-no-qt)
withQT=false
;;
-qt-[1-9]*)
-qt-[0-9]*)
withQT=true
QMAKE_PATH="$installBASE/${1##-}"
;;
-verbose)
@ -311,7 +293,12 @@ do
;;
-buildType)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
buildType="$2"
BUILD_TYPE="$2"
shift
;;
-suffix)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
setBuildSuffix "$2"
shift
;;
*)
@ -323,7 +310,7 @@ done
[ -n "$ParaView_VERSION" ] || die "The paraview-VERSION was not specified"
# nothing to build
# Nothing to build
if _foamIsNone "$ParaView_VERSION"
then
echo "Using paraview-none (skip ThirdParty build of ParaView)"
@ -341,6 +328,16 @@ then
fi
fi
# ParaView-5.7.0 default is python3
if [ "$withPYTHON" = true ] && [ -z "$withPYTHON3" ]
then
case "${ParaView_VERSION}" in
(5.[7-9]* | [6-9]* | [1-9][0-9].*)
withPYTHON3=true
;;
esac
fi
if [ "$runDEFAULT" = true ]
then
: ${runPATCH:=true}
@ -349,6 +346,16 @@ then
: ${runINSTALL:=true}
fi
if [ "$withMESA" = true ]
then
: ${withQT:=false} # No QT unless explicitly requested
addCMakeVariable "VTK_USE_X=OFF"
# addCMakeVariable "OPENGL_INCLUDE_DIR=IGNORE"
# addCMakeVariable "OPENGL_gl_LIBRARY=IGNORE"
# addCMakeVariable "OPENGL_xmesa_INCLUDE_DIR=IGNORE"
## seems to be unnecessary => addCMakeVariable "VTK_USE_OFFSCREEN=OFF"
fi
# Set configure options
#~~~~~~~~~~~~~~~~~~~~~~
@ -379,11 +386,15 @@ Features selected
python ${withPYTHON:-false}
qt ${withQT:-false}
---------------------
Compiler
cxx ${CXX:-unknown}
flags ${CXXFLAGS:-none}
---------------------
Version information
qt ${QtVersion:-none}
version ${ParaView_VERSION:-unknown} $(checkVersion)
paraview ${ParaView_VERSION:-unknown}
major ${ParaView_MAJOR:-unknown}
build ${buildType:-Release}
build ${BUILD_TYPE:-unknown}
qt ${QT_VERSION:-none}
---------------------
SUMMARY

View File

@ -1,14 +1,23 @@
#!/bin/sh
# An example for building particular combinations of ParaView with
# - mpi (0 = no upper-limit on processes)
# - off-screen mesa
# - mesa
# - python (required for Catalyst)
#
# NOTE: must modify etc/config.*/paraview to use this particular version
# and combination, or use chaining as per etc/config.*/example/paraview
mesa=mesa-11.2.2
# mesa=mesa-13.0.2
# mesa=mesa-11.2.2
# mesa=mesa-13.0.3
# mesa=mesa-17.1.1
mesa=mesa-18.3.4
set -x
./makeParaView \
-mpi=0 \
-mpi \
-mesa-prefix $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mesa \
-python \
-suffix mesa-mpi-py \
"$@"
#------------------------------------------------------------------------------

91
makeQt
View File

@ -3,24 +3,14 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011 OpenFOAM Foundation
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeQt
@ -28,16 +18,14 @@
# Description
# Build script for QT (the qt-everywhere-opensource-src package)
#
#------------------------------------------------------------------------------
qtVERSION=4.8.7
qtTYPE=qt-everywhere-opensource-src
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# 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."
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
@ -48,39 +36,39 @@ usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [VERSION]
usage: ${0##*/} [OPTION] [qt-VERSION] [-- configure-options]
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-force Force compilation, even if it already exists
-gcc Force use of gcc/g++
-help
* build $qtTYPE, version $qtVERSION
* build $qtTYPE, version ${qtVERSION:-undefined}
USAGE
showDownloadHint QT
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"
exportCompiler true # Compiler info + flags for CMake/configure
unset optForce
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
;;
-qt-[1-9]* | [1-9]* | qt-*)
'') ;; # Ignore empty
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
-qt-[0-9]* | [0-9]* | qt-*)
# -qt-VERSION, VERSION, qt-VERSION, qt-everywhere-opensource-src-VERSION
qtVERSION="${1%%/}";
qtVERSION="${qtVERSION##*-}"
;;
*)
die "unknown option/argument: '$1'"
;;
@ -89,7 +77,7 @@ do
done
qtPACKAGE=$qtTYPE-$qtVERSION
# nothing to build
# Nothing to build
if _foamIsNone "$qtPACKAGE"
then
echo "Using qt-none (skip ThirdParty build of QT)"
@ -111,7 +99,10 @@ echo
echo ========================================
echo "Build Qt $qtPACKAGE"
echo
if [ -d "$QT_ARCH_PATH" -a -r "$QT_ARCH_PATH/bin/qmake" ]
if [ -z "$optForce" ] \
&& [ -d "$QT_ARCH_PATH" ] \
&& [ -r "$QT_ARCH_PATH/bin/qmake" ]
then
echo "Already built: Qt-$qtVERSION"
else
@ -140,11 +131,19 @@ else
;;
esac
# end of configuration options
# Additional configure options
if [ "$1" = "--" ]
then
shift
configOpt="$configOpt $@"
fi
# End of configuration options
# ----------------------------
buildDIR=$buildBASE/$qtPACKAGE
cd $QT_SOURCE_DIR || exit 1
cd "$QT_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
[ -e Makefile ] && make distclean 2>/dev/null
# Remove any existing build folder and recreate
@ -157,7 +156,7 @@ else
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
cd "$buildDIR" || exit
# Compile as opensource, accepting LGPL conditions (yes)
echo yes | $QT_SOURCE_DIR/configure \
@ -174,4 +173,4 @@ else
}
fi
# ----------------------------------------------------------------- end-of-file
# -----------------------------------------------------------------------------

336
makeSCOTCH Executable file
View File

@ -0,0 +1,336 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2019-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeSCOTCH
#
# Description
# Build the SCOTCH and PTSCOTCH libraries, optionally build binaries
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
_foamConfig scotch # Get SCOTCH_ARCH_PATH, SCOTCH_VERSION
scotchPACKAGE=${SCOTCH_VERSION:-scotch-system}
unset withMPI
case "$WM_MPLIB" in (*MPI*) [ "$FOAM_MPI" = dummy ] || withMPI=true ;; esac
#------------------------------------------------------------------------------
usage()
{
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
/bin/cat<<USAGE
Usage: ${0##*/} [OPTION] [libso] [scotch-VERSION]
options:
-force Force compilation, even if include/library already exists
Also force build attempt of pt-scotch (mingw)
-gcc Force use of gcc/g++
-bin Create scotch binaries as well (experimental)
-no-bin Suppress creation of scotch binaries (default)
-no-mpi Suppress build of pt-scotch
-help
* Compile SCOTCH
$scotchPACKAGE
USAGE
showDownloadHint SCOTCH
exit 1
}
#------------------------------------------------------------------------------
unset optBinaries optForce
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
-bin) optBinaries=true ;;
-no-bin) unset optBinaries ;;
-no-mpi) unset withMPI ;;
scotch-[0-9]* | scotch-git | scotch_* )
scotchPACKAGE="${1%%/}"
unset SCOTCH_ARCH_PATH # Avoid inconsistency
;;
*)
die "unknown option/argument: '$1'"
;;
esac
shift
done
[ -n "$scotchPACKAGE" ] || die "The scotch-VERSION was not specified"
# Nothing to build
if _foamIsNone "$scotchPACKAGE"
then
echo "Using scotch-none (skip ThirdParty build of SCOTCH)"
exit 0
elif _foamIsSystem "$scotchPACKAGE"
then
echo "Using scotch-system"
exit 0
fi
requireExtLibBin
#------------------------------------------------------------------------------
# Needs generalizing, but works fairly well
for scotchMakefile in \
"OpenFOAM-$(uname -s)-${WM_COMPILER}.shlib" \
"OpenFOAM-$(uname -s).shlib" \
OpenFOAM-Linux.shlib \
;
do
scotchMakefile="etc/makeFiles/scotch/Makefile.inc.$scotchMakefile"
[ -f "$scotchMakefile" ] && break
done
# The relative link location within the "scotch/src/" directory
makefileInc="../../$scotchMakefile"
#------------------------------------------------------------------------------
#
# Build SCOTCH
#
# SCOTCH_ARCH_PATH : installation directory
# SCOTCH_SOURCE_DIR : location of the original sources
SCOTCH_SOURCE_DIR="$sourceBASE/$scotchPACKAGE"
: "${SCOTCH_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$scotchPACKAGE}"
[ -d "$SCOTCH_SOURCE_DIR/src" ] || {
echo "Missing sources: '$scotchPACKAGE'"
showDownloadHint SCOTCH
exit 2
}
echo
echo ========================================
echo "scotch decomposition ($scotchPACKAGE)"
echo " Makefile.inc : ${makefileInc##*/}"
# (serial) scotch
prefixDIR="$SCOTCH_ARCH_PATH"
binDIR="$prefixDIR"/bin
incDIR="$prefixDIR"/include
libDIR="$FOAM_EXT_LIBBIN"
# Test installation. May or may not have libscotcherrexit.so
if [ -z "$optForce" ] \
&& [ -f "$incDIR"/scotch.h ] \
&& haveLibso "$libDIR"/libscotch
then
echo " scotch include: $incDIR"
echo " scotch library: $libDIR"
elif [ -d "$SCOTCH_SOURCE_DIR" ]
then
(
# Older versions ok, but scotch-6.0.5a cannot build in parallel.
# Force serial build
export WM_NCOMPPROCS=1
echo "*** building scotch in serial ***"
echo
[ -f "$scotchMakefile" ] || {
echo " Error: no such makefile: $scotchMakefile"
exit 1
}
cd "$SCOTCH_SOURCE_DIR/src" || exit
export GIT_DIR="$SCOTCH_SOURCE_DIR/.git" # Mask seeing our own git-repo
rm -rf "$SCOTCH_ARCH_PATH"
applyPatch "$scotchPACKAGE" .. # patch at parent-level
mkdir -p "$binDIR" 2>/dev/null
mkdir -p "$incDIR" 2>/dev/null
mkdir -p "$libDIR" 2>/dev/null
if [ -f "$makefileInc" ]
then
rm -f Makefile.inc
ln -s "$makefileInc" Makefile.inc
fi
[ -f Makefile.inc ] || {
echo " Error: scotch needs an appropriate Makefile.inc"
exit 1
}
export CCS="$(whichCC)" # CCS (serial compiler)
export CCP="$(whichMpicc)" # CCP (parallel compiler) default=mpicc
# Consistency for Intel-MPI and non-icc compilers
[ -n "$I_MPI_CC" ] || export I_MPI_CC="$(whichCC)"
# The make targets
make_targets="libscotch"
if [ "$optBinaries" = true ]
then
make_targets="$make_targets scotch"
fi
make realclean 2>/dev/null # Extra safety
make -j $WM_NCOMPPROCS $make_targets \
&& make \
prefix="$prefixDIR" \
bindir="$binDIR" \
libdir="$libDIR" \
includedir="$incDIR" \
install
rmdir "$binDIR" 2>/dev/null || true # Remove empty bin/
rmdir "${binDIR%/*}" 2>/dev/null || true # ... and empty parent
make realclean 2>/dev/null || true # Failed cleanup is uncritical
) || warnBuildIssues SCOTCH
else
warnNotFound SCOTCH
fi
# Build ptscotch when MPI (ThirdParty or system) is available
if [ "${withMPI}" != true ]
then
# Report that the above tests failed and pass-through the failure
echo "Skipping pt-scotch (no mpi)"
exit 0
fi
# Known build issues for mingw (MS-MPI source code annotations)
case "$WM_COMPILER" in
(Mingw*)
if [ -z "$optForce" ]
then
echo "Skipping pt-scotch - known compilation issues with $WM_COMPILER"
exit 0
else
echo "Warning: pt-scotch - known compilation issues with $WM_COMPILER"
fi
;;
esac
# Build ptscotch if normal scotch was built (has include and library)
# (reuse prefix/include/lib dirs set above)
if [ -f "$incDIR"/scotch.h ] \
&& haveLibso "$libDIR"/libscotch
then
echo
echo ========================================
echo "pt-scotch decomposition ($scotchPACKAGE with $FOAM_MPI)"
else
# Report that the above tests failed and pass-through the failure
echo "Skipping pt-scotch - no <scotch.h> found"
exit 2
fi
# (parallel) pt-scotch
prefixDIR="$SCOTCH_ARCH_PATH"
binDIR="$prefixDIR/bin/$FOAM_MPI"
incDIR="$prefixDIR/include/$FOAM_MPI"
libDIR="$FOAM_EXT_LIBBIN/$FOAM_MPI"
if [ -z "$optForce" ] \
&& [ -f "$incDIR"/ptscotch.h ] \
&& haveLibso "$libDIR"/libptscotch
then
echo " ptscotch include: $incDIR"
echo " ptscotch library: $libDIR"
else
(
# Older versions ok, but scotch-6.0.5a cannot build in parallel.
# Force serial build
export WM_NCOMPPROCS=1
echo "*** building pt-scotch in serial ***"
[ -f "$scotchMakefile" ] || {
echo " Error: no such makefile: $scotchMakefile"
exit 1
}
cd "$SCOTCH_SOURCE_DIR/src" || exit
export GIT_DIR="$SCOTCH_SOURCE_DIR/.git" # Mask seeing our own git-repo
echo
mkdir -p "$binDIR" 2>/dev/null
mkdir -p "$incDIR" 2>/dev/null
mkdir -p "$libDIR" 2>/dev/null
if [ -f "$makefileInc" ]
then
rm -f Makefile.inc
ln -s "$makefileInc" Makefile.inc
fi
[ -f Makefile.inc ] || {
echo " Error: ptscotch needs an appropriate Makefile.inc"
exit 1
}
export CCS="$(whichCC)" # CCS (serial compiler)
export CCP="$(whichMpicc)" # CCP (parallel compiler) default=mpicc
# Consistency for Intel-MPI and non-icc compilers
[ -n "$I_MPI_CC" ] || export I_MPI_CC="$(whichCC)"
# The make targets. No simple means of handling mpi-specific binaries
make_targets="libptscotch"
if [ "$optBinaries" = true ]
then
make_targets="$make_targets ptscotch"
fi
make realclean 2>/dev/null # Extra safety
make -j $WM_NCOMPPROCS $make_targets \
&& make \
prefix="$prefixDIR" \
bindir="$binDIR" \
libdir="$libDIR" \
includedir="$incDIR" \
install
rmdir "$binDIR" 2>/dev/null || true # Remove empty bin/
rmdir "${binDIR%/*}" 2>/dev/null || true # ... and empty parent
make realclean 2>/dev/null || true # Failed cleanup is uncritical
) || warnBuildIssues PTSCOTCH
fi
# Verify existence of ptscotch include
[ -f "$SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h" ] || {
echo
echo " WARNING: required include file 'ptscotch.h' not found!"
}
# Could now remove $SCOTCH_SOURCE_DIR/src/Makefile.inc
#------------------------------------------------------------------------------

206
makeTecio
View File

@ -1,206 +0,0 @@
#!/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
#------------------------------------------------------------------------------

154
makeVTK
View File

@ -3,24 +3,13 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeVTK
@ -28,86 +17,81 @@
# Description
# 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
# - $WM_THIRD_PARTY_DIR/VTK-VERSION
#
# 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)
# ln -s ParaView-v5.3.0/VTK VTK-7.1.0
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# 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."
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
. etc/tools/ParaViewFunctions
. etc/tools/vtkFunctions
#------------------------------------------------------------------------------
#
# USER OPTIONS:
# ~~~~~~~~~~~~~
# MPI support:
# use 0 or unset MPI_MAX_PROCS for no upper-limit
withMPI=false
unset MPI_MAX_PROCS
unset vtk_version mesa_version # Purge current values
# MESA graphics support:
withMESA=false
MESA_INCLUDE="/usr/include/GL"
MESA_LIBRARY="/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so"
# vtk version from OpenFOAM etc/config.sh file:
_foamConfig vtk
VTK_VERSION="$vtk_version"
case "$VTK_VERSION" in
[Vv]*)
VTK_VERSION="${VTK_VERSION##*-}" # Without "VTK-" prefix
;;
esac
VTK_VERSION="${VTK_VERSION%%-*}" # Without suffix (eg, -mesa)
# Set the path to cmake
CMAKE_PATH=""
# New rendering backend (starting with vtk 7?).
# Default to auto-config based on VTK version
withGL2=auto
withGL2=auto # auto-config based on version
#
# 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] [vtk-VERSION] [CMAKE-OPTION]
usage: ${0##*/} [OPTION] [vtk-VERSION] [CMAKE-OPTION]
options:
-gcc Force use of gcc/g++
-cmake PATH with cmake from the given path
-rebuild for repeated builds (-make -install) *use with caution*
-gl2 with new rendering backend (if not already enabled)
-gl2 with new rendering backend (default: auto)
-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.
-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: $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})
-mesa-include DIR location of mesa headers (current: ${MESA_INCLUDE:-none})
-mesa-lib PATH path to mesa library (current: ${MESA_LIBRARY:-none})
-osmesa with off-screen mesa only
-mpi with mpi (VTK_Group_MPI=ON)
-mpi=N with max 'N' mpi processes. N=0 for no upper-limit.
-verbose verbose output in Makefiles
-version VER specify an alternative version (current: $VTK_VERSION)
-buildType NAME specify the build type (default: Release)
-suffix NAME specify a suffix to distinguish the build
-help
The -no-FEATURE option can be disable these features (if not already disabled):
mesa mpi
The -no-FEATURE option can be used to forcibly disable these features:
-no-gl2 | -no-mesa | -no-mpi
CMake options start with a capital letter and contain an '='.
For example,
$Script BUILD_TESTING=ON
${0##*/} BUILD_TESTING=ON
to add tests and avoid building documentation
For finer control, the build stages can be selected or deselected individually:
-patch -no-patch
-config -no-config
-make -no-make
-install -no-install
@ -115,40 +99,39 @@ For finer control, the build stages can be selected or deselected individually:
* 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
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/VTK-$VTK_VERSION$BUILD_SUFFIX
USAGE
# showDownloadHint VTK
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
exportCompiler minimal # Minimal compiler info for CMake/configure
#
# Various building stages
#
unset runPATCH runCONFIG runMAKE runINSTALL
runDEFAULT=true
buildType=Release
withOSMESA=false
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
[0-9]* | vtk-[0-9]* | VTK-[0-9]*) # VTK version
setVtkVersion "${1%%/}"
;;
[A-Z]*=*) # cmake variables
addCMakeVariable "$1"
;;
-gcc)
export CC=gcc # use gcc/g++
export CXX=g++
-patch) # stage 0: patch sources
runPATCH=true
unset runDEFAULT
;;
-no-patch)
runPATCH=false
;;
-config) # stage 1: config only
runCONFIG=true
@ -197,16 +180,20 @@ do
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
withMESA=true
MESA_INCLUDE="${2%%/}/include"
# Could be under (lib64 | lib)
MESA_LIBRARY="${2%%/}/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so"
[ -f "$MESA_LIBRARY" ] || MESA_LIBRARY="${2%%/}/lib/libOSMesa.so"
shift
;;
-mesa-include)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
withMESA=true
MESA_INCLUDE="${2%%/}"
shift
;;
-mesa-lib)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
withMESA=true
MESA_LIBRARY="${2%%/}"
shift
;;
@ -236,7 +223,12 @@ do
;;
-buildType)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
buildType="$2"
BUILD_TYPE="$2"
shift
;;
-suffix)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
setBuildSuffix "$2"
shift
;;
*)
@ -276,14 +268,14 @@ addMpiSupport # set MPI-specific options
addMesaSupport # set MESA-specific options
addGL2Support # new rendering backend
# set off-screen only options
# Set off-screen options
if [ "$withOSMESA" = true ]
then
addCMakeVariable "VTK_USE_X:BOOL=OFF"
addCMakeVariable "VTK_USE_X=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"
addCMakeVariable "OPENGL_xmesa_INCLUDE_DIR=$MESA_INCLUDE"
fi
setVtkDirs # where things are or should be put
@ -304,9 +296,13 @@ Features selected
mesa ${withMESA:-false}
mpi ${withMPI:-false}
---------------------
Compiler
cxx ${CXX:-unknown}
cxxflags ${CXXFLAGS:-none}
---------------------
Version information
version ${VTK_VERSION:-unknown}
build ${buildType:-Release}
vtk ${VTK_VERSION:-unknown}
build ${BUILD_TYPE:-unknown}
---------------------
SUMMARY

View File

@ -1,15 +1,23 @@
#!/bin/sh
# An example for building particular combinations of VTK with
# - off-screen mesa
# - mesa (off-screen only)
vtk=VTK-7.1.0
vtk=VTK-8.2.0
# mesa=mesa-11.2.2
mesa=mesa-13.0.1
# mesa=mesa-13.0.3
# mesa=mesa-17.1.1
mesa=mesa-18.3.4
# Module_vtkAcceleratorsVTKm : Request building vtkAcceleratorsVTKm
#
# -mpi implies VTK_Group_MPI : Request building MPI modules
set -x
./makeVTK \
$vtk \
-mpi \
-osmesa \
-mesa-prefix $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mesa \
"$@"
$vtk "$@" \
Module_vtkAcceleratorsVTKm=ON
#------------------------------------------------------------------------------

View File

@ -3,24 +3,13 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2016-2020 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/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# minCmake
@ -28,12 +17,14 @@
# Description
# Scour CMakeLists.txt files to report the cmake_minimum required.
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# 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."
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
#------------------------------------------------------------------------------
@ -81,7 +72,7 @@ do
min=$(sed -n \
-e 's/^.*cmake_minimum.*VERSION *\([0-9.][0-9.]*\).*/\1/p' \
"$dir/CMakeLists.txt" \
2>/dev/null)
2>/dev/null | head -1)
if [ -n "$min" ]
then
@ -92,6 +83,6 @@ do
done \
| sort -n -k 1 \
| xargs printf " %-10s %s\n"
# Use 4 leading spaces for easier pasting as Markdown
# 4 leading spaces for easy pasting as Markdown
#------------------------------------------------------------------------------

View File

@ -1,38 +0,0 @@
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