“Killed signal” in general means you ran out of memory. You should reduce the parallelism (-j N with N the number of parallel jobs) or make sure you have enough memory (2GB / process may be a reasonable guess).
I don’t see how this can help with the original issue?
In the original command, I already add variable “-DLLVM_PARALLEL_LINK_JOBS=1” which restrict the parallelism but I think my computer still run out of memory
This flag only restricts the parallelism of the link step, not the overall parallelism (which is controlled in general with -j N when you build instead of configure)
I can see you are using ninja for building then why don’t you use ninja to install, it will be faster. Again, in your command you didn’t specify the host architechture. Follow the following steps,
I have added most common options you might need, you can it according to your need like you need only clang, -DLLVM_ENABLE_PROJECTS="clang" instead of -DLLVM_ENABLE_PROJECTS="llvm;clang"
If you are installing it in a different host, -DLLVM_TARGETS_TO_BUILD=host_arch instead of -DLLVM_TARGETS_TO_BUILD=X86
With other options, you should get some additional functionalities, but it depends on your need. But double check your storage, it will be a problem if you are running out of space.
You missed -j to the ninja invocation, which is the source of their issue here…
I never use cmake --build, according to the doc: cmake(1) — CMake 3.28.0-rc5 Documentation it should support the -j option.
However you can just use ninja directly in place of cmake --build, so ninja -j 1 should work (-j 2 or -j 3 may work just fine as well!).
By default, I believe ninja uses the number of cores you have plus one to compute the number of parallel job,…
I might be wrong but will it be solved after adding -j N to ninja? Because ninja -C build -j 20 means, it will run 20 build commands in parallel in the build directory. Ninja by default runs commands in parallel anyway, so typically I don’t see a need to pass -j.
I also didn’t understand how that would solve the memory issue. Because if he only wants to install llvm then 1-3 GB is enough. If he only wants to install clang, then 1.5 GB is enough, I think. It is possible to install clang, clang-tools-extra, lld, libcxx, libcxxabi, compiler-rt and openmp with only 1.2 GB.
In the second screenshot, there were kill signals. It indicates that he ran out of main memory. One solution is to reduce the parallelism and run less compilers in parallel. See the -j discussion.
In the first screenshot, there were real errors. The compiler was complaining.