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

error C2039: 'tolower': is not a member of 'std' #1520

Open
xinxcode opened this issue Feb 25, 2024 · 1 comment
Open

error C2039: 'tolower': is not a member of 'std' #1520

xinxcode opened this issue Feb 25, 2024 · 1 comment

Comments

@xinxcode
Copy link

Hello,
Im having trouble from building pytorch from source.
Gpu: GT 730M
Gpu cc: 3.5
Cuda: v11.0
Cudnn: v8.5.0.96
Python: 3.8
Git: 2.43.0

Im following tutorial from DataGraphi website, I found that their system is same as me, so I followed the instruction exactly like the autors do, it run smooth until come to
"Building CXX FAILED: third_party/onnx/CMakeFiles/onnx.dir/onnx/defs/parser.cc.obj"
it says
"error C2039: 'tolower': is not a member of 'std'"
and then the build was stopped.

-- Building version 2.3.0a0+gita17979f
cmake --build . --target install --config Release -- -j 1
[1/2557] Building CXX object third_party\onnx\CMakeFiles\onnx.dir\onnx\defs\parser.cc.obj
FAILED: third_party/onnx/CMakeFiles/onnx.dir/onnx/defs/parser.cc.obj
C:\PROGRA2\MICROS2\2017\COMMUN1\VC\Tools\MSVC\14161.270\bin\Hostx64\x64\cl.exe /nologo /TP -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -D__STDC_FORMAT_MACROS -IC:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\cmake..\third_party\benchmark\include -IC:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\third_party\onnx -IC:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\build\third_party\onnx -IC:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\cmake..\third_party\googletest\googlemock\include -IC:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\cmake..\third_party\googletest\googletest\include -IC:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\third_party\protobuf\src -IC:\Users\user\Documents\StableDiffusion\PyTorch\mkl\include -IC:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\third_party\XNNPACK\include -IC:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\third_party\ittapi\include -IC:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\cmake..\third_party\eigen -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" /DWIN32 /D_WINDOWS /GR /EHsc /Zc:__cplusplus /bigobj /FS /utf-8 -DUSE_PTHREADPOOL /EHsc /wd26812 /O2 /Ob2 /DNDEBUG /bigobj -std:c++17 -MD -DMKL_HAS_SBGEMM /MP /wd4244 /wd4267 /wd4996 /MD /showIncludes /Fothird_party\onnx\CMakeFiles\onnx.dir\onnx\defs\parser.cc.obj /Fdthird_party\onnx\CMakeFiles\onnx.dir\onnx.pdb /FS -c C:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\third_party\onnx\onnx\defs\parser.cc
C:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\third_party\onnx\onnx\defs\parser.cc(142): error C2039: 'tolower': is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\string_view(20): note: see declaration of 'std'
ninja: build stopped: subcommand failed.

I dont know what I must to do from here.

@xinxcode
Copy link
Author

Ok, I've got the solution from GPT that I need to include manually inside the parser.cc:

#include <cctype>

But now I encounter this error:

C:\Users\user\Documents\StableDiffusion\PyTorch\pytorch>python setup.py install --cmake
Building wheel torch-2.3.0a0+gita17979f
-- Building version 2.3.0a0+gita17979f
cmake -GNinja -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR=Ninja -DCMAKE_INCLUDE_PATH=C:\Users\user\Documents\StableDiffusion\PyTorch\mkl\include -DCMAKE_INSTALL_PREFIX=C:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\torch -DCMAKE_PREFIX_PATH=C:\Users\user\AppData\Local\Programs\Python\Python38\Lib\site-packages -DNUMPY_INCLUDE_DIR=C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\include -DPYTHON_EXECUTABLE=C:\Users\user\AppData\Local\Programs\Python\Python38\python.exe -DPYTHON_INCLUDE_DIR=C:\Users\user\AppData\Local\Programs\Python\Python38\Include -DPYTHON_LIBRARY=C:\Users\user\AppData\Local\Programs\Python\Python38/libs/python38.lib -DTORCH_BUILD_VERSION=2.3.0a0+gita17979f -DUSE_NUMPY=True C:\Users\user\Documents\StableDiffusion\PyTorch\pytorch
-- The CXX compiler identification is MSVC 19.16.27051.0
-- The C compiler identification is MSVC 19.16.27051.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: C:/Users/user/AppData/Local/Programs/Python/Python38/Scripts/sccache.exe
-- Check for working CXX compiler: C:/Users/user/AppData/Local/Programs/Python/Python38/Scripts/sccache.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeTestCXXCompiler.cmake:60 (message):
The C++ compiler

"C:/Users/user/AppData/Local/Programs/Python/Python38/Scripts/sccache.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: 'C:/Users/user/Documents/StableDiffusion/PyTorch/pytorch/build/CMakeFiles/CMakeScratch/TryCompile-468alj'

Run Build Command(s): C:/Users/user/AppData/Local/Programs/Python/Python38/Scripts/ninja.exe -v cmTC_310c8
[1/2] C:\Users\user\AppData\Local\Programs\Python\Python38\Scripts\sccache.exe  cl  /nologo /TP   /DWIN32 /D_WINDOWS /GR /EHsc  /Zi /Ob0 /Od /RTC1 -MDd /showIncludes /FoCMakeFiles\cmTC_310c8.dir\testCXXCompiler.cxx.obj /FdCMakeFiles\cmTC_310c8.dir\ /FS -c C:\Users\user\Documents\StableDiffusion\PyTorch\pytorch\build\CMakeFiles\CMakeScratch\TryCompile-468alj\testCXXCompiler.cxx
[2/2] C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_310c8.dir --rc=C:\PROGRA~2\WINDOW~4\10\bin\100162~1.0\x86\rc.exe --mt=C:\PROGRA~2\WINDOW~4\10\bin\100162~1.0\x86\mt.exe --manifests  -- C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\x86\link.exe /nologo CMakeFiles\cmTC_310c8.dir\testCXXCompiler.cxx.obj  /out:cmTC_310c8.exe /implib:cmTC_310c8.lib /pdb:cmTC_310c8.pdb /version:0.0 /machine:X86  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: cmTC_310c8.exe
C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_310c8.dir --rc=C:\PROGRA~2\WINDOW~4\10\bin\100162~1.0\x86\rc.exe --mt=C:\PROGRA~2\WINDOW~4\10\bin\100162~1.0\x86\mt.exe --manifests  -- C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\x86\link.exe /nologo CMakeFiles\cmTC_310c8.dir\testCXXCompiler.cxx.obj  /out:cmTC_310c8.exe /implib:cmTC_310c8.lib /pdb:cmTC_310c8.pdb /version:0.0 /machine:X86  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\x86\link.exe /nologo CMakeFiles\cmTC_310c8.dir\testCXXCompiler.cxx.obj /out:cmTC_310c8.exe /implib:cmTC_310c8.lib /pdb:cmTC_310c8.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_310c8.dir/intermediate.manifest CMakeFiles\cmTC_310c8.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
ninja: build stopped: subcommand failed.

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