想编译WebRTC的源代码,想测试下一些东西。其实官方有说明怎样编译的。理论上也是比较简单的。但是非常不幸的是。webrtc的源代码在墙外。这个源代码据称有8G那么大。不过最后发觉压缩后还有10G多。
代码怎样下载?虽然webrtc用的是git管理代码,但是他的下载是用另外一套工具下载的,具体为什么我也不知道。而且我发觉他下载的代码除了webrtc外还包含了chrome的代码,还有一些第三方的工具。下载这个代码最困难的是由于是巨大的容量,而且不支持断点续传。google是怎样想的,这么大的容量还不支持断点。虽然可以挂VPN进行代码下载。但是需要非常稳定的VPN。而且速度也要快。我想不出哪里可以提供这么稳定的vpn,有时候不是vpn不稳定,而是自身网络也不一定稳定。现在想到的办法是在海外创建VPS服务,把代码拉好了。然后打包下载回来。
由于本身在DigitalOcean有VPS。所以就在上边进行拉取。由于用的是最低的配置,没有拉多久,git就报内存不足了。TMD的。谁叫你穷,买的是512M的内存服务器,现在手机的内存都比你多尼?最后找了国内的云主机供应商的香港云主机。搞个4G内存。下载代码就是非常快了。最后把代码拉到Mac上。不过发觉编译有问题。
第一个问题:
>gn gen out/mac –args=’target_os=”mac” target_cpu=”x64″ is_component_build=false’
gn.py: Could not find gn executable at: /Users/daozhao/Documents/sourcecode/WebRTCdemo/webrtc_macos_test/src/buildtools/mac/gn
找不到命令,怎么搞的。居然找不到命令。看了看gn的代码,发觉有一个chromium编译路径可设置在环境变量的。然后我设置了这个,在这个目录下再创建了一个mac的目录。把depot tools工具都放在这个mac目录中。
export CHROMIUM_BUILDTOOLS_PATH=XXXXXXXX
这样重要可以运行gn生成工具了。结果有悲剧了。又显示了一个错误。
gn fork: Resource temporarily unavailable
网上google了这个错误。没有发现编译webrtc的时候有别人出现这个错误,在其他地方会会出现这个错误,原因是mac os系统有限制创建线程数量。大家可以输入。
>launchctl limit
cpu unlimited unlimited
file size unlimited unlimited
data unlimited unlimited
stack 8388608 67104768
core 0 unlimited
rss unlimited unlimited
memlock unlimited unlimited
maxproc 709 1064
maxfiles 256 unlimited
最后把参数调大。但是还是报同样的错误。现在我怀疑mac有专用的gn工具的。在同步代码的时候应该是根据系统下载相关的工具。由于我是使用linux系统下载的代码,下载了linux的编译工具,没有下载mac的工具。需要再次运行gclient sync,当然运行这个命令是需要vpn的。但是由于有之前的下载,不用所有东西都重新下载,只是下载很少一部分工具而已。
rm src/links #需要先删除这个文件,要不然会报错。
gclient sync
rm -rf src/third_party/llvm-build
gclient sync
这时候可以从新运行gn生成工具了。
>gn gen out/mac –args=’target_os=”mac” target_cpu=”x64″ is_component_build=false’
Done. Made 347 targets from 107 files in 5461ms
到了这里就可以编译了,编译时间比较久,
楼主用的啥vpn,我在gclient sync –no-history 有很多资源没法下载(我用的自建ss代理)
________ running ‘/usr/bin/python src/tools/clang/scripts/update.py –if-needed’ in ‘/Users/xx/Documents/work/code/github/chrome-project/chromium’
Updating Clang to 289944-2…
Downloading prebuilt clang
Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Mac/clang-289944-2.tgz
I found a vulnerability in your plugin. Please contact me.
Alternative To Typical Synthetic Supplements Is Needed, Say Experts
Whole dietary supplements is a subject of worldwide interest currently. A profusion of proof has recently come to light suggesting that common synthetic multivitamin supplements may be hazardous to your health. Goran Bjelakovic, a reputed scientist from the University or college of Copenhagen, headed up an enormous meta-study that viewed the results of 67 placebo-controlled trials previously carried out to look for the effects of supplement and anti-oxidant supplements on durability. In the final end, the analysis mixed observations of 232 000 test subjects. By using such a big population sample, a study can become much more powerful in relation to spotting large-scale developments and overcoming human being bias.
The full total results of the analysis, published in the Journal of the American Medical Association, were nothing less than shocking. Looking at patients with diabetes, heart disease and lung malignancy, as well as healthy, normal individuals, there is no apparent advantage to taking popular fractionated supplements like Supplement A, Supplement E, Vitamin C, Selenium, or beta-Carotene. Actually, the results went in the contrary direction – there is a greater chance of death (16 percent) among Supplement A users, a 7 percent higher death count amongst beta-Carotene users, and a 4 percent mortality upsurge in Supplement E users. Beta-Carotene and Retinol, marketed as anti-carcinogenic agents, may promote lung malignancy. That’s right – pills marketed as assisting you towards a longer, healthier life are actually correlated with a speedier demise. This scholarly study used typical supplements on the marketplace created from synthetic vitamins.
To add insult to injury, a recent research published in the British Journal of Nourishment under the unimaginative title of “Ascorbic Acid Supplementation WILL NOT Attenuate Post-Exercise Muscle Soreness Pursuing Muscle-Damaging Exercise But May Delay The Recovery Process” indicated that supplementation with anti-oxidants from synthetic resources may reverse lots of the beneficial ramifications of physical training.
Now, this is not to state that anti-oxidants or vitamins are bad for you. Far from it – these supplements were created based on solid science. Anti-oxidants are believed to protect cells from the ravages of free radicals still. The problem, rather, is the essential proven fact that you can get those benefits from synthetic isolated compounds. Disease and the aging process are more complicated than test-tube studies can account for usually. Furthermore, the presssing issue of bioavailability is an ever-present concern. Many typical synthetic supplements include large sums of the advertised vitamin, but absence the additional substances had a need to ensure that their key ingredients are actually assimilated by your body. Passing direct through the digestive tract, these ‘miracle health treatments’ often wind up doing little beyond giving people expensive urine. To the rescue…Whole Food Supplements.
Website: herb24.space