meelgroup / approxmc

Approximate Model Counter
Other
70 stars 25 forks source link

pip install pyapproxmc - install error with picogcnf.c #33

Closed jeffchhen closed 1 year ago

jeffchhen commented 1 year ago

I installed microsoft visual studio build tools for a C++ compiler. When running pip install pyapproxmc, i get the following error code:


  Building wheel for pyapproxmc (pyproject.toml) did not run successfully.
  exit code: 1

  [16 lines of output]
  running bdist_wheel
  running build
  running build_clib
  building 'picosatlib' library
  creating build
  creating build\temp.win-amd64-cpython-39
  creating build\temp.win-amd64-cpython-39\python
  creating build\temp.win-amd64-cpython-39\python\cryptominisat
  creating build\temp.win-amd64-cpython-39\python\cryptominisat\src
  creating build\temp.win-amd64-cpython-39\python\cryptominisat\src\picosat
  "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ipython/cryptominisat/src/ "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcpython/cryptominisat/src/picosat/picogcnf.c /Fobuild\temp.win-amd64-cpython-39\python/cryptominisat/src/picosat/picogcnf.obj
  picogcnf.c
  python/cryptominisat/src/picosat/picogcnf.c(32): error C2010: '.': unexpected in macro parameter list
  python/cryptominisat/src/picosat/picogcnf.c(79): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
  python/cryptominisat/src/picosat/picogcnf.c(90): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.35.32215\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  [end of output]

Can you please help with this issue?

Thank you!

msoos commented 1 year ago

Hi,

I just fixed these issues and kicked off a new PIP build for version 4.1.10. Please wait for 4.1.10 to show up in PIP: https://pypi.org/project/pyapproxmc/

However, it is HIGHLY likely that it will not work for you without Windows Subsystem For Linux (WSL) -- see here: https://learn.microsoft.com/en-us/windows/wsl/install it basically gives you a Linux terminal in Windows. Then you can pip install there. You WILL need apt-get install libboost-all-dev before pip install pyapproxmc. However, my understanding is that pyapproxmc will then only be available from with in WSL. In general, I can't really support Windows because I don't use it. However, pyapproxmc should work from both Linux and Mac.

Sorry for not supporting Windows. However, it may not be too hard to support it. If you send in a PR to fix it I'm happy to review and merge! I hope this helped,

Mate

msoos commented 1 year ago

I am closing, because I have not heard anything back for 6 months. I believe this issue has been fixed. Please re-open the issue or open a new one in case this is still a bug!

Thanks again for telling us about the issue,

Mate