gustavochm / phasepy

Other
87 stars 29 forks source link

Successful Compilation under Android Termux #24

Closed defencedog closed 10 months ago

defencedog commented 10 months ago

I had installed previous version without any error but upgrading gives this error. Current installed version

~ $ pip list| grep phase
phasepy                            0.0.51

New version error...

Compiling phasepy/src/coloc_cy.pyx because it changed.
      [1/1] Cythonizing phasepy/src/coloc_cy.pyx
      /data/data/com.termux/files/usr/lib/python3.9/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /data/data/com.termux/files/usr/tmp/pip-install-97hqrqhn/phasepy_8d2e91d0ff404d17baed653aa79e6f34/phasepy/src/coloc_cy.pyx
        tree = Parsing.p_module(s, pxd, full_module_name)
      building 'phasepy.coloc_cy' extension
      creating build/temp.linux-aarch64-3.9
      creating build/temp.linux-aarch64-3.9/phasepy
      creating build/temp.linux-aarch64-3.9/phasepy/src
      gcc-11 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -I/data/data/com.termux/files/usr/include/python3.9 -c phasepy/src/coloc_cy.c -o build/temp.linux-aarch64-3.9/phasepy/src/coloc_cy.o
      phasepy/src/coloc_cy.c: In function '__pyx_add_acquisition_count_locked':
      phasepy/src/coloc_cy.c:28692:34: error: wrong type argument to increment
      28692 |     result = (*acquisition_count)++;
            |                                  ^~
      phasepy/src/coloc_cy.c: In function '__pyx_sub_acquisition_count_locked':
      phasepy/src/coloc_cy.c:28702:34: error: wrong type argument to decrement
      28702 |     result = (*acquisition_count)--;
            |                                  ^~
      error: command '/data/data/com.termux/files/usr/bin/gcc-11' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for phasepy
  Running setup.py clean for phasepy
Failed to build phasepy
ERROR: Could not build wheels for phasepy, which is required to install pyproject.toml-based projects
gustavochm commented 10 months ago

Hey!

This is compilation error that comes from the cython part of phasepy. As you can see here, I have uploaded pre-compiled versions of phasepy for Python 3.6, 3.7, 3.8, and 3.9 for Windows. In any other case, pip will not find the wheel and attempt to compile. Which Python version and OS are you using? If using Windows, you could get the pre-compiled wheel if you use Python <=3.9. If using linux/mac os, you could easily get the compilers (and then the installation should proceed without any issues).

Regards, Gustavo

defencedog commented 10 months ago

I am on Android arm64 with python3.9

gustavochm commented 10 months ago

Hi, I'm not sure how to proceed here. I don't think arm64 should be any issues, as phasepy works just fine on the M1 processor. However, I'm not sure how to compile specifically for an environment on Android e.e

Gustavo

defencedog commented 10 months ago

Congratulations ... to you & me

Downgraded from Cython 3.0.8 to 0.29.32

Command used to build

tar -xf phasepy-0.0.52.tar.gz
cd phasepy-0.0.52/
MATHLIB=m CC=gcc pip install . -v

My compiler

Reading specs from /data/data/com.termux/files/usr/lib/gcc/arm-linux-androideabi/11.4.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/data/data/com.termux/files/usr/libexec/gcc/arm-linux-androideabi/11.4.0/lto-wrapper
Target: arm-linux-androideabi
Configured with: /home/builder/.termux-build/gcc-11/src/configure --disable-dependency-tracking --prefix=/data/data/com.termux/files/usr --libdir=/data/data/com.termux/files/usr/lib --sbindir=/data/data/com.termux/files/usr/bin --disable-rpath --disable-rpath-hack --enable-initfini-array --enable-default-pie --enable-languages=c,c++,fortran,ada --enable-lto --enable-host-shared --enable-host-libquadmath --enable-libatomic --enable-libatomic-ifuncs=no --enable-libbacktrace --enable-libquadmath --enable-libgomp --enable-gold --enable-version-specific-runtime-libs --enable-eh-frame-hdr-for-static --disable-shared --disable-libmpx --disable-libssp --disable-libstdcxx --disable-multilib --disable-tls --with-libatomic --with-system-zlib --with-gmp=/data/data/com.termux/files/usr --with-mpfr=/data/data/com.termux/files/usr --with-mpc=/data/data/com.termux/files/usr --with-isl=/data/data/com.termux/files/usr --with-gxx-include-dir=/data/data/com.termux/files/usr/include/c++/v1 --program-suffix=-11 --with-arch=armv7-a --with-float=soft --with-fpu=vfp --with-stage1-ldflags=-specs=/home/builder/.termux-build/gcc-11/tmp/specs --host=arm-linux-androideabi --target=arm-linux-androideabi --disable-nls --enable-static --libexecdir=/data/data/com.termux/files/usr/libexec
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (GCC)
Created wheel for phasepy: filename=phasepy-0.0.52-cp39-cp39-linux_armv8l.whl size=1618254 sha256=8363c8c4fce52138a130af77a3fbbe7dd07abbe738d58dc814b673c10c9ba3ea
  Stored in directory: /data/data/com.termux/files/home/.cache/pip/wheels/da/7a/63/ab38a4a24696c8d47084784ed4e0f285df36117db3ab04e692
Successfully built phasepy
Installing collected packages: et-xmlfile, openpyxl, phasepy
  Attempting uninstall: phasepy
    Found existing installation: phasepy 0.0.52
    Can't uninstall 'phasepy'. No files were found to uninstall.
Successfully installed et-xmlfile-1.1.0 openpyxl-3.1.2 phasepy-0.0.52
defencedog commented 10 months ago

Adding ARM32/64 whl

Remove .txt extension

phasepy-0.0.52-cp39-cp39-linux_armv8l.whl.txt

phasepy-0.0.52-cp39-cp39-linux_aarch64.whl.txt