1. 程式人生 > >licode學習之編譯篇--1

licode學習之編譯篇--1

最近學習licode開源專案,越發覺得世界發展如此之快。菜鳥哥突然意識到,再不緊跟,就要被落伍淘汰了,下定決心要好好學習。

licode是一個封裝webrtc的server,是一個開源專案。感謝licode的team為我們提供了優秀的程式碼,架構。

學習licode的主要內容是學習原始碼,學習使用的技術,架構,編譯方法,實現細節。

在開始之前,需要下載licode原始碼:https://github.com/lynckia/licode。

我的學習思路是,先下載原始碼,再編譯原始碼,再學習原始碼。

下載後,閱讀其下面的文件:

If you are interested in contributing, want to get a better view of the Licode architecture or you don't trust those fancy containers - 

How to build Licode from source

文件裡面說,如果對更好看架構,並且有興趣為licode做貢獻,可以看一下,如何從原始碼編譯。

如何編譯原始碼這塊兒功能,恰好是我所期望的。

 開啟連結:https://licode.readthedocs.io/en/master/from_source/

裡面介紹如何編譯licode。介紹的作業系統有:Ubuntu,Mac OS X

菜鳥哥使用的作業系統是CentOS 6.6 x64,沒有對應的指令碼。不過沒有關係,Ubuntu和centos都是linux核心,裡面大多數命令都是類似的。

根據介紹,進入script目錄,

[[email protected] scripts]# ls
checkNvm.sh initLicode.sh installErizo.sh installNuve.sh libnice-014.patch0 rtp_media_config_default.js travisInstall.sh
initBasicExample.sh installBasicExample.sh installMacDeps.sh installUbuntuDeps.sh licode_default.js travisInstallDeps.sh travisScript.sh

比較有用的腳步,intallUbuntuDeps.sh:這個應該是準備環境的腳步,installErizo.sh:這個是準備licode的C++程式碼部分的環境。

C++,對這部分比較感興趣,先把C++的庫編譯出來再說。

執行 vim installUbuntuDeps.sh,將裡面的apt-get修改為yum,sudo apt-get修改為yum,刪除裡面的sudo

執行腳步:./installUbuntuDeps.sh

[[email protected] scripts]# ./installUbuntuDeps.sh
Initialized empty Git repository in /home/test/licode-master/build/libdeps/nvm/.git/
error: while accessing https://github.com/creationix/nvm.git/info/refs

fatal: HTTP request failed

看資訊,是git版本比較低,參考 https://blog.csdn.net/chuxuan909/article/details/79485750,升級新版本的git

根據https://blog.csdn.net/tanga842428/article/details/73277739 安裝nodejs和npm

再次執行 installUbuntuDeps.sh,進入漫長的等待完成過程中。。。。

經過漫長的等待以後,出現了報錯:

libav-11.9/version.sh
ERROR: libvpx decoder version must be >=0.9.1

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
[email protected] mailing list or IRC #libav on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.
Makefile:1: config.mak: No such file or directory
Makefile:99: /common.mak: No such file or directory
Makefile:137: /libavutil/Makefile: No such file or directory
Makefile:137: /library.mak: No such file or directory
Makefile:139: /doc/Makefile: No such file or directory
Makefile:214: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
Makefile:1: config.mak: No such file or directory
Makefile:99: /common.mak: No such file or directory
Makefile:137: /libavutil/Makefile: No such file or directory
Makefile:137: /library.mak: No such file or directory
Makefile:139: /doc/Makefile: No such file or directory
Makefile:214: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.

 

好吧,看來路不是這麼容易就可以通的

今天太晚了,明天繼續學習了