編譯EMC2前要安裝很多開發工具,但實際上可利用Linuxcnc.org 所提供的 Shell程序 emc2-install.sh 或 emc2-install-sim.sh (模擬)命令安裝,首先我們可先看有哪些內容要安裝,可直接連結以下網址
http://www.linuxcnc.org/hardy/dists/hardy/linuxcnc2.5/source/linuxcnc_2.5.3.dsc
看到如下內容
上面所有內容為我們需要安裝項目,但實際上我們不用一一去安裝,只要在consol模式下執行
sudo apt-get build-dep linuxcnc
即可自行下載與安裝完成,另外由於EMC2使用的是git這套SVN管理,所以我們也需安裝git的工具,可執行
sudo apt-get install git-core gitk git-gui
有了開發編譯器與git版本管理器,接下來就是要下載EMC2的原始碼,可直接在consol模式下執行
git clone git://git.linuxcnc.org/git/linuxcnc.git /root/linuxcnc-dev
上面指令 /root/linuxcnc-dev 為下載後要存放在電腦的那個目錄(可自行決定),此部分我等了30分鐘下載(要看網路速度啦),下載完了,就要開始設立編譯環境,為了方便不用一直打sudo,為先取得暫時root的權限,可打
sudo -i
然後就開始進到剛下載EMC2原始檔的目錄下,
cd /root/linuxcnc-dev/
cd src/
設置自動產生
./autogen.sh
然後configure
./configure
其中會跑出一堆東西,跑到一個地方會出現錯誤 configure: error: libmodbus3 not found!
此時就要再打
sudo apt-get install libmodbus-dev
就可裝好,再次執行 ./configure,但是還是有個錯誤
checking whether the Boost::Python headers are available... no
configure: error: boost::python is required to build LinuxCNC
解決方法
sudo apt-get install python-gnome2 python-glade2 python-numpy python-imaging python-xlib python- gtkglext1 python-configobj python-gtksourceview2
sudo apt-get install libboost-python-dev
第三次的執行./configure,終於順利完成環境建置,但怎麼開發,其實還是沒那麼清楚,我再多找點資料再看看。
沒有留言:
張貼留言