Build Error: no matching constructor for initialization of 'ipcl::CipherText'
crockeea opened this issue · 4 comments
crockeea commented
I get a build error when running setup.py
in init.h. Console output below.
(pailliercryptolib_python) local:$ python3 --version
Python 3.6.9
(pailliercryptolib_python) local:$ git status
On branch development
Your branch is up to date with 'origin/development'.
(pailliercryptolib_python) local:$ python3 setup.py install
running install
running bdist_egg
running egg_info
writing src/ipcl_python.egg-info/PKG-INFO
writing dependency_links to src/ipcl_python.egg-info/dependency_links.txt
writing requirements to src/ipcl_python.egg-info/requires.txt
writing top-level names to src/ipcl_python.egg-info/top_level.txt
reading manifest file 'src/ipcl_python.egg-info/SOURCES.txt'
writing manifest file 'src/ipcl_python.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
-- CMAKE_BUILD_TYPE: Release
-- CMAKE_C_COMPILER: /usr/bin/clang
-- CMAKE_CXX_COMPILER: /usr/bin/clang++
-- IPCL_PYTHON_TEST: ON
-- IPCL_PYTHON_DOCS: OFF
-- IPCL_PYTHON_DETECT_IFMA_RUNTIME:
-- IPCL_PYTHON_ENABLE_OMP: OFF
-- IPCL_BINDINGS_SRCS_DIR : ./pailliercryptolib_python/src/ipcl_python/bindings
-- Configuring Intel Paillier Cryptosystem Library
-- pybind11 v2.11.0 dev1
-- Configuring done
-- Generating done
-- Build files have been written to: ./pailliercryptolib_python/build/temp.linux-x86_64-3.6
[ 66%] Built target ext_ipcl
[ 75%] Building CXX object CMakeFiles/ipcl_bindings.dir/src/ipcl_python/bindings/ipcl_bindings_classes.cpp.o
warning: unknown warning option '-Wno-as-needed' [-Wunknown-warning-option]
In file included from ./pailliercryptolib_python/src/ipcl_python/bindings/ipcl_bindings_classes.cpp:7:
In file included from ./pailliercryptolib_python/src/ipcl_python/bindings/include/ipcl_bindings.h:7:
In file included from ./pailliercryptolib_python/build/temp.linux-x86_64-3.6/_deps/pybind11-src/include/pybind11/numpy.h:12:
In file included from ./pailliercryptolib_python/build/temp.linux-x86_64-3.6/_deps/pybind11-src/include/pybind11/pybind11.h:14:
./pailliercryptolib_python/build/temp.linux-x86_64-3.6/_deps/pybind11-src/include/pybind11/detail/init.h:82:16: error: no matching constructor for initialization of 'ipcl::CipherText'
return new Class{std::forward<Args>(args)...};
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./pailliercryptolib_python/build/temp.linux-x86_64-3.6/_deps/pybind11-src/include/pybind11/detail/init.h:206:35: note: in instantiation of function template specialization 'pybind11::detail::initimpl::construct_or_initialize<ipcl::CipherText, const ipcl::PublicKey *, const ipcl::PlainText &, 0>' requested here
v_h.value_ptr() = construct_or_initialize<Cpp<Class>>(std::forward<Args>(args)...);
^
./pailliercryptolib_python/build/temp.linux-x86_64-3.6/_deps/pybind11-src/include/pybind11/pybind11.h:1606:14: note: in instantiation of function template specialization 'pybind11::detail::initimpl::constructor<const ipcl::PublicKey *, const ipcl::PlainText &>::execute<pybind11::class_<ipcl::CipherText>, char [27], 0>' requested here
init.execute(*this, extra...);
^
./pailliercryptolib_python/src/ipcl_python/bindings/ipcl_bindings_classes.cpp:268:8: note: in instantiation of function template specialization 'pybind11::class_<ipcl::CipherText>::def<const ipcl::PublicKey *, const ipcl::PlainText &, char [27]>' requested here
.def(py::init<const ipcl::PublicKey*, const ipcl::PlainText&>(),
^
./pailliercryptolib_python/build/temp.linux-x86_64-3.6/ext_ipcl/include/ipcl/ciphertext.hpp:23:3: note: candidate constructor not viable: no known conversion from 'const ipcl::PlainText' to 'const uint32_t' (aka 'const unsigned int') for 2nd argument
CipherText(const PublicKey* pub_key, const uint32_t& n);
^
./pailliercryptolib_python/build/temp.linux-x86_64-3.6/ext_ipcl/include/ipcl/ciphertext.hpp:24:3: note: candidate constructor not viable: no known conversion from 'const ipcl::PlainText' to 'const std::vector<uint32_t>' (aka 'const vector<unsigned int>') for 2nd argument
CipherText(const PublicKey* pub_key, const std::vector<uint32_t>& n_v);
^
./pailliercryptolib_python/build/temp.linux-x86_64-3.6/ext_ipcl/include/ipcl/ciphertext.hpp:25:3: note: candidate constructor not viable: no known conversion from 'const ipcl::PlainText' to 'const BigNumber' for 2nd argument
CipherText(const PublicKey* pub_key, const BigNumber& bn);
^
./pailliercryptolib_python/build/temp.linux-x86_64-3.6/ext_ipcl/include/ipcl/ciphertext.hpp:26:3: note: candidate constructor not viable: no known conversion from 'const ipcl::PlainText' to 'const std::vector<BigNumber>' for 2nd argument
CipherText(const PublicKey* pub_key, const std::vector<BigNumber>& bn_vec);
^
./pailliercryptolib_python/build/temp.linux-x86_64-3.6/ext_ipcl/include/ipcl/ciphertext.hpp:31:3: note: candidate constructor not viable: requires single argument 'ct', but 2 arguments were provided
CipherText(const CipherText& ct);
^
./pailliercryptolib_python/build/temp.linux-x86_64-3.6/ext_ipcl/include/ipcl/ciphertext.hpp:17:3: note: candidate constructor not viable: requires 0 arguments, but 2 were provided
CipherText() = default;
^
1 warning and 1 error generated.
CMakeFiles/ipcl_bindings.dir/build.make:88: recipe for target 'CMakeFiles/ipcl_bindings.dir/src/ipcl_python/bindings/ipcl_bindings_classes.cpp.o' failed
make[2]: *** [CMakeFiles/ipcl_bindings.dir/src/ipcl_python/bindings/ipcl_bindings_classes.cpp.o] Error 1
CMakeFiles/Makefile2:124: recipe for target 'CMakeFiles/ipcl_bindings.dir/all' failed
make[1]: *** [CMakeFiles/ipcl_bindings.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
File "setup.py", line 109, in <module>
zip_safe=False,
File "./pailliercryptolib_python/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "./pailliercryptolib_python/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "./pailliercryptolib_python/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "./pailliercryptolib_python/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 172, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "./pailliercryptolib_python/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 158, in call_command
self.run_command(cmdname)
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "./pailliercryptolib_python/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 24, in run
self.build()
File "/usr/lib/python3.6/distutils/command/install_lib.py", line 109, in build
self.run_command('build_ext')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 41, in run
self.build_extension(ext)
File "setup.py", line 80, in build_extension
["cmake", "--build", "."] + build_args, cwd=self.build_temp
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j7']' returned non-zero exit status 2.
crockeea commented
This is a failure at the linking stage.
Tangjacson commented
This is a failure at the linking stage.
Hi, could you please tell me how to fix this issue?
Thx
justalittlenoob commented
This is a failure at the linking stage.
Hi, could you please tell me how to fix this issue?
Thx
Hi @Tangjacson
You can have a try with the latest code(development branch), and see the result.
fangxiaoran commented
This issue was closed because it has been inactive for more than 30 days.