When I install ffrecord with python setup.py install
, it failed with the following errors:
running install
running bdist_egg
running egg_info
creating ffrecord.egg-info
writing ffrecord.egg-info/PKG-INFO
writing dependency_links to ffrecord.egg-info/dependency_links.txt
writing requirements to ffrecord.egg-info/requires.txt
writing top-level names to ffrecord.egg-info/top_level.txt
writing manifest file 'ffrecord.egg-info/SOURCES.txt'
reading manifest file 'ffrecord.egg-info/SOURCES.txt'
writing manifest file 'ffrecord.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/ffrecord
copying ffrecord/fileio.py -> build/lib.linux-x86_64-3.7/ffrecord
copying ffrecord/__init__.py -> build/lib.linux-x86_64-3.7/ffrecord
copying ffrecord/utils.py -> build/lib.linux-x86_64-3.7/ffrecord
creating build/lib.linux-x86_64-3.7/ffrecord/torch
copying ffrecord/torch/__init__.py -> build/lib.linux-x86_64-3.7/ffrecord/torch
copying ffrecord/torch/dataset.py -> build/lib.linux-x86_64-3.7/ffrecord/torch
copying ffrecord/torch/dataloader.py -> build/lib.linux-x86_64-3.7/ffrecord/torch
running build_ext
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /opt/conda/bin/python (found version "3.7.10")
-- Found PythonLibs: /opt/conda/lib/libpython3.7m.so
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- Performing Test HAS_CPP11_FLAG
-- Performing Test HAS_CPP11_FLAG - Success
-- Performing Test HAS_LTO_FLAG
-- Performing Test HAS_LTO_FLAG - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /root/ffrecord/build/temp.linux-x86_64-3.7
[ 20%] Building CXX object CMakeFiles/_ffrecord_cpp.dir/reader.cpp.o
[ 40%] Building CXX object CMakeFiles/_ffrecord_cpp.dir/writer.cpp.o
[ 60%] Building CXX object CMakeFiles/_ffrecord_cpp.dir/utils.cpp.o
[ 80%] Building CXX object CMakeFiles/_ffrecord_cpp.dir/bindings.cpp.o
/root/ffrecord/ffrecord/src/bindings.cpp: In member function ‘void ffrecord::WriterWrapper::write_one_wrapper(const pybind11::buffer&)’:
/root/ffrecord/ffrecord/src/bindings.cpp:22:44: error: passing ‘const pybind11::buffer’ as ‘this’ argument discards qualifiers [-fpermissive]
py::buffer_info info = buf.request();
^
In file included from /usr/include/pybind11/cast.h:13:0,
from /usr/include/pybind11/attr.h:13,
from /usr/include/pybind11/pybind11.h:36,
from /root/ffrecord/ffrecord/src/bindings.cpp:1:
/usr/include/pybind11/pytypes.h:832:17: note: in call to ‘pybind11::buffer_info pybind11::buffer::request(bool)’
buffer_info request(bool writable = false) {
^~~~~~~
/root/ffrecord/ffrecord/src/bindings.cpp: In member function ‘std::vector<pybind11::array> ffrecord::ReaderWrapper::read_batch_wrapper(const std::vector<long int>&)’:
/root/ffrecord/ffrecord/src/bindings.cpp:41:59: error: invalid conversion from ‘void (*)(void*)’ to ‘void (*)(PyObject*) {aka void (*)(_object*)}’ [-fpermissive]
auto capsule = py::capsule(b.data, free_buffer);
^
In file included from /usr/include/pybind11/cast.h:13:0,
from /usr/include/pybind11/attr.h:13,
from /usr/include/pybind11/pybind11.h:36,
from /root/ffrecord/ffrecord/src/bindings.cpp:1:
/usr/include/pybind11/pytypes.h:734:14: note: initializing argument 2 of ‘pybind11::capsule::capsule(const void*, void (*)(PyObject*))’
explicit capsule(const void *value, void (*destruct)(PyObject *) = nullptr)
^~~~~~~
/root/ffrecord/ffrecord/src/bindings.cpp: In member function ‘pybind11::array ffrecord::ReaderWrapper::read_one_wrapper(int64_t)’:
/root/ffrecord/ffrecord/src/bindings.cpp:49:55: error: invalid conversion from ‘void (*)(void*)’ to ‘void (*)(PyObject*) {aka void (*)(_object*)}’ [-fpermissive]
auto capsule = py::capsule(b.data, free_buffer);
^
In file included from /usr/include/pybind11/cast.h:13:0,
from /usr/include/pybind11/attr.h:13,
from /usr/include/pybind11/pybind11.h:36,
from /root/ffrecord/ffrecord/src/bindings.cpp:1:
/usr/include/pybind11/pytypes.h:734:14: note: initializing argument 2 of ‘pybind11::capsule::capsule(const void*, void (*)(PyObject*))’
explicit capsule(const void *value, void (*destruct)(PyObject *) = nullptr)
^~~~~~~
/root/ffrecord/ffrecord/src/bindings.cpp: In member function ‘pybind11::array_t<long int> ffrecord::ReaderWrapper::get_offsets(int)’:
/root/ffrecord/ffrecord/src/bindings.cpp:55:58: error: invalid user-defined conversion from ‘ffrecord::ReaderWrapper::get_offsets(int)::<lambda(void*)>’ to ‘void (*)(PyObject*) {aka void (*)(_object*)}’ [-fpermissive]
auto capsule = py::capsule(v.data(), [](void*) {});
^
/root/ffrecord/ffrecord/src/bindings.cpp:55:54: note: candidate is: ffrecord::ReaderWrapper::get_offsets(int)::<lambda(void*)>::operator void (*)(void*)() const <near match>
auto capsule = py::capsule(v.data(), [](void*) {});
^
/root/ffrecord/ffrecord/src/bindings.cpp:55:54: note: no known conversion from ‘void (*)(void*)’ to ‘void (*)(PyObject*) {aka void (*)(_object*)}’
In file included from /usr/include/pybind11/cast.h:13:0,
from /usr/include/pybind11/attr.h:13,
from /usr/include/pybind11/pybind11.h:36,
from /root/ffrecord/ffrecord/src/bindings.cpp:1:
/usr/include/pybind11/pytypes.h:734:14: note: initializing argument 2 of ‘pybind11::capsule::capsule(const void*, void (*)(PyObject*))’
explicit capsule(const void *value, void (*destruct)(PyObject *) = nullptr)
^~~~~~~
/root/ffrecord/ffrecord/src/bindings.cpp: In member function ‘pybind11::array_t<unsigned int> ffrecord::ReaderWrapper::get_checksums(int)’:
/root/ffrecord/ffrecord/src/bindings.cpp:61:58: error: invalid user-defined conversion from ‘ffrecord::ReaderWrapper::get_checksums(int)::<lambda(void*)>’ to ‘void (*)(PyObject*) {aka void (*)(_object*)}’ [-fpermissive]
auto capsule = py::capsule(v.data(), [](void*) {});
^
/root/ffrecord/ffrecord/src/bindings.cpp:61:54: note: candidate is: ffrecord::ReaderWrapper::get_checksums(int)::<lambda(void*)>::operator void (*)(void*)() const <near match>
auto capsule = py::capsule(v.data(), [](void*) {});
^
/root/ffrecord/ffrecord/src/bindings.cpp:61:54: note: no known conversion from ‘void (*)(void*)’ to ‘void (*)(PyObject*) {aka void (*)(_object*)}’
In file included from /usr/include/pybind11/cast.h:13:0,
from /usr/include/pybind11/attr.h:13,
from /usr/include/pybind11/pybind11.h:36,
from /root/ffrecord/ffrecord/src/bindings.cpp:1:
/usr/include/pybind11/pytypes.h:734:14: note: initializing argument 2 of ‘pybind11::capsule::capsule(const void*, void (*)(PyObject*))’
explicit capsule(const void *value, void (*destruct)(PyObject *) = nullptr)
^~~~~~~
/root/ffrecord/ffrecord/src/bindings.cpp: At global scope:
/root/ffrecord/ffrecord/src/bindings.cpp:67:16: error: expected constructor, destructor, or type conversion before ‘(’ token
PYBIND11_MODULE(_ffrecord_cpp, m) {
^
CMakeFiles/_ffrecord_cpp.dir/build.make:117: recipe for target 'CMakeFiles/_ffrecord_cpp.dir/bindings.cpp.o' failed
make[2]: *** [CMakeFiles/_ffrecord_cpp.dir/bindings.cpp.o] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/_ffrecord_cpp.dir/all' failed
make[1]: *** [CMakeFiles/_ffrecord_cpp.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
File "setup.py", line 24, in <module>
ext_modules=[cpp_module]
File "/opt/conda/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/opt/conda/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/conda/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/opt/conda/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/opt/conda/lib/python3.7/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/opt/conda/lib/python3.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/opt/conda/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/conda/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/opt/conda/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 164, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/opt/conda/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
self.run_command(cmdname)
File "/opt/conda/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/conda/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/opt/conda/lib/python3.7/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/opt/conda/lib/python3.7/distutils/command/install_lib.py", line 107, in build
self.run_command('build_ext')
File "/opt/conda/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/conda/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/opt/conda/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/opt/conda/lib/python3.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/opt/conda/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/opt/conda/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/root/ffrecord/cmake_build.py", line 118, in build_extension
["cmake", "--build", "."] + build_args, cwd=self.build_temp
File "/opt/conda/lib/python3.7/subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 2.
bug install