PGCC 7.0 Incompatible With Numerical Recipes

How do I include Numerical Recipes nr.h on linux64 with pgcc version 7.0? Version 6.1 is OK, but version 7.0 says, “PGC-S-0137 Incompatible prototype declaration for function __builtin_fmin(./nr.h:190)” This was a major reason we rejected the Intel FORTRAN/C compiler.

Terry C.

Hi Terry,

My guess as to what’s happening is that the nr.h header file contains it’s own prototype for “fmin” which may not be compatible with the C99 language standard’s version. Try compiling with “-c89” to use the C89 language standard instead of the default of C99. Release 6.1 uses C89 by default.

Hope this helps,
Mat

Thanks for the suggestion. After consulting with: 1) PGI tech support, 2) the FAQs at the Numerical Recipes Web site, and 3) some oher Numerical Recipe users in my work group, I wrote a small include file “nr_some.h” which contains only the five Numerical Recipe prototypes from “nr.h” that my applications actually use.

#ifndef NR_SOME
#define NR_SOME
#include “nrutil.h”
double dpythag(double a, double b);
void dsvbksb(double **u, double w, double **v, int m, int n, double b, double x);
void dsvdcmp(double **a, int m, int n, double w, double **v);
void jacobi(float **a, int n, float d, float **v, int nrot);
float selectf(unsigned long k, unsigned long n, float arr[]);
#endif /
NR_SOME */

I still need to include the prototypes in “nrutil.h”, but these don’t cause any trouble with the new PGI 7.0 compiler.