Skip to content

Commit 29b40b1

Browse files
authored
Merge pull request #1892 from Thirumalai-Shaktivel/lpython_03
Specify the Python version to link the python library
2 parents 60c7c39 + 7c4f844 commit 29b40b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/runtime/lpython/lpython.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,13 +832,15 @@ def get_data_type(t):
832832
raise NotImplementedError("Platform not implemented")
833833

834834
from numpy import get_include
835-
from distutils.sysconfig import get_python_inc, get_python_lib
835+
from distutils.sysconfig import get_python_inc, get_python_lib, \
836+
get_python_version
836837
python_path = "-I" + get_python_inc() + " "
837838
numpy_path = "-I" + get_include() + " "
838839
rt_path_01 = "-I" + get_rtlib_dir() + "/../libasr/runtime "
839840
rt_path_02 = "-L" + get_rtlib_dir() + " -Wl,-rpath " \
840841
+ get_rtlib_dir() + " -llpython_runtime "
841-
python_lib = "-L" + get_python_lib() + "/../.. -lpython3.10 -lm"
842+
python_lib = "-L" + get_python_lib() + "/../.. -lpython" + \
843+
get_python_version() + " -lm"
842844

843845
r = os.system("gcc -g" + gcc_flags + python_path + numpy_path +
844846
filename + ".c -o lpython_module_" + self.fn_name + ".so " +

0 commit comments

Comments
 (0)