Giter Club home page Giter Club logo

Comments (9)

epipping avatar epipping commented on July 23, 2024 2

The problem

error: no member named 'accumulate' in namespace 'std'

is easily fixed. Just add the missing #include <numeric> to src/util/widening_vector.hpp.

from paratext.

epipping avatar epipping commented on July 23, 2024 2

The next error

error: ‘id’ is not a member of ‘numpy_type’

is fixed for me by adding the specialisation

template <> struct numpy_type<unsigned long>  { static const long id = NPY_ULONG; };

to src/python/numpy_helper.hpp.

With these two changes in place, python setup.py build finishes with exit status 0 for me.

Edit: That's with swig 3.0.7 and python 2.7.10 on OS X 10.11.6 Beta (15G7b).

from paratext.

igorbrigadir avatar igorbrigadir commented on July 23, 2024

Python version: 3.5.1

I guess #10, #13 are related - Python 3.5 isn't quite working yet.

in numpy_helper.hpp PyString_FromStringAndSize needs to be PyUnicode_FromStringAndSize (or PyBytes_FromStringAndSize... haven't looked in detail) to work in 3.5 - But this definitely won't fix the issue on its own, it's just one of the things that needs to change to support python3

from paratext.

michaelgeary avatar michaelgeary commented on July 23, 2024

Doesn't compile for me either: Python 2.7; OS X 10.9.5; swig 3.0.2:

/usr/local/bin/swig
0.1.1rc1
('running swig: ', ['swig', '-c++', '-python', '-I../src/', '-outdir', './', '../src/paratext_internal.i'])
../src/diagnostic/parse_and_sum.hpp:158: Warning 302: Identifier 'parse_token' redefined (ignored),
../src/diagnostic/parse_and_sum.hpp:129: Warning 302: previous definition of 'parse_token'.
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'include_package_data'
warnings.warn(msg)
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
building extension "_paratext_internal" sources
build_src: building npy-pkg config files
running build_py
creating build
creating build/lib.macosx-10.9-intel-2.7
copying paratext_internal.py -> build/lib.macosx-10.9-intel-2.7
creating build/lib.macosx-10.9-intel-2.7/paratext
copying paratext/init.py -> build/lib.macosx-10.9-intel-2.7/paratext
copying paratext/core.py -> build/lib.macosx-10.9-intel-2.7/paratext
copying paratext/helpers.py -> build/lib.macosx-10.9-intel-2.7/paratext
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building '_paratext_internal' extension
compiling C++ sources
C compiler: c++ -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe

creating build/temp.macosx-10.9-intel-2.7
creating build/temp.macosx-10.9-intel-2.7/paratext-master
creating build/temp.macosx-10.9-intel-2.7/paratext-master/src
compile options: '-I../src/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
extra options: '-std=c++11 -Wall -Wextra -pthread -m64 -D_REENTRANT'
c++: ../src/paratext_internal_wrap.cxx
In file included from ../src/paratext_internal_wrap.cxx:4887:
In file included from ../src/csv/colbased_loader.hpp:34:
In file included from ../src/csv/colbased_chunk.hpp:31:
../src/util/widening_vector.hpp:308:17: error: no member named 'accumulate' in namespace 'std'
return std::accumulate<decltype(begin)>(values_.begin(), values_.end(), (T)0);
~~~~~^
../src/util/widening_vector.hpp:308:43: error: expected '(' for function-style cast or type construction
return std::accumulate<decltype(begin)>(values_.begin(), values_.end(), (T)0);
~~~~~~~~~~~~~~~^
../src/util/widening_vector.hpp:365:17: error: no member named 'accumulate' in namespace 'std'
return std::accumulate<decltype(begin)>(values_.begin(), values_.end(), (T)0);
~~~~~^
../src/util/widening_vector.hpp:365:43: error: expected '(' for function-style cast or type construction
return std::accumulate<decltype(begin)>(values_.begin(), values_.end(), (T)0);
~~~~~~~~~~~~~~~^
In file included from ../src/paratext_internal_wrap.cxx:4887:
In file included from ../src/csv/colbased_loader.hpp:36:
../src/csv/parallel.hpp:67:46: warning: initialized lambda captures are a C++1y extension [-Wc++1y-extensions]
.emplace_back( it, step, thread_id, f = std::forward(f) {
^
In file included from ../src/paratext_internal_wrap.cxx:4887:
In file included from ../src/csv/colbased_loader.hpp:34:
In file included from ../src/csv/colbased_chunk.hpp:31:
../src/util/widening_vector.hpp:212:25: warning: implicit conversion loses integer precision: 'long' to 'value_type' (aka 'int') [-Wshorten-64-to-32]
values_.push_back(value);
~~~~~~~ ^~~~~
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<3, int, long long, float>::v_push_back' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<4, short, int, long long, float>::widening_vector_impl' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<5, signed char, short, int, long long, float>::widening_vector_impl' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:460:3: note: in instantiation of member function 'widening_vector_impl<6, unsigned char, signed char, short, int, long long, float>::widening_vector_impl' requested here
widening_vector_dynamic() : first_(NULL), current_(NULL) {
^
../src/csv/colbased_chunk.hpp:49:5: note: in instantiation of member function 'widening_vector_dynamic<unsigned char, signed char, short, int, long long, float>::widening_vector_dynamic' requested here
ColBasedChunk() : max_level_name_length_(std::numeric_limits<size_t>::max()), max_levels_(std::numeric_limits<size_t>::max()), forced_semantics_(Semantics::UNKNOWN) {}
^
In file included from ../src/paratext_internal_wrap.cxx:4887:
In file included from ../src/csv/colbased_loader.hpp:34:
In file included from ../src/csv/colbased_chunk.hpp:31:
../src/util/widening_vector.hpp:212:25: warning: implicit conversion loses integer precision: 'long' to 'value_type' (aka 'unsigned int') [-Wshorten-64-to-32]
values_.push_back(value);
~~~~~~~ ^~~~~
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<2, unsigned int, unsigned long long>::v_push_back' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<3, unsigned short, unsigned int, unsigned long long>::widening_vector_impl' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<4, unsigned char, unsigned short, unsigned int, unsigned long long>::widening_vector_impl' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:460:3: note: in instantiation of member function 'widening_vector_impl<5, unsigned char, unsigned char, unsigned short, unsigned int, unsigned long long>::widening_vector_impl' requested here
widening_vector_dynamic() : first_(NULL), current_(NULL) {
^
../src/csv/colbased_chunk.hpp:49:5: note: in instantiation of member function 'widening_vector_dynamic<unsigned char, unsigned char, unsigned short, unsigned int, unsigned long long>::widening_vector_dynamic' requested here
ColBasedChunk() : max_level_name_length_(std::numeric_limits<size_t>::max()), max_levels_(std::numeric_limits<size_t>::max()), forced_semantics_(Semantics::UNKNOWN) {}
^
In file included from ../src/paratext_internal_wrap.cxx:3063:
../src/python/numpy_helper.hpp:68:86: error: no member named 'id' in 'numpy_type'
PyObject array = (PyObject)PyArray_SimpleNew(1, fdims, numpy_type<value_type>::id);
~~~~~~~~~~~~~~~~~~~~~~~~^
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarrayobject.h:125:46: note: expanded from macro 'PyArray_SimpleNew'
PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)
^
../src/python/numpy_helper.hpp:299:50: note: in instantiation of member function 'build_array_impl<std::1::vector<unsigned long, std::1::allocator >, void>::build_array' requested here
return (PyObject
)build_array_impl::build_array(container);
^
../src/paratext_internal_wrap.cxx:10134:30: note: in instantiation of function template specialization 'build_array<std::1::vector<unsigned long, std::1::allocator > >' requested here
resultobj = (PyObject
)::build_arraystd::vector<size_t>(result);
^
3 warnings and 5 errors generated.
In file included from ../src/paratext_internal_wrap.cxx:4887:
In file included from ../src/csv/colbased_loader.hpp:34:
In file included from ../src/csv/colbased_chunk.hpp:31:
../src/util/widening_vector.hpp:308:17: error: no member named 'accumulate' in namespace 'std'
return std::accumulate<decltype(begin)>(values
.begin(), values
.end(), (T)0);
~~~~~^
../src/util/widening_vector.hpp:308:43: error: expected '(' for function-style cast or type construction
return std::accumulate<decltype(begin)>(values
.begin(), values.end(), (T)0);
~~~~~~~~~~~~~~~^
../src/util/widening_vector.hpp:365:17: error: no member named 'accumulate' in namespace 'std'
return std::accumulate<decltype(begin)>(values.begin(), values.end(), (T)0);
~~~~~^
../src/util/widening_vector.hpp:365:43: error: expected '(' for function-style cast or type construction
return std::accumulate<decltype(begin)>(values_.begin(), values_.end(), (T)0);
~~~~~~~~~~~~~~~^
In file included from ../src/paratext_internal_wrap.cxx:4887:
In file included from ../src/csv/colbased_loader.hpp:36:
../src/csv/parallel.hpp:67:46: warning: initialized lambda captures are a C++1y extension [-Wc++1y-extensions]
.emplace_back( it, step, thread_id, f = std::forward(f) {
^
In file included from ../src/paratext_internal_wrap.cxx:4887:
In file included from ../src/csv/colbased_loader.hpp:34:
In file included from ../src/csv/colbased_chunk.hpp:31:
../src/util/widening_vector.hpp:212:25: warning: implicit conversion loses integer precision: 'long' to 'value_type' (aka 'int') [-Wshorten-64-to-32]
values_.push_back(value);
~~~~~~~ ^~~~~
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<3, int, long long, float>::v_push_back' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<4, short, int, long long, float>::widening_vector_impl' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<5, signed char, short, int, long long, float>::widening_vector_impl' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:460:3: note: in instantiation of member function 'widening_vector_impl<6, unsigned char, signed char, short, int, long long, float>::widening_vector_impl' requested here
widening_vector_dynamic() : first_(NULL), current_(NULL) {
^
../src/csv/colbased_chunk.hpp:49:5: note: in instantiation of member function 'widening_vector_dynamic<unsigned char, signed char, short, int, long long, float>::widening_vector_dynamic' requested here
ColBasedChunk() : max_level_name_length_(std::numeric_limits<size_t>::max()), max_levels_(std::numeric_limits<size_t>::max()), forced_semantics_(Semantics::UNKNOWN) {}
^
In file included from ../src/paratext_internal_wrap.cxx:4887:
In file included from ../src/csv/colbased_loader.hpp:34:
In file included from ../src/csv/colbased_chunk.hpp:31:
../src/util/widening_vector.hpp:212:25: warning: implicit conversion loses integer precision: 'long' to 'value_type' (aka 'unsigned int') [-Wshorten-64-to-32]
values_.push_back(value);
~~~~~~~ ^~~~~
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<2, unsigned int, unsigned long long>::v_push_back' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<3, unsigned short, unsigned int, unsigned long long>::widening_vector_impl' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:198:3: note: in instantiation of member function 'widening_vector_impl<4, unsigned char, unsigned short, unsigned int, unsigned long long>::widening_vector_impl' requested here
widening_vector_impl() {}
^
../src/util/widening_vector.hpp:460:3: note: in instantiation of member function 'widening_vector_impl<5, unsigned char, unsigned char, unsigned short, unsigned int, unsigned long long>::widening_vector_impl' requested here
widening_vector_dynamic() : first_(NULL), current_(NULL) {
^
../src/csv/colbased_chunk.hpp:49:5: note: in instantiation of member function 'widening_vector_dynamic<unsigned char, unsigned char, unsigned short, unsigned int, unsigned long long>::widening_vector_dynamic' requested here
ColBasedChunk() : max_level_name_length_(std::numeric_limits<size_t>::max()), max_levels_(std::numeric_limits<size_t>::max()), forced_semantics_(Semantics::UNKNOWN) {}
^
In file included from ../src/paratext_internal_wrap.cxx:3063:
../src/python/numpy_helper.hpp:68:86: error: no member named 'id' in 'numpy_type'
PyObject array = (PyObject)PyArray_SimpleNew(1, fdims, numpy_type<value_type>::id);
~~~~~~~~~~~~~~~~~~~~~~~~^
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarrayobject.h:125:46: note: expanded from macro 'PyArray_SimpleNew'
PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)
^
../src/python/numpy_helper.hpp:299:50: note: in instantiation of member function 'build_array_impl<std::__1::vector<unsigned long, std::_1::allocator >, void>::build_array' requested here
return (PyObject
)build_array_impl::build_array(container);
^
../src/paratext_internal_wrap.cxx:10134:30: note: in instantiation of function template specialization 'build_array<std::__1::vector<unsigned long, std::_1::allocator > >' requested here
resultobj = (PyObject
)::build_arraystd::vector<size_t>(result);
^
3 warnings and 5 errors generated.
error: Command "c++ -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I../src/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c ../src/paratext_internal_wrap.cxx -o build/temp.macosx-10.9-intel-2.7/paratext-master/src/paratext_internal_wrap.o -std=c++11 -Wall -Wextra -pthread -m64 -D_REENTRANT" failed with exit status 1

from paratext.

cbonnett avatar cbonnett commented on July 23, 2024

same problem here :

SWIG Version 3.0.8
python 2.7
gcc (GCC) 4.8.5

python setup.py build install
/Users/Christopher_old/anaconda2/bin/swig
0.1.1rc1
('running swig: ', ['swig', '-c++', '-python', '-I../src/', '-outdir', './', '../src/paratext_internal.i'])
../src/diagnostic/parse_and_sum.hpp:158: Warning 302: Identifier 'parse_token' redefined (ignored),
../src/diagnostic/parse_and_sum.hpp:129: Warning 302: previous definition of 'parse_token'.
/Users/Christopher_old/anaconda2/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'include_package_data'
warnings.warn(msg)
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
building extension "_paratext_internal" sources
build_src: building npy-pkg config files
running build_py
copying paratext_internal.py -> build/lib.macosx-10.5-x86_64-2.7
copying paratext/init.py -> build/lib.macosx-10.5-x86_64-2.7/paratext
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building '_paratext_internal' extension
compiling C++ sources
C compiler: g++ -fno-strict-aliasing -I/Users/Christopher_old/anaconda2/include -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -DNDEBUG -g -fwrapv -O3 -Wall

compile options: '-I../src/ -I/Users/Christopher_old/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/Users/Christopher_old/anaconda2/include/python2.7 -c'
extra options: '-std=c++11 -Wall -Wextra -pthread -m64 -D_REENTRANT'
g++: ../src/paratext_internal.cpp
g++: ../src/paratext_internal_wrap.cxx
In file included from /Users/Christopher_old/anaconda2/gcc/include/c++/random:38:0,
from /Users/Christopher_old/anaconda2/gcc/include/c++/bits/stl_algo.h:65,
from /Users/Christopher_old/anaconda2/gcc/include/c++/algorithm:62,
from ../src/paratext_internal_wrap.cxx:3507:
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1105:11: error: ‘::llrint’ has not been declared
using ::llrint;
^
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1106:11: error: ‘::llrintf’ has not been declared
using ::llrintf;
^
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1107:11: error: ‘::llrintl’ has not been declared
using ::llrintl;
^
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1109:11: error: ‘::llround’ has not been declared
using ::llround;
^
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1110:11: error: ‘::llroundf’ has not been declared
using ::llroundf;
^
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1111:11: error: ‘::llroundl’ has not been declared
using ::llroundl;
^
In file included from /Users/Christopher_old/anaconda2/gcc/include/c++/system_error:39:0,
from /Users/Christopher_old/anaconda2/gcc/include/c++/mutex:43,
from ../src/csv/colbased_loader.hpp:40,
from ../src/paratext_internal_wrap.cxx:4993:
/Users/Christopher_old/anaconda2/gcc/include/c++/x86_64-apple-darwin11.4.2/bits/error_constants.h:135:24: error: ‘EOWNERDEAD’ was not declared in this scope
owner_dead = EOWNERDEAD,
^
/Users/Christopher_old/anaconda2/gcc/include/c++/x86_64-apple-darwin11.4.2/bits/error_constants.h:151:34: error: ‘ENOTRECOVERABLE’ was not declared in this scope
state_not_recoverable = ENOTRECOVERABLE,
^
In file included from /Users/Christopher_old/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:0,
from ../src/python/numpy_helper.hpp:40,
from ../src/paratext_internal_wrap.cxx:3142:
../src/python/numpy_helper.hpp: In instantiation of ‘static PyObject* build_array_impl<Container, typename std::enable_if<std::is_arithmetic::value>::type>::build_array(const Container&) [with Container = std::vector; PyObject = _object]’:
../src/python/numpy_helper.hpp:299:71: required from ‘PyObject* build_array(const Container&) [with Container = std::vector; PyObject = _object]’
../src/paratext_internal_wrap.cxx:10366:69: required from here
/Users/Christopher_old/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:135:77: error: ‘id’ is not a member of ‘numpy_type’
PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)
^
../src/python/numpy_helper.hpp:68:34: note: in expansion of macro ‘PyArray_SimpleNew’
PyObject array = (PyObject)PyArray_SimpleNew(1, fdims, numpy_type<value_type>::id);
^
In file included from /Users/Christopher_old/anaconda2/gcc/include/c++/random:38:0,
from /Users/Christopher_old/anaconda2/gcc/include/c++/bits/stl_algo.h:65,
from /Users/Christopher_old/anaconda2/gcc/include/c++/algorithm:62,
from ../src/paratext_internal_wrap.cxx:3507:
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1105:11: error: ‘::llrint’ has not been declared
using ::llrint;
^
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1106:11: error: ‘::llrintf’ has not been declared
using ::llrintf;
^
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1107:11: error: ‘::llrintl’ has not been declared
using ::llrintl;
^
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1109:11: error: ‘::llround’ has not been declared
using ::llround;
^
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1110:11: error: ‘::llroundf’ has not been declared
using ::llroundf;
^
/Users/Christopher_old/anaconda2/gcc/include/c++/cmath:1111:11: error: ‘::llroundl’ has not been declared
using ::llroundl;
^
In file included from /Users/Christopher_old/anaconda2/gcc/include/c++/system_error:39:0,
from /Users/Christopher_old/anaconda2/gcc/include/c++/mutex:43,
from ../src/csv/colbased_loader.hpp:40,
from ../src/paratext_internal_wrap.cxx:4993:
/Users/Christopher_old/anaconda2/gcc/include/c++/x86_64-apple-darwin11.4.2/bits/error_constants.h:135:24: error: ‘EOWNERDEAD’ was not declared in this scope
owner_dead = EOWNERDEAD,
^
/Users/Christopher_old/anaconda2/gcc/include/c++/x86_64-apple-darwin11.4.2/bits/error_constants.h:151:34: error: ‘ENOTRECOVERABLE’ was not declared in this scope
state_not_recoverable = ENOTRECOVERABLE,
^
In file included from /Users/Christopher_old/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:0,
from ../src/python/numpy_helper.hpp:40,
from ../src/paratext_internal_wrap.cxx:3142:
../src/python/numpy_helper.hpp: In instantiation of ‘static PyObject* build_array_impl<Container, typename std::enable_if<std::is_arithmetic::value>::type>::build_array(const Container&) [with Container = std::vector; PyObject = _object]’:
../src/python/numpy_helper.hpp:299:71: required from ‘PyObject* build_array(const Container&) [with Container = std::vector; PyObject = _object]’
../src/paratext_internal_wrap.cxx:10366:69: required from here
/Users/Christopher_old/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:135:77: error: ‘id’ is not a member of ‘numpy_type’
PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)
^
../src/python/numpy_helper.hpp:68:34: note: in expansion of macro ‘PyArray_SimpleNew’
PyObject array = (PyObject)PyArray_SimpleNew(1, fdims, numpy_type<value_type>::id);
^
error: Command "g++ -fno-strict-aliasing -I/Users/Christopher_old/anaconda2/include -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -DNDEBUG -g -fwrapv -O3 -Wall -I../src/ -I/Users/Christopher_old/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/Users/Christopher_old/anaconda2/include/python2.7 -c ../src/paratext_internal_wrap.cxx -o build/temp.macosx-10.5-x86_64-2.7/paratext/src/paratext_internal_wrap.o -std=c++11 -Wall -Wextra -pthread -m64 -D_REENTRANT" failed with exit status 1

from paratext.

andytwigg avatar andytwigg commented on July 23, 2024

same for me.
python 2.7.11
swig 3.0.8
$ g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.5.0
Thread model: posix

$ python setup.py build install
/usr/local/bin/swig
0.1.1rc1
('running swig: ', ['swig', '-c++', '-python', '-I../src/', '-outdir', './', '../src/paratext_internal.i'])
../src/diagnostic/parse_and_sum.hpp:158: Warning 302: Identifier 'parse_token' redefined (ignored),
../src/diagnostic/parse_and_sum.hpp:129: Warning 302: previous definition of 'parse_token'.
/Users/atwigg/anaconda/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'include_package_data'
warnings.warn(msg)
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
building extension "_paratext_internal" sources
build_src: building npy-pkg config files
running build_py
copying paratext_internal.py -> build/lib.macosx-10.5-x86_64-2.7
copying paratext/init.py -> build/lib.macosx-10.5-x86_64-2.7/paratext
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building '_paratext_internal' extension
compiling C++ sources
C compiler: g++ -fno-strict-aliasing -I/Users/atwigg/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall

compile options: '-I../src/ -I/Users/atwigg/anaconda/lib/python2.7/site-packages/numpy/core/include -I/Users/atwigg/anaconda/include/python2.7 -c'
extra options: '-std=c++11 -Wall -Wextra -pthread -m64 -D_REENTRANT'
g++: ../src/paratext_internal.cpp
g++: ../src/paratext_internal_wrap.cxx
In file included from ../src/paratext_internal_wrap.cxx:4993:
In file included from ../src/csv/colbased_loader.hpp:34:
In file included from ../src/csv/colbased_chunk.hpp:31:
../src/util/widening_vector.hpp:308:17: error: no member named 'accumulate' in namespace 'std'
return std::accumulate<decltype(begin)>(values_.begin(), values_.end(), (T)0);
~~~~~^
../src/util/widening_vector.hpp:308:43: error: expected '(' for function-style cast or type construction
return std::accumulate<decltype(begin)>(values_.begin(), values_.end(), (T)0);
~~~~~~~~~~~~~~~^
../src/util/widening_vector.hpp:365:17: error: no member named 'accumulate' in namespace 'std'
return std::accumulate<decltype(begin)>(values_.begin(), values_.end(), (T)0);
~~~~~^
../src/util/widening_vector.hpp:365:43: error: expected '(' for function-style cast or type construction
return std::accumulate<decltype(begin)>(values_.begin(), values_.end(), (T)0);
~~~~~~~~~~~~~~~^
In file included from ../src/paratext_internal_wrap.cxx:4993:
In file included from ../src/csv/colbased_loader.hpp:36:
../src/csv/parallel.hpp:67:46: warning: initialized lambda captures are a C++14 extension [-Wc++14-extensions]
.emplace_back( it, step, thread_id, f = std::forward(f) {
^
In file included from ../src/paratext_internal_wrap.cxx:3142:
../src/python/numpy_helper.hpp:68:86: error: no member named 'id' in 'numpy_type'
PyObject array = (PyObject)PyArray_SimpleNew(1, fdims, numpy_type<value_type>::id);
~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/atwigg/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:135:46: note: expanded from macro 'PyArray_SimpleNew'
PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)
^~~~~~~
../src/python/numpy_helper.hpp:299:50: note: in instantiation of member function 'build_array_impl<std::1::vector<unsigned long, std::1::allocator >, void>::build_array' requested here
return (PyObject
)build_array_impl::build_array(container);
^
../src/paratext_internal_wrap.cxx:10366:30: note: in instantiation of function template specialization 'build_array<std::1::vector<unsigned long, std::1::allocator > >' requested here
resultobj = (PyObject
)::build_arraystd::vector<size_t>(result);
^
1 warning and 5 errors generated.
In file included from ../src/paratext_internal_wrap.cxx:4993:
In file included from ../src/csv/colbased_loader.hpp:34:
In file included from ../src/csv/colbased_chunk.hpp:31:
../src/util/widening_vector.hpp:308:17: error: no member named 'accumulate' in namespace 'std'
return std::accumulate<decltype(begin)>(values
.begin(), values
.end(), (T)0);
~~~~~^
../src/util/widening_vector.hpp:308:43: error: expected '(' for function-style cast or type construction
return std::accumulate<decltype(begin)>(values
.begin(), values.end(), (T)0);
~~~~~~~~~~~~~~~^
../src/util/widening_vector.hpp:365:17: error: no member named 'accumulate' in namespace 'std'
return std::accumulate<decltype(begin)>(values.begin(), values.end(), (T)0);
~~~~~^
../src/util/widening_vector.hpp:365:43: error: expected '(' for function-style cast or type construction
return std::accumulate<decltype(begin)>(values_.begin(), values_.end(), (T)0);
~~~~~~~~~~~~~~~^
In file included from ../src/paratext_internal_wrap.cxx:4993:
In file included from ../src/csv/colbased_loader.hpp:36:
../src/csv/parallel.hpp:67:46: warning: initialized lambda captures are a C++14 extension [-Wc++14-extensions]
.emplace_back( it, step, thread_id, f = std::forward(f) {
^
In file included from ../src/paratext_internal_wrap.cxx:3142:
../src/python/numpy_helper.hpp:68:86: error: no member named 'id' in 'numpy_type'
PyObject array = (PyObject)PyArray_SimpleNew(1, fdims, numpy_type<value_type>::id);
~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/atwigg/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:135:46: note: expanded from macro 'PyArray_SimpleNew'
PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)
^~~~~~~
../src/python/numpy_helper.hpp:299:50: note: in instantiation of member function 'build_array_impl<std::__1::vector<unsigned long, std::_1::allocator >, void>::build_array' requested here
return (PyObject
)build_array_impl::build_array(container);
^
../src/paratext_internal_wrap.cxx:10366:30: note: in instantiation of function template specialization 'build_array<std::__1::vector<unsigned long, std::_1::allocator > >' requested here
resultobj = (PyObject
)::build_arraystd::vector<size_t>(result);
^
1 warning and 5 errors generated.
error: Command "g++ -fno-strict-aliasing -I/Users/atwigg/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -I../src/ -I/Users/atwigg/anaconda/lib/python2.7/site-packages/numpy/core/include -I/Users/atwigg/anaconda/include/python2.7 -c ../src/paratext_internal_wrap.cxx -o build/temp.macosx-10.5-x86_64-2.7/paratext/src/paratext_internal_wrap.o -std=c++11 -Wall -Wextra -pthread -m64 -D_REENTRANT" failed with exit status 1

from paratext.

wesm avatar wesm commented on July 23, 2024

The integer stuff across platforms is pretty annoying, see:

https://github.com/wesm/feather/blob/master/python/feather/interop.h#L71

and related #defines

from paratext.

caseymacphee avatar caseymacphee commented on July 23, 2024

Thanks @Pipping

from paratext.

michaelgeary avatar michaelgeary commented on July 23, 2024

Confirmed, @Pipping. Thank you

from paratext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.