Skip to content

Commit

Permalink
Merge pull request #2327 from ReactionMechanismGenerator/rmg_bin_inst…
Browse files Browse the repository at this point in the history
…allation

Added an instruction on how to fix ImportError for rmg binary
  • Loading branch information
xiaoruiDong authored Aug 11, 2022
2 parents b2c917f + 7fb8eac commit 8197792
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions documentation/source/users/rmg/installation/anacondaUser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,46 @@ Binary Installation Using Anaconda for Unix-Based Systems: Linux and Mac OSX

rmg.py input.py

If you encounter the ImportError related to ``libmkl_rt.so.2``, refer to the :ref:`Fixing the ImportError related to libmkl_rt.so.2 <fixImportError>`
section below to fix the error and re-run the RMG test job.

You may now use RMG-Py, Arkane, as well as any of the :ref:`Standalone Modules <modules>` included in the RMG-Py package.

.. _fixImportError:

Fixing the ImportError related to ``libmkl_rt.so.2``
============================================================

You may encounter the following ImportError when you try to run a RMG test job ::

Traceback (most recent call last):
File "/PATH-TO-YOUR-ANACONDA/envs/rmg_env/bin/rmg.py", line 48, in <module>
from rmgpy.rmg.main import RMG, initialize_log, process_profile_stats, make_profile_graph
File "/PATH-TO-YOUR-ANACONDA/envs/rmg_env/lib/python3.7/site-packages/rmgpy/rmg/main.py", line 51, in <module>
from cantera import ck2cti
File "/PATH-TO-YOUR-ANACONDA/envs/rmg_env/lib/python3.7/site-packages/cantera/__init__.py", line 4, in <module>
from ._cantera import *
ImportError: libmkl_rt.so.2: cannot open shared object file: No such file or directory

where ``PATH-TO-YOUR-ANACONDA`` is the path to the ``Anaconda3`` directory installed on your machine.
The default install location of Anaconda on Linux is ``/home/<your_username>/Anaconda3``.

To fix this issue, simply copy ``libmkl_rt.so.1`` as ``libmkl_rt.so.2`` under the rmg environment library by typing the following
line on your terminal::

cp /PATH-TO-YOUR-ANACONDA/envs/rmg_env/lib/libmkl_rt.so.1 /PATH-TO-YOUR-ANACONDA/envs/rmg_env/lib/libmkl_rt.so.2

Note that ``PATH-TO-YOUR-ANACONDA`` needs to be the path to your ``Anaconda3`` directory, which mostly likely looks
like ``/home/<your_username>/Anaconda3``. If you are unable to locate the ``libmkl_rt.so.1`` file on your computer, you can find its location with the following command::

locate libmkl_rt.so.1

After copying the file as ``libmkl_rt.so.2``, try running the RMG test job again::

rmg.py input.py

You will see a line saying ``MODEL GENERATION COMPLETED`` on your terminal if your RMG test job ran successfully.


Updating your binary installation of RMG in Linux or Mac OSX
============================================================
Expand Down

0 comments on commit 8197792

Please sign in to comment.