- The Apple SIP (System Integrity Protection) clears environment
variables, which affects the behaviour of dynamic library loading
(the DYLD_LIBRARY_PATH env variable).
OpenFOAM shadows this variable as FOAM_LD_LIBRARY_PATH, which has
been used to restore DYLD_LIBRARY_PATH (eg, in RunFunctions script).
However, this solution is not quite complete, as it
(a) requires sourcing of RunFunctions file,
(b) additional errors appear depending on a user workflow.
This changeset alleviates the problem by also iterating through
paths stored in the shadow variable when loading dynamic libraries
(if the DYLD_LIBRARY_PATH is empty).
- directory discovery originally designed for a sub-dir location
(eg, etc/openfoam) but failed if called from within the sub-dir
itself.
Now simply assume it is located in the project directory or the etc/
sub-dir, so that it can also be relocated into the project directory
in the future (pending changes to RPM and debian packaging)
- interpret as '-decomposeParDict xyz' for simpler scripting:
A empty value ("") as well as "none" or "false" values are ignored.
Eg,
unset decompDict
if some_condition; then decompDict=decomposeParDict-12; fi
runParallel -decompose-dict=$decompDict ...
ENH: more generous when scanning decomposeParDict for numberOfSubdomains
- assume file is in system/ directory if not otherwise found
- for repeated tests (eg, during bisection) can be used to preserve
the existing directory as tutorialsTest.bak01,
tutorialsTest.bak02, ... (max of 10).
- preserve the commit information as tutorialsTest/commit-info
to help document the current or backup test results.
- introduce a FOAM_LD_LIBRARY_PATH variable to shadow
DYLD_LIBRARY_PATH on MacOS.
The DYLD_LIBRARY_PATH and LD_LIBRARY_PATH cannot be modified via sub
shells etc when SIP is active. This helps circumvent these
restrictions, which is obviously a hack, but seems to be required.
COMP: disable -ftrapping-math in geompack for MacOS
- include constant/faMesh cleanup (cleanFaMesh) as part of standard
cleanCase
- simplify cleanPolyMesh function to now just warn about old
constant/polyMesh/blockMeshDict but not try to remove anything
- cleanup cellDist.vtu (decomposePar -dry-run) as well
ENH: foamRunTutorials - fallback to Allrun-parallel, Allrun-serial
TUT: call m4 with file argument instead of redirected stdin
TUT: adjust suffixes on decomposeParDict variants
- partial revert for 13740de427 (#2158)
MS-MPI does not currently have a MPI_Comm_create_group(),
so keep using MPI_Comm_create() there.
Only affects multi-world simulations.
CONFIG: retain dummy version of libPstream.dll
- retain as libPstream.dll-dummy so that it is available for
manual replacement of the regular libPstream.dll (#2290)
Keep extra copy of libPstream.dll as libPstream.dll-msmpi
(for example) for manual replacement.
- fix overly aggressive match in the API value
- allow `INTELMPI*` generic value, this can be used to specify something
like INTELMPI_custom and populate the corresponding wmake rule
manually
STYLE: mention FOAM_BUILDROOT in wmake -help-full output
STYLE: adjust openfoam shell session welcome information
- adjust internal variable names to reduce collision potential
- improve handling of openfoam -etc=...
- more closely reflect what the binaries report
- report the installation path
- change PS1 case/separator to roughly correspond to package names
STYLE: adjust README to mention upcoming v2112
- was taking from the current head instead from specified commit-ish
ENH: add -debian=NUM convenience option to foamPackRelease
STYLE: relocate compile begin/end messages
COMP: suppress more clang warnings (needed for boost)
- it is now possible to include the selected mpi version in the
top-level bashrc or prefs.sh file. For example,
WM_MPLIB=OPENMPI-4.1.1 or WM_MPLIB=openmpi-4.1.1
after evaluation of the config.sh/mpi, this will define
WM_MPLIB=OPENMPI-4.1.1 and FOAM_MPI=openmpi-4.1.1
During the wmake, the mpi-rules will first load the MPI 'family'
rules (OPENMPI in this example) before trying to load
version-specific rules if they exist.
NOTE: the regular user-defined prefs system is unaffected by this
change. This means it is still possible to use a file such as
'prefs.openmpi' to define the preferred version instead or as well.
However, it does mean inconsistent naming can be specified.
For example, specify WM_MPLIB=OPENMPI-4.1.1 at the top-level but
actually have FOAM_MPI=openmpi-4.0.6 in the prefs.openmpi file.
This will make the value of WM_MPLIB misleading.
CONFIG: foamConfigurePaths support for sys-openmpi major version
CONFIG: cleanup any shadow env variables
- migrate to c++14 for most compilers *except* gcc.
There are still many systems in use with gcc-4.8.5, which does not
support c++14.
- initial rules for nvidia compilers (pgi is will soon be defunct).
Not fully tested...
CONFIG: provide fallback value for the user directory name
- in containers may have an unset USER env variable.
Default to 'user' to prevent ugly looking directory names.
- previously a function (unlike the csh version) but since bashrc and
setup have been split -> replace with inline definition
STYLE: formatting/wording for openfoam starters
TUT: simplify controlDict modification, add default substitution
ENH: accept '/' for end-of-options terminator (etc/openfoam)
- makes the application or service more apparent.
* eg. /usr/bin/openfoam / blockMesh
* vs. /usr/bin/openfoam -- blockMesh
Accept lone '-' as the end-of-options terminator, as per bash
- Adjust handling of openfoam '-c' option to flag that a command-string
will appear, but continue with option parsing.
Consistent with bash definition.
- in the 'auto' mode (now the default), it will use cleanCase and also
remove the 0/ directory if a 0.orig/ directory also exists.
This corresponds to a frequent idiom and can be used quite safely
for most cases.
ENH: add -serial / -parallel preference for foamRunTutorials
- additional -serial/-parallel option:
prefer Allrun-serial or Allrun-parallel if available
- optional -output=DIR to preserve output
ENH: report missing tutorials/ directory in RunFunctions
- add to wmakeFunctions to ensure it works even without 'make' being
installed. Exit immediately after -show-api for consistency with
-version.
foamEtcFile:
- drop warnings for some old (pre-v1812) defunct options
and simply flag as unknown options.
- handle -version, --version as equivalent to -show-api
- provide '-clean' option for removing old files
- handle out of order '-decomposeParDict' as per RunFunctions
- implicit no-prompt '-yes' with the shortcuts (eg, -log, -xterm)
and set -local if not already defined
- accept <return> to select defaults
Example usage,
wmake -with-bear src/OpenFOAM
src/Allwmake -with-bear -s -j
- bin/tools/vscode-settings
Emit some json content suitable for setting up Visual Studio Code
for use with OpenFOAM.
For example,
bin/tools/vscode-settings > .vscode/settings.json
Ideas from Volker Weissman
----
install-dirs: a general directory installer
Copy installs non-binary (platform) directories.
Eg,
install-dirs -prefix=... -devel
install-dirs -prefix=... -default -no-app
----
install-platform: a platform (binary) installer
This is primarily driven by the need to install into system mpi
directories. The problem noted in issue #1893 is caused by the
rpm-mpi-hooks (fedora and redhat-8).
For the additional mpi library qualifier (openmpi-x86_64) to be
added to the requirements, the mpi-specific libraries (eg,
libPstream.so) need to be installed in the mpi system directory
(eg, /usr/lib64/openmpi).
However, then need symlinks from the system locations back to our
local directories to ensure that the libraries are correctly found
via our LD_LIBRARY_PATH and we don't get dummy libraries.
----
update-mpi-links: a post-install update hook
Expected paths are registered as persistent information into the
hook during packaging. Triggering the hook after installation
completes the creation of the symlinks.
Normal usage,
```
prefix="/tmp/local-install/openfoam"
bin/tools/install-dirs -prefix="$prefix" -common
bin/tools/install-platform -prefix="$prefix"
```
Installs
- /tmp/local-install/openfoam/META-INFO
- /tmp/local-install/openfoam/bin
- /tmp/local-install/openfoam/etc
- /tmp/local-install/openfoam/platforms/linux64GccDPInt32Opt/bin
- /tmp/local-install/openfoam/platforms/linux64GccDPInt32Opt/lib
Can also place architecture-dependent bits elsewhere,
```
prefix="/tmp/local-install/openfoam"
multi_arch="$(dpkg-architecture -qDEB_TARGET_MULTIARCH)"
bin/tools/install-dirs -prefix="$prefix" -common
bin/tools/install-platform -exec-prefix="$prefix/$multi_arch"
```
Installs
- /tmp/local-install/openfoam/META-INFO
- /tmp/local-install/openfoam/bin
- /tmp/local-install/openfoam/etc
- /tmp/local-install/openfoam/x86_64-linux-gnu/bin
- /tmp/local-install/openfoam/x86_64-linux-gnu/lib
Can use it to flatten out platforms entirely,
```
prefix="/tmp/local-install/openfoam"
bin/tools/install-dirs -prefix="$prefix" -common
bin/tools/install-platform -exec-prefix="$prefix"
```
Installs
- /tmp/local-install/openfoam/META-INFO
- /tmp/local-install/openfoam/bin
- /tmp/local-install/openfoam/etc
- /tmp/local-install/openfoam/lib
- prefix FOAM_MPI and library directories with 'sys-' for system
versions for uniform identication.
WM_MPLIB | libdir (FOAM_MPI) | old naming |
SYSTEMMPI | sys-mpi | mpi |
SYSTEMOPENMPI | sys-openmpi | openmpi-system |
- prefix preferences with 'prefs.' to make them more easily
identifiable, and update bin/tools/create-mpi-config accordingly
Old name: config.{csh,sh}/openmpi
New name: config.{csh,sh}/prefs.openmpi
- additional mpi preferences now available:
* prefs.intelmpi
* prefs.mpich
...
CONFIG: added hook for EASYBUILDMPI (eb-mpi), somewhat like USERMPI
- EasyBuild uses mpicc when compiling, so no explicit wmake rules are
used
ENH: support different major versions for system openmpi
- for example, with
WM_MPLIB=SYSTEMOPENMPI2
defines FOAM_MPI=sys-openmpi2 and thus creates lib/sys-openmpi2
ENH: centralize handling of mpi as 'mpi-rules'
Before:
sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB)
ifeq (,$(FOAM_MPI_LIBBIN))
FOAM_MPI_LIBBIN := $(FOAM_LIBBIN)/$(FOAM_MPI)
endif
After:
include $(GENERAL_RULES)/mpi-rules
- also allows variants such as SYSTEMOPENMPI2 to be handled separately
- ensures that subsequent Allwmake scripts know about it.
ENH: add bin/tools/query-detect wrapper for wmake have_* scripts
CONFIG: use project/ThirdParty without additional sanity checks
- no need to test for Allwmake or platforms/ if ThirdParty is located
within the project directory itself.
COMP: add simple mpi test to 00-dummy
- for testing library linkage, etc.
- can help when designing/debugging blockMesh layouts
- propagate low-level cellModel methods face() and edge() to cellShape
STYLE: relocate blockMesh OBJ output to application only
- remove blockTopology files in cleanCase function
- improve code consistency in top-level blockMesh, PDRblockMesh
generation.