終於把這個軟件安裝上了,一天的時間,以前沒用過Linux,突然用,一天一類一邊補習Linux的基礎,一邊閱讀安裝軟件的說明,這個軟件比較麻煩的是不是用configure配置,得自己手動改好幾個文件,並且那個文件我本身就看不懂,沒有Linux下軟件開發的基礎。
下面說說在Ubuntu下安裝的過程吧!
01,就是解壓,我是解壓到桌面,不好,因為後來用時才發現,那些源文件還要用的,當然自己可以建立文件夾,在自己的目錄下,或者home下。
02,配置頂層的makefile文件
需要做的 將prefix=/CSLinux 改成 /usr/local(這個我是參照安裝說明改的)
並且在usr/local下新建cnetlib(必須的),其余參數默認
03,安裝以下軟件:tcl8.5,tcl8.5-dev,tk8.5,tk8.5-dev(這幾個文件的區別看ubuntu的官方介紹),libelf.x11.安裝完成要記住他們的頭文件路徑,後面要用到,因為編譯軟件需要用到。注意的是(ubuntu下 x11r6下好像沒有include文件夾)
04,config.h文件不用改,他的功能是檢測系統和設置一些安裝環境,默認是tcl/tk,這裡我們就用這個。
05,修改makefile.Linux
這個文件主要是引導一些libelf,tcl/tk的lib庫和頭文件的路徑,修改方法如下:
Un-commented the line LIBELFDIR = -L/usr/lib and commented the line LIBELFDIR = -Llibelf. (Note un-commenting means removing the # before the line and commenting means adding a # at the starting of the line.)
Commented the line LIBELFINC = -Ilibelf and added a new line LIBELFINC = -I/usr/include after that.
Changed values of XINCLUDES, XLIBDIRS and XLIBS, such that the concerned lines now looked like as below
XINCLUDES = -I/usr/include/tcl8.4(這裡變化比較大,原來是-l/usr/x11r6/include不過ubutnu下沒有這個文件夾,重新安裝還是不行,但是從功能來看,應該就是tcl
XLIBDIRS = -L/usr/lib
XLIBS = -ltcl8.4 -ltk8.4 -lX11(注意版本號,我的是8.5)
Note the TCL and TK libraries version numbers. If you use another version then change the above accordingly
最後就是make,會有警告,再就是make install,完成,測試就是先cd轉到EXAMPLES路徑下輸入:cnet T2,就可以看到一個圖形的仿真界面。