Huelse / SEAL-Python

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

Problems of windows compilation errors #44

Closed molimolihon closed 3 years ago

molimolihon commented 3 years ago

I pull the code down from GitHub and follow the steps.When I run the ‘python3 setup.py build_ext -i’,it shows some errors like C2059,C2334,C7586.And when I run the python script , it shows me 'No module named ‘seal’ '.And my compilation environment is Windows VS Native2019 x64.Please give the advice, thank you!

Huelse commented 3 years ago

Sorry, for some reason(may caused by the latest VS 2019 building requirements), you need to update to pybind11-2.6.1, I will commit it later.

molimolihon commented 3 years ago

I have updated to pybind11-2.6.1 ,but it also shows the same errors

Huelse commented 3 years ago

Can you put screenshots? or more details?

molimolihon commented 3 years ago

My environment is win10 vs2019+python 3.6.8 ,a new version. And I want to say what's the version about release ?3.4.5?or 3.3.2.1? 2711607349811_ pic_hd 3901607424305_ pic_hd

molimolihon commented 3 years ago

Can I speak Chinese with you?

Huelse commented 3 years ago

Obviously, you didn't reference the pybind11-2.6.1 successfully. Please check out your native files /pybind11. You will get the obj named like seal.cp37-win_amd64.pyd if compile well, and paste it into the tests and run.

Huelse commented 3 years ago

可以打中文,只是用英文更方便后来者参考。

molimolihon commented 3 years ago

Obviously, you didn't reference the pybind11-2.6.1 successfully. Please check out your native files /pybind11. You will get the obj named like seal.cp37-win_amd64.pyd if compile well, and paste it into the tests and run.

I need to run the ‘setup.py’ at first ,and then i may get the obj named likeseal.cp37-win_amd64.pyd.But now I can't run the 'setup.py'

Huelse commented 3 years ago

看上面的报错,应该是没有把pybind11-2.6.1引用成功,所以不行。

molimolihon commented 3 years ago

看上面的报错,应该是没有把pybind11-2.6.1引用成功,所以不行。

我都是按照步骤操作的,请问这个问题可能出现在哪个环节呢?

Huelse commented 3 years ago

报错在哪里问题肯定就在那里啊,你是怎么替换pybind11的?2个版本的pybind11.h的837行内容完全不一样。

molimolihon commented 3 years ago

报错在哪里问题肯定就在那里啊,你是怎么替换pybind11的?2个版本的pybind11.h的837行内容完全不一样。

现在提示这个: warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;请使用 DEFAULTLIB:library

molimolihon commented 3 years ago

重新跑了一次又报这个错误: C:\Code\SEAL-Python-master>python setup.py build_ext -i running build_ext building 'seal' extension C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT "-IC:\Program Files\Python36\include" -I./pybind11/include -I./SEAL/native/src "-IC:\Program Files\Python36\include" "-IC:\Program Files\Python36\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpsrc/base64.cpp /Fobuild\temp.win-amd64-3.6\Release\src/base64.obj /std:c++latest base64.cpp src/base64.cpp(78): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 src/base64.cpp(89): warning C4267: “=”: 从“size_t”转换到“unsigned char”,可能丢失数据 src/base64.cpp(103): warning C4267: “=”: 从“sizet”转换到“unsigned char”,可能丢失数据 C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT "-IC:\Program Files\Python36\include" -I./pybind11/include -I./SEAL/native/src "-IC:\Program Files\Python36\include" "-IC:\Program Files\Python36\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.183 WechatIMG451 ![4521607525026 pic_hd](https://user-images.githubusercontent.com/75678447/101644769-8eb66b80-3a70-11eb-9155-05b803c98d91.jpg)

Huelse commented 3 years ago

这个报错信息也很清楚啊,你重新按要求编译就行了,实在不行就全部删了重来。

molimolihon commented 3 years ago

这个报错信息也很清楚啊,你重新按要求编译就行了,实在不行就全部删了重来。

您重新拉下来跑是没问题的么?请问是什么系统平台环境?

Huelse commented 3 years ago

就win10或者ubuntu,python任意版本都可以啊

  1. generate the seal.lib image.png
  2. pip install numpy or pip install -r requirements.txt
  3. python .\setup.py build_ext -i image.png
  4. copy the seal.<version>.pyd to the tests and run image.png
molimolihon commented 3 years ago

我的步骤跟您的一样,环境也一样,您这个是在本地跑的还是在这个git上拉下来跑的呢?我看目录好像不太一样~

Huelse commented 3 years ago

和目录没关系,我就是复制了git仓库一份到新建的tests文件夹里给你演示了下。 你看不懂报错吗?这个和目录没关系的,目前我看到的就是你的pybind11有问题,或者编译器问题。 这种自己环境上的问题请自行解决。

molimolihon commented 3 years ago

问题解决了,之前只是分别pip 了requirements里面的内容,但是不是pip install -r requirements.txt这样操作的,不知道问题出在了哪里,但是现在解决了。谢谢您。

Huelse commented 3 years ago

嗯,自己总结下吧,确认没问题后记得关闭此issues。