[gmx-users] compile error - MAC OSX

Jay Mashl mashl at uiuc.edu
Sat Feb 15 00:04:31 CET 2003


On Fri, 14 Feb 2003, Erik Lindahl wrote:

> Steven Hentel wrote:
>
> > Help!  I'm no UNIX pro and compiling gromacs gives me:
> >
> > xutils.c:97: `fmax' redeclared as different kind of symbol
> > /usr/include/architecture/ppc/math.h:307: previous declaration of `fmax'
> > xutils.c:97: warning: `fmax' was declared `extern' and later `static'
> >
> > I've tried make with the -e flag and that doesn't help.
> >
> > Steven
> >
> Hi Steven,
>
> This seems to be a bug in some system header files; fmax isn't a
> reserved word, so we should be able to use it, but instead of banging
> your head against it you can just change the 2-3 occurences of fmax in
> xutils.c to fmax_gmx or something. This is already fixed in our CVS sources.
>
> Cheers,
>
> Erik


This is the patch I have made for myself.

--------SNIP ------------------------------------------------
--- src/kernel/xutils.c.orig    Thu Feb 28 14:00:10 2002
+++ src/kernel/xutils.c Tue Mar 12 21:55:13 2002
@@ -94,7 +94,7 @@
 /* Lots of global variables! Yummy... */
 static real tol     = 0.1;
 static real epot    = 0.0;
-static real fmax    = 100;
+static real _fmax    = 100;
 static real npow    = 12.0;
 static bool bComb   = TRUE;
 static bool bLogEps = FALSE;
@@ -107,7 +107,7 @@
   epot    = ff_epot;
   npow    = ff_npow;
   bComb   = ff_bComb;
-  fmax    = ff_fmax;
+  _fmax    = ff_fmax;
   ratio   = ff_ratio;
   bLogEps = ff_bLogEps;
 }
@@ -401,7 +401,7 @@
     for(i=0; (i<natoms); i++)
       msf += iprod(f[i],f[i]);
     rmsf = sqrt(msf/natoms);
-    if ((fmax == 0) || (rmsf < fmax))
+    if (( _fmax == 0) || (rmsf < _fmax))
       print_range(fp,rmsf,energy);
   }
 }
--------SNIP ------------------------------------------------

Jay





More information about the gromacs.org_gmx-users mailing list