sms-tools
sms-tools copied to clipboard
Cannot compile C functions
when I run
python compileModule.py build_ext --inplace
I got error
running build_ext
skipping 'cutilFunctions.c' Cython extension (up-to-date)
building 'utilFunctions_C' extension
error: Unable to find vcvarsall.bat
python=3.6 windows 10
windows 10 Python 3.6.5
When I run
python compileModule.py build_ext --inplace
I get
running build_ext
skipping 'cutilFunctions.c' Cython extension (up-to-date)
building 'utilFunctions_C' extension
creating build
creating build\temp.win32-3.6
creating build\temp.win32-3.6\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\OWNER\AppData\Local\Programs\Python\Python36-32\include -IC:\Users\OWNER\AppData\Local\Programs\Python\Python36-32\lib\site-packages\numpy\core/include -IC:\Users\OWNER\AppData\Local\Programs\Python\Python36-32\include -IC:\Users\OWNER\AppData\Local\Programs\Python\Python36-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include" /TcutilFunctions.c /Fobuild\temp.win32-3.6\Release\utilFunctions.obj
utilFunctions.c
c:\users\owner\dropbox\sms-tools-master\software\models\utilfunctions_c\utilFunctions.h(2): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
@jiemojiemo Maybe this will help https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/
Anyway, as the manual tells, Ubuntu is strongly preferred over other OS.
I managed to compile the c files by using the virtual Linux environment on Windows called MSYS2:
https://www.msys2.org/
perhaps you can give this a try and use google to figure out how to set everything up properly ;)
Anyway, as the manual tells, Ubuntu is strongly preferred over other OS.
I respectfully disagree, I prefer Windows over Ubuntu. It is just a matter of setting up your environment properly. Clearly if you have never worked with C or C++ in a native windows environment, you will run into trouble and you will not know what to do.
I have the sms tools running on Python 3.7.4 64 bit, built with Visual Studio 2019, Windows SDK 10.0.17763.0.
For this code to compile on Windows (10), you need an install of Visual Studio and a Windows SDK. If you startup a command line environment through vcvarsall.bat you will find the build starts working much better, up until the moment it bails with a message on how it fails to find m.lib for linking.
This is remediated by removing the libraries=['m'] part from the compileModule.py script (in the setup block). Windows does not need a seperate m.lib so this is superfluous.
Hi, i have similar problems when trying to compile through pycharm. Anyone please help me? I use pycharm a lot in my work and it's the most comfortable for me so if i don't need to i prefer to not change it
For anyone still struggling with the build issue with the error:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
What worked for me was to install the Windows SDK and Microsoft visual studio and choosing python development.
See the following for more information: https://devguide.python.org/getting-started/setup-building/index.html#windows https://wiki.python.org/moin/WindowsCompilers#Compilers_Installation_and_configuration