Opened 9 years ago

Closed 9 years ago

#49868 closed defect (fixed)

py-bob-blitz (and possibly others): build fails on 10.6, error: unrecognized command line option "-std=c++0x"

Reported by: dbevans (David B. Evans) Owned by: tiago.pereira@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: andre.anjos@…, laurent.el-shafey@…
Port: py-bob-blitz

Description (last modified by dbevans (David B. Evans))

building 'bob.blitz.version' extension
creating build/temp.macosx-10.6-x86_64-2.7
creating build/temp.macosx-10.6-x86_64-2.7/bob
creating build/temp.macosx-10.6-x86_64-2.7/bob/blitz
/usr/bin/gcc-4.2 -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -Wno-strict-aliasing -DBOB_EXT_MODULE_PREFIX="bob.blitz" -DBOB_EXT_MODULE_NAME="version" -DBOB_EXT_ENTRY_NAME=initversion -DBOB_EXT_MODULE_VERSION="2.0.8" -DHAVE_BOOST=1 -DBOOST_VERSION="1.59.0" -DHAVE_BLITZ=1 -DBLITZ_VERSION="0.10" -DPY_ARRAY_UNIQUE_SYMBOL=BOB_BLITZ_NUMPY_C_API -DNO_IMPORT_ARRAY=1 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -I/opt/local/var/macports/build/_opt_mports_dports_python_py-bob-blitz/py27-bob-blitz/work/bob.blitz-2.0.8/bob/blitz/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bob/extension/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c bob/blitz/version.cpp -o build/temp.macosx-10.6-x86_64-2.7/bob/blitz/version.o -std=c++0x -Wno-#warnings -isystem /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -isystem /opt/local/include
cc1plus: error: unrecognized command line option "-std=c++0x"
error: command '/usr/bin/gcc-4.2' failed with exit status 1
Command failed:  cd "/opt/local/var/macports/build/_opt_mports_dports_python_py-bob-blitz/py27-bob-blitz/work/bob.blitz-2.0.8" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build
Exit code: 1

Default compilers on 10.6 and earlier (gcc-4.2, llvm-gcc-4.2, early clang < 3.0) don't support -std=c++0x.

Possible remedy is to use PortGroup compiler_blacklist_versions to blacklist these compilers.

PortGroup           compiler_blacklist_versions 1.0
...
compiler.blacklist  *gcc* {clang < 300}

This will cause the compiler selection to fall back to a more recent compiler (MacPorts clang-3.4 in this case).

Attachments (2)

patch-py-bob-blitz-blacklist-older-compilers.diff (844 bytes) - added by dbevans (David B. Evans) 9 years ago.
Patch for blitz to fix build on 10.6 (already committed)
patch-py-bob.zip (25.6 KB) - added by tiagofrepereira2012 (Tiago Freitas Pereira) 9 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 9 years ago by tiagofrepereira2012 (Tiago Freitas Pereira)

Hi Dave,

Thanks for the report. We don't have a computer infrastructure to test this against the OS X 10.6.

Feel free to submit a patch with the suggested modification.

Best

Tiago

Changed 9 years ago by dbevans (David B. Evans)

Patch for blitz to fix build on 10.6 (already committed)

comment:2 Changed 9 years ago by dbevans (David B. Evans)

Summary: py-bob-blitz: build fails on 10.6, error: unrecognized command line option "-std=c++0x"py-bob-blitz (and possibly others): build fails on 10.6, error: unrecognized command line option "-std=c++0x"

Patch attached. I went ahead and committed this to test that it fixes the issue with this port on the 10.6 buildbot (r143007). Test was successful.

I'll leave it to you to make similar modifications to the rest of the py-bob* ports that use -std=c++0x and post the necessary patch. One patch for the lot would be best. Be sure to sync your sources with the current ports repository before making the changes.

sudo port selfupdate

BTW, you can simulate this issue and the solution on more current machines by installing the necessary compilers from MacPorts and forcing the compiler selection on the command line.

e.g. to demonstrate the error with gcc-4.2

$ sudo port install apple-gcc42
$ sudo port -d build py27-bob-blitz configure.compiler=apple-gcc-4.2

To demonstrate the fix by building with clang-3.4 (the fallback compiler)

$ sudo port install clang-3.4
$ sudo port -d build py27-bob-blitz configure.compiler=macports-clang-3.4

I'll leave this ticket open until the rest of the ports are fixed.

Last edited 9 years ago by dbevans (David B. Evans) (previous) (diff)

comment:3 Changed 9 years ago by dbevans (David B. Evans)

Description: modified (diff)

comment:4 Changed 9 years ago by tiagofrepereira2012 (Tiago Freitas Pereira)

Thanks for the update Dave; I will update the others.

Shall I use this ticket to update the other ports?

Thanks

comment:5 in reply to:  4 Changed 9 years ago by dbevans (David B. Evans)

Replying to tiagofrepereira@…:

Thanks for the update Dave; I will update the others.

Shall I use this ticket to update the other ports?

Yes, its really the same issue.

comment:6 Changed 9 years ago by tiagofrepereira2012 (Tiago Freitas Pereira)

Hello Dave,

To apply your suggested modification in the other py-bob-XXXX ports, I tried to copy the Portfile from py-bob-blitz (https://trac.macports.org/browser/trunk/dports/python/py-bob-blitz/Portfile), but wasn't possible. I always get page with the message (Track Error - HTTP -404).

Is there any problem with the MacPorts portal?

Thanks

comment:7 in reply to:  6 Changed 9 years ago by dbevans (David B. Evans)

Replying to tiagofrepereira@…:

Hello Dave,

To apply your suggested modification in the other py-bob-XXXX ports, I tried to copy the Portfile from py-bob-blitz (https://trac.macports.org/browser/trunk/dports/python/py-bob-blitz/Portfile), but wasn't possible. I always get page with the message (Track Error - HTTP -404).

Is there any problem with the MacPorts portal?

Yes, the trac port repository currently has an issue and has not been updating for some time. Try getting the port from the main macports svn repository instead.

http://svn.macports.org/repository/macports/trunk/dports/python/py-bob-blitz/Portfile

comment:8 Changed 9 years ago by tiagofrepereira2012 (Tiago Freitas Pereira)

Hello Dave,

I already applied your suggested modifications. Can I attach the Portfiles entirely?

Thanks

Tiago

comment:9 in reply to:  8 Changed 9 years ago by dbevans (David B. Evans)

Replying to tiagofrepereira@…:

Hello Dave,

I already applied your suggested modifications. Can I attach the Portfiles entirely?

Thanks

Tiago

A unified diff is usually preferred (smaller and easier to see what changes have been made) but the Portfiles in their entirety will work as well.

Dave

Changed 9 years ago by tiagofrepereira2012 (Tiago Freitas Pereira)

Attachment: patch-py-bob.zip added

comment:10 Changed 9 years ago by tiagofrepereira2012 (Tiago Freitas Pereira)

Hello Dave,

Follow attached the diffs for each Portfile that is part of py-bob

Thanks for find a solution for the bug.

comment:11 Changed 9 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: newclosed

Patches applied cleanly and fix the issue with compiling py34-bob* on 10.9+. The compiler compatibility issue on 10.6 and earlier is also fixed but the 10.6 buildbot build of py-bob-core now fails with the same issue as reported in #49867. Please refer to that ticket for details.

Note: See TracTickets for help on using tickets.