Git Product home page Git Product logo

fpbinary's People

Contributors

peter-d avatar smlgit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fpbinary's Issues

Installation on Windows 10

Hello,

First of all, thanks for this awesome library. I've working a lot with it on linux.
But now, I'd need to install it on Windows 10. And in Windows it's a problem. I've already installed pip 20 and wheel, and I've installed the following Visual Studio Build tools for C++:

  • MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.26)
  • Windows 10 SDK (10.0.18362.0)
  • C++ CMake tools for Windows
  • Testing tools core features - Build Tools
  • C++ AddressSanitizer (Experimental)-
  • C++ Modules for v142 build tools (x64/x86 โ€“ experimental)
  • C++ Clang tools for Windows (10.0.0 - x64/x86)
  • Windows 10 SDK (10.0.17763.0)
  • MSVC v141 - VS 2017 C++ x64/x86 build tools (v14.16)
  • MSVC v140 - VS 2015 C++ build tools (v14.00)

But I still get errors when I try to install fpbinary:

pip install git+https://github.com/smlgit/fpbinary.git
Collecting git+https://github.com/smlgit/fpbinary.git
Cloning https://github.com/smlgit/fpbinary.git to c:\users\user\appdata\local\temp\pip-req-build-sy5d5jbv
Running command git clone -q https://github.com/smlgit/fpbinary.git 'C:\Users\User\AppData\Local\Temp\pip-req-build-sy5d5jbv'
Building wheels for collected packages: FpBinary
Building wheel for FpBinary (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\User\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\User\AppData\Local\Temp\pip-req-build-sy5d5jbv\setup.py'"'"'; file='"'"'C:\Users\User\AppData\Local\Temp\pip-req-build-sy5d5jbv\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\User\AppData\Local\Temp\pip-wheel-3zorn_su'
cwd: C:\Users\User\AppData\Local\Temp\pip-req-build-sy5d5jbv
Complete output (47 lines):
running bdist_wheel
running build
running build_ext
building 'fpbinary' extension
creating build
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinarymodule.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinarymodule.obj
fpbinarymodule.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinaryglobaldoc.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinaryglobaldoc.obj
fpbinaryglobaldoc.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinarycommon.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinarycommon.obj
fpbinarycommon.c
src/fpbinarycommon.c(306): warning C4244: 'function': conversion from 'unsigned __int64' to 'int', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinarysmall.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinarysmall.obj
fpbinarysmall.c
src/fpbinarysmall.c(361): warning C4244: 'function': conversion from '__int64' to 'int', possible loss of data
src/fpbinarysmall.c(571): warning C4244: 'function': conversion from '__int64' to 'int', possible loss of data
src/fpbinarysmall.c(575): warning C4244: 'function': conversion from '__int64' to 'int', possible loss of data
src/fpbinarysmall.c(585): warning C4244: 'function': conversion from '__int64' to 'long', possible loss of data
src/fpbinarysmall.c(586): warning C4244: 'function': conversion from '__int64' to 'long', possible loss of data
src/fpbinarysmall.c(638): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinarysmall.c(639): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinarysmall.c(1151): warning C4244: 'function': conversion from '__int64' to 'long', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinarylarge.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinarylarge.obj
fpbinarylarge.c
src/fpbinarylarge.c(549): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinarylarge.c(551): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinarylarge.c(1559): warning C4244: 'function': conversion from '__int64' to 'long', possible loss of data
src/fpbinarylarge.c(1560): warning C4244: 'function': conversion from '__int64' to 'long', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinaryobject.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinaryobject.obj
fpbinaryobject.c
src/fpbinaryobject.c(401): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinaryobject.c(402): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinaryobject.c(665): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinaryobject.c(666): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinaryswitchable.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinaryswitchable.obj
fpbinaryswitchable.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinaryenums.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinaryenums.obj
fpbinaryenums.c
creating C:\Users\User\AppData\Local\Temp\pip-req-build-sy5d5jbv\build\lib.win-amd64-3.8
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\libs" "/LIBPATH:C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\PCbuild\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64" /EXPORT:PyInit_fpbinary build\temp.win-amd64-3.8\Release\src/fpbinarymodule.obj build\temp.win-amd64-3.8\Release\src/fpbinaryglobaldoc.obj build\temp.win-amd64-3.8\Release\src/fpbinarycommon.obj build\temp.win-amd64-3.8\Release\src/fpbinarysmall.obj build\temp.win-amd64-3.8\Release\src/fpbinarylarge.obj build\temp.win-amd64-3.8\Release\src/fpbinaryobject.obj build\temp.win-amd64-3.8\Release\src/fpbinaryswitchable.obj build\temp.win-amd64-3.8\Release\src/fpbinaryenums.obj /OUT:build\lib.win-amd64-3.8\fpbinary.cp38-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.8\Release\src\fpbinary.cp38-win_amd64.lib
Creating library build\temp.win-amd64-3.8\Release\src\fpbinary.cp38-win_amd64.lib and object build\temp.win-amd64-3.8\Release\src\fpbinary.cp38-win_amd64.exp
fpbinaryobject.obj : error LNK2001: unresolved external symbol check_supported_builtin
build\lib.win-amd64-3.8\fpbinary.cp38-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\link.exe' failed with exit status 1120

ERROR: Failed building wheel for FpBinary
Running setup.py clean for FpBinary
Failed to build FpBinary
Installing collected packages: FpBinary
Running setup.py install for FpBinary ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\User\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\User\AppData\Local\Temp\pip-req-build-sy5d5jbv\setup.py'"'"'; file='"'"'C:\Users\User\AppData\Local\Temp\pip-req-build-sy5d5jbv\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\User\AppData\Local\Temp\pip-record-34dtpb9r\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\FpBinary'
cwd: C:\Users\User\AppData\Local\Temp\pip-req-build-sy5d5jbv
Complete output (47 lines):
running install
running build
running build_ext
building 'fpbinary' extension
creating build
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinarymodule.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinarymodule.obj
fpbinarymodule.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinaryglobaldoc.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinaryglobaldoc.obj
fpbinaryglobaldoc.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinarycommon.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinarycommon.obj
fpbinarycommon.c
src/fpbinarycommon.c(306): warning C4244: 'function': conversion from 'unsigned __int64' to 'int', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinarysmall.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinarysmall.obj
fpbinarysmall.c
src/fpbinarysmall.c(361): warning C4244: 'function': conversion from '__int64' to 'int', possible loss of data
src/fpbinarysmall.c(571): warning C4244: 'function': conversion from '__int64' to 'int', possible loss of data
src/fpbinarysmall.c(575): warning C4244: 'function': conversion from '__int64' to 'int', possible loss of data
src/fpbinarysmall.c(585): warning C4244: 'function': conversion from '__int64' to 'long', possible loss of data
src/fpbinarysmall.c(586): warning C4244: 'function': conversion from '__int64' to 'long', possible loss of data
src/fpbinarysmall.c(638): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinarysmall.c(639): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinarysmall.c(1151): warning C4244: 'function': conversion from '__int64' to 'long', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinarylarge.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinarylarge.obj
fpbinarylarge.c
src/fpbinarylarge.c(549): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinarylarge.c(551): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinarylarge.c(1559): warning C4244: 'function': conversion from '__int64' to 'long', possible loss of data
src/fpbinarylarge.c(1560): warning C4244: 'function': conversion from '__int64' to 'long', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinaryobject.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinaryobject.obj
fpbinaryobject.c
src/fpbinaryobject.c(401): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinaryobject.c(402): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinaryobject.c(665): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
src/fpbinaryobject.c(666): warning C4244: '=': conversion from '__int64' to 'long', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinaryswitchable.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinaryswitchable.obj
fpbinaryswitchable.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMAJOR_VERSION=1 -DMINOR_VERSION=3 "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\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" /Tcsrc/fpbinaryenums.c /Fobuild\temp.win-amd64-3.8\Release\src/fpbinaryenums.obj
fpbinaryenums.c
creating C:\Users\User\AppData\Local\Temp\pip-req-build-sy5d5jbv\build\lib.win-amd64-3.8
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\libs" "/LIBPATH:C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\PCbuild\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64" /EXPORT:PyInit_fpbinary build\temp.win-amd64-3.8\Release\src/fpbinarymodule.obj build\temp.win-amd64-3.8\Release\src/fpbinaryglobaldoc.obj build\temp.win-amd64-3.8\Release\src/fpbinarycommon.obj build\temp.win-amd64-3.8\Release\src/fpbinarysmall.obj build\temp.win-amd64-3.8\Release\src/fpbinarylarge.obj build\temp.win-amd64-3.8\Release\src/fpbinaryobject.obj build\temp.win-amd64-3.8\Release\src/fpbinaryswitchable.obj build\temp.win-amd64-3.8\Release\src/fpbinaryenums.obj /OUT:build\lib.win-amd64-3.8\fpbinary.cp38-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.8\Release\src\fpbinary.cp38-win_amd64.lib
Creating library build\temp.win-amd64-3.8\Release\src\fpbinary.cp38-win_amd64.lib and object build\temp.win-amd64-3.8\Release\src\fpbinary.cp38-win_amd64.exp
fpbinaryobject.obj : error LNK2001: unresolved external symbol check_supported_builtin
build\lib.win-amd64-3.8\fpbinary.cp38-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\link.exe' failed with exit status 1120
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\User\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\User\AppData\Local\Temp\pip-req-build-sy5d5jbv\setup.py'"'"'; file='"'"'C:\Users\User\AppData\Local\Temp\pip-req-build-sy5d5jbv\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\User\AppData\Local\Temp\pip-record-34dtpb9r\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Include\FpBinary' Check the logs for full command output.

=============================================================
What should I do to make it work on W10?
Thank you a lot!

FpBinary instances with format (0, system_word_length) have wrong value.

Found when looking at #4 .

If a user instantiates an FpBinary instance with 0 int bits and the architecture word length for frac bits (e.g (0, 64) on a 64 bit system), the value the user specifies will not be preserved.

For example:

>>> FpBinary(0, 64, signed=True, value=0.25)
0.0

This issue has always been present.

numpy float64 type causes kernel crash in fpBinarySwitchable

The following results in a Dead kernel when executed in a Jupyter Notebook or the Spyder IDE (but appeared to work fine from a Python console directly).

import numpy as np
import fpbinary as fpb
fp_mode= False
test = np.float64(5)
node = fpb.FpBinarySwitchable(fp_mode=fp_mode, fp_value=fpb.FpBinary(4,0, True, test), float_value=test)

Sometimes there will be a delay, but subsequent cells in the notebook won't execute and eventually "Dead kernel" results. The solution is to use float(test) to ensure it is a standard float data type, but I am submitting this as fpBinarySwitchable would be more robust if it did this internally for its float parameter type. I am using the numpy float datatype as I am using the fpbinary library with numpy arrays which are set to float64 by default.

Division on FpBinary objects may cause a crash

A segfault may occur when doing a division operation on FpBinary objects. This will occur if:

(op1.total_bits + op2.total_bits) > (native word length / 2) AND (op1.total_bits + op2.total_bits) <= native word length

For example, on a 64 bit system, if the total number of bits in operand 1 and operand 2 is between 32 and 64 (say int_bits and frac_bits both equal 10 for both operands), a division will result in a segfault.

The reason for this is the total bits calculation for a division result erroneously uses the rules for multiplication, not division.

The near_zero rounding type doesn't do what it implies

The near_zero rounding type is supposed to round to the nearest bit, and ties are rounded towards zero. But it has been implemented to truncate (or direct) round towards zero. E.g. :

when resizing to 0 frac bits:

1.5 goes to 1 : this is correct
1.6 goes to 1 : this is WRONG (should be 2)
-1.5 goes to -1 : this is correct
-1.6 goes to -1 : this is WRONG (should be -2)

This mode is useful (it is what python does when converting floats to ints) but the terminology is incorrect and, therefore, confusing.

Would like to contact fpbinary contributors

Hi!
I am not sure if posting an issue to send this message is best practice (and if not I apologize). I would like to get in touch with the primary contributors for fpbinary. I have reviewed several options for implementing fixedpoint datatypes in Python and this one is by far my favorite. I am giving a presentation at the end of this month on implementing IIR/FIR filters in fixed point, demonstrated using this package. I would like to talk with you briefly about what I am doing and will be showing. I would be grateful if you could send me an email at boschen at loglin dot com. Thank you!

Dead kernel when using resize method incorrectly

Using the invalid condition of a the total bits being negative for the FpBinary.resize method results in a dead kernel:

# Creating a new FpBinary object properly creates a ValueError if integer_bits + fractional_bits is negative

# this will properly raise a ValueError exception
try:
    test = fpb.FpBinary(4, -5, value=12)
except ValueError:
    print("Nice Work!")

# this will crash the kernel (memory leak?)
test = fpb.FpBinary(4, 5, value=12)
test.resize((4,-5))

Tested using:

Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:50:36) [MSC v.1929 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.33.0 -- An enhanced Interactive Python. Type '?' for help.

Creating np.array of FpBinary triggers cast to bool

I've been using the function below to generate arrays of FpBinary numbers. It works, but is a bit slower than it could be as unless I use the for loop all of the FpBinary numbers get cast to bool (see the commented lines).

An simpler example is to look at the result of

gen=lambda x: FpBinary(int_bits=1, frac_bits=15, signed=True, value=x)
np.array([FP16_15(.4)],  dtype=object)

It looks like the FpBinary object is getting expanded into its bits!

I'm not sure what would work useres of this library. I do find I'm generating large numpy arrays of FP numbers (100k-a few million).

def fparray(a, fpgen=None):
    """
    Convert a numpy array to a numpy object array of FpBinary numbers.

    Complex numbers gain an additional axis of length 2.

    if fpgen is None 16wide  1integer signed is used
    """
    if fpgen is None:
        fpgen = lambda x: FpBinary(int_bits=1, frac_bits=15, signed=True, value=x)

    if a.dtype in (np.complex, np.complex128, np.complex64):
        out = np.empty(tuple(list(a.shape)+[2]), dtype=object)
        b = [(fpgen(x.real), fpgen(x.imag)) for x in a.flat]
        for i in range(out.size):
            out.flat[i] = b[i//2][i % 2]
        #You'd think this would work, but it doesn't as the FP types get cast to bool
        #out.flat = [(fpgen(x.real), fpgen(x.imag)) for x in a.flat]
    else:
        out = np.empty_like(a, dtype=object)
        b = [fpgen(x) for x in a.flat]
        for i in range(out.size):
            out.flat[i] = b[i]
        #out.flat = [fpgen(x) for x in a.flat]
    return out

Negative int_bits behavior is suspect

I'm trying to use this library to verify an FIR that has 16_15 signed samples with -10_26 signed coefficients (16 bit width, quantized by Xilinx's to 26 fractional bits as they are all quite small).

x=FpBinary(int_bits=-10,frac_bits=26,signed=True)

Takes a long time to execute and allows for values >1. Looking at the code it looks like the FpBinary constructor accepts signed values for int_bits but then fp small uses FP_UINT_TYPE for in_bits, so I'm guessing my request is being interpreted as for a VERY large integer part. the result of .format ((4294967287, 26)) seems to suggest this!

Is there a way for me to do this math with your library?

Modify build naming and test versioning scheme.

Currently the build system will create alpha numbers based on a build number that is initialised per branch. This may cause conflicts with test.pypi (because test.pypi doesn't allow the complete overwrite of packages which means versions can't be reused).

The proposed scheme is to version non-release packages (i.e. test packages) as {base_version}a{global_build_number}. Appveyor build names will be {branch}-{base_version}a{global_build_number} for non-release builds and {branch}-{base_version}rc{global_build_number} for release builds.

Error in doc for RoundingEnum?

(Minor clerical error). The doc string for RoundingEnum describes Python as using 'near_zero' when converting floats to ints. I believe Python uses 'near_even' (as given by 'round()' as well as numpy 'np.round() ).

Getting/setting the raw bits?

Is there an undocumented method to get and set the raw bits? An example use case could be as follows:

x=sin(np.random.uniform(size=1000)*2*np.pi)
fp_bitarray = np.zeros(1000, dtype=np.uint16)
for i in range(1000):
    fp_bitarray[i] = FPBinary(16,15,  True, x[i]).bits
...
Do stuff with data, eg on an FPGA, get a return array of bits, result_bitarray
...
result = np.array([float(FPBinary(16,15, True, from_bits=bits)) for bits in result_bitarray])

Add support for negative fractional bits.

I'm not sure if this is a common use case, but I'm going to add it to make the format functionality complete (we already support negative int_bits).

Negative format bits (either int_bits OR fract_bits) indicates the instance represents a number that only has bits below or above the value zero.

Copying FpBinarySwitchable objects may result in the wrong min_value or max_value.

Copying FpBinarySwitchable instances via copy.copy() does not copy the min_value and max_value fields correctly. It will set these to the current value:

>>> fs = FpBinarySwitchable(fp_mode=False, float_value=0.0)
>>> fs.value = -5.0
>>> fs.value = 5.0
>>> fs.value = 1.0
>>> fs.value, fs.min_value, fs.max_value
(1.0, -5.0, 5.0)
>>> fs2 = copy.copy(fs)
>>> fs2.value, fs2.min_value, fs2.max_value
(1.0, 1.0, 1.0)

Applied value is too large for int representation on this CPU.

Hi!

I'm having this problem:

>>> fp_num = FpBinary(int_bits=0, frac_bits=15, signed=True, value=-0.501)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: Applied value is too large for int representation on this CPU.

My CPU is Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz

FpBinary objects can't be pickled.

Given the long creation time for large arrays and involved FP operations it would be nice to be able to cache arrays of FpBinary objects to disk. Presently any attempt to pickle results in: TypeError: can't pickle fpbinary.FpBinary objects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.