Installation¶
We recommend the conda installation for most users. The conda installation will install MoSDeF Cassandra, Cassandra, and all other required dependencies. If you wish to contribute to MoSDeF Cassandra, you may install from source.
Installing with conda¶
If you already have conda installed, you can create a new conda environment and install MoSDeF Cassandra with a single command:
conda create --name mc mosdef_cassandra -c conda-forge
The command creates a new conda environment (mc
) and installs
mosdef_cassandra
. The -c
flag specifies the conda channels
that are searched. To use
the environment, run conda activate mc
.
You can test your installation by opening up a Python interpreter and typing:
import mosdef_cassandra as mc
(py, fraglib_setup, cassandra) = mc.utils.detect_cassandra_binaries()
If the module is imported without error and is able to find the required
binaries (python
, cassandra.exe
, and library_setup.py
,
you have successfully installed the package. Example output from the second
line is:
Using the following executables for Cassandra:
Python: /Users/username/anaconda3/envs/mc-prod/bin/python
library_setup: /Users/username/anaconda3/envs/mc-prod/bin/library_setup.py
Cassandra: /Users/ryandefever/anaconda3/envs/mc-prod/bin/cassandra.exe
Installing from source¶
MoSDeF Cassandra may alternatively be installed from source. First, clone MoSDeF Cassandra from GitHub to a location of your choosing:
git clone git@github.com:maginngroup/mosdef_cassandra.git
Next, install the required dependencies. You can use the dependencies listed
in requirements.txt
or requirements-dev.txt
. However, if you are
installing from source we recommend the latter:
conda install -c conda-forge --file mosdef_cassandra/requirements-dev.txt
Finally, run the following commands to complete the installation of MoSDeF Cassandra:
cd mosdef_cassandra/
pip install .
Installing Cassandra from source¶
Note
Installing Cassandra from source is unnecessary unless you wish to modify the source code of Cassandra or use a hardware specific (e.g., intel) compiler.
Once you have downloaded the tarball (available here):
tar -xzvf Cassandra-1.2.5.gz
cd Cassandra-1.2.5/Src
make -f Makefile.gfortran
cd ../
mkdir bin/
mv Src/cassandra_gfortran.exe ./bin/.
cp Scripts/Frag_Library_Setup/library_setup.py ./bin/.
Note
You may also wish to use the openMP version. In that case use the
Makefile.gfortran.openMP
and move the relevant executable to
bin/
. Depending on system size, Cassandra the openMP version
may offer speedups for up to ~8 cores. The number of OMP threads
can be controlled by setting the OMP_NUM_THREADS
environment
variable, e.g., export OMP_NUM_THREADS=8
.
Add Cassandra-1.2.5/bin
to your PATH
:
export PATH=path_to_install/Cassandra-1.2.5/bin:${PATH}
Unless you add the preceding line to your .bashrc
you will need to
run it every time you open a new terminal window.