Closed alex-bender closed 1 year ago
I do not have an M1, so I can not test but you can define python directories like this:
cmake -DPYTHON_LIBRARIES=/path/to/your/libpython.dylib -DPYTHON_INCLUDE_DIRS=/path/to/your/python/include ..
I will try build it with that and report back, thanks!
This worked for me on M1
cmake -DPYTHON_LIBRARIES=/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/libpython3.10.dylib -DPYTHON_INCLUDE_DIRS=/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Vers
ions/3.10/include/python3.10/ ..
To find what are the one for you
from sysconfig import get_paths
info = get_paths()
print(info)
# This will ouput the /include/
And for the .so
locate libpython
@plague-lab thanks for help, that did help to build it @JonathanSalwan what do you think, would it be good to improve installation notes on that?
Unfortunately I've got following problem. Looks like lib is installed but still can not use it
-- Installing: /usr/local/lib/cmake/triton/tritonConfig.cmake
-- Installing: /usr/local/lib/cmake/triton/tritonConfigVersion.cmake
-- Installing: /usr/local/lib/python3.10/site-packages/triton.so
build ~ λ % python
Python 3.10.8 (main, Oct 13 2022, 09:48:40) [Clang 14.0.0 (clang-1400.0.29.102)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from triton import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'triton'
ok, looks like wrong dirs it's looking into.
This snipped fixing this:
>>> import site
>>> site.addsitedir('/usr/local/lib/python3.10/site-packages')
@alex-bender
@JonathanSalwan what do you think, would it be good to improve installation notes on that?
Yeah it's a good idea. Can I let you do the MR?
Yes, sure!
After launching
cmake ..
i'm getting error:Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
despite all required libs are being installed
Is that expectable not to compile on m1?