建筑ang永远 [英] Building clang taking forever

查看:403
本文介绍了建筑ang永远的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑。我有一个VM运行Ubuntu 14.04。我遵循了以下过程: http://clang.llvm.org/docs/LibASTMatchersTutorial.html 和am在运行忍者的步骤。这构建llvm和铛。现在,我的VM不懒,我给它6GB的内存和4个CPU和一个20GB的交换文件。最大的问题出现在链接时间 - 似乎启动大量的ld进程,每个进程使用至少3-4GB或虚拟内存,在某些时候每个CPU有很多CPU。但是交换文件增长到超过12GB和进程都是IO限制,但我不知道他们是做一些有用的,或thrashing。我所知道的是磁盘被锤击,工作永远运行。我实际上刚刚把虚拟机的CPU计数减少到1,看看它是否可能更有效率的并行性较低,因为我推测这个问题可能是thrashing。

I'm baffled. I have a VM running Ubuntu 14.04. I've followed procedures here: http://clang.llvm.org/docs/LibASTMatchersTutorial.html and am at the step to run ninja. This builds llvm and clang. Now, my VM is no slouch, I gave it 6GB of RAM and 4 CPUs and a 20GB swap file. The biggest problem comes at link time - it seems to start a large number of ld processes, each using at least 3-4GB or virtual memory, and at some point a lot of CPU each. But the the swap file grew to over 12GB and the processes are all IO bound, but I don't know if they are doing something useful, or thrashing. All I know is the disk is getting hammered and the jobs run forever. I've actually just dropped the CPU count to the VM to 1, to see if it might be more efficient with less parallelism, as I surmised the issue may be thrashing.

我想我的磁盘可能很慢...任何想法?我应该使用make而不是忍者?我的专业知识不是Linux(虽然我到那里:-))所以我遵循教程,但也许不推荐最好的方式来构建clang / llvm程序。

I suppose my disk could be slow... Any ideas? Should I be using make instead of ninja? My expertise is not Linux (although I'm getting there :-) ) So I'm following the tutorial but perhaps it is not recommended the "best" way to build the clang / llvm programs.

推荐答案

我一直在那里,这是发生在最新的svn版本(但不是如果你得到cl 3.8或更旧的版本)。发生的是,由于在开发期间为每个编译单元生成大量调试信息,文件大小变得很大。

I have been there, It's happening with the latest svn release (but not if you get clang 3.8 or older releases). What is happening is that since during development a lot of debug information is also being generated for each compilation unit the file sizes are becoming big.

解决方案是关闭所有默认附加的调试信息。你可能不会去调试铛,所以不会需要它。 SO而不是这样做

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

你应该做的是

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

所有其他步骤一样。现在我没有测试这与忍者,但已验证它与ubuntu的make(这个教程,我修改了同样的事情在步骤7)。这应该owkr asel。

All the other steps remain the same. Now I have not tested this with ninja, but have verified it with make on ubuntu (this tutorial, I modified the same thing in step 7). This should owkr as weel.

这篇关于建筑ang永远的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆