-1

There was a problem when I've tried to build clang with ninja.I've executed all commands one after another from the link:
http://clang.llvm.org/docs/LibASTMatchersTutorial.html
but after running ninja where the tutorial says "Okay.Now we’ll build Clang!" it takes 2 hours to build half of the objects and after that OS stuck and I couldn't even move the cursor.I did the job on both my laptop and PC but the result was the same.What is attract my attention is that, the size of the folder is so huge (18.3GB).

Is there any way to solve the problem?

iliya
  • 514
  • 6
  • 19

1 Answers1

-1

I have already answered the same question on StackOverflow here. I will suggest a deeper search in future before asking the same question.

Including information here in case link is lost. What is happening is that building clang in debug mode (that's by default) a lot of debug information is also being generated for each compilation unit the file sizes are becoming big.

The solution is to turn off all the debug info that's been attached by default. You probably are not going to debug clang, so won't need it. So instead of just doing this

cmake -G Ninja ../llvm -DLLVM_BUILD_TESTS=ON

What you should do is

cmake -G Ninja ../llvm -DLLVM_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release

All the other steps remain the same.

Community
  • 1
  • 1
Nishant Sharma
  • 683
  • 9
  • 16
  • Thank you for your help ,it was clear and worked perfectly and I'm sorry for that repetition .I've searched a lot but the title was a little ambiguous , so I couldn't find it. – iliya Aug 09 '16 at 08:50