Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems of windows compilation errors #44

Closed
molimolihon opened this issue Dec 8, 2020 · 20 comments
Closed

Problems of windows compilation errors #44

molimolihon opened this issue Dec 8, 2020 · 20 comments

Comments

@molimolihon
Copy link

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
Copy link
Owner

Huelse commented Dec 8, 2020

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
Copy link
Author

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

@Huelse
Copy link
Owner

Huelse commented Dec 8, 2020

Can you put screenshots? or more details?

@molimolihon
Copy link
Author

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
Copy link
Author

Can I speak Chinese with you?

@Huelse
Copy link
Owner

Huelse commented Dec 8, 2020

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
Copy link
Owner

Huelse commented Dec 8, 2020

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

@molimolihon
Copy link
Author

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
Copy link
Owner

Huelse commented Dec 9, 2020

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

@molimolihon
Copy link
Author

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

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

@Huelse
Copy link
Owner

Huelse commented Dec 9, 2020

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

@molimolihon
Copy link
Author

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

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

@molimolihon
Copy link
Author

重新跑了一次又报这个错误:
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: “=”: 从“size_t”转换到“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

@Huelse
Copy link
Owner

Huelse commented Dec 10, 2020

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

@molimolihon
Copy link
Author

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

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

@Huelse
Copy link
Owner

Huelse commented Dec 10, 2020

就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
Copy link
Author

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

@Huelse
Copy link
Owner

Huelse commented Dec 10, 2020

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

@molimolihon
Copy link
Author

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

@Huelse
Copy link
Owner

Huelse commented Dec 10, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants