From 7d2ed1b48f108b99f0b54332470f7d21fbaba9be Mon Sep 17 00:00:00 2001 From: Calvin Pieters Date: Thu, 2 Mar 2023 19:19:19 +0200 Subject: [PATCH 1/5] Adjusted the reactors.py import of Julia to now look for rms.so --- rmgpy/rmg/reactors.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rmgpy/rmg/reactors.py b/rmgpy/rmg/reactors.py index 3e1fab93203..4f7c9803e30 100644 --- a/rmgpy/rmg/reactors.py +++ b/rmgpy/rmg/reactors.py @@ -35,10 +35,10 @@ import sys import logging import itertools +from os.path import dirname, abspath, join, exists if __debug__: try: - from os.path import dirname, abspath, join, exists path_rms = dirname(dirname(dirname(abspath(__file__)))) from julia.api import Julia jl = Julia(sysimage=join(path_rms,"rms.so")) if exists(join(path_rms,"rms.so")) else Julia(compiled_modules=False) @@ -49,6 +49,9 @@ pass else: try: + path_rms = dirname(dirname(dirname(abspath(__file__)))) + if exists(join(path_rms, "rms.so")): + jl = Julia(sysimage=join(path_rms,"rms.so")) from pyrms import rms from diffeqpy import de from julia import Main From 6b823e62e3e6c01d1c3806411a69051cd7bee83f Mon Sep 17 00:00:00 2001 From: Calvin Pieters Date: Thu, 2 Mar 2023 19:41:01 +0200 Subject: [PATCH 2/5] Added instructions into the RMG website for creating system image of rms --- .../source/users/rmg/installation/anacondaDeveloper.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/documentation/source/users/rmg/installation/anacondaDeveloper.rst b/documentation/source/users/rmg/installation/anacondaDeveloper.rst index 63d1716e749..7523ab6becd 100644 --- a/documentation/source/users/rmg/installation/anacondaDeveloper.rst +++ b/documentation/source/users/rmg/installation/anacondaDeveloper.rst @@ -133,6 +133,12 @@ Installation by Source Using Anaconda Environment for Unix-based Systems: Linux 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. +#. Create custom system image of RMS :: + + python -m julia.sysimage rms.so + + This will create a custom system image of Julia with RMS compiled + #. 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). :: python-jl replace/with/path/to/rmg.py input.py From a545cee4174b1197bec75ce7009fb9cefd2c544f Mon Sep 17 00:00:00 2001 From: Calvin Pieters Date: Thu, 2 Mar 2023 19:19:19 +0200 Subject: [PATCH 3/5] Adjusted the reactors.py import of Julia to now look for rms.so --- rmgpy/rmg/reactors.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rmgpy/rmg/reactors.py b/rmgpy/rmg/reactors.py index 3e1fab93203..4f7c9803e30 100644 --- a/rmgpy/rmg/reactors.py +++ b/rmgpy/rmg/reactors.py @@ -35,10 +35,10 @@ import sys import logging import itertools +from os.path import dirname, abspath, join, exists if __debug__: try: - from os.path import dirname, abspath, join, exists path_rms = dirname(dirname(dirname(abspath(__file__)))) from julia.api import Julia jl = Julia(sysimage=join(path_rms,"rms.so")) if exists(join(path_rms,"rms.so")) else Julia(compiled_modules=False) @@ -49,6 +49,9 @@ pass else: try: + path_rms = dirname(dirname(dirname(abspath(__file__)))) + if exists(join(path_rms, "rms.so")): + jl = Julia(sysimage=join(path_rms,"rms.so")) from pyrms import rms from diffeqpy import de from julia import Main From 91b6a59aa805845931d63fd25dcae8c193a9bb0c Mon Sep 17 00:00:00 2001 From: Calvin Pieters Date: Thu, 2 Mar 2023 19:41:01 +0200 Subject: [PATCH 4/5] Added instructions into the RMG website for creating system image of rms --- .../source/users/rmg/installation/anacondaDeveloper.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/documentation/source/users/rmg/installation/anacondaDeveloper.rst b/documentation/source/users/rmg/installation/anacondaDeveloper.rst index 63d1716e749..7523ab6becd 100644 --- a/documentation/source/users/rmg/installation/anacondaDeveloper.rst +++ b/documentation/source/users/rmg/installation/anacondaDeveloper.rst @@ -133,6 +133,12 @@ Installation by Source Using Anaconda Environment for Unix-based Systems: Linux 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. +#. Create custom system image of RMS :: + + python -m julia.sysimage rms.so + + This will create a custom system image of Julia with RMS compiled + #. 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). :: python-jl replace/with/path/to/rmg.py input.py From bc104ef6d5d5108a5621894f9d055848e6bbff83 Mon Sep 17 00:00:00 2001 From: Calvin Pieters Date: Mon, 15 May 2023 19:23:53 +0300 Subject: [PATCH 5/5] Change PyJulia channel --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index f16342f1c5f..ad7508b0f64 100644 --- a/environment.yml +++ b/environment.yml @@ -37,7 +37,7 @@ dependencies: - rmg::pydas >=1.0.3 - pydot - rmg::pydqed >=1.0.3 - - rmg::pyjulia + - conda-forge::pyjulia - pymongo - pyparsing - rmg::pyrdl