Download Prebuilt Binaries
- Download from paratools.com
- Unpack the downloaded file:
tar xvzf perl-5.18.2-mic.tgz
-
Run install.sh to install to a desired location:
./perl-5.18.2-mic/install.sh $HOME/perl-mic
-
Source perlvars.sh or perlvars.csh in the perl installation directory to use perl on the mic.
Build from Source
- Download perl source and perl-cross:
wget http://www.cpan.org/src/5.0/perl-5.18.2.tar.gz wget 'https://github.com/arsv/perl-cross/blob/releases/perl-5.18.2-cross-0.8.4.tar.gz?raw=true'
- Unpack archives
tar xvzf perl-5.18.2.tar.gz tar xvzf perl-5.18.2-cross-0.8.4.tar.gz
- Configure perl:
cd perl-5.18.2 ./configure --prefix=$HOME/perl-mic -Dcc=x86_64-k1om-linux-gcc -Dusethreads -Duserelocatableinc --target=x86_64-k1om-linux --host-cc=gcc
- Edit Makefile and remove --follow-symlinks from line 59
-
Type make to compile. The first compilation will fail with missing pthread symbols, so link the perl binary manually:
x86_64-k1om-linux-gcc -o perl -Wl,-E perlmain.o libperl.a -lm -lcrypt -ldl -lpthread
-
Type make again to resume compilation
-
Type make install to install to $HOME/perl-mic
- Remember to set your PATH and PERL5LIB environment variables.