Install the Perl Module

Source: Internet
Author: User

Manually compile the Perl Module

Advantage: all modules are available.
Disadvantage: A little trouble
Specific steps: 1 install the compiler 2 set the environment variable of the compiler 3 possibly install dmake
Specific Method:

1. First of all, there must be a C compiler, recommended Dev-CPP (open-source free, http://umn.dl.sourceforge.net/sourceforge/dev-cpp/devcpp4990setup.exe environment, remember to have the mingwof the lower (download containing mingw, because the BINLOG of this region has gcc.exe and other tools ).

1.1 after the compiler is installed, you must set the environment variable to run in cmd as a command, in WINXP, go to [my computer]-> [properties]-> [advanced]-> [environment variables] and add your path to the path, for example, if your installation path is c: \ Dev-CPP, you need to add c: \ Dev-CPP \ bin (there are many other paths in the path, and remember to separate them) run gcc-V in cmd to show that the compiler is successfully installed and can be compiled using the command line.

2. Compile the steps. download the required modules on CPAN, such as Win32: SerialPort. After downloading and decompressing the modules, go to the directory in cmd and use the common method:
Perl makefile. pl
Make
Make Test
Make install

2.1 notes
2.1.1 The specific compilation steps should first look at the README in the module package
2.1.2 the dev-PP compiler is used, so make and VC compiler are like nmake.
2.1.3 The most important thing is that errors may occur when you use make and you cannot compile it. I have found many reasons. Some people have introduced the solution, that is, to download a tool named dmake (

Http://search.cpan.org/CPAN/authors/id/S/SH/SHAY/dmake-4.12-20090907-SHAY.zip

Download and decompress the package. Copy the dmake.exe and startup folders to the C: \ Dev-CPP \ bin folder (because the directory is registered in the environment variable), and then install the directory:
Perl makefile. pl
Dmake
Dmake Test
Dmake install

 

Ref:

Http://blog.csdn.net/runandrun/article/details/6010840

Http://hi.baidu.com/opcbo/blog/item/07801e2a02dd9d195243c110.html

 

Install and solve the Perl CPAN module in Windows XP

There are some online tutorials on this topic, right and wrong. If you try all the correct and wrong methods, you will find that the results are often depressing. For Windows users, the standard three-step operations of Perl makefile. pl, make, and make install are like the prompts provided by tianshu.
Now I will introduce the methods I have tried and the results that appear. The final solution is as follows. The entire process uses the Coro module as an example.
The Perl used is ActiveState Perl 5.10.
1. Download and decompress the Coro module. It is better not to contain spaces or Chinese characters in the directory to avoid problems.
2. Enter the directory under DOS and run the command: Perl makefile. pl
3. It is doomed to fail because the module is an Xs module. You need to configure a C/C ++ Compiler (C/C ++ compiler environment ).
Tip: It looks like you don't have a C compiler on your path, so you will not be able to compile C or Xs extension modules.
4. Yes Article Microsoft Visual C ++ 2005 express edition is recommended. The size is about MB. Download, install, and run vsvarsall. BAT to set the environment variables and verify whether the environment variables are successfully set: in DOS, directly type CL and press Enter. If some prompts of this command are returned, the setting is correct. To download nmake.exeand run nmake.exe, two files are generated: nmake15.exe and nmake. Err. Copy these two files to the bin folder in the Perl installation directory.
5. Run the command in step 2 and then run the command nmake. The system prompts that the windows. h file cannot be found. The SDK was originally required. Ah, it's really annoying. I gave up this road.
6, Uninstall VC 2005 . At the same time, some unnecessary paths in the environment variable path are cleared.
7. Download DEV-C ++ 5. The size is only 10 MB.
8. install it. Enter gcc-V in the command line and the returned result is as follows:
Reading specs from C:/perl/dev_cpp/DEV-CPP/bin/../lib/GCC/mingw32/3.4.2/specs
Configured with: ../GCC/configure -- With-GCC -- With-GNU-LD -- With-GNU-as -- Host =
Mingw32 -- target = mingw32 -- prefix =/mingw -- enable-threads -- disable-NLS -- enable
-Languages ages = C, C ++, f77, Ada, objc, Java -- disable-win32-registry -- disable-shared -- e
Nable-sjlj-exceptions -- enable-libgcj -- disable-Java-AWT -- without-X -- enable-ja
Va-GC = Boehm -- disable-libgcj-Debug -- enable-interpreter -- enable-hash-synchroniz
Ation -- enable-libstdcxx-Debug
Thread model: Win32
GCC version 3.4.2 ( Mingw-Special )
9. Install dmake. Enter the following in the command line: PPM install dmake . The installation is successful. Enter dmake-V in the command line. Note that the value is in uppercase and the returned result is:
Dmake.exe-version 4.11-20080107-shay (Windows/ms visual c ++)
Copyright (c) 1990,..., 1997 by WTI Corp.

Default Configuration:
Maxlinelength := 32766
Maxprocesslimit: = 4
Maxprocess: = 1
. Import. Ignore: dmakeroot
. Makefiles: makefile. mk makefile
. Source:. null
Dmakeroot * = $ (absmakecmd: d) Startup
Makestartup: = $ (dmakeroot) \ Startup. mk

Please read the news file for the latest release notes.
10. Enter the Coro directory under the command line and run the command: Perl makefile. pl
11. Enter dmake in the command line. Return Value:
Dmake.exe: Error: -- 'C: \ Perl \ libconfig. M' not found, and can't be made
After some searching, it is recommended that the Module Directory Makefile (files in native) File Dirfilesep = ^ \ To dirfilesep = \\
After the change, dmake again. Another problem:
Dmake.exe: Error executing 'rem ': no such file or directory
Dmake.exe: Error Code 255, while making 'blibdirs'
God, why?
Another search seems to have found clues. Run the following command line: Perl-mconfig-e "Print $ config {make }"
Returned results: nmake,Manually delete the nmake.exe File .
This is the problem. Dev-CPP should contain dmake, while VC and the like are nmake. Therefore, the nmake15.exe and nmake. Err files in the Perl \ bindirectory were deleted.
Run: Perl-mconfig-e "Print $ config {make }"
Return Value: dmake
Finally.
12, and then restart Perl makefile. pl
13. dmake
14, dmake Test
15. dmake install
Installed successfully!

[Source: http://hi.baidu.com/qkgztdd]

 

G‑0000.exe-C-nologo-GF-W3-MD-Zi-dndebug-O1-dwin32-d_console-dno_str ICT-allow-dperl_ I mplicit_sys-duse_perlio-allow-MD- zi-dndebug-O1-dvers ion = \ "\"-dxs_version = \ "\" "-ic: \ Perl \ Lib \ core "distributions. cxx
G00000000.exe: Unrecognized option '-nologo'
G‑0000.exe: Unrecognized option '-GF'
G00000000.exe: Unrecognized option '-zi'
G00000000.exe: Unrecognized option '-zi'
Cc1plus.exe: Error: Unrecognized option '-w3'
Dmake.exe: Error Code 129, while making 'stributions. OBJ'
Dmake: Error Code 255, while making 'subdirs'

------------------------------------------------------------------------

OK I got inline working.

As Rob suggested I triedOverwrite my active Perl installBecause it's configuration was odd, and this fixed some of the problems but now when I ask about Perl C compiler it gives me the full path E: /XAMPP/perl/site/bin/gcc.exe instead of just 'gcc 'and surprisingly when I open config_heavy.pl file I can't find that anywhere, my config_heavy says CC: 'gcc 'So why Perl gives compiler with full path ?? I guess Perl is using another file for detecting invocations, I really couldn't find where is that so I had to make some of my usual hacks here is what I did maybe this can help someone, but in all this is not a recommended method to get inline working unless you're really know what you' re doing and you used every method suggested by the inline list who really know what they are doing unlike me :))

Here is what I did after installing ActivePerl mingw package

PPM install mingw

I downloaded strawberry zipped package (not installer) then unpacked it, make sure to download the same version of your active Perl version, in my situation it's Perl 5.10

I copied C folder from strawberry and placed it in the same folder where my Perl folder resides

I copied strawberry/perl/lib/Core folder and placed it in my ActivePerl/lib folder, this will ask you to replace the current core folder just accept to replace all

Then I opened strawberry/perl/lib/config_heavy.pl file replaced all C:/strawberry/Perl with my ActivePerl location, in my case it's E: /XAMPP/perl then saved config_heavy and placed it in E:/XAMPP/perl/lib, this will ask you to overwrite the current config_heavy.pl accept that and you're done

Please remember to back up your Perl folder before doing this so if any odd behavior you can delete and place the backup again and try something else, I always do that

Now after trying my Perl with Inline it works just fine plus every other module and script I wrote previusly, so everything seems OK

Thank you guys for being a lot of help, I'll go now and play with the great inline Module
Perl: Awesome
C: Rules

:))

Here is my final Perl-V output

D: \> Perl-V
Summary of my perl5 (Revision 5 version 10 subversion 1) Configuration:

Platform :
Osname = mswin32, osvers = 5.00, archname = MSWin32-x86-multi-thread
Uname = 'win32 strawberryperl 5.10.1.3 #1 Thu Jul 29 10:08:11 2010 i386'
Config_args = 'undef'
Hint = recommended, useposix = true, d_sigaction = UNDEF
Useithreads = define, usemultiplicity = define
Useperlio = define, d_sfio = UNDEF, uselargefiles = define, usesocks = UNDEF
Use64bitint = UNDEF, use64bitall = UNDEF, uselongdouble = UNDEF
Usemymalloc = N, bincompat5005 = UNDEF
Compiler :
Cc = 'gcc ', ccflags ='-S-O2-dwin32-dhave_des_fcrypt-encrypt-dperl_implicit_context-encryption-fno-strict-aliasing-dperl_msvcrt_re adfix ',
Optimize = '-S-O2 ',
Cppflags = '-dwin32'
Ccversion = '', gccversion = '3. 4.5 ', gccosandvers =''
Intsize = 4, longsize = 4, ptrsize = 4, doublesize = 8, byteorder = 1234
D_longlong = UNDEF, longlongsize = 8, d_longdbl = define, longdblsize = 12
Ivtype = 'long', ivsize = 4, nvtype = 'double', nvsize = 8, off_t = 'long long', lseek size = 8
Alignbytes = 8, prototype = define
Linker and libraries:
LD = 'G ++ ', ldflags ='-S-l "E: \ XAMPP \ Perl \ Lib \ core"-l "E: \ XAMPP \ c \ Lib "'
Libpth = E: \ XAMPP \ c \ Lib
Libs =-lmoldname-lkernel32-luser32-lgdi32-lwinspool-lcomdlg32-ladvapi3
2-lshell32-lole32-loleaut32-lnetapi32-luuid-lws2_32-lmip-lwinmm-lversio
N-lodbc32-lodbccp32
Perllibs =-lmoldname-lkernel32-luser32-lgdi32-lwinspool-plugin-ladv api32-lshell32-lole32-loleaut32-plugin-luuid-plugin-lmip-lwinmm-lve
Rsion-lodbc32-lodbccp32
Libc =, so = DLL, useshrplib = true, libperl = libperl510.a
Gnulibc_version = ''Dynamic Linking:
Dlsrc = dl_win32.xs, dlext = DLL, d_dlsymun = UNDEF, ccdlflags =''
Cccdlflags = '', lddlflags = '-mdll-S-l" E: \ XAMPP \ Perl \ Lib \ core"
-L "E: \ XAMPP \ c \ Lib "'

Characteristics of this binary (from libperl ):
Compile-time options: Multiplicity perl_dont_create_gvsv
Perl_implicit_context perl_implicit_sys
Perl_malloc_wrap pl_op_slab_alloc use_ithreads
Use_large_files use_perlio use_sitecustomize
Locally applied patches:
ActivePerl build 1007 [291969]
0abd0d disable non-Unicode case insensitive trie matching
Built under mswin32
Compiled at Jan 26 2010 23:15:11
@ INC:
E:/XAMPP/perl/site/lib
E:/XAMPP/perl/lib

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.