JonathanSalwan / Triton

Triton is a dynamic binary analysis library. Build your own program analysis tools, automate your reverse engineering, perform software verification or just emulate code.
https://triton-library.github.io
Apache License 2.0
3.4k stars 524 forks source link

python setup.py install bug #1282

Closed cctv130 closed 9 months ago

cctv130 commented 10 months ago

triton was successfully installed on wsl, but triton showed two

1693662303292

cnheitman commented 10 months ago

@cctv130 How did you exactly build the package to get this error?

cctv130 commented 10 months ago

@cctv130 How did you exactly build the package to get this error?

I ran python setup.py install after setting the environment variables in wsl on windows, and this error occurred.

cctv130 commented 10 months ago

@cctv130 How did you exactly build the package to get this error?

My impression is that he was able to use import triton, but two appeared

cctv130 commented 9 months ago

@cnheitman Can you see if you can solve this problem?

cnheitman commented 9 months ago

I tested the wheel package both on Linux and Windows and I did not had this issue. I did not tried WSL, though, but I assume it shouldn't be much different.

Could you list the files under your Python's site-packages folder?

cctv130 commented 9 months ago

@cnheitman 1694749043128

cnheitman commented 9 months ago

You should have something like this on your folder:

triton_library-1.0.0rc2.dist-info
triton_library.libs
triton.cpython-311-x86_64-linux-gnu.so

Instead you have triton_library-1.0.0rc2-py3.11-linux-x86_64.egg, which was generated by python setup.py install

This is the result of not properly building the Python Wheel package. For that you should run:

export Z3_INCLUDE_DIRS=<path/to/z3/include>
export Z3_LIBRARIES=<path/to/z3/lib>
export CAPSTONE_INCLUDE_DIRS=<path/to/capstone/include>
export CAPSTONE_LIBRARIES=<path/to/capstone/lib>
export BITWUZLA_INTERFACE=On
export BITWUZLA_INCLUDE_DIRS=<path/to/bitwuzla/include>
export BITWUZLA_LIBRARIES=<path/to/bitwuzla/lib>
export LLVM_INTERFACE=ON
export CMAKE_PREFIX_PATH=$(llvm-config --prefix)

python -m build --wheel --outdir /tmp/triton-linux_x86_64
pip install /tmp/triton-linux_x86_64/*.whl

You'll have to adapt the above commands to WSL (in case it's needed).

cctv130 commented 9 months ago

@cnheitman I think I should switch to ubuntu now, there are too many bugs on windows.

cctv130 commented 9 months ago

@cnheitman After I took the time to test it today, it was my fault, thank you very much.