[llvm-dev] using the bat script build_llvm_package.bat on windows

Brian Cain via llvm-dev llvm-dev at lists.llvm.org
Sun Apr 12 20:02:07 PDT 2020


This is like EMFILE on linux.  If it's transient, you can nudge the file
limit up or nudge concurrency down.  On linux the open file count is
specified in ulimit and sysctl, not sure about Windows.  Nudging
concurrency down is something most folks have to do during linking anyways,
for memory's sake.  If you haven't already, try
setting DLLVM_PARALLEL_LINK_JOBS (per
https://llvm.org/docs/GettingStarted.html#common-problems ).

Another potential cause is some kind of stall/system locking, you can try
to identify whether there's some critical resource that's causing jobs to
pile up.

If you don't have a lot of confidence in the host toolchain, maybe it's a
file descriptor leak.

On Sun, Apr 12, 2020 at 5:59 PM blackthirt33n . via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> after following the instructions for  ninja check-all:
>
> FAILED: bin/libclang.dll lib/liblibclang.dll.a
> cmd.exe /C "cd . && C:\Strawberry\c\bin\c++.exe  -Wa,-mbig-obj
> -Werror=date-time
>  -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual
> -Wno-missing-fi
> eld-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough
> -Wno-maybe-unin
> itialized -Wno-class-memaccess -Wno-noexcept-type
> -Wdelete-non-virtual-dtor -Wno
> -comment -fno-common -Woverloaded-virtual -fno-strict-aliasing  -O2
>  C:/temp/llv
> m-build/llvm-project/build1/tools/clang/tools/libclang/libclang.def
> -shared -o b
> in\libclang.dll -Wl,--out-implib,lib\liblibclang.dll.a
> -Wl,--major-image-version
> ,11,--minor-image-version,0 @CMakeFiles\libclang.rsp  && cd ."
>
> C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-m
> ingw32/bin/ld.exe: cannot find lib/libLLVMCore.a: Too many open files
>
> C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-m
> ingw32/bin/ld.exe: cannot find lib/libLLVMRemarks.a: Too many open files
>
> C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-m
> ingw32/bin/ld.exe: cannot find lib/libLLVMBitstreamReader.a: Too many open
> files
>
> On Sun, Apr 12, 2020 at 1:25 PM Alexandre Ganea <
> alexandre.ganea at ubisoft.com> wrote:
>
>> build_llvm_package.bat is only a template for building releases.
>>
>>
>>
>> You can use it as reference, but for a two-stage build the simplest you
>> can do is:
>>
>>
>>
>>    1. Ensure cmake, ninja build, python, GnuWin32 are installed and
>>    available in %PATH%.
>>    2. Start “x64 Native Tools Command Prompt for VS 2017” from the Start
>>    menu/Visual Studio 2017.
>>    3. ‘cd’ to the root of your git checkout and run:
>>
>>
>>
>> D:\llvm-project> mkdir build1 && cd build1
>>
>>
>>
>> D:\llvm-project\build1> cmake -GNinja ../llvm -DCMAKE_BUILD_TYPE=Release
>> -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_ENABLE_ASSERTIONS=ON
>> -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_ENABLE_PROJECTS="llvm;clang;lld"
>>
>> (…)
>>
>>
>>
>> D:\llvm-project\build1> ninja check-all
>>
>>
>>
>> The first stage will therefore use MSVC. If the above commands succeed,
>> you can move on to stage 2:
>>
>>
>>
>> D:\llvm-project\build1> cd .. && mkdir build2 && cd build2
>>
>>
>>
>> D:\llvm-project\build2> cmake -GNinja ../llvm -DCMAKE_BUILD_TYPE=Release
>> -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_ENABLE_LIBXML2=OFF
>> -DCMAKE_C_COMPILER="../build1/bin/clang-cl.exe"
>> -DCMAKE_CXX_COMPILER="../build1/bin/clang-cl.exe"
>> -DCMAKE_LINKER="../build1/bin/lld-link.exe" -DLLVM_ENABLE_LLD=ON
>> -DCMAKE_CXX_FLAGS="-Xclang -O3" -DCMAKE_C_FLAGS="-Xclang -O3"
>> -DLLVM_ENABLE_PROJECTS="llvm;clang;lld"
>> -DCLANG_TABLEGEN="../build1/bin/clang-tblgen.exe"
>> -DLLVM_TABLEGEN="../build1/bin/llvm-tblgen.exe"
>>
>>
>>
>> D:\llvm-project\build2> ninja check-all
>>
>>
>>
>> You should have now the binaries for the second stage in build2\bin.
>>
>>
>>
>> This is only an example. You can then take a look at
>> https://llvm.org/docs/CMake.html for extra cmake flags that can be used
>> to tweak your build. You could for example use ThinLTO on the second stage,
>> by adding -DLLVM_ENABLE_LTO=Thin. You can also use `cmake-gui` if you don’t
>> want to go through command-lines (ensure it points to the right build
>> stage).
>>
>>
>>
>> Best,
>>
>> Alex.
>>
>>
>>
>> *De :* llvm-dev <llvm-dev-bounces at lists.llvm.org> *De la part de*
>> blackthirt33n . via llvm-dev
>> *Envoyé :* April 11, 2020 7:46 PM
>> *À :* llvm-dev at lists.llvm.org
>> *Objet :* [llvm-dev] using the bat script build_llvm_package.bat on
>> windows
>>
>>
>>
>> where should the file build_llvm_package.bat be placed and how should
>> the build_llvm_package.bat be called?
>>
>> or
>>
>> is there a another way to do a two stage build of the llvm project on
>> windows starting with using visual studio 2017 community.
>>
>>
>>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


-- 
-Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200412/84b0d07e/attachment.html>


More information about the llvm-dev mailing list