Skip to content

Commit

Permalink
add instructions for properly integrating pyrms to the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mjohnson541 committed Sep 1, 2021
1 parent 5737bad commit 5d20826
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
43 changes: 33 additions & 10 deletions documentation/source/users/rmg/installation/anacondaDeveloper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,21 @@ Installation by Source Using Anaconda Environment for Unix-based Systems: Linux
On Manjaro or Arch Linux the package manager is ``pacman`` ::

sudo pacman -S git gcc make
For MacOS users, these packages will not come preinstalled, but can be easily obtained by installing the XCode Command Line Tools.

For MacOS users, the above packages will not come preinstalled, but can be easily obtained by installing the XCode Command Line Tools.
These are a set of packages relevant for software development which have been bundled together by Apple. The easiest way
to install this is to simply run one of the commands in the terminal, e.g. ``git``. The terminal will then prompt you on
whether or not you would like to install the Command Line Tools.

For MacOS users only, download and install the latest macOS julia from here: <https://julialang.org/downloads/>. Then add julia to PATH by running the following command replacing 1.6 with the first two numbers in the Julia version designation (ex: 1.6.2->1.6, 1.1.1->1.1):

echo 'export PATH="/Applications/Julia-1.6.app/Contents/Resources/julia/bin:$PATH"' >> ~/.bash_profile

export PATH="/Applications/Julia-1.6.app/Contents/Resources/julia/bin:$PATH"

Note that this julia install will not respect conda environmental boundaries this means only one conda environment can be linked to it at a time.
For linux users julia will be installed automatically.

#. Install the latest versions of RMG and RMG-database through cloning the source code via Git. Make sure to start in an
appropriate local directory where you want both RMG-Py and RMG-database folders to exist. ::

Expand All @@ -68,15 +77,29 @@ Installation by Source Using Anaconda Environment for Unix-based Systems: Linux

source ~/.zshrc

#. Compile RMG-Py after activating the conda environment ::
#. Activate conda environment ::

conda activate rmg_env
make
Note regarding differences between conda versions: Prior to Anaconda 4.4, the command to activate an environment was
``source activate rmg_env``. It has since been changed to ``conda activate rmg_env`` due to underlying changes to
standardize operation across different operating systems. However, a prerequisite to using the new syntax is having
run the ``conda init`` setup routine, which can be done at the end of the install procedure if the user requests.
#. Install and Link Julia dependencies ::

python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"

julia -e 'using Pkg; Pkg.add(PackageSpec("ReactionMechanismSimulator",version="0.4")); using ReactionMechanismSimulator;'

Note regarding differences between conda versions: Prior to Anaconda 4.4, the command to activate an environment was
``source activate rmg_env``. It has since been changed to ``conda activate rmg_env`` due to underlying changes to
standardize operation across different operating systems. However, a prerequisite to using the new syntax is having
run the ``conda init`` setup routine, which can be done at the end of the install procedure if the user requests.
Note that this links your python to python-jl enabling calls to Julia through pyjulia. Occasionally programs will
interact with python-jl differently than the default python. If this occurs for you we recommend doing that operation
in a different conda environment. However, if convenient you can undo this linking by replacing python-jl with
python3 in the second command above. Just make sure to rerun the linking command once you are done.

#. Compile RMG-Py after activating the conda environment ::

make

#. Modify environment variables. Add RMG-Py to the PYTHONPATH to ensure that you can access RMG modules from any folder.
Also, add your RMG-Py folder to PATH to launch ``rmg.py`` from any folder.
Expand All @@ -96,8 +119,8 @@ Installation by Source Using Anaconda Environment for Unix-based Systems: Linux

#. Finally, you can run RMG from any location by typing the following (given that you have prepared the input file as ``input.py`` in the current folder). ::

rmg.py input.py
python-jl replace/with/path/to/rmg.py input.py

#. Optional: If you wish to use the :ref:`QMTP interface <qm>` with `MOPAC <http://openmopac.net/>`_ to run quantum mechanical calculations for improved thermochemistry estimates of cyclic species, please obtain a legal license through the `MOPAC License Request Form <http://openmopac.net/form.php>`_. Once you have it, type the following into your terminal ::
mopac password_string_here
Expand Down
10 changes: 5 additions & 5 deletions documentation/source/users/rmg/installation/anacondaUser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Binary Installation Using Anaconda for Unix-Based Systems: Linux and Mac OSX
#. Install both RMG and the RMG-database binaries through the terminal. Dependencies will be installed automatically. It is safest to make a new conda environment for RMG and its dependencies. Type the following command into the terminal to create the new environment named 'rmg_env' containing the latest stable version of the RMG program and its database. ::

conda create -c defaults -c rmg -c rdkit -c cantera -c pytorch -c conda-forge --name rmg_env rmg rmgdatabase

Whenever you wish to use it you must first activate the environment::

source activate rmg_env

#. Optional: If you wish to use the :ref:`QMTP interface <qm>` with `MOPAC <http://openmopac.net/>`_ to run quantum mechanical calculations for improved thermochemistry estimates of cyclic species, please obtain a legal license through the `MOPAC License Request Form <http://openmopac.net/form.php>`_. Once you have it, type the following into your terminal ::

mopac password_string_here

#. You may now run an RMG test job. Save the `Minimal Example Input File <https://raw.githubusercontent.com/ReactionMechanismGenerator/RMG-Py/master/examples/rmg/minimal/input.py>`_
Expand All @@ -41,4 +41,4 @@ If you had previously installed a binary version of the RMG package, you may
check and update your installation to the latest stable version available on Anaconda by typing the following command on the terminal ::

source activate rmg_env
conda update rmg rmgdatabase -c rmg
conda update rmg rmgdatabase -c rmg

0 comments on commit 5d20826

Please sign in to comment.