@@ -700,13 +700,13 @@ def get_data_type(t):
700
700
// Define the module initialization function
701
701
static struct PyModuleDef module_def = {{
702
702
PyModuleDef_HEAD_INIT,
703
- "lpython_jit_module ",
703
+ "lpython_module_ { self . fn_name } ",
704
704
"Shared library to use LPython generated functions",
705
705
-1,
706
706
module_methods
707
707
}};
708
708
709
- PyMODINIT_FUNC PyInit_lpython_jit_module (void) {{
709
+ PyMODINIT_FUNC PyInit_lpython_module_ { self . fn_name } (void) {{
710
710
PyObject* module;
711
711
712
712
// Create the module object
@@ -748,12 +748,13 @@ def get_data_type(t):
748
748
python_lib = "-L" + get_python_lib () + "/../.. -lpython3.10 -lm"
749
749
750
750
r = os .system ("gcc -g" + gcc_flags + python_path + numpy_path +
751
- filename + ".c -o lpython_jit_module .so " +
751
+ filename + ".c -o lpython_module_" + self . fn_name + " .so " +
752
752
rt_path_01 + rt_path_02 + python_lib )
753
753
assert r == 0 , "Failed to create the shared library"
754
754
755
755
def __call__ (self , * args , ** kwargs ):
756
756
import sys ; sys .path .append ('.' )
757
757
# import the symbol from the shared library
758
- function = getattr (__import__ ("lpython_jit_module" ), self .fn_name )
758
+ function = getattr (__import__ ("lpython_module_" + self .fn_name ),
759
+ self .fn_name )
759
760
return function (* args , ** kwargs )
0 commit comments