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

MS Visual Studio C and C++ build during pip install fails. #3251

Open
oldspammer opened this issue May 10, 2024 · 2 comments
Open

MS Visual Studio C and C++ build during pip install fails. #3251

oldspammer opened this issue May 10, 2024 · 2 comments

Comments

@oldspammer
Copy link

No description provided.

@oldspammer
Copy link
Author

pip install nltk

This is the step that fails during the make processing of compiling _regex.c with a cascade of error messages following this initial one.

clock_t and a number of other symbols are never defined, and these had cascading consequences during further processing.

creating build\temp.win32-cpython-313\Release\regex_3
"c:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.40.33807\bin\HostX86\x86\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\AverMedia\AppData\Local\Programs\Python\Python313\include -IC:\Users\AverMedia\AppData\Local\Programs\Python\Python313\Include "-Ic:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.40.33807\include" "-Ic:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.40.33807\ATLMFC\include" "-Ic:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-Ic:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.40.33807\include" "-Ic:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.40.33807\ATLMFC\include" "-Ic:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcregex_3_regex.c /Fobuild\temp.win32-cpython-313\Release\regex_3_regex.obj

regex_3_regex.c(518): error C2061: syntax error: identifier ‘clock_t’
regex_3_regex.c(534): error C2059: syntax error: ‘}’
regex_3_regex.c(614): error C2061: syntax error: identifier ‘RE_State’

AverMedia@AverMedia-PC /cygdrive/c/Program Files/Microsoft Visual Studio
$ find ./ -iname “*.h” -exec grep -isa “clock_t” {} /dev/null ; >/cygdrive/c/Users/AverMedia/Documents/found-clock_t.txt

A find command was done in the root directory of msvs and ms vc++ etc, to locate instances of the string clock_t and these were the results...

./2022/Preview/VC/Tools/Llvm/ARM64/lib/clang/17/include/__clang_cuda_device_functions.h:// clock_t is on the system.
./2022/Preview/VC/Tools/Llvm/ARM64/lib/clang/17/include/__clang_cuda_device_functions.h:DEVICE /* clock_t= / int clock() { return __nvvm_read_ptx_sreg_clock(); }
./2022/Preview/VC/Tools/Llvm/lib/clang/17/include/__clang_cuda_device_functions.h:// clock_t is on the system.
./2022/Preview/VC/Tools/Llvm/lib/clang/17/include/__clang_cuda_device_functions.h:DEVICE /
clock_t= / int clock() { return __nvvm_read_ptx_sreg_clock(); }
./2022/Preview/VC/Tools/Llvm/x64/lib/clang/17/include/__clang_cuda_device_functions.h:// clock_t is on the system.
./2022/Preview/VC/Tools/Llvm/x64/lib/clang/17/include/__clang_cuda_device_functions.h:DEVICE /
clock_t= */ int clock() { return __nvvm_read_ptx_sreg_clock(); }
./2022/Preview/VC/Tools/MSVC/14.38.33130/atlmfc/include/afxdockingmanager.h: clock_t m_clkLastTime;
./2022/Preview/VC/Tools/MSVC/14.38.33130/atlmfc/include/afxribboncategory.h: clock_t m_ActiveTime;
./2022/Preview/VC/Tools/MSVC/14.38.33130/atlmfc/include/afxtaskspane.h: AFX_IMPORT_DATA static clock_t m_nLastAnimTime;
./2022/Preview/VC/Tools/MSVC/14.40.33807/atlmfc/include/afxdockingmanager.h: clock_t m_clkLastTime;
./2022/Preview/VC/Tools/MSVC/14.40.33807/atlmfc/include/afxribboncategory.h: clock_t m_ActiveTime;
./2022/Preview/VC/Tools/MSVC/14.40.33807/atlmfc/include/afxtaskspane.h: AFX_IMPORT_DATA static clock_t m_nLastAnimTime;

Microsoft was given a bug report, but they insisted that it was not their problem, but that of the python package maintainers, and thereby not a bug within msvc, etc.

I hope that some future provisions are made to have the code as portable to other platforms as possible?

@oldspammer
Copy link
Author

To circumvent the compiler include errors, I watched what packages were installed when using wsl 2 ubuntu 22.04 then issued pip install for each thing needed for the Windows 10 python that I was using as follows...

Fri 05/10/2024 13:46:29.17
C:\Users\AverMedia>pip install click
Collecting click
Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting colorama (from click)
Using cached colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Installing collected packages: colorama, click
Successfully installed click-8.1.7 colorama-0.4.6

Fri 05/10/2024 13:47:06.77
C:\Users\AverMedia>pip install joblib
Collecting joblib
Using cached joblib-1.4.2-py3-none-any.whl.metadata (5.4 kB)
Using cached joblib-1.4.2-py3-none-any.whl (301 kB)
Installing collected packages: joblib
Successfully installed joblib-1.4.2

Fri 05/10/2024 13:47:34.59
C:\Users\AverMedia>pip install regex
Collecting regex
Downloading regex-2024.5.10.tar.gz (394 kB)
---------------------------------------- 394.8/394.8 kB 911.3 kB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: regex
Building wheel for regex (pyproject.toml) ... done
Created wheel for regex: filename=regex-2024.5.10-cp313-cp313-win_amd64.whl size=268189 sha256=75b349b210635ead3f135c3ca2d7a32219c446e1944e340fb99dcb242a2a3c35
Stored in directory: c:\users\avermedia\appdata\local\pip\cache\wheels\96\22\d2\26c086e3056a45edd3b04a2d18362e212188dd7e35d6ee1e94
Successfully built regex
Installing collected packages: regex
Successfully installed regex-2024.5.10

Fri 05/10/2024 13:48:40.24
C:\Users\AverMedia>pip install tqdm
Collecting tqdm
Using cached tqdm-4.66.4-py3-none-any.whl.metadata (57 kB)
Requirement already satisfied: colorama in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from tqdm) (0.4.6)
Using cached tqdm-4.66.4-py3-none-any.whl (78 kB)
Installing collected packages: tqdm
Successfully installed tqdm-4.66.4

Fri 05/10/2024 13:49:11.74
C:\Users\AverMedia>pip install nltk
Collecting nltk
Using cached nltk-3.8.1-py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: click in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from nltk) (8.1.7)
Requirement already satisfied: joblib in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from nltk) (1.4.2)
Requirement already satisfied: regex>=2021.8.3 in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from nltk) (2024.5.10)
Requirement already satisfied: tqdm in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from nltk) (4.66.4)
Requirement already satisfied: colorama in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from click->nltk) (0.4.6)
Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB)
Installing collected packages: nltk
Successfully installed nltk-3.8.1

Fri 05/10/2024 13:49:44.53
C:\Users\AverMedia>

Thus, I have nltk installed without having msvs msvc having to compile and or link the subcomponents that would not successfully install. Yet, the actual c compiling still lacks these include file symbols that also affect a cascade of other compiling 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

1 participant