Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating and utilising a custom system image of Julia with RMS #2381

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion rmgpy/rmg/reactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down