Project

General

Profile

Bug #324

4.0.5's use of "restrict" keyword in altivec kernel breaks GCC compilers

Added by Nicholas Breen over 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

4.0.5 added the "restrict" keyword to various parts of the PPC AltiVec-specific kernels. The release notes say this was done to fix a compile failure with IBM Xlc 10.1, but it now breaks with GCC 4.x, which does not recognize restrict unless specifically put in C99 mode.

A possible workaround:

--- ppc_altivec_util.h.orig 2009-05-14 17:12:46.000000000 -0700
+++ ppc_altivec_util.h 2009-05-14 17:13:56.000000000 -0700
@ -41,6 +41,13 @
#include <altivec.h>
#endif

/* gcc disallows the "restrict" keyword without -std=c99, but restrict
* always works.
+ /
#ifdef __GNUC

#define restrict __restrict
#endif

/
* Write contents of a SIMD FP variable on standard out. * * @internal

History

#2 Updated by Erik Lindahl over 10 years ago

Hi,

Sorry about that, will fix. However, instead of a gcc-only fix we'll introduce a gmx_restrict, which is defined to restrict, __restrict, or empty if not supported.

(The restrict modifier is important, since this makes IBM xlc just as fast as xlf, and then we can retire fortran in the future...)

Cheers,

Erik

#3 Updated by Rossen Apostolov over 9 years ago

Hi Erik,

Is that already fixed in git?

#4 Updated by Erik Lindahl about 9 years ago

Fix for automake added to the stable 4.0.x branch, and both for automake and cmake to the 4.5 branch.

Also available in: Atom PDF