rename to LAMMPS_OMP_COMPAT, improve docs

This commit is contained in:
Michael Lamparski 2020-03-20 13:21:21 -04:00
parent 0bedebc083
commit 6563331d6e
4 changed files with 15 additions and 4 deletions

View File

@ -242,9 +242,9 @@ if(BUILD_OMP)
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.99.9))
# GCC 9.x strictly implements OpenMP 4.0 semantics for consts.
add_definitions(-DLMP_OMP_COMPAT=4)
add_definitions(-DLAMMPS_OMP_COMPAT=4)
else()
add_definitions(-DLMP_OMP_COMPAT=3)
add_definitions(-DLAMMPS_OMP_COMPAT=3)
endif()
endif()

View File

@ -264,6 +264,16 @@ cmake -C ../cmake/presets/all_on.cmake -C ../cmake/presets/nolib.cmake -D PKG_GP
</dl>
</td>
</tr>
<tr>
<td><code>LAMMPS_OMP_COMPAT</code></td>
<td>Workaround for backwards-incompatible changes regarding predetermined sharing modes in OpenMP 4.x. A value of 3 or 4 should be used, reflecting the version of the OpenMP spec that is implemented by the compiler.</td>
<td>
<dl>
<dt><code>3</code> (default except for known OMP 4.0 compilers)</dt>
<dt><code>4</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>LAMMPS_MEMALIGN</code></td>
<td>controls the alignment of blocks of memory allocated by LAMMPS</td>

View File

@ -147,7 +147,8 @@ semantics, which are incompatible with the OpenMP 3.1 semantics used
in LAMMPS (for maximal compatibility with compiler versions in use).
LAMMPS will try to detect compilers that use OpenMP 4.0 semantics and
change the directives accordingly, but if your compiler is not
detected, you may set the CMake variable ``-D LMP_OMP_COMPAT=4``.
detected, you may set the define ``-D LAMMPS_OMP_COMPAT=4`` in ``LMP_INC``
or the CMake build command.
----------

View File

@ -25,7 +25,7 @@
// so this is what LAMMPS primarily uses. For those compilers
// that strictly implement OpenMP 4.0 (such as GCC 9.0), we
// give up default(none).
#if LMP_OMP_COMPAT == 4
#if LAMMPS_OMP_COMPAT == 4
# define LMP_SHARED(...)
# define LMP_DEFAULT_NONE default(shared)
#else