petsc-mini:junk petsc$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.11.6
BuildVersion: 15G17023
petsc-mini:junk petsc$ xcodebuild -version
Xcode 8.2.1
Build version 8C1002
petsc-mini:junk petsc$ pgcc --version
pgcc 17.10-0 64-bit target on macOS -tp penryn
PGI Compilers and Tools
Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
petsc-mini:junk petsc$
petsc-mini:junk petsc$ cat ntest.c
#include <stdio.h>
#include <limits.h>
#include <stddef.h>
int main(void)
{
double zero=0.0;
double a = zero/zero;
if (a == a) printf("yes\n");
else printf("no\n");
return 0;
}
petsc-mini:junk petsc$ pgcc ntest.c
PGC-W-0221-Redefinition of symbol __SIZE_TYPE__ (/opt/pgi/osx86-64/17.10/include/stddef.h: 21)
PGC/x86-64 OSX 17.10-0: compilation completed with warnings
petsc-mini:junk petsc$
I’m working arround with the following change to /opt/pgi/osx86-64/17.10/include/stddef.h
--- stddef.h.orig 2017-12-01 15:56:55.000000000 -0600
+++ stddef.h 2017-12-01 15:57:26.000000000 -0600
@@ -18,7 +18,9 @@
/* These macros are predefined by gcc, g++, and pgc++, but not by pgcc. */
#define __PTRDIFF_TYPE__ long int
#define __WCHAR_TYPE__ int
+#if !defined(__SIZE_TYPE__)
#define __SIZE_TYPE__ unsigned long int
+#endif
#ifdef __builtin_offsetof
#undef __builtin_offsetof