Skip to content

Commit 5d1b428

Browse files
Use function to get the paths
1 parent 50239f8 commit 5d1b428

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/runtime/lpython/lpython.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import platform
55
from dataclasses import dataclass as py_dataclass, is_dataclass as py_is_dataclass
66
from goto import with_goto
7+
from numpy import get_include
8+
from distutils.sysconfig import get_python_inc
79

810
# TODO: this does not seem to restrict other imports
911
__slots__ = ["i8", "i16", "i32", "i64", "f32", "f64", "c32", "c64", "CPtr",
@@ -700,9 +702,8 @@ def get_data_type(t):
700702
gcc_flags = " -bundle -flat_namespace -undefined suppress "
701703
else:
702704
raise NotImplementedError("Platform not implemented")
703-
python_path = "-I" "$CONDA_PREFIX/include/python3.10 "
704-
numpy_path = "-I" "$CONDA_PREFIX/lib/python3.10/site-packages/" \
705-
"numpy/core/include/"
705+
python_path = "-I" + get_python_inc() + " "
706+
numpy_path = "-I" + get_include()
706707
rt_path_01 = "-I" + get_rtlib_dir() + "/../libasr/runtime "
707708
rt_path_02 = "-L" + get_rtlib_dir() + " -Wl,-rpath " \
708709
+ get_rtlib_dir() + " -llpython_runtime "

0 commit comments

Comments
 (0)