[gmx-users] Compilation problem with 3.2

Erik Lindahl lindahl at csb.stanford.edu
Tue Feb 10 17:09:01 CET 2004


Hi Ross,

Yes, we are changing it to "static const". This was just a bit of 
overkill in our quest to get rid of static variables to prepare for 
multithreading...

Cheers,

Erik

On Feb 10, 2004, at 5:03 PM, Ross Nobes wrote:

> Dear All,
>
> I have come across a problem in trying to build version 3.2 on a 
> Fujitsu
> Solaris machine. In src/gmxlib/index.c, the array chains is declared 
> thus:
>
>   /* array of arrays of atomnames: */
>   const char **chains[] = { 
> NULL,pnoh,calpha,bb,mc,mcb,mch,mch,mch,pnodum };
>
> In order for the initializer to be a constant expression (in the strict
> sense that the compiler must be able to evaluate the expression), all 
> of
> pnoh, calpha, bb, mc, mcb, mch and pnodum should be declared as 
> static, e.g.
>
>  static const char *pnoh[]    = { "H" };
>
> (In 3.1.4, these arrays were indeed declared as static, but this has 
> been
> changed in 3.2.) Most compilers let the user get away with this sort of
> thing - in fact the standard says
>
> "An implementation may accept other forms of constant expressions."
>
> but the Fujitsu compiler unfortunately sticks rigidly to the standard. 
> Would
> it be possible to revert to static storage for these arrays in future
> release of GROMACS?
>
> Cheers,
> Ross
>
> --
> Ross Nobes
> Manager, Physical and Life Sciences Research Group
> Fujitsu Laboratories of Europe
> Hayes Park Central, Hayes End Road
> Hayes, Middlesex UB4 8FE, UK
> Phone +44 (0) 77 7195 6113
> Fax +44 (0) 20 8606 4539
> E-mail R.Nobes at fle.fujitsu.com
>
>
> <InterScan_Disclaimer.txt>




More information about the gromacs.org_gmx-users mailing list