Skip to content

Build mlir failed in Windows #171

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

Closed
jcwchen opened this issue Mar 13, 2020 · 5 comments
Closed

Build mlir failed in Windows #171

jcwchen opened this issue Mar 13, 2020 · 5 comments

Comments

@jcwchen
Copy link

jcwchen commented Mar 13, 2020

Here are commands for my mlir build:

git clone --config core.autocrlf=false https://github.com/llvm/llvm-project.git
mkdir llvm-project/build && cd llvm-project/build
cmake -G Ninja ../llvm \
   -DLLVM_ENABLE_PROJECTS=mlir \
   -DLLVM_BUILD_EXAMPLES=ON \
   -DLLVM_TARGETS_TO_BUILD="host" \
   -DCMAKE_BUILD_TYPE=Release \
   -DLLVM_ENABLE_ASSERTIONS=ON \
   -DLLVM_ENABLE_RTTI=ON
cmake --build . --target check-mlir

However, I bumped into some errors while executing the last command. (cmake --build . --target check-mlir)

ex1:
llvm/Support/Mutex.h:29:12: error: 'recursive_mutex' in namespace 'std' does not name a type
ex2:
llvm/lib/Support/CrashRecoveryContext.cpp:89:27: error: 'mutex' is not a member of 'std'
ex3:
llvm/lib/Support/Chrono.cpp:35:17: error: '::localtime_s' has not been declared; did you mean 'localtime'?

It seems like a version issue, but I do not know the proper version. I am using cmake-3.17.0-rc2-win64-x64, ninja v1.10.0, latest MinGW and latest Windows 10.

I saw that there are some updates for fixing Windows issue today. I was wondering that is latest repo works well in Windows? How can I fix my errors?

Thanks!

@joker-eph
Copy link
Collaborator

Seems like your issues are related to MinGW and the standard library. I don't know enough about MinGW to help you on this.
The windows fix you saw recently were MSVC related, I doubt it would help.

@jcwchen
Copy link
Author

jcwchen commented Mar 13, 2020

Seems like your issues are related to MinGW and the standard library. I don't know enough about MinGW to help you on this.
The windows fix you saw recently were MSVC related, I doubt it would help.

Good point. I will try visual studio c++ instead. Will report whether it works soon. Thank you for answering!

@stellaraccident
Copy link
Contributor

stellaraccident commented Mar 13, 2020 via email

@mstorsjo
Copy link
Member

Your issue is most probably that you've got a GCC/MinGW setup that uses win32 threading model, which doesn't support C++11 threads. For native toolchains, there's often separate installs for ones with the pthreads/posix threading model, which do support C++11 threads. For cross toolchains on e.g. debian/ubuntu, both are often available in tandem, where you can call either x86_64-w64-mingw32-g++-posix or x86_64-w64-mingw32-g++-win32 to choose between the two.

@jcwchen
Copy link
Author

jcwchen commented Mar 14, 2020

Thank you all for the answering. I kept failing on MinGW so I tried to build it in Visual Studio C++ command line and it seems work. (Pass all test except one Unexpected Failures)

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

4 participants