LLVM x64 in Visual Studio

Discussion of chess software programming and technical issues.

Moderator: Ras

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

LLVM x64 in Visual Studio

Post by velmarin »

It says in the download page:
http://llvm.org/builds/
A 64-bit version is also available, but it doesn't integrate as well with Visual Studio.


But now and possibly by changes in libraries in Visual Studio, it is possible your work, only a small trick.

Install package x 32 in its path "C:\Program Files (x 86) \" and now the overwrite with the installation of x 86, we can do this with 7zip for example.
And does work, else if us gives benefit.

Code: Select all

We provide a periodically updated installer for Windows. The current installer integrates with MSVC 2010, 2012, 2013 and 14 CTP.

Windows installer, based on SVN r273898 (27 June 2016).

To use the LLVM toolchain from Visual Studio, select a project in Solution Explorer, open its Property Page (Alt+F7 by default), and in the "General" section of "Configuration Properties" change "Platform Toolset" to "LLVM-vs2012", "LLVM-vs2013", etc.

Alternatively, invoke MSBuild with /p:PlatformToolset=LLVM-vs2013 to try out the toolchain without modifying the project files.

Currently, the package only includes clang, clang-format, lld, and the AddressSanitizer runtime from compiler-rt, but eventually it should grow to encompass other Clang tools, lldb, and possibly other LLVM projects such as libc++.

A 64-bit version is also available, but it doesn't integrate as well with Visual Studio.
Dann Corbit
Posts: 12828
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: LLVM x64 in Visual Studio

Post by Dann Corbit »

I found that this works fine and installs easily:
https://sourceforge.net/projects/clangonwin/
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: LLVM x64 in Visual Studio

Post by velmarin »

Dann Corbit wrote:I found that this works fine and installs easily:
https://sourceforge.net/projects/clangonwin/
Thank you very much for the link, I'll have the two tolchains, with the "ugly" method to rename directories according to the need of the moment.

You know this repository, https://github.com/juj/vs-tool
¿ you know if anyone got install MinGW in Visual Studio ?, that would be fantastic.


Before I tried it, but I didn't get it, I'm going to try again, but there is a risk of return unstable Visual Studio.
Dann Corbit
Posts: 12828
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: LLVM x64 in Visual Studio

Post by Dann Corbit »

A simpler method to use all your compilers is to use Code::Blocks.
It works with Visual Studio compilers, CLANG and Mingw toolchains.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
ZirconiumX
Posts: 1361
Joined: Sun Jul 17, 2011 11:14 am
Full name: Hannah Ravensloft

Re: LLVM x64 in Visual Studio

Post by ZirconiumX »

velmarin wrote:
Dann Corbit wrote:I found that this works fine and installs easily:
https://sourceforge.net/projects/clangonwin/
Thank you very much for the link, I'll have the two tolchains, with the "ugly" method to rename directories according to the need of the moment.

You know this repository, https://github.com/juj/vs-tool
¿ you know if anyone got install MinGW in Visual Studio ?, that would be fantastic.


Before I tried it, but I didn't get it, I'm going to try again, but there is a risk of return unstable Visual Studio.
GCC is not compatible with visual studio, so neither MinGW, not Cygwin will work, because GCC doesn't understand the parameters MSVC uses.
tu ne cede malis, sed contra audentior ito
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: LLVM x64 in Visual Studio

Post by velmarin »

ZirconiumX wrote:
velmarin wrote:
Dann Corbit wrote:I found that this works fine and installs easily:
https://sourceforge.net/projects/clangonwin/
Thank you very much for the link, I'll have the two tolchains, with the "ugly" method to rename directories according to the need of the moment.

You know this repository, https://github.com/juj/vs-tool
¿ you know if anyone got install MinGW in Visual Studio ?, that would be fantastic.
Before I tried it, but I didn't get it, I'm going to try again, but there is a risk of return unstable Visual Studio.
GCC is not compatible with visual studio, so neither MinGW, not Cygwin will work, because GCC doesn't understand the parameters MSVC uses.
I got it, it works well with the power of the editor of "Visual Studio"
Perhaps disregard as simple, start with Visual Studio 2010, not 2012 siblings, ect...
configuración: Release MinGW ------

Code: Select all

1>------ Operación Generar iniciada: proyecto: Bou2010, configuración: Release MinGW ------
1>Compilación iniciada a las 30/06/2016 23:16:20.
1>PrepareForBuild:
1>  Creando directorio "C:\#Proyectos2010\############Bou1.8\Release\ULTIMAL".
1>InitializeBuildStatus:
1>  Se creará "Release\MEDL\Bou2010.unsuccessfulbuild" porque se especificó "AlwaysCreate".
1>ClCompile:
1>  50move.c
1>  C:\#Proyectos2010\############Bou1.8\win-linux.h(54): includes this header: 0,
1>                   from _bouquet.h:75,
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: LLVM x64 in Visual Studio

Post by velmarin »

Hi, Mattew.


Almost, almost,
directly from the repository.

Code: Select all

1>------ Operación Generar iniciada: proyecto: Dorpsgek, configuración: Release MinGW ------
1>Compilación iniciada a las 30/06/2016 23:31:46.
1>PrepareForBuild:
1>  Creando directorio "C:\#Proyectos2010\Dorpsgek-master\MinGW\Release\SALIDA\".
1>InitializeBuildStatus:
1>  Se creará "MinGW\Release\Dorpsgek.unsuccessfulbuild" porque se especificó "AlwaysCreate".
1>ClCompile:
1>  attacks.c
1>  check.c
1>  dan.c
1>  debug.c
1>  draw.c
1>  eval.c
1>  generate.c
1>  hash.c
1>  makemove.c
1>  ray.c
1>  search.c
1>  see.c
1>  time.c
1>Link:
1>  MinGW/Release/time.o:time.c:(.text+0x164): undefined reference to `GetTickCount'
1>  MinGW/Release/time.o:time.c:(.text+0x151): undefined reference to `GetTickCount'
1>collect2.exe : error : ld returned 1 exit status
1>
1>ERROR al compilar.
1>
1>Tiempo transcurrido 00:00:07.18
========== Generar: 0 correctos, 1 incorrectos, 0 actualizados, 0 omitidos ==========
ZirconiumX
Posts: 1361
Joined: Sun Jul 17, 2011 11:14 am
Full name: Hannah Ravensloft

Re: LLVM x64 in Visual Studio

Post by ZirconiumX »

Top of time.c:

Code: Select all

#ifndef WIN32
#include <sys/time.h>
#else // add this
#include <windows.h> // add this
#endif
That should fix it.

I'd also appreciate some help in porting Dorpsgek to MSVC, because it seems to be crashing horribly.
tu ne cede malis, sed contra audentior ito
ZirconiumX
Posts: 1361
Joined: Sun Jul 17, 2011 11:14 am
Full name: Hannah Ravensloft

Re: LLVM x64 in Visual Studio

Post by ZirconiumX »

ZirconiumX wrote:Top of time.c:

Code: Select all

#ifndef WIN32
#include <sys/time.h>
#else // add this
#include <windows.h> // add this
#endif
That should fix it.

I'd also appreciate some help in porting Dorpsgek to MSVC, because it seems to be crashing horribly.
I pushed this fix to the repo, along with some other stuff.
tu ne cede malis, sed contra audentior ito
Joost Buijs
Posts: 1671
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: LLVM x64 in Visual Studio

Post by Joost Buijs »

Since Visual Studio 2015 update 1 Clang 3.7 (32 and 64 bit) is included by Microsoft and it uses the Microsoft code generator. The current version of Clang is 3.9, so it lags a little bit behind.

I compiled my engine with it, it works fine although the executable runs a little bit slow because it doesn't support the intrinsics I use, the intrinsics are emulated in the header and they don't use the equivalent machine instructions.

In the mean time there have been a few updates to it, but I didn't check it since.

https://blogs.msdn.microsoft.com/vcblog ... -update-1/