message(WARNING "Currently tested PGI compiler versions (up to 15.7) generate binaries that do not pass all regression test, and the generated binaries are significantly slower than with GCC, ICC or Clang. For now we do not recommend PGI beyond development testing - make sure to run the regressiontests.")
endif()
- # Test that C bool and C++ bool size is the same
- include(CheckTypeSize)
- set(CMAKE_EXTRA_INCLUDE_FILES "stdbool.h")
- CHECK_TYPE_SIZE("bool" C_BOOL_SIZE LANGUAGE "C")
- set(CMAKE_EXTRA_INCLUDE_FILES "")
- CHECK_TYPE_SIZE("bool" CXX_BOOL_SIZE LANGUAGE "CXX")
- if(NOT C_BOOL_SIZE EQUAL CXX_BOOL_SIZE)
- message(FATAL_ERROR "Size of bool of C and C++ compiler don't match. Make sure you use compatible C and C++ compilers. If both compilers are from the same vendor, please report the issue to redmine.gromacs.org.")
- endif()
endmacro(gmx_test_compiler_problems)
#ifndef _fftpack_h
#define _fftpack_h
-#include "gromacs/utility/real.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#define Treal real
+#if GMX_DOUBLE
+#define Treal double
+#else
+#define Treal float
+#endif
void fftpack_cffti1(int n, Treal wa[], int ifac[]);
void fftpack_cfftf1(int n, Treal c[], Treal ch[], const Treal wa[], const int ifac[], int isign);
#include "gromacs/mdtypes/nblist.h"
#include "gromacs/utility/real.h"
-#if 0
-} /* fixes auto-indentation problems */
-#endif
-
/*! \def gmx_inline
* \brief
* Keyword to use in C code instead of C99 `inline`.
* to indicate a function is inlined.
* C++ code should use plain `inline`, as that is already in C++98.
*/
-#if !defined __cplusplus && defined _MSC_VER
-#define gmx_inline __inline
-#else
-/* C++ or C99 */
#define gmx_inline inline
-#endif
struct t_blocka;
return (m[XX][XX]+m[YY][YY]+m[ZZ][ZZ]);
}
-#ifdef __cplusplus
namespace gmx
{
/*!
template <typename T> T norm2(T* v) { return ::norm2(v); }
} // namespace gmx
/*! \} */
-#endif // __cplusplus
#endif
#ifndef GMX_MATH_VECTYPES_H
#define GMX_MATH_VECTYPES_H
-#ifdef __cplusplus
-
#include <cmath>
#include <type_traits>
-#else
-
-#include <math.h> // since this file used from C source files
-
-#endif
-
#include "gromacs/utility/real.h"
#define XX 0 /* Defines for indexing in */
typedef int ivec[DIM];
-#ifdef __cplusplus
-
namespace gmx
{
} // namespace gmx
-#endif // ifdef __cplusplus
-
#endif // include guard
#ifndef GMX_MDTYPES_TYPES_FORCEREC_H
#define GMX_MDTYPES_TYPES_FORCEREC_H
-#include "gromacs/math/vectypes.h"
-#ifdef __cplusplus
#include "gromacs/math/paddedvector.h"
-#endif
+#include "gromacs/math/vectypes.h"
#include "gromacs/mdtypes/interaction_const.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/utility/basedefinitions.h"
* PPPM/PME/Ewald/posres/ForceProviders
*/
/* True when we have contributions that are directly added to the virial */
- gmx_bool haveDirectVirialContributions;
-#ifdef __cplusplus
+ gmx_bool haveDirectVirialContributions;
/* TODO: Replace the pointer by an object once we got rid of C */
std::vector<gmx::RVec> *forceBufferForDirectVirialContributions;
-#else
- void *forceBufferForDirectVirialContributions_dummy;
-#endif
/* Data for PPPM/PME/Ewald */
struct gmx_pme_t *pmedata;
/* Deprecated, C-style version of RangePartitioning */
typedef struct t_block
{
-#ifdef __cplusplus
int blockSize(int blockIndex) const
{
GMX_ASSERT(blockIndex < nr, "blockIndex should be in range");
return index[blockIndex + 1] - index[blockIndex];
}
-#endif // __cplusplus
int nr; /* The number of blocks */
int *index; /* Array of indices (dim: nr+1) */
#include <stdint.h>
-#if defined __cplusplus
#include <cinttypes>
#include <cstddef>
-#else
-#include <stdbool.h>
-#endif
//! Identical to bool
typedef bool gmx_bool;
/** Number of gmx_bool values. */
#define BOOL_NR 2
-#if defined __cplusplus
namespace gmx
{
/*! \brief Integer type for indexing into arrays or vectors
*/
using index = std::ptrdiff_t;
}
-#endif
/* ICC, GCC, MSVC, Pathscale, PGI, XLC support __restrict.
* Any other compiler can be added here. */
#define DIAGNOSTIC_RESET
#endif
-#ifdef __cplusplus
namespace gmx
{
namespace internal
*/
#define GMX_IGNORE_RETURN_VALUE(call) \
::gmx::internal::ignoreValueHelper(call)
-#endif
#endif
#endif /* GMX_DOUBLE */
-#ifdef __cplusplus
/*! \brief User defined literal for real numbers.
*
* Examples: 2._real, 2.5_real, .5_real. The number is always of type real.
* See https://en.cppreference.com/w/cpp/language/user_literal for details on this lanuage feature.
*/
constexpr real operator"" _real(long double x) { return real(x); }
-#endif
#endif