[MacPorts] #53040: py27-wxpython-3.0 @3.0.2.0 fatal error: 'type_traits' file not found on systems upgraded to libc++

MacPorts noreply at macports.org
Fri Dec 9 17:15:55 CET 2016


#53040: py27-wxpython-3.0 @3.0.2.0 fatal error: 'type_traits' file not found on
systems upgraded to libc++
--------------------+-------------------------------
 Reporter:  kencu   |      Owner:
     Type:  defect  |     Status:  new
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  py27-wxpython-3.0
--------------------+-------------------------------
 wxpython build stalls on 10.6 with libc++ (and I will presume other
 systems upgraded to libc++ < 10.9) due to
 {{{
 fatal error: 'type_traits' file not found
 }}}

 the configuration phase gives a clue trouble is coming
 {{{
 checking how to run the C++ preprocessor... /opt/local/bin/clang++-mp-3.7
 -E
 checking type_traits usability... yes
 checking type_traits presence... no
 configure: WARNING: type_traits: accepted by the compiler, rejected by the
 preprocessor!
 configure: WARNING: type_traits: proceeding with the compiler's result
 checking for type_traits... yes
 checking for __sync_fetch_and_add and __sync_sub_and_fetch builtins... yes
 }}}

 which then fails during compilation:
 {{{
 creating build/temp.macosx-10.6-x86_64-2.7/src/osx_cocoa
 /opt/local/bin/clang-mp-3.7 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-
 prototypes -arch x86_64 -DSWIG_TYPE_TABLE=_wxPython_table
 -DSWIG_PYTHON_OUTPUT_TUPLE -DSWIG_PYTHON_SILENT_MEMLEAK -DWXP_USE_THREAD=1
 -UNDEBUG -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__
 -D__WXOSX_COCOA__ -Iinclude -Isrc
 -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxPython/3.0/lib/wx/include
 /osx_cocoa-unicode-3.0
 -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxPython/3.0/include/wx-3.0
 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
 -c src/helpers.cpp -o build/temp.macosx-10.6-x86_64-2.7/src/helpers.o -O3
 In file included from src/helpers.cpp:17:
 In file included from include/wx/wxPython/wxPython_int.h:35:
 In file included from
 /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxPython/3.0/include/wx-3.0/wx/wx.h:15:
 In file included from
 /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxPython/3.0/include/wx-3.0/wx/object.h:19:
 In file included from
 /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxPython/3.0/include/wx-3.0/wx/memory.h:15:
 In file included from
 /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxPython/3.0/include/wx-3.0/wx/string.h:46:
 /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxPython/3.0/include/wx-3.0/wx/strvararg.h:25:14:
 fatal error: 'type_traits' file not found
     #include <type_traits>
 }}}
 the solution seems to be to get -stdlib=libc++ onto that build command
 line.

 I tried various things, but in the end, adding the following bit to
 `wxPython-src-3.0.2.0/wxPython/config.py` in the darwin section worked.
 {{{
     if sys.platform[:6] == "darwin":
         WXPLAT = '__WXMAC__'

         if WXPORT == 'osx_carbon':
         # Flags and such for a Darwin (Max OS X) build of Python
             GENDIR = 'osx_carbon'
             WXPLAT2 = '__WXOSX_CARBON__'
         else:
             GENDIR = 'osx_cocoa'
             WXPLAT2 = '__WXOSX_COCOA__'
 +            cflags.append('-stdlib=libc++')
 +            lflags.append('-stdlib=libc++')
 }}}

 I think only one of the the flag is actually used, but at this moment I'm
 not sure which one it is.

 in the end, success:
 {{{
 $ port -v installed | grep py27-wxpython-3.0
   py27-wxpython-3.0 @3.0.2.0_0 (active) platform='darwin 10'
 archs='x86_64'
 }}}

 not completely sure how to fully test the functionality at present,
 however.

 No doubt there are better ways to fix it, like rewriting the issue with
 the configure script to correctly decide whether to use `type_traits`.

 Is this useful enough to you to have me build a patch for it? Or shall we
 just leave it as an available workaround for people?

--
Ticket URL: <https://trac.macports.org/ticket/53040>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list