LLVM toolchain on Windows

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

LLVM toolchain on Windows

Post by velmarin »

Thursday, September 5, 2013

A path forward for an LLVM toolchain on Windows
http://blog.llvm.org/2013/09/a-path-for ... in-on.html

Code: Select all

Over the past several months, contributors from Google and elsewhere in the community have begun actively working on bringing an LLVM toolchain to Windows in a way that would support and enhance a fully native development experience. This toolchain works with Visual Studio and the Windows development process that Windows developers are already using, making LLVM tools and technologies available to them. We want to cross the streams (in the Ghostbuster proton-pack sense) of the Visual Studio IDE and the LLVM-based C++ tools to enable developers to build C++ software better.

To that end, we’ve been driving many of the efforts around compatibility with Visual Studio and native Windows C++ code in Clang and LLD (the LLVM linker). Today, as announced at my GoingNative 2013 talk, we are able to build a trivial C++ application that in turn links against native C++ libraries and uses them in real, interesting ways. This is a huge milestone for the project, and something we’re really excited to be talking more about. Lots of folks in the LLVM project came together to get the open source project here. Thanks to every single one of you.

Going forward, we would really like to see an increased level of involvement from Windows developers. We’re launching an alpha-build website as part of llvm.org where you can get fresh builds of Clang, various Clang-based-tools, LLD, and the rest of the LLVM toolchain for Windows on a regular basis. These installable packages should make it dramatically easier to test and experiment with this new set of tools in your development environment. Please feel free to try it out, file bugs, and even submit patches to help move the toolchain forward on this new platform. Keep in mind, we are following the tried-and-true open source release mantra of releasing early and frequently. These are alpha-quality releases intended at developers interested in helping us track down and understand bugs.

There is still a lot of exciting work left to make LLVM and the C++ toolchain built on top of LLVM fully support the Windows platform. Come join the fun, because this is one place where patches are truly welcome.

-Chandler Carruth
http://llvm.org/builds/
We provide a periodically updated installer for Windows. The current installer is built with MSVC 2012 and integrates with MSVC 2010 and 2012.
mar
Posts: 2673
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: LLVM toolchain on Windows

Post by mar »

Doesn't work for me - not there yet, but looks interesting.
btw. doesn't this belong in the programming forum?
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: LLVM toolchain on Windows

Post by JuLieN »

mar wrote:Doesn't work for me - not there yet, but looks interesting.
btw. doesn't this belong in the programming forum?
[moderation]
Yep. Moved there. :)
Last edited by JuLieN on Sat Sep 07, 2013 11:38 am, edited 1 time in total.
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: LLVM toolchain on Windows

Post by velmarin »

mar wrote:Doesn't work for me - not there yet, but looks interesting.
btw. doesn't this belong in the programming forum?
To me if I work,
the version of Visual Studio has to be professional.
The path I had to manually put.
And Visual Studi plugin instaled.
Bouquet code gives me errors(normal), so I'll start with some simple project
later, with time.

Regarding the forum, you're right, you can move considering.sorry.

Code: Select all

We also provide a standalone Visual Studio plugin for clang-format. It requires Visual Studio 2012 Professional. Notably, the Express edition does not support plugins.
mar
Posts: 2673
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: LLVM toolchain on Windows

Post by mar »

What I meant was that clang-cl spits many errors (C++ name mangling) and thus can't be used as a replacement for msc yet. Plain C programs may compile fine.
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: LLVM toolchain on Windows

Post by JuLieN »

mar wrote:What I meant was that clang-cl spits many errors (C++ name mangling) and thus can't be used as a replacement for msc yet. Plain C programs may compile fine.
Can you copy/paste the errors it gave you, Martin? That's probably just some switch(es) to turn on. :)
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
mar
Posts: 2673
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: LLVM toolchain on Windows

Post by mar »

JuLieN wrote:Can you copy/paste the errors it gave you, Martin? That's probably just some switch(es) to turn on. :)
Of course :)

Code: Select all

error : cannot mangle the name of type 'BoundType' into RTTI descriptors yet
error: cannot mangle thunk for this destructor yet
And so on. Of course this is not a problem of clang itself as I can compile my program on Linux using clang without any trouble.
Problem is that clang-cl tries to ignore msc switches, so perhaps if I would disable RTTI? Is there a switch for it?
Either way there are more errors:

Code: Select all

error: explicit instantiation of 'pseudoIsLegal' does not refer to a function template, variable template, member function, member class, or static data member
1>  template bool Board::pseudoIsLegal<0>( Move, Bitboard ) const;
1>                       ^
1>  board.cpp:1322:38: note: candidate template ignored: could not match 'bool (Move, Bitboard) __attribute__((thiscall)) const' against 'bool (Move, Bitboard) const'
Obviously it does something behind the curtains to emulate Microsoft thiscall too (and something goes wrong) so even disabling RTTI won't help.
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: LLVM toolchain on Windows

Post by JuLieN »

mar wrote:Problem is that clang-cl tries to ignore msc switches, so perhaps if I would disable RTTI? Is there a switch for it?
Yes there is. And, surprise, surprise, it is:

Code: Select all

-fno-rtti
;)
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
mar
Posts: 2673
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: LLVM toolchain on Windows

Post by mar »

JuLieN wrote:Yes there is. And, surprise, surprise, it is:

Code: Select all

-fno-rtti
;)
-fthanks :)
mar
Posts: 2673
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: LLVM toolchain on Windows

Post by mar »

Unfortunately clang-cl doesn't use -fno-rtti. Oh well:

Code: Select all

clang cl.exe : warning : argument unused during compilation: '-fno-rtti'