[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation
Nasos Dousis added the comment: Ronald, Thanks much for your help and insight. I tried the patch but unfortunately it didn't work for me-- this might be because I have Python extensions written in C++. Any other suggestions? Should I wait for the next version of boost.python? Thanks and regards, Nasos -- ___ Python tracker <http://bugs.python.org/issue10910> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation
Nasos Dousis added the comment: Ronald, thanks again. I stripped out as much as I could from the original code and generated the attached project. In doing so, I narrowed the problem down to boost/weak_ptr.hpp. The sample project consists of: test-boost-python/Makefile test-boost-python/src test-boost-python/src/Jamroot test-boost-python/src/test test-boost-python/src/test/Jamfile test-boost-python/src/test/TestBoostPython.cc test-boost-python/src/test/TestBoostPython.hh test-boost-python/tools/Makefile Before building the project (just type "make" in test-boost-python), you'll need to download Boost and save it to test-boost-python/tools/boost/boost.tar.bz2; also, the tools/Makefile automatically downloads Python 2.7.2, but you can try Python 3.2+ in its place. Thanks and kind regards, Nasos -- ___ Python tracker <http://bugs.python.org/issue10910> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation
Nasos Dousis added the comment: With attachment-- -- Added file: http://bugs.python.org/file22703/test-boost-python.tar.gz ___ Python tracker <http://bugs.python.org/issue10910> ___ test-boost-python.tar.gz Description: GNU Zip compressed data ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation
Nasos Dousis added the comment: I'm upgrading from Python 2.6.5 to 2.7.1, and I'm getting the error below when compiling my code using Boost 1.45 and gcc 4.2.1 in OSX 10.6.6. The following thread describes similar symptoms related to the ordering of header files and macro definitions: http://code.google.com/p/unladen-swallow/issues/detail?id=87#c13 The suggested patch to pyport.h (http://codereview.appspot.com/179049/patch/1/2) does not fix my problem. However, prepending #include "Python.h" to each source file (e.g., bend.cc below) does fix the problem. Is there a simple way to fix this without adding Python.h to every source file in my codebase? I've installed Boost and Python from source to non-standard directories, Boost 1.45 by: cd $(BOOST); ./bootstrap.sh --prefix=$(CURDIR)/$(BOOST) --with-python-root=$(CURDIR)/$(PYTHON_DIR) --with-python-version=2.7 --with-libraries=mpi and Python 2.7 by: cd $(PYTHON_SRCDIR) ; ./configure --enable-shared --prefix=$(CURDIR)/$(PYTHON_DIR) cd $(PYTHON_SRCDIR) ; make -j $(NUMPROC) && make install Any guidance will be greatly appreciated. Kind regards, Nasos === ... darwin.compile.c++ bin/darwin-4.2.1/release/threading-multi/bend.o In file included from /usr/include/c++/4.2.1/ios:47, from /usr/include/c++/4.2.1/ostream:45, from /usr/include/c++/4.2.1/iterator:70, from boost/boost/next_prior.hpp:15, from boost/boost/utility.hpp:17, from boost/boost/python/instance_holder.hpp:10, from boost/boost/python/object/pointer_holder.hpp:14, from boost/boost/python/to_python_indirect.hpp:10, from boost/boost/python/converter/arg_to_python.hpp:10, from boost/boost/python/call.hpp:15, from boost/boost/python/object_core.hpp:14, from boost/boost/python/args.hpp:25, from boost/boost/python.hpp:11, from bend.hh:6, from bend.cc:1: /usr/include/c++/4.2.1/bits/localefwd.h:58:34: error: macro "isspace" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/localefwd.h:70:34: error: macro "isupper" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/localefwd.h:74:34: error: macro "islower" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/localefwd.h:78:34: error: macro "isalpha" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/localefwd.h:94:34: error: macro "isalnum" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/localefwd.h:102:34: error: macro "toupper" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/localefwd.h:106:34: error: macro "tolower" passed 2 arguments, but takes just 1 In file included from /usr/include/c++/4.2.1/bits/basic_ios.h:44, from /usr/include/c++/4.2.1/ios:50, from /usr/include/c++/4.2.1/ostream:45, from /usr/include/c++/4.2.1/iterator:70, from boost/boost/next_prior.hpp:15, from boost/boost/utility.hpp:17, from boost/boost/python/instance_holder.hpp:10, from boost/boost/python/object/pointer_holder.hpp:14, from boost/boost/python/to_python_indirect.hpp:10, from boost/boost/python/converter/arg_to_python.hpp:10, from boost/boost/python/call.hpp:15, from boost/boost/python/object_core.hpp:14, from boost/boost/python/args.hpp:25, from boost/boost/python.hpp:11, from bend.hh:6, from bend.cc:1: /usr/include/c++/4.2.1/bits/locale_facets.h:242:53: error: macro "toupper" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/locale_facets.h:271:53: error: macro "tolower" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/locale_facets.h:814:53: error: macro "toupper" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/locale_facets.h:847:53: error: macro "tolower" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/locale_facets.h:4611:44: error: macro "isspace" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/locale_facets.h:4629:44: error: macro "isupper" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/locale_facets.h:4635:44: error: macro "islower" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/locale_facets.h:4641:44: error: macro "isalpha" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/locale_facets.h:4665:44: error: macro "isalnum" passed 2 arguments, but takes just 1 /usr/include/c++/4.2.1/bits/locale_facets.h:4677:44: error: macro "
[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation
Nasos Dousis added the comment: Meador et al, Thanks for your attention to this issue. Just to clarify, I can eliminate the compile errors by prepending #include "Python.h" to any source file with #include Also, my code compiles in Linux, with and without the Python.h header: $ uname -a Linux nxx.xx.com 2.6.18-128.1.14.el5 #1 SMP Wed Jun 17 06:38:05 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux with the same flags as before: cd $(BOOST); ./bootstrap.sh --prefix=$(CURDIR)/$(BOOST) --with-python-root=$(CURDIR)/$(PYTHON_DIR) --with-python-version=2.7 --with-libraries=mpi cd $(PYTHON_SRCDIR) ; ./configure --enable-shared --prefix=$(CURDIR)/$(PYTHON_DIR) cd $(PYTHON_SRCDIR) ; make -j $(NUMPROC) && make install Thanks again, Nasos -- Added file: http://bugs.python.org/file21728/unnamed ___ Python tracker <http://bugs.python.org/issue10910> ___Meador et al,Thanks for your attention to this issue.  Just to clarify, I can eliminate the compile errors by prepending #include "Python.h" to any source file with #include<boost/python.hpp> Also, my code compiles in Linux, with and without the Python.h header: $ uname -aLinux http://nxx.xx.com";>nxx.xx.com 2.6.18-128.1.14.el5 #1 SMP Wed Jun 17 06:38:05 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux with the same flags as before:cd $(BOOST); ./bootstrap.sh --prefix=$(CURDIR)/$(BOOST) --with-python-root=$(CURDIR)/$(PYTHON_DIR) --with-python-version=2.7 --with-libraries=mpi cd $(PYTHON_SRCDIR) ; ./configure --enable-shared --prefix=$(CURDIR)/$(PYTHON_DIR)cd $(PYTHON_SRCDIR) ; make -j $(NUMPROC) && make install Thanks again,Nasos ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation
Nasos Dousis added the comment: Per Chen Huang's comment, I retested my test case code using several versions of boost and Python 2.7: boost 1.45: build fails, errors as reported. boost 1.46: success. boost 1.47: success. I've attached a revised test case that automatically downloads and builds boost 1.45. -- Added file: http://bugs.python.org/file24428/test-boost-python.revised.tar.gz ___ Python tracker <http://bugs.python.org/issue10910> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com