Download Prebuilt Binaries

  1. Download from paratools.com
  2. Unpack the downloaded file:
    tar xvzf perl-5.18.2-mic.tgz
  3. Run install.sh to install to a desired location:

    ./perl-5.18.2-mic/install.sh $HOME/perl-mic
  4. Source perlvars.sh or perlvars.csh in the perl installation directory to use perl on the mic.

Build from Source

  1. 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'
  2. Unpack archives
    tar xvzf perl-5.18.2.tar.gz 
    tar xvzf perl-5.18.2-cross-0.8.4.tar.gz
  3. 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
  4. /!\ Edit Makefile and remove --follow-symlinks from line 59
  5. 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
  6. Type make again to resume compilation

  7. Type make install to install to $HOME/perl-mic

  8. Remember to set your PATH and PERL5LIB environment variables.