You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an error while trying to build the pi-heif package on Termux due to the use of a deprecated optimization flag in the compilation command. Works fine on Prooted Debian there. The specific error message is as follows:
clang: error: argument '-Ofast' is deprecated; use '-O3 -ffast-math' for the same behavior, or '-O3' to enable only conforming optimizations [-Werror,-Wdeprecated-ofast]
error: command '/data/data/com.termux/files/usr/bin/clang' failed with exit code 1
Proposed Solution
To resolve this issue, I suggest updating the build configuration to replace the -Ofast optimization flag with either -O3 -ffast-math or just -O3. This change would prevent the deprecation warning from causing the build process to fail.
For now I will try to much in the code for that.
Steps/Code to Reproduce
Steps to Reproduce
Attempt to install the pi-heif package using pip:
pip install pi-heif
Expected Results
.
Actual Results
Using pip 24.3.1 from /data/data/com.termux/files/usr/lib/python3.12/site-packages/pip (python 3.12)
Looking in indexes: https://pypi.org/simple, https://termux-user-repository.github.io/pypi/, https://termux-user-repository.github.io/pypi/
Collecting setuptools>=67.8
Obtaining dependency information for setuptools>=67.8 from https://files.pythonhosted.org/packages/90/12/282ee9bce8b58130cb762fbc9beabd531549952cac11fc56add11dcb7ea0/setuptools-75.3.0-py3-none-any.whl.metadata
Using cached setuptools-75.3.0-py3-none-any.whl.metadata (6.9 kB)
...
Looking for libheif using pkg-config.
Checking for include file 'heif.h' in '/data/data/com.termux/files/usr/include'
Checking for include file 'heif.h' in '/data/data/com.termux/files/usr/include/libheif'
Found 'heif.h' in '/data/data/com.termux/files/usr/include/libheif'
building '_pi_heif' extension
creating build/temp.linux-aarch64-cpython-312/pi_heif
clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -I/data/data/com.termux/files/usr/include -I/data/data/com.termux/files/usr/include/flang/Evaluate -I/data/data/com.termux/files/usr/include/python3.12 -c pi_heif/_pi_heif.c -o build/temp.linux-aarch64-cpython-312/pi_heif/_pi_heif.o -Ofast -Werror
clang: error: argument '-Ofast' is deprecated; use '-O3 -ffast-math' for the same behavior, or '-O3' to enable only conforming optimizations [-Werror,-Wdeprecated-ofast]
error: command '/data/data/com.termux/files/usr/bin/clang' failed with exit code 1
error: subprocess-exited-with-error
× Building wheel for pi-heif (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
Quick fix
sed -i 's/-Ofast/-O3/g' setup.py
The text was updated successfully, but these errors were encountered:
Describe the bug
Issue Description
I encountered an error while trying to build the
pi-heif
package on Termux due to the use of a deprecated optimization flag in the compilation command. Works fine on Prooted Debian there. The specific error message is as follows:clang: error: argument '-Ofast' is deprecated; use '-O3 -ffast-math' for the same behavior, or '-O3' to enable only conforming optimizations [-Werror,-Wdeprecated-ofast]
error: command '/data/data/com.termux/files/usr/bin/clang' failed with exit code 1
Current Environment Variables
PATH: /data/data/com.termux/files/home/.opam/default/bin:/data/data/com.termux/files/usr/google-cloud-sdk/bin:/data/data/com.termux/files/usr/bin:/system/bin/:/data/data/com.termux/files/usr/bin:/system/bin/:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/home/.local/bin:/data/data/com.termux/files/home/.local/bin
LD_PRELOAD:
LD_LIBRARY_PATH: /data/data/com.termux/files/home/.local/lib:
CC: clang
CXX: clang++
C_INCLUDE_PATH: :/data/data/com.termux/files/usr/include/flang/Evaluate/:/data/data/com.termux/files/usr/include/:/data/data/com.termux/files/usr/include/flang/Evaluate/:/data/data/com.termux/files/usr/include/:/data/data/com.termux/files/usr/opt/libllvm-16/include/llvm/Frontend/OpenMP
FC: gfortran
CFLAGS:
CXXFLAGS:
LDFLAGS: -lm -lpython3.12 -llog
CPPFLAGS:
ANDROID_NDK: /storage/7B27-F244/Installs/Android_ndk_sdk/android-ndk-r26b
Proposed Solution
To resolve this issue, I suggest updating the build configuration to replace the -Ofast optimization flag with either -O3 -ffast-math or just -O3. This change would prevent the deprecation warning from causing the build process to fail.
For now I will try to much in the code for that.
Steps/Code to Reproduce
Steps to Reproduce
pi-heif
package using pip:Expected Results
.
Actual Results
Using pip 24.3.1 from /data/data/com.termux/files/usr/lib/python3.12/site-packages/pip (python 3.12)
Looking in indexes: https://pypi.org/simple, https://termux-user-repository.github.io/pypi/, https://termux-user-repository.github.io/pypi/
Collecting setuptools>=67.8
Obtaining dependency information for setuptools>=67.8 from https://files.pythonhosted.org/packages/90/12/282ee9bce8b58130cb762fbc9beabd531549952cac11fc56add11dcb7ea0/setuptools-75.3.0-py3-none-any.whl.metadata
Using cached setuptools-75.3.0-py3-none-any.whl.metadata (6.9 kB)
...
Looking for
libheif
using pkg-config.Checking for include file 'heif.h' in '/data/data/com.termux/files/usr/include'
Checking for include file 'heif.h' in '/data/data/com.termux/files/usr/include/libheif'
Found 'heif.h' in '/data/data/com.termux/files/usr/include/libheif'
building '_pi_heif' extension
creating build/temp.linux-aarch64-cpython-312/pi_heif
clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -I/data/data/com.termux/files/usr/include -I/data/data/com.termux/files/usr/include/flang/Evaluate -I/data/data/com.termux/files/usr/include/python3.12 -c pi_heif/_pi_heif.c -o build/temp.linux-aarch64-cpython-312/pi_heif/_pi_heif.o -Ofast -Werror
clang: error: argument '-Ofast' is deprecated; use '-O3 -ffast-math' for the same behavior, or '-O3' to enable only conforming optimizations [-Werror,-Wdeprecated-ofast]
error: command '/data/data/com.termux/files/usr/bin/clang' failed with exit code 1
error: subprocess-exited-with-error
× Building wheel for pi-heif (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
Quick fix
sed -i 's/-Ofast/-O3/g' setup.py
The text was updated successfully, but these errors were encountered: