Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#49867 closed defect (fixed)

py-bob-core, py-bob-io-base: build fails on 10.8, fatal error: 'type_traits' file not found

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-core py-bob-io-base

Description

Build fails on 10.8 buildbot as follows.

[ 50%] Building CXX object CMakeFiles/bob_core.dir/opt/local/var/macports/build/_opt_mports_dports_python_py-bob-core/py27-bob-core/work/bob.core-2.0.5/bob/core/cpp/logging.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++   -DBLITZ_VERSION=\"0.10\" -DHAVE_BLITZ=1 -DNO_IMPORT_ARRAY=1 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=BOB_NUMPY_C_API -Dbob_core_EXPORTS -I/opt/local/var/macports/build/_opt_mports_dports_python_py-bob-core/py27-bob-core/work/bob.core-2.0.5/bob/core/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bob/blitz/include -isystem /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -isystem /opt/local/include  -std=c++0x -pedantic -Wall -pthread -Qunused-arguments -m64 -arch x86_64  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -fPIC   -o CMakeFiles/bob_core.dir/opt/local/var/macports/build/_opt_mports_dports_python_py-bob-core/py27-bob-core/work/bob.core-2.0.5/bob/core/cpp/logging.cpp.o -c /opt/local/var/macports/build/_opt_mports_dports_python_py-bob-core/py27-bob-core/work/bob.core-2.0.5/bob/core/cpp/logging.cpp
In file included from /opt/local/var/macports/build/_opt_mports_dports_python_py-bob-core/py27-bob-core/work/bob.core-2.0.5/bob/core/cpp/logging.cpp:30:
In file included from /opt/local/include/boost/thread/mutex.hpp:16:
In file included from /opt/local/include/boost/thread/pthread/mutex.hpp:16:
In file included from /opt/local/include/boost/thread/lock_types.hpp:11:
/opt/local/include/boost/thread/detail/move.hpp:31:10: fatal error: 'type_traits' file not found
#include <type_traits>
         ^
1 error generated.

I believe this may be a problem that has been seen before with boost 1.59 and OS X versions that use libstdc++ (10.8, 10.7). 10.7 buildbot is currently down so can't confirm the result there.

More complete excerpt from 10.8 buildbot log file attached

Attachments (3)

buildports-mtln-x86_64-26188-main.log (15.7 KB) - added by dbevans (David B. Evans) 9 years ago.
Build log for py27-bob-core showing failure
patch-py-bob-core.diff (998 bytes) - added by dbevans (David B. Evans) 9 years ago.
Patch to fix py-bob-core
patch-py-bob-io-base.diff (998 bytes) - added by dbevans (David B. Evans) 9 years ago.
Patch to fix py-bob-io-base

Download all attachments as: .zip

Change History (10)

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

Build log for py27-bob-core showing failure

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

After resolving the 10.6 compiler issue described in #49868, the 10.6 buildbot build of py-bob-core also fails with this same error. This supports the theory that this occurs with boost 1.59 (only) when building on platforms that build against libstdc++ by default (10.8 and earlier).

Version 0, edited 9 years ago by dbevans (David B. Evans) (next)

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

Hi Dave,

With a fast search I found this long thread with a possible workaround (you are involved btw) https://lists.macosforge.org/pipermail/macports-users/2015-September/039196.html

I don't have the systems 10.6, 10.7 and 10.8 handy, so I can't test this workaround. If I submit a patch with the this modification could you please test it?

Thanks

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

Yes, I'm familiar with this. This work around works for the libvisio case, but really doesn't address the root cause of the problem so one should be careful using it.

In the update of boost to version 1.59.0, the order of header inclusion internal to several boost libraries was reordered in such a way as to cause the inclusion of <type_traits> to be asserted unconditionally breaking compatibility with libstdc++. I need to review my notes, but as I remember, boost.move was a particular case in point. In the libvisio case, the workaround works because the code never actually uses any of the boost libraries, it just uses boost header files for their definitions and nothing from <type_traits>.

The better solution would be for the boost developers to address this issue in their code but I haven't seen any fixes upstream yet. Need to check again and see if anything has happened in that department.

The work around may work for you but it also may cause some problems depending on which boost libraries are being used and what the effect of disabling the <type_traits> inclusion is for you. So I'm guessing that using this will probably allow your code to compile but could possibly be problematic at run time.

I will test the build on 10.8 locally and report back but I don't know enough about bob at this point to be able to test it in a run time setting. Can you recommend a test case or cases that might be appropriate?

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

Port: py-bob-io-base added
Summary: py-bob-core: build fails on 10.8, fatal error: 'type_traits' file not foundpy-bob-core, py-bob-io-base: build fails on 10.8, fatal error: 'type_traits' file not found

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

After testing I found that both py-bob-core and py-bob-io-base are effected my this build error.

The error occurs on platforms that use libstdc++ with boost 1.59.0 and include directly or indirectly boost/thread/detail/move.hpp.

The workaround is to assert -DBOOST_NO_CXX11_RVALUE_REFERENCES which can be seen by inspection of move.hpp to disable the inclusion of <type_traits> which is not libstdc++ compatible. The questionable side effect is that boost will then avoid using rvalue references throughout even though Apple libstdc++ does support them.

We've seen this with a number of ports that use boost now so I'm reporting this issue upstream to the boost developers.

Attached are patches for the two modules that assert -DBOOST_NO_CXX11_RVALUE_REFERENCES if libstdc++ is being used. I had some difficulty figuring out how to get your build system to add -DBOOST_NO_CXX11_RVALUE_REFERENCES to the appropriate build commands so you may be able to suggest a more elegant approach.

Let me know if these are ok to commit.

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

Attachment: patch-py-bob-core.diff added

Patch to fix py-bob-core

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

Attachment: patch-py-bob-io-base.diff added

Patch to fix py-bob-io-base

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

Resolution: fixed
Status: newclosed

Committed in r144927 with Andre's agreement (#50201).

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

As a result of this fix py-bob-core and py-bob-io-core now build correctly on 10.8+ (10.7 not tested). py-bob-core also builds on 10.6 but py-bob-io-core now fails on 10.6 with a different issue. See #50399.

Note: See TracTickets for help on using tickets.