OpenFOAM® v1806: New and updated build system

OpenFOAM® v1806: New and updated build system

29/06/2018

Improved configuration and make system

Compiler settings

Base-level compiler settings are now consolidated under the wmake/rules/General directory by compiler type. This makes it easier to ensure that compiler flags remain consistent across platforms.

Dependencies

Building of file dependencies uses a new ragel-based parser that is about 40% faster than the previous flex-based parser and does not cause a too many open files error.

Library locations

The configuration scripts have been updated to automatically handle lib/ vs lib64/ installation directories for system packages of boost, CGAL, etc..

System installation of packages (boost, CGAL, FFTW, etc.) now also include /usr/local in the search for system headers and libraries

CGAL, gmp/mpfr

When using CGAL with with a ThirdParty build of gmp/mpfr, but not using a ThirdParty Gcc, the gmp/mpfr locations can now be defined in the CGAL config file.

The wmake rules for CGAL now also include any platform-specific CGAL rules if they are available.

scotch

The librt dependency is now only included for systems using .so files, e.g., Linux.

Centralised handling of ThirdParty packages

Previous ad-hoc detection and locating of ThirdParty packages has now be centralised into the wmake/scripts subdirectory in the form of scripts in the spirit of GNU autoconfig.

For example,

have_boost, have_readline, have_scotch, ...

Each of the have˙<package> scripts will generally provide the following type of functions:

have_<package>          # detection
no_<package>            # reset
echo_<package>          # echoing
and the following type of variables:

HAVE_<package>          # unset or 'true'
<package>_ARCH_PATH     # root for <package>
<package>_INC_DIR       # include directory for <package>
<package>_LIB_DIR       # library directory for <package>

This simplifies the calling scripts:

if have_metis
then
    wmake metisDecomp
fi

As well as reducing clutter in the corresponding Make/options:

EXE_INC = -I$(METIS_INC_DIR) -I../decompositionMethods/lnInclude
LIB_LIBS = -L$(METIS_LIB_DIR) -lmetis

Any additional modifications (platform-specific or for an external build system) can now be made centrally.

Portability

Generalized the handling of library extensions, .so vs .dylib in configuration scripts and source code.

  • These functions are provided as wmake sysFunctions
  • New compilation rules and adjusted source code for compilation on Darwin (Mac OSX). Configured to use the system Clang compiler.
  • This new platform also includes SIGFPE handling and an addr2line emulation for proper handling of a stack trace.

This porting was supported by the valuable contributions from Alexey Matveichev.

Note that this port represents an initial effort that has not been thoroughly tested.