LLVM toolchain on Windows

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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:Unfortunately clang-cl wrapper doesn't pass -fno-rtti to clang. Oh well.
D*mn! :( Maybe cross-compiling from Linux to Windows would work?

Seems like one can compile for OSX and Windows from Linux, nowadays:
http://blog.boceto.fr/2012/05/10/cross- ... and-cmake/
http://blog.boceto.fr/2012/04/29/the-un ... -compiler/

EDIT:
Some more:
http://blog.boceto.fr/2012/05/07/the-un ... ing-mingw/
"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: 2566
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: LLVM toolchain on Windows

Post by mar »

Thanks, I will give it a try. Right now I can compile 64-bit Windows executables either with MinGW (gcc) or msc or icc. I haven't tried cross-compiling yet.
As for performance: gcc produces fastest code so far.
Only Intel compiler produces equally fast code.
clang OTOH compiles fast and has very good error/warning reports.
I wonder how much clang has improved. Last time I tried it produced slower code than gcc (you recently wrote that clang produces faster code in certain cases?).
I like all the compilers, it's always good to try to compile with different compiler as each produces different warnings.
I would also like to try clang's static analyzer - do you have any experience with it?
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 »

For my osx builds, I try both GCC and Clang, and chose the fastest exe. I'd say that 60% are clang exe, now. I made no enquiry on what made some engines faster with GCC and others faster with Clang.

But in all cases, Clang's exes are always much smaller than gcc's. before and after strip. Maybe that's why some engines are faster with clang: all of their exe can stay in the cache?
"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
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: I would also like to try clang's static analyzer - do you have any experience with it?
Yes, and it's very impressive! It tells you before compile time things like "this point in this function is never reached." And things like that. Xcode makes really good use of it. I think developing with Clang should make bug-free development easier.
"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: 2566
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, and it's very impressive! It tells you before compile time things like "this point in this function is never reached." And things like that. Xcode makes really good use of it. I think developing with Clang should make bug-free development easier.
Yes static analysis is becoming increasingly popular and I too believe it's awesome. It's much faster and easier to fix bugs before they happen :)
There are commercial tools like Coverity, PVS, Goanna, but the licenses are much above what I can afford. VS2012 includes a static analyzer too and I've to say it's pretty good.
There is also open source cppcheck which isn't bad, except that it takes very long to analyze (much longer than any other SA tool I tried).
Of course the only problem with static analysis is false positives.
I recently tried Intel's static analysis and got 200 warnings/errors in my very simple program, 99% of them being false positives (I'm even tempted to say it probably wasn't parsing C++ :).
But it may just need some tweaking, making it less sensitive.
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: LLVM toolchain on Windows

Post by velmarin »

I uploaded in Visual Studio a small project,
Stuff chess engine specifically, on first down with errors.
I changed the platform from LLVM-vs2012 to LLVM.vs 2010,
and despite the warnings, all right.

I'll give it a try, I guess I will wear soon also for 64 bits, is very interesting.

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

Re: LLVM toolchain on Windows

Post by velmarin »

The project is continuing

Already produces 64-bit executable, very interesting.

http://llvm.org/builds/
jdart
Posts: 4368
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: LLVM toolchain on Windows

Post by jdart »

I have used tools like PC-Lint (http://www.gimpel.com/html/pcl.htm) in the past, but false positives are a big problem.

An early man page for lint on SunOS listed under "Bugs:" "There are some things you just cannot get lint to shut up about."

--Jon