Install Perl from source

· Read in about 1 min · (164 Words)

I never realized that installing Perl from source could be such a tough thing.

1). The first obstacle is the error from the uncompression of source package.  I also tried to compress the package on my PC and transfered them to server by sftp. However, over 200 files failed to be transfered. The same error occured with binary distributions.

The simplest solution is to uncompress the source package on PC and make a copy, then compress this copy and transfer it to server by sftp.

2). The second obstacle stands in the way of compile. Error messages are like

code=512 at make_ext.pl line 449

With the help from  serverfault and another page (forgotten), I finally successfully compile Perl.

The first point is to carefully check the environment variables$C_INCLUDE_PATH . If the original  $C_INCLUDE_PATH  is not set, it should be set like bellow,

export C_INCLUDE_PATH=$HOME/app/include

instead of

export C_INCLUDE_PATH=$HOME/app/include:$C_INCLUDE_PATH

The second point is to add the compiler option -Dcc=gcc for Configure

./Configure -des -Dusethreads -Dcc=gcc -Dprefix=$HOME/local/app/perl