Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
perlbrew [2014/05/20 21:44] popel created |
perlbrew [2016/11/25 12:34] (current) ufal |
||
---|---|---|---|
Line 5: | Line 5: | ||
Martin Popel | Martin Popel | ||
- | ==== How to setup the Perlbrew environment ==== | + | ===== How to setup the Perlbrew environment |
- | In your '' | + | Add to your '' |
source / | source / | ||
eval " | eval " | ||
- | The second line is optional, but it enables [[https:// | ||
+ | The second line is optional, but it enables [[https:// | ||
+ | Make sure you have deleted (commented out) the old setup_platform setup ('' | ||
- | ==== How to use Perlbrew ==== | + | Also note that perlbrew (unlike '' |
+ | |||
+ | export PERL5LIB="" | ||
+ | |||
+ | To finish the Perlbrew environment setup, run (in a new bash session) | ||
+ | |||
+ | perlbrew switch perl-5.18.2 | ||
+ | |||
+ | |||
+ | ===== How to use Perlbrew | ||
perlbrew list # Which perl versions are installed? | perlbrew list # Which perl versions are installed? | ||
- | perlbrew use perl-5.16.3 # use one of these perls for the current shell | + | perlbrew use perl-5.18.2 # use one of these perls for the current shell |
- | perlbrew switch perl-5.16.3 # use this perl version permanently | + | perlbrew switch perl-5.18.2 # use this perl version permanently |
+ | perlbrew off # return to the system installation of perl | ||
+ | |||
+ | You can read [[https:// | ||
+ | Note that there is a separate Perlbrew environment for each architecture (32bit vs. 64bit machines) at ÚFAL, so if you switch to perl-5.18.2 on 32bit machines, you need to do it again on 64bit machines if you want to use perl-5.18.2 on both. | ||
+ | |||
+ | ===== How to install missing modules from CPAN ===== | ||
+ | If you see an error message such as '' | ||
+ | You can install it into the ÚFAL perlbrew repository, so it will be available also for others. | ||
+ | If you are used to '' | ||
+ | |||
+ | cpanm String:: | ||
+ | |||
+ | This installs String:: | ||
+ | If you want to install it for all Perl versions and the current architecture, | ||
+ | |||
+ | perlbrew exec cpanm String:: | ||
+ | |||
+ | If you did this on your machine (32bit), you still need to ssh to some 64bit machine (e.g. '' | ||
+ | |||
+ | Useful switches for '' | ||
+ | You can install the modules also manually ('' | ||
+ | |||
+ | ===== How to install new Perl version ===== | ||
+ | |||
+ | perlbrew available | ||
+ | perlbrew install perl-5.16.3 | ||
+ | perlbrew install -Dcc=gcc --thread --multi -j 4 perl-5.20.0 # on Ubuntu10.04 64bit, I had to use -Dcc=gcc | ||
+ | |||
+ | (Note that when trying to compile threaded perl on cluster machines I had to ignore [[http:// | ||
+ | |||
+ | Now, we probably want to install all modules from the current perl to the new perl: | ||
+ | |||
+ | perlbrew list-modules > list.txt | ||
+ | perlbrew switch perl-5.16.3 | ||
+ | #cpanm -n Tk # Tk tests are long and pop up many windows | ||
+ | # but to get support for XFT anti-aliased fonts on newer Ubuntu, let's do: | ||
+ | cpanm -n -v git:// | ||
+ | cpanm -n PerlIO:: | ||
+ | cpanm < list.txt | ||
+ | |||
+ | ==== Tricky modules ==== | ||
+ | |||
+ | === Tk === | ||
+ | |||
+ | When compiled without XFT support, the fonts are ugly and some fonts (Cyrillic, Arabic,...) are completely unreadable. | ||
+ | First, you need some packages (which should be installed by default, so the following command is not needed) | ||
+ | |||
+ | sudo apt-get install libx11-dev libfreetype6-dev libxft-dev libpng-dev libz-dev | ||
+ | |||
+ | However, new Debian and Ubuntu (14.04) changed location of some files (freetype.h, | ||
+ | |||
+ | cpanm -n -v git:// | ||
+ | |||
+ | Last time, I found some tests failing, so I add '' | ||
+ | |||
+ | widget | ||
+ | |||
+ | and you should see a window with nice anti-aliased font. | ||
+ | |||
+ | === Algorithm:: | ||
+ | In '' | ||
+ | |||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | === Algorithm:: | ||
+ | [[https:// | ||
+ | |||
+ | === ÚFAL modules unreleased on CPAN === | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ===== How to install Perlbrew for a new architecture ===== | ||
+ | |||
+ | source / | ||
+ | |||
+ | (You probably have this in your '' | ||
+ | |||
+ | wget -O - http:// | ||
+ | source / | ||
+ | perlbrew install-cpanm | ||
+ | That's all! Now, install some perl, as described [[perlbrew# | ||
+ | perlbrew available | ||
+ | perlbrew install -j 4 perl-5.18.2 | ||
+ | # If this fails as mentioned above, finish the installation with something like | ||
+ | # cd / | ||
+ | perlbrew switch perl-5.18.2 | ||