[SciPy-dev] gcc bzonfig.h

John Hunter jdh2358 at gmail.com
Mon Jul 16 16:32:48 EDT 2007


On our x86 solaris platform with gcc

johnh at flag:svn> gcc --version
gcc (GCC) 3.4.1

johnh at flag:svn> uname -a
SunOS flag 5.10 Generic_118855-15 i86pc i386 i86pc

we are getting an error with blitz inline (eg in Prabhu's laplace.py
example) because we are getting the gnu/bzconfig.h macro defined

/* define if the compiler has isnan function in namespace std */
#ifndef BZ_ISNAN_IN_NAMESPACE_STD
#define BZ_ISNAN_IN_NAMESPACE_STD
#endif

and then a compiler error that isnan is not in the std::namespace.  We
tried to "undec_macros" this variable, but that was no help, so we
patched the file with the scipy svn patch below.  This shouldn't
adversely affect anyone, because the default behavior will be the
same, but will allow us to compile weave blitz code with the
define_macros

definte_macros=[('NO_BZ_ISNAN_IN_NAMESPACE_STD',1)]

Although the double negative syntax is a bit irksome, I didn't know a
better way to turn off this macro.  If this, or something like it,
could be included in scipy, that would be great.

Thanks.
JDH

Index: Lib/weave/blitz/blitz/gnu/bzconfig.h
===================================================================
--- Lib/weave/blitz/blitz/gnu/bzconfig.h	(revision 3166)
+++ Lib/weave/blitz/blitz/gnu/bzconfig.h	(working copy)
@@ -298,9 +298,11 @@
 #endif

 /* define if the compiler has isnan function in namespace std */
+#ifndef NO_BZ_ISNAN_IN_NAMESPACE_STD
 #ifndef BZ_ISNAN_IN_NAMESPACE_STD
 #define BZ_ISNAN_IN_NAMESPACE_STD
 #endif
+#endif

 /* define if the compiler has C math functions in namespace std */
 #ifndef BZ_MATH_FN_IN_NAMESPACE_STD



More information about the SciPy-Dev mailing list