Errors building Cython extensions on 10.9...

Chris Barker <[email protected]>
Newsgroups gmane.comp.python.apple
Message-ID <CALGmxELkm2vciF34LTPX67bahuvrdgU-hmH9siY=1G2LjcEOtQ@mail.gmail.com>
Hi all,

Have people in general been able to get extensions to build  right under
10.9? I"ve got a bunch of C++ code (and Cython-generated C++ wrappers),
that hav been building fine on OS-X up to 10.8, and Windows, and LInux, but
now I've got a user trying to build under 10.9, and they get a bunch of
errors.

They reported trying both clang and gcc, with the same (or similar) results.

Error 1):
In file included from gnome/cy_gnome/cy_mover.cpp:561:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/complex:246:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1552:1:
error:
      'inline' can only appear on functions
inline _LIBCPP_INLINE_VISIBILITY float       round(float __x) _NOEXCEP...

that's in the library code! -- weird.

Then there is:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1571:46:
error:
      call to 'scalbln' is ambiguous
scalbln(_A1 __x, long __y) _NOEXCEPT {return scalbln((double)__x, __y);}
                                             ^~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1565:46:
note:
      candidate function
inline _LIBCPP_INLINE_VISIBILITY float       scalbln(float __x, long __y...
                                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1566:46:
note:
      candidate function
inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __x, lo...

Again in the library...


gnome/cy_gnome/cy_mover.cpp:5082:13: error: call to 'isspace' is ambiguous
        if (isspace(*ts))
            ^~~~~~~
/usr/include/ctype.h:267:1: note: candidate function
isspace(int _c)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cctype:124:38:
note:
      candidate function
inline _LIBCPP_INLINE_VISIBILITY int isspace(int __c) {return __libcpp_i...


Another library issue.

So all this seems to be related to what librares 10.9 is using.

Hint:

On the Cython list, there was this thread:

https://groups.google.com/forum/#!topic/cython-users/XfUMB1vhM3g

in which the user had the same "isspace" problem. In that thread someone
suggested:

"""
The problem seems to stem
from the fact that libc++ requires the std:: namespacing. Compiling and
linking with the GNU libstdc++ can use the isspace function without
namespacing fine.  Mavericks changed the default C++ library to libc++
"""

Is there a way to get it to use the old lib, rather than changing our
source and Cython, and ????

I think that Cython has been patched to remove the call to isspace, but who
knows what other issues may crop up....

I don't have a 10.9 system to test on, so this will be a trick to debug,
but any suggestions are welcome.

Thanks,
   -Chris



Full Error report:

cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common
-fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX
-DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv
-Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch x86_64
-DpyGNOME=1 -I../lib_gnome
-I/Users/kthyng/.virtualenvs/default/lib/python2.7/site-packages/numpy/core/include
-I../third_party_lib/netcdf-4.3/darwin/x86_64/include -I.
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-c gnome/cy_gnome/cy_mover.cpp -o
build/temp.macosx-10.9-intel-2.7/gnome/cy_gnome/cy_mover.o
clang: warning: argument unused during compilation: '-mno-fused-madd'
In file included from gnome/cy_gnome/cy_mover.cpp:350:
../lib_gnome/ShioTimeValue_c.h:88:18: warning:
      'ShioTimeValue_c::ReadTimeValues' hides overloaded virtual function
      [-Woverloaded-virtual]
        virtual OSErr                   ReadTimeValues (char *path);
                                        ^
../lib_gnome/OSSMTimeValue_c.h:74:18: note: hidden overloaded virtual
function
      'OSSMTimeValue_c::ReadTimeValues' declared here
        virtual OSErr                   ReadTimeValues (char *path, shor...
                                        ^
In file included from gnome/cy_gnome/cy_mover.cpp:352:
In file included from ../lib_gnome/TimeGridVel_c.h:24:
In file included from ../lib_gnome/Replacements.h:18:
../lib_gnome/CurrentMover_c.h:43:17: warning:
      'CurrentMover_c::UpdateUncertainty' hides overloaded virtual function
      [-Woverloaded-virtual]
        virtual OSErr           UpdateUncertainty(const Seconds& elapsed...
                                ^
../lib_gnome/Mover_c.h:58:17: note: hidden overloaded virtual function
      'Mover_c::UpdateUncertainty' declared here
        virtual OSErr           UpdateUncertainty(void);
                                ^
In file included from gnome/cy_gnome/cy_mover.cpp:352:
In file included from ../lib_gnome/TimeGridVel_c.h:24:
In file included from ../lib_gnome/Replacements.h:19:
../lib_gnome/CATSMover_c.h:62:17: warning: 'CATSMover_c::AddUncertainty'
hides
      overloaded virtual function [-Woverloaded-virtual]
        virtual OSErr           AddUncertainty(long setIndex, long leInd...
                                ^
../lib_gnome/Mover_c.h:49:17: note: hidden overloaded virtual function
      'Mover_c::AddUncertainty' declared here
        virtual OSErr           AddUncertainty (long setIndex, long leIn...
                                ^
In file included from gnome/cy_gnome/cy_mover.cpp:352:
In file included from ../lib_gnome/TimeGridVel_c.h:24:
In file included from ../lib_gnome/Replacements.h:20:
../lib_gnome/WindMover_c.h:73:17: warning: 'WindMover_c::UpdateUncertainty'
      hides overloaded virtual function [-Woverloaded-virtual]
        virtual OSErr           UpdateUncertainty(const Seconds& elapsed...
                                ^
../lib_gnome/Mover_c.h:58:17: note: hidden overloaded virtual function
      'Mover_c::UpdateUncertainty' declared here
        virtual OSErr           UpdateUncertainty(void);
                                ^
In file included from gnome/cy_gnome/cy_mover.cpp:360:
../lib_gnome/GridCurrentMover_c.h:49:17: warning:
      'GridCurrentMover_c::AddUncertainty' hides overloaded virtual function
      [-Woverloaded-virtual]
        virtual OSErr           AddUncertainty(long setIndex, long leInd...
                                ^
../lib_gnome/Mover_c.h:49:17: note: hidden overloaded virtual function
      'Mover_c::AddUncertainty' declared here
        virtual OSErr           AddUncertainty (long setIndex, long leIn...
                                ^
In file included from gnome/cy_gnome/cy_mover.cpp:365:
In file included from
/Users/kthyng/.virtualenvs/default/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from
/Users/kthyng/.virtualenvs/default/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from
/Users/kthyng/.virtualenvs/default/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760:
/Users/kthyng/.virtualenvs/default/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2:
warning:
      "Using deprecated NumPy API, disable it by "          "#defining
      NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by " \
 ^
In file included from gnome/cy_gnome/cy_mover.cpp:561:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/complex:246:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1552:1:
error:
      'inline' can only appear on functions
inline _LIBCPP_INLINE_VISIBILITY float       round(float __x) _NOEXCEP...
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1552:46:
error:
      redefinition of 'floor' as different kind of symbol
inline _LIBCPP_INLINE_VISIBILITY float       round(float __x) _NOEXCEP...
                                             ^
../lib_gnome/TypeDefs.h:197:18: note: expanded from macro 'round'
#define round(n) floor((n) + 0.5)
                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:833:1:
note:
      previous definition is here
floor(_A1 __x) _NOEXCEPT {return floor((double)__x);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1552:58:
error:
      expected ')'
inline _LIBCPP_INLINE_VISIBILITY float       round(float __x) _NOEXCEP...
                                                         ^
../lib_gnome/TypeDefs.h:197:25: note: expanded from macro 'round'
#define round(n) floor((n) + 0.5)
                        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1552:46:
note:
      to match this '('
inline _LIBCPP_INLINE_VISIBILITY float       round(float __x) _NOEXCEP...
                                             ^
../lib_gnome/TypeDefs.h:197:24: note: expanded from macro 'round'
#define round(n) floor((n) + 0.5)
                       ^
In file included from gnome/cy_gnome/cy_mover.cpp:561:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/complex:246:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1552:62:
error:
      expected ';' after top level declarator
inline _LIBCPP_INLINE_VISIBILITY float       round(float __x) _NOEXCEP...
                                                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1571:46:
error:
      call to 'scalbln' is ambiguous
scalbln(_A1 __x, long __y) _NOEXCEPT {return scalbln((double)__x, __y);}
                                             ^~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1565:46:
note:
      candidate function
inline _LIBCPP_INLINE_VISIBILITY float       scalbln(float __x, long __y...
                                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:1566:46:
note:
      candidate function
inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __x, lo...
                                             ^
gnome/cy_gnome/cy_mover.cpp:2049:64: warning: implicit conversion loses
integer
      precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
  ...= __pyx_v_self->mover->ReallocateUncertainty(__pyx_v_num_LEs,
(&(*__Pyx_...
       ~~~~~~~~~~~~                               ^~~~~~~~~~~~~~~
gnome/cy_gnome/cy_mover.cpp:5082:13: error: call to 'isspace' is ambiguous
        if (isspace(*ts))
            ^~~~~~~
/usr/include/ctype.h:267:1: note: candidate function
isspace(int _c)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cctype:124:38:
note:
      candidate function
inline _LIBCPP_INLINE_VISIBILITY int isspace(int __c) {return __libcpp_i...
                                     ^
7 warnings and 6 errors generated.
error: command 'cc' failed with exit status 1


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]

_______________________________________________
Pythonmac-SIG maillist  -  [email protected]
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.