https://support.beocat.ksu.edu/BeocatDocs/api.php?action=feedcontributions&user=Sirmatt&feedformat=atomBeocat - User contributions [en]2024-03-29T07:29:06ZUser contributionsMediaWiki 1.39.6https://support.beocat.ksu.edu/BeocatDocs/index.php?title=Installed_software&diff=178Installed software2016-03-02T19:59:29Z<p>Sirmatt: source virtualenvwrapper.sh in .bashrc instead of .bash_profile</p>
<hr />
<div>== Drinking from the Firehose ==<br />
For a complete list of all installed software, see [[NodePackageList]]<br />
<br />
== Most Commonly Used Software ==<br />
=== [http://www.open-mpi.org/ OpenMPI] ===<br />
Version 1.8.8<br />
<br />
=== [http://www.scilab.org Scilab] ===<br />
Version 5.4.0<br />
<br />
=== [http://www.r-project.org/ R] ===<br />
Version 3.2.3<br />
<br />
==== Modules ====<br />
We provide a small number of R modules installed by default, these are generally modules that are needed by more than one person.<br />
<br />
==== Installing your own modules ====<br />
To install your own module, login to Beocat and start R interactively<br />
<syntaxhighlight lang="bash"><br />
R<br />
</syntaxhighlight><br />
Then install the package using<br />
<syntaxhighlight lang="rsplus"><br />
install.packages("PACKAGENAME")<br />
</syntaxhighlight><br />
Follow the prompts. Note that there is a CRAN mirror at KU - it will be listed as "USA (KS)".<br />
<br />
After installing you can test before leaving interactive mode by issuing the command<br />
<syntaxhighlight lang="rsplus"><br />
library("PACKAGENAME")<br />
</syntaxhighlight><br />
==== Running R Jobs ====<br />
<br />
You cannot submit an R script directly. '<tt>qsub myscript.R</tt>' will result in an error. Instead, you need to make a bash [[AdvancedSGE#Running_from_a_qsub_Submit_Script|script]] that will call R appropriately. Here is a minimal example. We'll save this as submit-R.qsub<br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
#$ -l mem=1G<br />
# Now we tell qsub how long we expect our work to take: 15 minutes (H:MM:SS)<br />
#$ -l h_rt=0:15:00<br />
<br />
# Now lets do some actual work. This starts R and loads the file myscript.R<br />
R --no-save -q < myscript.R<br />
</syntaxhighlight><br />
<br />
Now, to submit your R job, you would type<br />
<syntaxhighlight lang="bash"><br />
qsub submit-R.qsub<br />
</syntaxhighlight><br />
<br />
=== [http://www.java.com/ Java] ===<br />
We support 5 versions of the Java VM on Beocat. [[wikipedia:IcedTea|IcedTea]] 6 and 7 (based on [[wikipedia:OpenJDK|OpenJDK]]), Sun JDK 1.6 (Java 6), Oracle JDK 1.7 (Java 7), and Oracle JDK 1.8 (Java 8).<br />
<br />
We allow each user to select his or her Java version individually. If you do not select one, we default to IcedTea 7. This was changed from Oracle JDK 1.7 on May 29, 2015 due to a EOL notice from Oracle.<br />
<br />
==== Selecting your Java version ====<br />
First, lets list the available versions. This can be done with the command <code>eselect java-vm list</code><br />
<pre><br />
% eselect java-vm list<br />
Available Java Virtual Machines:<br />
[1] icedtea-bin-6<br />
[2] icedtea-bin-7 system-vm<br />
[3] oracle-jdk-bin-1.7<br />
[4] oracle-jdk-bin-1.8<br />
[5] sun-jdk-1.6<br />
</pre><br />
If you'll note, icedtea-bin-7 (marked "system-vm") is the default for all users. If you have a custom version set, it will be marked with "user-vm". Now if you wanted to use icedtea-6, you could run the following:<br />
<syntaxhighlight lang="bash"><br />
eselect java-vm set user 1<br />
</syntaxhighlight><br />
Now, we see the difference when running the above command<br />
<pre><br />
% eselect java-vm list<br />
Available Java Virtual Machines:<br />
[1] icedtea-bin-6 user-vm<br />
[2] icedtea-bin-7 system-vm<br />
[3] oracle-jdk-bin-1.7<br />
[4] oracle-jdk-bin-1.8<br />
[5] sun-jdk-1.6<br />
</pre><br />
To verify you are seeing the correct java, you can run <code>java -version</code><br />
<pre><br />
% java -version<br />
java version "1.6.0_27"<br />
OpenJDK Runtime Environment (IcedTea6 1.12.7) (Gentoo build 1.6.0_27-b27)<br />
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)<br />
</pre><br />
<br />
=== [http://www.python.org/about/ Python] ===<br />
<br />
We have several versions of Python available:<br />
* [http://docs.python.org/2.7/ CPython 2.7]<br />
* [http://docs.python.org/3.4/ CPython 3.4]<br />
* [http://pypy.org/ PyPy 4.0.1] (Python 2.7.10)<br />
* [http://pypy.org/ PyPy3 2.4.0] (Python 3.2.5)<br />
<br />
For the uninitiated PyPy provides [[wikipedia:Just-in-time_compilation|just-in-time compilation]] for python code. While it doesn't support all modules, code which does run under PyPy can see a significant performance increase.<br />
<br />
If you just need python and its default modules, you can use python2 python3 or pypy as you would any other application.<br />
<br />
If, however, you need modules that we do not have installed, you should use [http://www.doughellmann.com/projects/virtualenvwrapper/ virtualenvwrapper] to setup a virtual python environment in your home directory. This will let you install python modules as you please.<br />
<br />
==== Setting up your virtual environment ====<br />
* [[LinuxBasics#Shells|Change your shell]] to bash<br />
* Make sure ~/.bash_profile exists<br />
<syntaxhighlight lang="bash"><br />
if [ ! -f ~/.bash_profile ]; then cp /etc/skel/.bash_profile ~/.bash_profile; fi<br />
</syntaxhighlight><br />
* Add a line like <code>source /usr/bin/virtualenvwrapper.sh</code> to your .bashrc.<br />
<syntaxhighlight lang="bash"><br />
echo "source /usr/bin/virtualenvwrapper.sh" >> ~/.bashrc<br />
</syntaxhighlight><br />
* '''''CRITICAL:''''' Logout, and then log back in<br />
* Show your existing environments<br />
<syntaxhighlight lang="bash"><br />
workon<br />
</syntaxhighlight><br />
* Create a virtual environment. Here I will create a default virtual environment called 'test', a python2 virtual environment called 'testp2', a python3 virtual environment called 'testp3', and a pypy environment called testpypy. Note that <code>mkvirtualenv --help</code> has many more useful options.<br />
<syntaxhighlight lang="bash"><br />
mkvirtualenv -p $(which python2) testp2<br />
mkvirtualenv -p $(which python3) testp3<br />
mkvirtualenv -p $(which pypy) testpypy<br />
</syntaxhighlight><br />
* Lets look at our virtual environments<br />
<pre><br />
%workon<br />
testp2<br />
testp3<br />
testpypy<br />
</pre><br />
* Activate one of these<br />
<pre><br />
%workon testp2<br />
</pre><br />
* You can now install the python modules you want. This can be done using <tt>pip</tt>.<br />
<syntaxhighlight lang="bash"><br />
pip install numpy biopython<br />
</syntaxhighlight><br />
<br />
==== Using your virtual environment within a job ====<br />
Here is a simple job script using the virtual environment testp2<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
source /usr/bin/virtualenvwrapper.sh<br />
workon testp2<br />
~/path/to/your/python/script.py<br />
</syntaxhighlight><br />
==== A note on [http://mpi4py.scipy.org/docs/usrman/index.html mpi4py] ====<br />
If you are wanting to use mpi with your python script and are using a virtual environment, you will need to send the correct environment variables to all of the mpi processes to make the virtual environment work.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
# sample mpi4py submit script<br />
source /usr/bin/virtualenvwrapper.sh<br />
workon testp2<br />
# figure out the location of the python interpreter in the virtual environment<br />
PYTHON_BINARY=$(which python)<br />
# mpirun the python interpreter within the virtual environment<br />
# if you don't use the interpreter within the virtual environment, i.e. just using 'python'<br />
# the system python interpreter (without access to your other modules) will be used.<br />
mpirun ${PYTHON_BINARY} ~/path/to/your/mpi-enabled/python/script.py<br />
</syntaxhighlight><br />
==== A note on [http://www.scipy.org/ scipy] ====<br />
SciPy requires numpy, unfortunately it doesn't properly define a dependency on numpy, so you just have to install it first.<br />
<syntaxhighlight lang="bash"><br />
source /usr/bin/virtualenvwrapper.sh<br />
workon testp2<br />
pip install numpy<br />
# now scipy needs lapack and it doesn't detect the system one. lets fix it<br />
export LAPACK=/usr/lib/libreflapack.so<br />
export BLAS=/usr/lib/libopenblas_openmp.so<br />
pip install scipy<br />
</syntaxhighlight><br />
<br />
=== [http://www.perl.org/ Perl] ===<br />
The system-wide version of perl is tracking the stable releases of perl. Unfortunately there are some features that we do not include in the system distribution of perl, namely threads.<br />
==== Submitting a job with Perl ====<br />
Much like R (above), you cannot simply '<tt>qsub myProgram.pl</tt>', but you must create a [[AdvancedSGE#Running_from_a_qsub_Submit_Script|submit script]] which will call perl. Here is an example:<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
#$ -l mem=1G<br />
# Now we tell qsub how long we expect our work to take: 15 minutes (H:MM:SS)<br />
#$ -l h_rt=0:15:00<br />
# Now lets do some actual work. <br />
perl /path/to/myProgram.pl<br />
</syntaxhighlight><br />
==== Getting Perl with threads ====<br />
* Setup perlbrew<br />
** [[LinuxBasics#Shells|Change your shell]] to bash<br />
** Install perlbrew<br />
<syntaxhighlight lang="bash"><br />
curl -L http://install.perlbrew.pl | bash<br />
</syntaxhighlight><br />
** Make sure that ~/.bash_profile exists<br />
<syntaxhighlight lang="bash"><br />
if [ ! -f ~/.bash_profile ]; then cp /etc/skel/.bash_profile ~/.bash_profile; fi<br />
</syntaxhighlight><br />
** Add <code>source ~/perl5/perlbrew/etc/bashrc</code> to ~/.bash_profile<br />
<syntaxhighlight lang="bash"><br />
echo "source ~/perl5/perlbrew/etc/bashrc" >> ~/.bash_profile<br />
</syntaxhighlight><br />
** Then source your bash profile<br />
<syntaxhighlight lang="bash"><br />
source ~/.bash_profile<br />
</syntaxhighlight><br />
* Now, install perl with threads within perlbrew<br />
** Find the current Perl version.<br />
<pre><br />
% perl -version<br />
<br />
This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux<br />
(with 22 registered patches, see perl -V for more detail)<br />
(...several more lines deleted)<br />
</pre><br />
** In this case the version is 5.16.3, so we run<br />
<syntaxhighlight lang="bash"><br />
perlbrew install -f -n -D usethreads perl-5.16.3<br />
</syntaxhighlight><br />
** To temporarily use the new version of perl in the current shell, we now run<br />
<syntaxhighlight lang="bash"><br />
perlbrew use perl-5.16.3<br />
</syntaxhighlight><br />
** To switch versions of perl for every new login or job, run<br />
<syntaxhighlight lang="bash"><br />
perlbrew switch perl-5.16.3<br />
</syntaxhighlight><br />
** You can reverse this switch with<br />
<syntaxhighlight lang="bash"><br />
perlbrew switch-off<br />
</syntaxhighlight><br />
<br />
== Installing my own software ==<br />
Installing and maintaining software for the many different users of Beocat would be very difficult, if not impossible. For this reason, we don't generally install user-run software on our cluster. Instead, we ask that you install it into your home directories.<br />
<br />
In many cases, the software vendor or support site will incorrectly assume that you are installing the software system-wide or that you need 'sudo' access.<br />
<br />
As a quick example of installing software in your home directory, we have a sample video on our [[Training Videos]] page. If you're still having problems or questions, please contact support as mentioned on our [[Main Page]].</div>Sirmatt