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

errors building llvm from sources using ninja #6

Open
PavelKotov1 opened this issue Oct 16, 2021 · 5 comments
Open

errors building llvm from sources using ninja #6

PavelKotov1 opened this issue Oct 16, 2021 · 5 comments

Comments

@PavelKotov1
Copy link

Hello, dear friends!
I am trying to build from sources and install llvm on windows 10.
Installed all the prerequisites first.
Then: git clone https://github.com/llvm/llvm-project.git
cd llvm-project
mkdir build
cd build
cmake –G Ninja -DLLVM_ENABLE_PROJECTS=clang ../llvm
ninja
The output of the last command is as follows:

[1/4233] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CachePruning.cpp.obj FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/CachePruning.cpp.obj C:\MinGW\bin\c++.exe -DGTEST_HAS_RTTI=0 -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Support -IC:/llvm-project/llvm/lib/Support -Iinclude -IC:/llvm-project/llvm/include -isystem "C:/Program Files (x86)/GnuWin32/include" -Wa,-mbig-obj -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Wmisleading-indentation -g -std=c++14 -fno-exceptions -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/CachePruning.cpp.obj -MF lib\Support\CMakeFiles\LLVMSupport.dir\CachePruning.cpp.obj.d -o lib/Support/CMakeFiles/LLVMSupport.dir/CachePruning.cpp.obj -c C:/llvm-project/llvm/lib/Support/CachePruning.cpp In file included from C:/llvm-project/llvm/lib/Support/CachePruning.cpp:16:0: C:/llvm-project/llvm/include/llvm/Support/Errc.h:65:23: error: 'not_supported' is not a member of 'std::errc' not_supported = int(std::errc::not_supported), ^~~ [2/4233] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ARMAttributeParser.cpp.obj FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/ARMAttributeParser.cpp.obj C:\MinGW\bin\c++.exe -DGTEST_HAS_RTTI=0 -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Support -IC:/llvm-project/llvm/lib/Support -Iinclude -IC:/llvm-project/llvm/include -isystem "C:/Program Files (x86)/GnuWin32/include" -Wa,-mbig-obj -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Wmisleading-indentation -g -std=c++14 -fno-exceptions -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/ARMAttributeParser.cpp.obj -MF lib\Support\CMakeFiles\LLVMSupport.dir\ARMAttributeParser.cpp.obj.d -o lib/Support/CMakeFiles/LLVMSupport.dir/ARMAttributeParser.cpp.obj -c C:/llvm-project/llvm/lib/Support/ARMAttributeParser.cpp In file included from C:/llvm-project/llvm/lib/Support/ARMAttributeParser.cpp:12:0: C:/llvm-project/llvm/include/llvm/Support/Errc.h:65:23: error: 'not_supported' is not a member of 'std::errc' not_supported = int(std::errc::not_supported), ^~~ [3/4233] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/CodeGenCoverage.cpp.obj FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/CodeGenCoverage.cpp.obj C:\MinGW\bin\c++.exe -DGTEST_HAS_RTTI=0 -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Support -IC:/llvm-project/llvm/lib/Support -Iinclude -IC:/llvm-project/llvm/include -isystem "C:/Program Files (x86)/GnuWin32/include" -Wa,-mbig-obj -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Wmisleading-indentation -g -std=c++14 -fno-exceptions -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/CodeGenCoverage.cpp.obj -MF lib\Support\CMakeFiles\LLVMSupport.dir\CodeGenCoverage.cpp.obj.d -o lib/Support/CMakeFiles/LLVMSupport.dir/CodeGenCoverage.cpp.obj -c C:/llvm-project/llvm/lib/Support/CodeGenCoverage.cpp In file included from C:/llvm-project/llvm/lib/Support/CodeGenCoverage.cpp:17:0: C:/llvm-project/llvm/include/llvm/Support/Mutex.h:29:12: error: 'recursive_mutex' in namespace 'std' does not name a type std::recursive_mutex impl; ^~~~~~~~~~~~~~~ C:/llvm-project/llvm/include/llvm/Support/Mutex.h: In member function 'bool llvm::sys::SmartMutex<mt_only>::lock()': C:/llvm-project/llvm/include/llvm/Support/Mutex.h:35:11: error: 'impl' was not declared in this scope impl.lock(); ^~~~ C:/llvm-project/llvm/include/llvm/Support/Mutex.h: In member function 'bool llvm::sys::SmartMutex<mt_only>::unlock()': C:/llvm-project/llvm/include/llvm/Support/Mutex.h:48:11: error: 'impl' was not declared in this scope impl.unlock(); ^~~~ C:/llvm-project/llvm/include/llvm/Support/Mutex.h: In member function 'bool llvm::sys::SmartMutex<mt_only>::try_lock()': C:/llvm-project/llvm/include/llvm/Support/Mutex.h:62:18: error: 'impl' was not declared in this scope return impl.try_lock(); ^~~~ ninja: build stopped: subcommand failed.
Could you please help me?
Thanks in advance!

@tesivo
Copy link

tesivo commented Oct 20, 2021

Hello,
In Chapter 1, in the prerequisites for Windows section, it says right after the Chocolatey command to run all commands through the "x64 Native Tools Command Prompt for VS 2019". If you are already doing this start Visual Studio Installer and edit your visual studio installation by adding "Desktop development with C++".
This is if you install Visual Studio Community.

@PavelKotov1
Copy link
Author

Ciao, Lorenzo!
thanks for your input!
unfortunately, i am not using visual studio to build llvm.
I am using NINJA.
So, are you suggesting to do what i did from withing x64 Native Tools Command Prompt for VS 2019?

@tesivo
Copy link

tesivo commented Oct 20, 2021

You' re welcome!
You don't need to use the Visual Studio generator, you can also use Ninja as a generator, but if you use the Visual Studio command prompt it will find what you need.

So yes, send your commands with x64 Native Tools Command Prompt for VS 2019

@redstar
Copy link
Collaborator

redstar commented Oct 20, 2021 via email

@PavelKotov1
Copy link
Author

PavelKotov1 commented Oct 22, 2021

hello, dear friends Lorenzo and Kai!
I am a bit late with my response because running ninja command took close to 50 hours on my modest laptop. So i was waiting to see if everything works.
Now, everything worked this time when i ran all commands through the "x64 Native Tools Command Prompt for VS 2019", as Lorenzo suggested.
I would close the issue now, but before i do that i have one more question.
In his comment Kia says:

I also see that you are using MinGW

To be quite honest, i did not do anything to make ninja use MinGW. Does ninja use it by defaul? How could I make ninja use any other available toolset? And what is the default behaviour?

Thanks again for your help! And please explain the toolset issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants