Commit 786ddbc7 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Make COMMON block work when using -fno-common.

* This is the default on gcc 10, but doesn't hurt to specify for older
  versions too in case the user activates -fno-common.
parent 8560103f
...@@ -67,6 +67,10 @@ ...@@ -67,6 +67,10 @@
# if defined __clang__ # if defined __clang__
# pragma GCC diagnostic pop # pragma GCC diagnostic pop
# endif # endif
# if defined __GNUC__
# undef COMMON_BLOCK_DEF
# define COMMON_BLOCK_DEF(DEFINITION, NAME) extern DEFINITION NAME __attribute__((aligned(16),common))
# endif
#endif #endif
#ifdef USE_MPI #ifdef USE_MPI
# include <mpi.h> # include <mpi.h>
...@@ -88,9 +92,12 @@ typedef struct ...@@ -88,9 +92,12 @@ typedef struct
COMMON_BLOCK_DEF(SymPrefix(F2C_Def),F2C_Data); COMMON_BLOCK_DEF(SymPrefix(F2C_Def),F2C_Data);
SymPrefix(F2C_Def) F2C_Data; SymPrefix(F2C_Def) F2C_Data
# if defined __GNUC__
__attribute__((aligned(16),common))
# endif
#endif #endif
;
void void
SymPrefix(set_default_comm)(MPI_Comm comm) SymPrefix(set_default_comm)(MPI_Comm comm)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment