[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
perlbrew [2014/05/21 01:12]
popel
perlbrew [2014/05/27 14:15]
popel
Line 5: Line 5:
 Martin Popel Martin Popel
  
-==== How to setup the Perlbrew environment ==== +===== How to setup the Perlbrew environment ===== 
-In your ''~.bashrc'':+Add to your ''~.bashrc'':
  
   source /net/work/projects/perlbrew/init   source /net/work/projects/perlbrew/init
   eval "$(bash-complete setup)"   eval "$(bash-complete setup)"
  
-The second line is optional, but it enables [[https://metacpan.org/pod/Bash::Completion|Bash Completion]] for [[http://perlbrew.pl/|perlbrew]], [[https://metacpan.org/pod/App::cpanminus|cpanm]] and treex.+The second line is optional, but it enables [[https://metacpan.org/pod/Bash::Completion|Bash Completion]] for [[http://perlbrew.pl/|perlbrew]], [[https://metacpan.org/pod/App::cpanminus|cpanm]] and treex (if the respective ''Bash::Completion::Plugins::XY'' modules are installed). 
 +Make sure you have deleted (commented out) the old setup_platform setup (''source /net/work/projects/perl_repo/admin/bin/setup_platform'') from your ''~/.bashrc''.
  
-==== How to use Perlbrew ====+===== How to use Perlbrew =====
   perlbrew list               # Which perl versions are installed?   perlbrew list               # Which perl versions are installed?
-  perlbrew use perl-5.16.   # use one of these perls for the current shell +  perlbrew use perl-5.18.   # use one of these perls for the current shell 
-  perlbrew switch perl-5.16.# use this perl version permanently+  perlbrew switch perl-5.18.# use this perl version permanently 
 +  perlbrew off                # return to the system installation of perl
  
-==== How to install missing modules from CPAN ==== +You can read [[https://metacpan.org/pod/distribution/App-perlbrew/bin/perlbrew|the full Perlbrew documentation]] (but it should not be needed). 
-If you see an error message ''Can't locate String/Diff.pm in @INC'', it means the module String::Diff is not installed.+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 ''Can't locate String/Diff.pm in @INC'', it means the module String::Diff is not installed.
 You can install it into the ÚFAL perlbrew repository, so it will be available also for others. You can install it into the ÚFAL perlbrew repository, so it will be available also for others.
 If you are used to ''cpan'' tool, you can use it, but I recommend using ''cpanm'', which is faster. If you are used to ''cpan'' tool, you can use it, but I recommend using ''cpanm'', which is faster.
Line 25: Line 30:
   cpanm String::Diff   cpanm String::Diff
  
-This installs String::Diff for the current architecture (32bit vs. 64bit) and currently selected Perl version.+This installs String::Diff for the current architecture (32bit vs. 64bit) and the currently selected Perl version.
 If you want to install it for all Perl versions and the current architecture, use this trick If you want to install it for all Perl versions and the current architecture, use this trick
  
   perlbrew exec cpanm String::Diff   perlbrew exec cpanm String::Diff
  
-If you did this on your machine (32bit), you still need to ssh to some 64bit machine (e.g. ''sol1'') and install it there, if you want it available from the LRC cluster.+If you did this on your machine (32bit), you still need to ssh to some 64bit machine (e.g. ''sol1'') and install it there, if you want the module to be available from the LRC cluster. 
 + 
 +Useful switch for ''cpanm'' is ''-n'' (notest, useful e.g. for ''cpanm -n Tk''). See ''cpanm -h'' for more (e.g. installing from github, installing to your own local-lib). 
 +You can install the modules also manually (''perl Build.PL && ./Build && ./Build test && ./Build install''). There is no need to set ''prefix'' nor ''install_base'', because you (everyone from the group ''ufal'') have write access to the shared ÚFAL perlbrew repository. 
 + 
 +===== How to install new Perl version ===== 
 + 
 +  perlbrew available                    # list perl versions available for download 
 +  perlbrew install perl-5.16.3          # install this older version 
 +  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://www.nntp.perl.org/group/perl.perl5.porters/2014/05/msg214911.html|this]] error.) 
 + 
 +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 
 +  cpanm -n UNIVERSAL::DOES PerlIO::Util # these modules have (reported) errors, but we need them as dependencies 
 +  cpanm < list.txt
  
-Two useful switches for ''cpanm'' are ''--notest'' and ''--force''. See ''cpanm -h'' for more (e.g. installing from github, installing to your own local-lib). 
-You can install the modules also manually (''perl Build.PL && ./Build && ./Build test && ./Build install''). There is no need to set ''--prefix'' nor ''--install_base'', because you (everyone group ufal) have write access to the shared ÚFAL perlbrew repository. 

[ Back to the navigation ] [ Back to the content ]