diff --git a/setup.py b/setup.py index 7a76a8e50..c411f39db 100644 --- a/setup.py +++ b/setup.py @@ -167,13 +167,13 @@ def copy_extension_to_source(self, ext): if platform.system() == "Linux": src_filename = os.path.join(self.build_temp + '/src/libtriton', 'triton.so') - dst_filename = os.path.join(self.build_lib, os.path.basename(filename)) + dst_filename = os.path.join(self.build_lib, 'triton.so') elif platform.system() == "Darwin": src_filename = os.path.join(self.build_temp + '/src/libtriton', 'libtriton.dylib') - dst_filename = os.path.join(self.build_lib, os.path.basename(filename)) + dst_filename = os.path.join(self.build_lib, 'libtriton.dylib') elif platform.system() == "Windows": src_filename = os.path.join(self.build_temp + '\\src\\libtriton\\Release', 'triton.pyd') - dst_filename = os.path.join(self.build_lib, os.path.basename(filename)) + dst_filename = os.path.join(self.build_lib, 'triton.pyd') else: raise Exception(f'Platform not supported: {platform.system()}') @@ -217,8 +217,7 @@ def copy_autocomplete(self): install_requires=[], options={ 'bdist_wheel': { - 'py_limited_api': 'cp38', - 'plat-name': 'manylinux_2_34_x86_64' + 'py_limited_api': 'cp38' } } ) diff --git a/src/libtriton/bindings/python/utils.cpp b/src/libtriton/bindings/python/utils.cpp index 89ab58200..f17d5e70c 100644 --- a/src/libtriton/bindings/python/utils.cpp +++ b/src/libtriton/bindings/python/utils.cpp @@ -42,7 +42,7 @@ namespace triton { throw triton::exceptions::Bindings("triton::bindings::python::PyLong_AsUint(): Bad internal call."); } - triton::__uint value = triton::__uint(str_value); + triton::__uint value = (triton::__uint) std::strtoul(str_value, 0, 10); Py_DECREF(py_str); @@ -70,7 +70,7 @@ namespace triton { throw triton::exceptions::Bindings("triton::bindings::python::PyLong_AsUsize(): Bad internal call."); } - triton::usize value = triton::usize(str_value); + triton::usize value = (triton::usize) std::strtoull(str_value, 0, 10); Py_DECREF(py_str); @@ -98,7 +98,7 @@ namespace triton { throw triton::exceptions::Bindings("triton::bindings::python::PyLong_AsUint32(): Bad internal call."); } - triton::uint32 value = (triton::uint32) triton::uint64(str_value); + triton::uint32 value = std::strtoul(str_value, 0, 10); Py_DECREF(py_str); @@ -126,7 +126,7 @@ namespace triton { throw triton::exceptions::Bindings("triton::bindings::python::PyLong_AsUint64(): Bad internal call."); } - triton::uint64 value = triton::uint64(str_value); + triton::uint64 value = std::strtoull(str_value, 0, 10); Py_DECREF(py_str); diff --git a/src/scripts/docker/build-wheel-linux.sh b/src/scripts/docker/build-wheel-linux.sh index a41a9546a..9269a3ca2 100755 --- a/src/scripts/docker/build-wheel-linux.sh +++ b/src/scripts/docker/build-wheel-linux.sh @@ -50,16 +50,16 @@ export PYTHON_LIBRARY=$($PYTHON_BINARY -c "from sysconfig import get_paths; prin $PYTHON_BINARY -m build --wheel --outdir $WHEEL_DIR/linux_x86_64 -# Build Triton Python wheel package for Python 3.9. -echo "[+] Build Triton wheel package for Python 3.9" -cd $SOURCE_DIR -rm -rf $SOURCE_DIR/build -rm -rf $SOURCE_DIR/triton_library.egg-info -export PYTHON_BINARY=/opt/_internal/cpython-3.8.*/bin/python -export PYTHON_INCLUDE_DIRS=$($PYTHON_BINARY -c "from sysconfig import get_paths; print(get_paths()['include'])") -export PYTHON_LIBRARY=$($PYTHON_BINARY -c "from sysconfig import get_paths; print(get_paths()['include'])") +# # Build Triton Python wheel package for Python 3.9. +# echo "[+] Build Triton wheel package for Python 3.9" +# cd $SOURCE_DIR +# rm -rf $SOURCE_DIR/build +# rm -rf $SOURCE_DIR/triton_library.egg-info +# export PYTHON_BINARY=/opt/_internal/cpython-3.8.*/bin/python +# export PYTHON_INCLUDE_DIRS=$($PYTHON_BINARY -c "from sysconfig import get_paths; print(get_paths()['include'])") +# export PYTHON_LIBRARY=$($PYTHON_BINARY -c "from sysconfig import get_paths; print(get_paths()['include'])") -$PYTHON_BINARY -m build --wheel --outdir $WHEEL_DIR/linux_x86_64 +# $PYTHON_BINARY -m build --wheel --outdir $WHEEL_DIR/linux_x86_64 # # Build Triton Python wheel package for Python 3.9. # echo "[+] Build Triton wheel package for Python 3.9"