<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><span style="color:rgb(0,0,0);font-family:monospace">The CMake
line in your first attempt does not build the project it just
generates build files. The command you shared:<br>
</span></p>
<p><span style="color:rgb(0,0,0);font-family:monospace">cmake
-DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 15 2017" -A x64
-Thost=x64 ../llvm</span></p>
<p><span style="color:rgb(0,0,0);font-family:monospace">should set
up your build directory (before building anything), to run the
build try "cmake --build ." (MSVC build can be invoked from the
command line, but the command is much more complicated).</span></p>
<p><span style="color:rgb(0,0,0);font-family:monospace">For the
second attempt, I haven't had luck with Makefiles on Windows
(but maybe it is just me), but Ninja with LLVM works really
well. To configure the build with ninja use Ninja generator in
CMake (-GNinja on command line). Note that ninja is parallel by
default and you might need to limit the number of concurrent
link jobs, so that you don't run out of memory. The
configuration that has worked the best for me is Ninja with LLVM
toolchain (clang+lld). So in the Visual Studio shell with LLVM
release on the PATH it would look something like this:<br>
</span></p>
<p><span style="color:rgb(0,0,0);font-family:monospace">> cmake
-GNinja -DCMAKE_C_COMPILER=clang-cl
-DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_LINKER=lld-link
-DLLVM_PARALLEL_LINK_JOBS=<N> <any other options>
<src dir></span></p>
<p><span style="color:rgb(0,0,0);font-family:monospace">Parallel
link parameter is best set by trial and error, but I was able to
get away with four lobs of LLVM 8 on 16 GB of ram. To build with
ninja simply invoke 'ninja'.<br>
</span></p>
<p><span style="color:rgb(0,0,0);font-family:monospace">Hope that
helps, let me know if you have any questions.<br>
</span></p>
<p><span style="color:rgb(0,0,0);font-family:monospace"><br>
</span></p>
<p><span style="color:rgb(0,0,0);font-family:monospace">Best,</span></p>
<p><span style="color:rgb(0,0,0);font-family:monospace">Petr<br>
</span></p>
<div class="moz-cite-prefix">On 10/30/19 10:16 PM, ghalib exaleap
via cfe-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CADstWbJ4=JbxW45XR650QfANet5ehH7N1UxJaP0at-4sz-sYYA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi,
<div> </div>
<div> To build clang on windows i have gone through the
following step's,</div>
<div>Try-1 on a windows machine</div>
<div>------------------------------------</div>
<div>Followed step's from <a
href="http://clang.llvm.org/get_started.html"
moz-do-not-send="true">http://clang.llvm.org/get_started.html</a> ----->
</div>
<h3 id="gmail-buildWindows"
style="color:rgb(45,88,183);padding-top:0.5em;font-family:"Lucida
Grande","Lucida Sans
Unicode",Arial,Verdana,Helvetica,sans-serif">Using Visual
Studio</h3>
<div>1. Downloaded Git <a href="https://git-scm.com/download"
moz-do-not-send="true">https://git-scm.com/download</a></div>
<div>2. <b style="font-family:"Lucida
Grande","Lucida Sans
Unicode",Arial,Verdana,Helvetica,sans-serif">CMake </b><a
href="https://cmake.org/download/" moz-do-not-send="true">https://cmake.org/download/</a></div>
<div>3. <b style="font-family:"Lucida
Grande","Lucida Sans
Unicode",Arial,Verdana,Helvetica,sans-serif">Visual
Studio 2017 </b></div>
<div>4. <b style="font-family:"Lucida
Grande","Lucida Sans
Unicode",Arial,Verdana,Helvetica,sans-serif">Python </b><a
href="https://www.python.org/download/"
moz-do-not-send="true">https://www.python.org/download/</a></div>
<div>5. <b style="font-family:"Lucida
Grande","Lucida Sans
Unicode",Arial,Verdana,Helvetica,sans-serif">GnuWin32
tools </b><a
href="http://sourceforge.net/projects/getgnuwin32/files/"
moz-do-not-send="true">http://sourceforge.net/projects/getgnuwin32/files/</a></div>
<div>6. Cloned <span
style="color:rgb(0,0,0);font-family:monospace">git clone <a
href="https://github.com/llvm/llvm-project.git"
moz-do-not-send="true">https://github.com/llvm/llvm-project.git</a></span></div>
<div><span style="color:rgb(0,0,0);font-family:monospace">7.
mkdir build && cd build </span></div>
<div><span style="color:rgb(0,0,0);font-family:monospace">8.
cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 15
2017" -A x64 -Thost=x64 ../llvm</span></div>
<div><font face="monospace" color="#000000">*** Build was
successful but, Am not getting what happen I searched each
and ervery folder their i haven't found clang executables.</font></div>
<div><br>
</div>
<div>*** You can find the build log & folder structure in
the attachment. </div>
<div><br>
</div>
<div><font face="monospace" color="#000000">-----------------------------------------------------------------------------------</font></div>
<div>
<div>Try-2 on a windows machine</div>
<div>------------------------------------</div>
</div>
<div>steps:</div>
<div>1. Download MSYS2 </div>
<div>2. pacman -S cmake</div>
<div>3. Run </div>
<div>$ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release"
-DBUILD_SHARED_LIBS=True -DLLVM_USE_SPLIT_DWARF=True
-DCMAKE_INSTALL_PREFIX="\Users\Dell\llvm-project\khan\install"
-DLLVM_OPTIMIZED_TABLEGEN=True -DLLVM_BUILD_TESTS=False
-DDEFAULT_SYSROOT="\Users\Dell\llvm-project\khan\install\sysroot"
-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-w64-mingw32"
-DLLVM_TARGETS_TO_BUILD=""
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="RISCV" ../llvm</div>
<div><br>
</div>
<div>(Or)</div>
<div> DLLVM_DEFAULT_TARGET_TRIPLE="riscv64-unknown-linux-gnu"</div>
<div> <br>
</div>
<div>Getting an Error:</div>
<div>-----------------------</div>
<div>CMake Error at CMakeLists.txt:53 (project):<br>
Generator<br>
<br>
Unix Makefiles<br>
<br>
does not support platform specification, but platform<br>
<br>
64<br>
<br>
was specified.<br>
<br>
<br>
-- Configuring incomplete, errors occurred!<br>
See also
"/home/Dell/llvm-project/build/CMakeFiles/CMakeOutput.log".<br>
</div>
<div>------------------------------------------------------------------------------------------------------------------------------</div>
<div><br>
</div>
<div> *** Can anyone please help me to get clang Windows
Executable. </div>
<div> <br>
</div>
<div> Thanks<br>
</div>
<div>Ghalib khan.</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
</body>
</html>