[cfe-dev] Clang build on windows

Sam Elliott via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 31 04:12:06 PDT 2019


The problem is that CMake caches some build configuration options for you, against your will.

Remove your whole build directory and try the `cmake` invocation from your second try again, and it should work (It’s picking up the cached value of the `-A` argument from your first invocation, which isn’t valid for Makefiles).

Looking at your other options that you provide to the build system, if you want your default target triple to be x86-based, you should specify `-DLLVM_TARGETS_TO_BUILD=“X86;RISCV”` (RISC-V is no longer experimental, so it can go in either `LLVM_TARGETS_TO_BUILD` or `LLVM_EXPERIMENTAL_TARGETS_TO_BUILD` now).

Hope this helps!

Sam

> On 31 Oct 2019, at 5:16 am, ghalib exaleap via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> Hi,
>  
>      To build clang on windows i have gone through the following step's,
> Try-1 on a windows machine
> ------------------------------------
> Followed step's from http://clang.llvm.org/get_started.html ----->   
> Using Visual Studio
> 
> 1. Downloaded Git https://git-scm.com/download
> 2. CMake https://cmake.org/download/
> 3. Visual Studio 2017 
> 4. Python https://www.python.org/download/
> 5. GnuWin32 tools http://sourceforge.net/projects/getgnuwin32/files/
> 6. Cloned git clone https://github.com/llvm/llvm-project.git
> 7. mkdir build && cd build 
> 8. cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 15 2017" -A x64 -Thost=x64 ../llvm
> *** Build was successful but, Am not getting what happen I searched each and ervery folder their i haven't found clang executables.
> 
> *** You can find the build log & folder structure in the attachment. 
> 
> -----------------------------------------------------------------------------------
> Try-2 on a windows machine
> ------------------------------------
> steps:
> 1. Download MSYS2 
> 2. pacman -S cmake
> 3. Run 
> $ 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
> 
> (Or)
>   DLLVM_DEFAULT_TARGET_TRIPLE="riscv64-unknown-linux-gnu"
>   
> Getting an Error:
> -----------------------
> CMake Error at CMakeLists.txt:53 (project):
>   Generator
> 
>     Unix Makefiles
> 
>   does not support platform specification, but platform
> 
>     64
> 
>   was specified.
> 
> 
> -- Configuring incomplete, errors occurred!
> See also "/home/Dell/llvm-project/build/CMakeFiles/CMakeOutput.log".
> ------------------------------------------------------------------------------------------------------------------------------
> 
>   *** Can anyone please help me to get clang Windows Executable. 
>  
>  Thanks
> Ghalib khan.
> <build.log>_______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

--
Sam Elliott
Software Developer - LLVM
lowRISC CIC
--




More information about the cfe-dev mailing list