2016年7月21日 星期四

Install WxPerl on Windows 備忘錄

日前實驗室來了新的外國暑期生。
資訊出身慣用Python,看她正在發開GUI介面的NGS分析工具。
發覺我自學Perl 2-3年,卻從未接觸GUI。
因此決定來學個Perl GUI。

首先查詢Perl 有哪些模組可以開發GUI介面:
主要有兩個TK以及WxPerl。
介紹上寫Wx跨系統支援能力較強,因此決定安裝WxPerl。


以下為失敗紀錄,請改至<Install WxPerl on Windows 備忘錄2>



Windows 下安裝Perl模組總是會遇到奇怪問題
#Perl 版本
#dmake
#MinGW
#gcc

0.以管理者權限開啟命令提示字元
1.ppm 安裝
>ppm install Wx
失敗找不到模組...

2.改用CPAN
>cpan -i Wx
......
It looks like you don't have a C compiler and make utility installed.  Trying
to install dmake and the MinGW gcc compiler using the Perl Package Manager.
This may take a a few minutes...
.......
Warning: No success on command[C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site]
  MDOOTSON/Wx-0.9928.tar.gz
  C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NOT OK
Failed during this command:
 MDOOTSON/Alien-wxWidgets-0.67.tar.gz         : make NO
 MDOOTSON/Wx-0.9928.tar.gz                    : writemakefile NO 'C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site' returned status 512

看來缺少dmake ,MinGW ,gcc compiler

3.安裝ppm ,minGW
>ppm install dmake
>ppm install minGW
皆失敗......。
經GOOGLE大神開示,ActivePerl v5.24版本太新,ppm, minGW尚不支援。

4.移除ActivePerl v5.24 64bit
5.安裝ActivePerl v5.22 64bit
6.安裝dmake, minGW
>ppm install dmake
#費時2~3分鐘
>ppm install minGW
#費時30分鐘以上
7.安裝WxPerl 
(由於WxPerl 表示ppm 安裝只支援到ActivePerl v5.16,改嘗試CPAN)
>cpan -i Wx
#費時~1小時以上
windres --target pe-x86-64 --include-dir C:\Perl64\cpan\build\Alien-wxWidgets-0.67-R2ycFu\blib\arch\Alien\wxWidgets\msw_
3_0_2_uni_gcc_3_4\include Wx.rc Wx_res.o
'windres' 不是內部或外部命令、可執行的程式或批次檔。
dmake.exe:  Error code 129, while making 'Wx_res.o'
  MDOOTSON/Wx-0.9928.tar.gz
  C:\Perl64\site\bin\dmake.exe -- NOT OK
Failed during this command:
 INGY/Test-Base-0.88.tar.gz                   : install NO -- is only 'build_requires'
 MDOOTSON/Wx-0.9928.tar.gz                    : make NO

cpan> be able to run Makefile commands or compile C extension code.  Please check
Unknown shell command 'be'. Type ? for help.

cpan> your internet connection and your proxy settings!
Unknown shell command 'your'. Type ? for help.

又失敗了,白等數小時QQ
==========查詢gcc相關資料========
http://www.activestate.com/blog/2010/10/how-install-cpan-modules-activeperl

INSTALLING A MAKE UTILITY AND C COMPILER ON 64-BIT WINDOWS

For 64-bit Perl on 64-bit Windows currently the only supported compiler is the Visual C++ compiler included in the Windows Server 2003 SP1 Platform SDK (aka the April 2005 edition).
=============================

8.從M$網站下載並安裝
Windows® Server 2003 SP1 Platform SDK Web Install
PSDK-amd64.exe

9.安裝WxPerl 
>cpan -i Wx
......失敗

10.seach windres
>where windres.exe
找不到,難怪......裝不成功。

11.把C:\Perl64\site\lib\auto\MinGW\bin加入PATH


>where windres.exe
C:\Perl64\site\lib\auto\MinGW\bin\windres.exe

12.安裝WxPerl 
>cpan -i Wx
等待中......


Test Summary Report
-------------------
t/03_threads.t    (Wstat: 29696 Tests: 0 Failed: 0)
  Non-zero exit status: 116
  Parse errors: Bad plan.  You planned 4 tests but ran 0.
Files=4, Tests=8, 40 wallclock secs ( 0.05 usr +  0.01 sys =  0.06 CPU)
Result: FAIL
Failed 1/4 test programs. 0/8 subtests failed.
dmake.exe:  Error code 255, while making 'test_dynamic'
dmake.exe:  Error code 255, while making 'subdirs-test_dynamic'
dmake.exe:  Error code 255, while making 'subdirs-test_dynamic'
  MDOOTSON/Wx-0.9928.tar.gz
  C:\Perl64\site\bin\dmake.exe test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MDOOTSON/Wx-0.9928.tar.gz

萬惡的M$阿......累了睡飽繼續。

設備環境:
NB GE60 OND
OS Windows 10 64bit 家用版
CPU i5-3230M
RAM 8G

##################################
深深感覺這筆電CPU能力越來越不符合需求。
最近使用Inkscape 0.91,即使檔案放在SSD。
依然覺得算圖、輸出都很慢阿!
唉,當初應該買I7的。需要新電腦啊!!!

沒有留言:

張貼留言