Huelse / SEAL-Python

Microsoft SEAL 4.X For Python
MIT License
319 stars 66 forks source link

python3 setup.py build_ext -i #6

Closed Ailab666666 closed 3 years ago

Ailab666666 commented 4 years ago

hi, when I excute the command, find some error:

wrapper.cpp: In function 'void pybind11_init_seal(pybind11::module&)': wrapper.cpp:136:20: error: 'py::array_t' has not been declared

Huelse commented 4 years ago

Sorry, #include <pybind11/numpy.h> is needed, add it to the wrapper.cpp head

Ailab666666 commented 4 years ago

Hi ,occur new error, when I execute cmake . in Path SEAL-Python/src.

CMake Error at CMakeLists.txt:13 (add_subdirectory): add_subdirectory given source "pybind11" which is not an existing directory.

CMake Error at CMakeLists.txt:15 (pybind11_add_module): Unknown CMake command "pybind11_add_module".

Huelse commented 4 years ago

If you have installed pybind11 currently will be no problem, or try to change the add_subdirectory(pybind11) to find_package(pybind11) in CMakeLists.txt

Ailab666666 commented 4 years ago

Hi, cmake ok. after I make, occur :

/usr/bin/ld: cannot find -l../SEAL/native/lib/libseal.a collect2: error: ld returned 1 exit status CMakeFiles/seal.dir/build.make:94: recipe for target 'seal.cpython-36m-x86_64-linux-gnu.so' failed make[2]: [seal.cpython-36m-x86_64-linux-gnu.so] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/seal.dir/all' failed make[1]: [CMakeFiles/seal.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

Huelse commented 4 years ago

The information has told you cannot find -l../SEAL/native/lib/libseal.a Build the SEAL 3.3.2 lib first. and make sure that the path is right Please read the README.md carefully

Ailab666666 commented 4 years ago

this file ../SEAL/native/lib/libseal.a in right Path.

Huelse commented 4 years ago

try to make install the SEAL, and use the absolute path /usr/local/lib/libseal.a

MarwanNour commented 4 years ago

I'm getting an error as well with this step:

running build_ext
building 'seal' extension
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6 -I../pybind11/include -I../SEAL/native/src -I/usr/include/python3.7m -c wrapper.cpp -o build/temp.linux-x86_64-3.7/wrapper.o -std=c++17
In file included from ../pybind11/include/pybind11/pybind11.h:47,
                 from wrapper.cpp:1:
../pybind11/include/pybind11/detail/init.h: In instantiation of ‘Class* pybind11::detail::initimpl::construct_or_initialize(Args&& ...) [with Class = seal::MemoryManager; Args = {}; typename std::enable_if<(! std::is_constructible<_Tp, _Args>::value), int>::type <anonymous> = 0]’:
../pybind11/include/pybind11/detail/init.h:174:66:   required from ‘static void pybind11::detail::initimpl::constructor<Args>::execute(Class&, const Extra& ...) [with Class = pybind11::class_<seal::MemoryManager>; Extra = {}; typename std::enable_if<(! Class::has_alias), int>::type <anonymous> = 0; Args = {}]’
../pybind11/include/pybind11/pybind11.h:1141:9:   required from ‘pybind11::class_<type_, options>& pybind11::class_<type_, options>::def(const pybind11::detail::initimpl::constructor<Args ...>&, const Extra& ...) [with Args = {}; Extra = {}; type_ = seal::MemoryManager; options = {}]’
wrapper.cpp:400:20:   required from here
../pybind11/include/pybind11/detail/init.h:63:64: error: use of deleted function ‘seal::MemoryManager::MemoryManager()’
   63 | inline Class *construct_or_initialize(Args &&...args) { return new Class{std::forward<Args>(args)...}; }
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../SEAL/native/src/seal/biguint.h:9,
                 from ../SEAL/native/src/seal/seal.h:6,
                 from wrapper.cpp:5:
../SEAL/native/src/seal/memorymanager.h:448:9: note: declared here
  448 |         MemoryManager() = delete;
      |         ^~~~~~~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Huelse commented 4 years ago

@MarwanNour It seemd that you have used the latest SEAL lib(3.4) which this wrapper is not adaptive, right? You need to complie the SEAL lib(3.3.2) in this project.

Huelse commented 4 years ago

@Ailab666666 If you don't have any other questions, close this issue please.

uriariel commented 4 years ago

It seems that the updated Seal code with deleted MemoryManager is in your repository.

Huelse commented 4 years ago

@uriariel You mean the class MemoryPoolHandle? Yes it is, this bind is support to SEAL3.3.2, we haven't update to fit the latest SEAL lib. Both are similar.

uriariel commented 4 years ago

No I mean the contrary. In the Seal directory in your repository there is a definition of MemoryManager which indicates that it's deleted.

On Sun, Feb 23, 2020, 16:52 Huelse notifications@github.com wrote:

@uriariel https://github.com/uriariel You mean the class MemoryPoolHandle? Yes it is, this bind is support to SEAL3.3.2, we haven't update to fit the latest SEAL lib. Both are similar.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Huelse/SEAL-Python/issues/6?email_source=notifications&email_token=AD5CJL5GQKOG4XZA3BDFPQTREKEUNA5CNFSM4KET6FV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMV5VJA#issuecomment-590076580, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD5CJLZ7UNDUPAL5OZR3ZPLREKEUNANCNFSM4KET6FVQ .

Huelse commented 4 years ago

@uriariel Thank you, I found it.