[matplotlib-devel] _POSIX_C_SOURCE redefined

2006-08-24 Thread Darren Dale
I spent a little time this morning looking into these warnings I get when 
building mpl from source, for example:

-
In file included from /usr/include/python2.4/Python.h:13,
 from ./CXX/Objects.hxx:9,
 from ./CXX/Extensions.hxx:19,
 from src/_backend_agg.h:8,
 from src/_wxagg.cpp:48:
/usr/include/python2.4/pyconfig.h:838:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/features.h:8,
 from /usr/include/gentoo-multilib/amd64/string.h:26,
 from /usr/include/string.h:8,
 
from /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/cstring:53,
 from src/_wxagg.cpp:38:
/usr/include/gentoo-multilib/amd64/features.h:154:1: warning: this is the 
location of the previous definition
-

These warnings come from the "#include Python.h" statements, although I 
haven't been able to track down the exact reason. (This problem was discussed 
on python-dev, 
http://mail.python.org/pipermail/python-dev/2005-June/054214.html, but I 
wasn't able to improve mpl's code based on that discussion.) The following 
patch allows mpl to build without warnings on my system (it is hackish, I 
don't intend to commit it.) Would anyone please care to comment?

Darren

Index: src/_gtkagg.cpp
===
--- src/_gtkagg.cpp (revision 2706)
+++ src/_gtkagg.cpp (working copy)
@@ -6,6 +6,9 @@
 #include 
 #include 

+#ifdef _POSIX_C_SOURCE
+#undef _POSIX_C_SOURCE
+#endif

 #include 
 #include 
Index: src/_image.cpp
===
--- src/_image.cpp  (revision 2706)
+++ src/_image.cpp  (working copy)
@@ -5,6 +5,10 @@
 #include 
 #include 

+#ifdef _POSIX_C_SOURCE
+#undef _POSIX_C_SOURCE
+#endif
+
 #include "Python.h" //after png.h due to setjmp bug
 #include 

Index: CXX/Objects.hxx
===
--- CXX/Objects.hxx (revision 2706)
+++ CXX/Objects.hxx (working copy)
@@ -6,6 +6,10 @@
 #ifndef __CXX_Objects__h
 #define __CXX_Objects__h

+#ifdef _POSIX_C_SOURCE
+#undef _POSIX_C_SOURCE
+#endif
+
 #include "Python.h"
 #include "CXX/Version.hxx"
 #include "CXX/Config.hxx"

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Error in compiling on intel Mac, gcc 4.0.1

2006-08-24 Thread Rob Hetland

I get this error when trying to compile _ns_backend_agg.so:

/usr/bin/ld: multiple definitions of symbol __NPY_SIGINT_BUF
build/temp.macosx-10.4-i386-2.4/src/_image.o definition of  
__NPY_SIGINT_BUF in section (__DATA,__common)
build/temp.macosx-10.4-i386-2.4/src/_ns_backend_agg.o definition of  
__NPY_SIGINT_BUF in section (__DATA,__common)
collect2: ld returned 1 exit status
/usr/bin/ld: multiple definitions of symbol __NPY_SIGINT_BUF
build/temp.macosx-10.4-i386-2.4/src/_image.o definition of  
__NPY_SIGINT_BUF in section (__DATA,__common)
build/temp.macosx-10.4-i386-2.4/src/_ns_backend_agg.o definition of  
__NPY_SIGINT_BUF in section (__DATA,__common)
collect2: ld returned 1 exit status
error: Command "c++ -bundle -undefined dynamic_lookup build/ 
temp.macosx-10.4-i386-2.4/agg23/src/agg_trans_affine.o build/ 
temp.macosx-10.4-i386-2.4/agg23/src/agg_path_storage.o build/ 
temp.macosx-10.4-i386-2.4/agg23/src/agg_bezier_arc.o build/ 
temp.macosx-10.4-i386-2.4/agg23/src/agg_curves.o build/ 
temp.macosx-10.4-i386-2.4/agg23/src/agg_vcgen_dash.o build/ 
temp.macosx-10.4-i386-2.4/agg23/src/agg_vcgen_stroke.o build/ 
temp.macosx-10.4-i386-2.4/agg23/src/agg_rasterizer_scanline_aa.o  
build/temp.macosx-10.4-i386-2.4/agg23/src/agg_image_filters.o build/ 
temp.macosx-10.4-i386-2.4/src/_image.o build/temp.macosx-10.4- 
i386-2.4/src/ft2font.o build/temp.macosx-10.4-i386-2.4/src/mplutils.o  
build/temp.macosx-10.4-i386-2.4/CXX/cxx_extensions.o build/ 
temp.macosx-10.4-i386-2.4/CXX/cxxsupport.o build/temp.macosx-10.4- 
i386-2.4/CXX/IndirectPythonInterface.o build/temp.macosx-10.4- 
i386-2.4/CXX/cxxextensions.o build/temp.macosx-10.4-i386-2.4/src/ 
_ns_backend_agg.o -L/usr/local/lib -L/usr/lib -L/usr/local/lib -L/usr/ 
lib -lpng -lz -lstdc++ -lm -lfreetype -lz -lstdc++ -lm -o build/ 
lib.macosx-10.4-i386-2.4/matplotlib/backends/_ns_backend_agg.so"  
failed with exit status 1


I tried to use the -multiply_defined suppress flag, but to no avail..

-Rob



Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel