chaquo / chaquopy

Chaquopy: the Python SDK for Android
https://chaquo.com/chaquopy/
MIT License
845 stars 133 forks source link

Failure building app with pygrib #826

Closed ytremare closed 14 hours ago

ytremare commented 1 year ago

Chaquopy version

    classpath 'com.chaquo.python:gradle:14.0.2'

Relevant parts of your build.gradle file

    python {
        version "3.8"
        buildPython '/home/ytrem/anaconda3/envs/python38-ytrem/bin/python3.8'
    //    buildPython "C:/Users/ytrem/anaconda3/python.exe"
        pip {
            options "--extra-index-url", "https://github.com/chaquo/chaquopy/tree/master/server/pypi/dist"
            install "eccodes"
            install"setuptools"
            install 'scipy'
            install 'wheel'
            install 'cython'
            install 'pyproj'
            install 'numpy'
            install "pygrib" 
        **}

pygrib version is 2.1.4

Describe your issue

Build fails at pygrib build wheel time. Please note that i'm also using https://github.com/chaquo/chaquopy/tree/master/server/pypi/dist. if any thing is missing or whatever I can do on my side, please let me know.

Executing tasks: [:app:assembleDebug] in project /home/ytrem/AndroidStudioProjects/AutoGribLoader_future1.2.6_Python

Configuration on demand is an incubating feature.

> Configure project :app
/home/ytrem
null
null

> Task :app:createDebugVariantModel UP-TO-DATE
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:extractPythonBuildPackages UP-TO-DATE

> Task :app:generateDebugPythonRequirements
Chaquopy: Installing for arm64-v8a
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-7.0, https://chaquo.com/pypi-13.1, https://github.com/chaquo/chaquopy/tree/master/server/pypi/dist
Processing /home/ytrem/.cache/chaquopy/pip/wheels/ab/df/93/00715c7ca46466f5b4e7b4873dc0a1d73a911cc4f1102e40c4/eccodes-1.5.1-cp38-none-any.whl
Collecting setuptools
  Using cached setuptools-67.6.0-py3-none-any.whl (1.1 MB)
Collecting scipy
  Using cached https://chaquo.com/pypi-7.0/scipy/scipy-1.4.1-0-cp38-cp38-android_21_arm64_v8a.whl (15.8 MB)
Collecting wheel
  Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
Collecting cython
  Using cached Cython-0.29.33-py2.py3-none-any.whl (987 kB)
Collecting pyproj
  Using cached https://chaquo.com/pypi-13.1/pyproj/pyproj-3.4.1-3-cp38-cp38-android_21_arm64_v8a.whl (380 kB)
Collecting numpy
  Using cached https://chaquo.com/pypi-7.0/numpy/numpy-1.19.5-0-cp38-cp38-android_21_arm64_v8a.whl (3.8 MB)
Collecting pygrib
  Using cached pygrib-2.1.4.tar.gz (21.8 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting attrs
  Using cached attrs-22.2.0-py3-none-any.whl (60 kB)
Collecting cffi
  Using cached https://chaquo.com/pypi-7.0/cffi/cffi-1.13.2-1-cp38-cp38-android_21_arm64_v8a.whl (168 kB)
Processing /home/ytrem/.cache/chaquopy/pip/wheels/82/9d/e9/528939cea46eb1e9f9282cce5035aead86074414a770ecd39c/findlibs-0.0.2-cp38-none-any.whl
Collecting chaquopy-libcxx>=7000
  Using cached https://chaquo.com/pypi-7.0/chaquopy-libcxx/chaquopy_libcxx-11000-0-py3-none-android_21_arm64_v8a.whl (308 kB)
Collecting chaquopy-libgfortran>=4.9
  Using cached https://chaquo.com/pypi-7.0/chaquopy-libgfortran/chaquopy_libgfortran-4.9-0-py3-none-android_21_arm64_v8a.whl (495 kB)
Collecting chaquopy-openblas>=0.2.20
  Using cached https://chaquo.com/pypi-7.0/chaquopy-openblas/chaquopy_openblas-0.2.20-5-py3-none-android_21_arm64_v8a.whl (4.3 MB)
Collecting chaquopy-proj>=9.1.1
  Using cached https://chaquo.com/pypi-13.1/chaquopy-proj/chaquopy_proj-9.1.1-1-py3-none-android_21_arm64_v8a.whl (3.4 MB)
Collecting certifi
  Using cached certifi-2022.12.7-py3-none-any.whl (155 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting chaquopy-libffi>=3.3
  Using cached https://chaquo.com/pypi-7.0/chaquopy-libffi/chaquopy_libffi-3.3-2-py3-none-android_21_arm64_v8a.whl (32 kB)
Collecting chaquopy-libtiff>=4.5.0
  Using cached https://chaquo.com/pypi-13.1/chaquopy-libtiff/chaquopy_libtiff-4.5.0-0-py3-none-android_21_arm64_v8a.whl (409 kB)
Collecting chaquopy-curl>=7.76.1
  Using cached https://chaquo.com/pypi-7.0/chaquopy-curl/chaquopy_curl-7.76.1-0-py3-none-android_21_arm64_v8a.whl (382 kB)
Collecting chaquopy-libjpeg>=1.5.3
  Using cached https://chaquo.com/pypi-7.0/chaquopy-libjpeg/chaquopy_libjpeg-1.5.3-1-py3-none-android_21_arm64_v8a.whl (176 kB)
Building wheels for collected packages: pygrib
  Building wheel for pygrib (PEP 517): started
  Building wheel for pygrib (PEP 517): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /home/ytrem/anaconda3/envs/python38-ytrem/bin/python3.8 /home/ytrem/AndroidStudioProjects/AutoGribLoader_future1.2.6_Python/app/build/generated/python/bp/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp1f0yv0hd
       cwd: /tmp/pip-install-09e0n0vz/pygrib
  Complete output (15 lines):
  eccodes found in /home/ytrem/anaconda3/envs/python38-ytrem
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-38
  creating build/lib.linux-x86_64-cpython-38/pygrib
  copying src/pygrib/__init__.py -> build/lib.linux-x86_64-cpython-38/pygrib
  running build_ext
  cythoning src/pygrib/_pygrib.pyx to src/pygrib/_pygrib.c
  building 'pygrib._pygrib' extension
  <string>:17: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`.
  /tmp/pip-build-env-gn5y32ig/overlay/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-09e0n0vz/pygrib/src/pygrib/_pygrib.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  error: CCompiler.compile: Chaquopy cannot compile native code
  ----------------------------------------
ERROR: Failed to install pygrib from https://files.pythonhosted.org/packages/d7/75/96eee88f4889507f72925b7e43be727a5fab0cae1b27fc54b3906bdf828c/pygrib-2.1.4.tar.gz#sha256=951a409eb3233dd95839dd77c0dbe4d8cbed8f21a4015b1047dec9edec65f545.
For assistance, please raise an issue at https://github.com/chaquo/chaquopy/issues.
Chaquopy: Exit status 1
mhsmith commented 1 year ago

This package contains native components, so it would have to be built into a wheel file. If you'd like to try doing this yourself, follow the instructions here. And if you're successful, please make a pull request so we can add the package to the public repository.

If anyone else wants this package too, let us know by clicking the thumbs-up button above.

mhsmith commented 1 year ago

Please note that i'm also using https://github.com/chaquo/chaquopy/tree/master/server/pypi/dist.

Merely adding an --extra-index-url argument for that directory won't do anything: you need to actually build the wheel file first, and then pass the path to the directory which contains it.

ytremare commented 1 year ago

Hi Malcom. Thank you so much for your quick reply. My first understanding of text below was that just doing this change will create the .whl file. This is confusing to me.

 ## Using a package in your app
.whl files can be built into your app using the [`pip`
block](https://chaquo.com/chaquopy/doc/current/android.html#requirements)
in your
`build.gradle` file. First, add an `options` line to pass
[`--extra-index-url`](
https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-extra-index-url)
with the location of the `dist` directory mentioned above. Either an HTTP
URL or a local path
can be used. Then add an `install` line giving the name of your package.

So from you reply i pay more attention to readme file, and understand I've to create for this package a dedicated .whl file by following the procedure. I'm willing to proceed and will let you know the result.

ytremare commented 1 year ago

Hi Malcom, sorry to bother you with this stuff. I spent some time trying to do it, unfortunately, for the time being I didn't succeed. After setting environment as per the readme file, I'm facing an issue I'm not able to solve it. Here below is the error:

Any Ideas? Is there some thing I can do, please let me know/ BR Yves

Le mar. 21 mars 2023 à 15:35, TREMARE YVES @.***> a écrit :

Hi Malcom. Thank you so much for your quick reply. My first understanding of text below was that just doing this change will create the .whl file. This is confusing to me. So from you reply i pay more attention to readme file, and understand I've to create for this package a dedicated .whl file by following the procedure. I'm willing to proceed and will let you know the result.

Best Regards

Using a package in your app

.whl files can be built into your app using the pip block in your build.gradle file. First, add an options line to pass --extra-index-url with the location of the dist directory mentioned above. Either an HTTP URL or a local path can be used. Then add an install line giving the name of your package.

Yves

Le mar. 21 mars 2023 à 12:40, Malcolm Smith @.***> a écrit :

Please note that i'm also using https://github.com/chaquo/chaquopy/tree/master/server/pypi/dist.

I'm not sure what you mean by that. Merely adding an --extra-index-url argument for that directory won't do anything: you need to actually build the wheel file first. Or if you've already built it, your build isn't using it, so look more carefully at the "Using a package in your app" section of the link above.

— Reply to this email directly, view it on GitHub https://github.com/chaquo/chaquopy/issues/826#issuecomment-1477687726, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATPJC4BECOFYZVENUIADYN3W5GHRZANCNFSM6AAAAAAWCIOMC4 . You are receiving this because you authored the thread.Message ID: @.***>

mhsmith commented 1 year ago

Please post the full build log. If it's too big to paste, you can attach it as a file on the GitHub issue page (not by email).

Please also create a fork of this repository, push your meta.yaml and any other files you used for the build, and post a link.

ytremare commented 1 year ago

Hi Malcolm. Sorry to be late, away from my eM.

Please find attached build log file. I'm a new comer on github, I've pull a fork but not sure at all it's correctly done. Here below the link. https://github.com/ytremare/Chaqupy_Build_Whell_pygrib/upload/master BR. Yves

build-wheel.py: python3.8 -m pip --disable-pip-version-check install Cython==0.29.33
Requirement already satisfied: Cython==0.29.33 in /home/ytrem/miniconda3/lib/python3.8/site-packages (0.29.33)
build-wheel.py: cd /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4
build-wheel.py: rm -rf /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a
build-wheel.py: mkdir -p /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a
build-wheel.py: Using cached sdist
build-wheel.py: tar -C /tmp/build-wheel-89l0cyku -xf pygrib-2.1.4.tar.gz
build-wheel.py: mv /tmp/build-wheel-89l0cyku/pygrib-2.1.4 /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src
build-wheel.py: rm -rf /tmp/build-wheel-89l0cyku
build-wheel.py: mv /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/pyproject.toml /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/pyproject-chaquopy-disabled.toml
build-wheel.py: mkdir -p /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements
build-wheel.py: mkdir -p /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include
build-wheel.py: mkdir -p /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib
build-wheel.py: ar rc /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/libpthread.a
build-wheel.py: ar rc /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/librt.a
build-wheel.py: unzip -q -d /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy /home/ytrem/miniconda3/chaquopy-wheel/maven/com/chaquo/python/target/3.8.16-0/target-*-arm64-v8a.zip include/* jniLibs/*
build-wheel.py: mv /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/jniLibs/arm64-v8a/* /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib
build-wheel.py: rm -r /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/jniLibs
Build_wheel line 325 /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/dist/numpy 
build-wheel.py: unzip -d /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements -q /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/dist/numpy/numpy-1.19.5-0-cp38-cp38-android_21_arm64_v8a.whl
build-wheel.py: ln -s libcrypto_chaquopy.so /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/libcrypto.so
build-wheel.py: ln -s libsqlite3_chaquopy.so /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/libsqlite3.so
build-wheel.py: ln -s libssl_chaquopy.so /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/libssl.so
build-wheel.py: ln -s libpython3.8.so /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/libpython3..so
build-wheel.py: abi=arm64-v8a; api_level=21; prefix=/home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy; . /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/../../target/build-common.sh; export
build-wheel.py: cd /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src
build-wheel.py: python3.8 -m pip --disable-pip-version-check wheel --no-deps -v -e .
Created temporary directory: /tmp/pip-ephem-wheel-cache-kpntdqxn
Created temporary directory: /tmp/pip-req-tracker-8do5yase
Created requirements tracker '/tmp/pip-req-tracker-8do5yase'
Created temporary directory: /tmp/pip-wheel-3xip1xos
Obtaining file:///home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src
  Added file:///home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src to build tracker '/tmp/pip-req-tracker-8do5yase'
    Running setup.py (path:/home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py) egg_info for package from file:///home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src
  Source in /home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src has version 2.1.4, which satisfies requirement pygrib==2.1.4 from file:///home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src
  Removed pygrib==2.1.4 from file:///home/ytrem/miniconda3/chaquopy-wheel/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src from build tracker '/tmp/pip-req-tracker-8do5yase'
Building wheels for collected packages: pygrib
  Created temporary directory: /tmp/pip-wheel-x788vnuk
  Building wheel for pygrib (setup.py): started
  Destination directory: /tmp/pip-wheel-x788vnuk
  Building wheel for pygrib (setup.py): finished with status 'error'
  Running setup.py clean for pygrib
Failed to build pygrib
Cleaning up...
Removed build tracker '/tmp/pip-req-tracker-8do5yase'
Exception information:
Traceback (most recent call last):
  File "/home/ytrem/miniconda3/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
    status = self.run(options, args)
  File "/home/ytrem/miniconda3/lib/python3.8/site-packages/pip/_internal/commands/wheel.py", line 171, in run
    raise CommandError(
pip._internal.exceptions.CommandError: Failed to build one or more wheels
build-wheel.py: Error: Command returned exit status 1
mhsmith commented 1 year ago

I said a fork of this repository, not the obsolete build-wheel repository. Which version of the tool are you using?

In any case, you haven't added anything to the fork. If you don't know how to do that, just post your meta.yaml file here.

Also, this log doesn't contain the error message you previously mentioned. Are you sure you copied the entire log, e.g. you didn't redirect stdout and miss stderr or something?

ytremare commented 1 year ago

Hi Malcom. I'm back. I restart all from the beginning. I've downloaded chaquopy master, tool version is 14.1.0. What has been done:

https://github.com/ytremare/Chaquopy_wheel_pygrib-ed2/upload# Yowza, that’s a big file. Try again with a file smaller than 25MB. I'm probably wrong on how to create this on github.

BR Yves

(build-wheel) @.**:~/miniconda3/chaquopy-master/server/pypi$ ./build-wheel.py --python 3.8 --abi arm64-v8a pygrib build-wheel.py: python3.8 -m pip --disable-pip-version-check install Cython==0.29.33 Requirement already satisfied: Cython==0.29.33 in /home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages (0.29.33) build-wheel.py: cd /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4 build-wheel.py: rm -rf /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a build-wheel.py: mkdir -p /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a build-wheel.py: Using cached sdist build-wheel.py: tar -C /tmp/build-wheel-daqh8zw7 -xf pygrib-2.1.4.tar.gz build-wheel.py: mv /tmp/build-wheel-daqh8zw7/pygrib-2.1.4 /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src build-wheel.py: rm -rf /tmp/build-wheel-daqh8zw7 build-wheel.py: mv /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/pyproject.toml /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/pyproject-chaquopy-disabled.toml build-wheel.py: mkdir -p /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements build-wheel.py: mkdir -p /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include build-wheel.py: mkdir -p /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib build-wheel.py: unzip -q -d /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy /home/ytrem/miniconda3/chaquopy-master/maven/com/chaquo/python/target/3.8.16.0/target-3.8.16-0-arm64-v8a.zip include/ jniLibs/ build-wheel.py: mv /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/jniLibs/arm64-v8a/ /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib build-wheel.py: rm -r /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/jniLibs build-wheel.py: unzip -d /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements -q /home/ytrem/miniconda3/chaquopy-master/server/pypi/dist/numpy/numpy-1.19.5-0-cp38-cp38-android_21_arm64_v8a.whl build-wheel.py: ln -s libcrypto_chaquopy.so /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/libcrypto.so build-wheel.py: ln -s libsqlite3_chaquopy.so /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/libsqlite3.so build-wheel.py: ln -s libssl_chaquopy.so /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/libssl.so build-wheel.py: ln -s libpython3.8.so /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/libpython3..so build-wheel.py: abi=arm64-v8a; api_level=21; prefix=/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy; . /home/ytrem/miniconda3/chaquopy-master/server/pypi/../../target/build-common.sh; export build-wheel.py: /home/ytrem/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar rc /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/libpthread.a build-wheel.py: /home/ytrem/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar rc /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/librt.a build-wheel.py: cd /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src build-wheel.py: python3.8 -m pip --disable-pip-version-check wheel --no-deps -v -e . /home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") Created temporary directory: /tmp/pip-ephem-wheel-cache-6_r2_293 Created temporary directory: /tmp/pip-req-tracker-ms40erzf Created requirements tracker '/tmp/pip-req-tracker-ms40erzf' Created temporary directory: /tmp/pip-wheel-kuui_7ce Obtaining file:///home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src Added file:///home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src to build tracker '/tmp/pip-req-tracker-ms40erzf' Running setup.py (path:/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py) egg_info for package from file:///home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src Running command python setup.py egg_info eccodes found in /home/ytrem/anaconda3/envs/python38-ytrem running egg_info writing src/pygrib.egg-info/PKG-INFO writing dependency_links to src/pygrib.egg-info/dependency_links.txt writing requirements to src/pygrib.egg-info/requires.txt writing top-level names to src/pygrib.egg-info/top_level.txt reading manifest file 'src/pygrib.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'pyproject.toml' warning: no files found matching '*.def' under directory 'eccodes' adding license file 'LICENSE' writing manifest file 'src/pygrib.egg-info/SOURCES.txt' Source in /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src has version 2.1.4, which satisfies requirement pygrib==2.1.4 from file:///home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src Removed pygrib==2.1.4 from file:///home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src from build tracker '/tmp/pip-req-tracker-ms40erzf' Building wheels for collected packages: pygrib Created temporary directory: /tmp/pip-wheel-7vb41yfa Building wheel for pygrib (setup.py) ... Destination directory: /tmp/pip-wheel-7vb41yfa Running command /home/ytrem/anaconda3/envs/build-wheel/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py'"'"'; file='"'"'/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-7vb41yfa eccodes found in /home/ytrem/anaconda3/envs/python38-ytrem running bdist_wheel running build running build_py creating build creating build/lib.linux_aarch64-cpython-38 creating build/lib.linux_aarch64-cpython-38/pygrib copying src/pygrib/init.py -> build/lib.linux_aarch64-cpython-38/pygrib running build_ext Traceback (most recent call last): File "/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/init.py", line 22, in from . import multiarray File "/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/multiarray.py", line 12, in from . import overrides File "/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/overrides.py", line 7, in from numpy.core._multiarray_umath import ( ImportError: /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/_multiarray_umath.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py", line 113, in setuptools.setup( File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/init.py", line 108, in setup return distutils.core.setup(**attrs) File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/home/ytrem/miniconda3/chaquopy-master/server/pypi/env/lib/python/sitecustomize.py", line 28, in run_command_override run_command_original(self, command) File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/dist.py", line 1213, in run_command super().run_command(command) File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 192, in run self.run_command('build') File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/home/ytrem/miniconda3/chaquopy-master/server/pypi/env/lib/python/sitecustomize.py", line 28, in run_command_override run_command_original(self, command) File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/dist.py", line 1213, in run_command super().run_command(command) File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 132, in run self.run_command(cmd_name) File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/home/ytrem/miniconda3/chaquopy-master/server/pypi/env/lib/python/sitecustomize.py", line 28, in run_command_override run_command_original(self, command) File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/dist.py", line 1213, in run_command super().run_command(command) File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py", line 15, in run import numpy File "/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/init.py", line 149, in from . import core File "/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/init.py", line 48, in raise ImportError(msg) ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

We have compiled some common reasons and troubleshooting tips at:

  https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

* The Python version is: Python3.8 from "/home/ytrem/anaconda3/envs/build-wheel/bin/python3.8"
* The NumPy version is: "1.19.5"

and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

Original error was: /home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/_multiarray_umath.so: cannot open shared object file: No such file or directory

error ERROR: Failed building wheel for pygrib Running setup.py clean for pygrib Running command /home/ytrem/anaconda3/envs/build-wheel/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py'"'"'; file='"'"'/home/ytrem/miniconda3/chaquopy-master/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' clean --all eccodes found in /home/ytrem/anaconda3/envs/python38-ytrem Chaquopy: clean command disabled Failed to build pygrib Cleaning up... Removed build tracker '/tmp/pip-req-tracker-ms40erzf' ERROR: Failed to build one or more wheels Exception information: Traceback (most recent call last): File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 153, in _main status = self.run(options, args) File "/home/ytrem/anaconda3/envs/build-wheel/lib/python3.8/site-packages/pip/_internal/commands/wheel.py", line 171, in run raise CommandError( pip._internal.exceptions.CommandError: Failed to build one or more wheels build-wheel.py: Error: Command returned exit status 1

SHELL=/bin/bash SESSION_MANAGER=local/ytrem-X756UAM:@/tmp/.ICE-unix/1632,unix/ytrem-X756UAM:/tmp/.ICE-unix/1632 QT_ACCESSIBILITY=1 COLORTERM=truecolor XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg SSH_AGENT_LAUNCHER=gnome-keyring XDG_MENU_PREFIX=gnome- GNOME_DESKTOP_SESSION_ID=this-is-deprecated CONDA_EXE=/home/ytrem/miniconda3/bin/conda _CE_M= TERMINATOR_DBUS_PATH=/net/tenshu/Terminator2 GNOME_SHELL_SESSION_MODE=ubuntu SSH_AUTH_SOCK=/run/user/1000/keyring/ssh PROJ_LIBDIR=/home/ytrem/anaconda3/envs/python38-ytrem/lib TERMINATOR_UUID=urn:uuid:52721386-2105-4d81-886f-566d88439db9 @.**=ibus DESKTOP_SESSION=ubuntu PROJ_INCDIR=/home/ytrem/anaconda3/envs/python38-ytrem/include/proj GTK_MODULES=gail:atk-bridge PWD=/home/ytrem LOGNAME=ytrem XDG_SESSION_DESKTOP=ubuntu XDG_SESSION_TYPE=wayland CONDA_PREFIX=/home/ytrem/miniconda3 SYSTEMD_EXEC_PID=1664 XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.UE4811 PROJ_VERSION=9.1.0 GJS_DEBUG_TOPICS=JS ERROR;JS LOG HOME=/home/ytrem USERNAME=ytrem IM_CONFIG_PHASE=1 LANG=fr_FR.UTF-8 LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.webp=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:*.xspf=00;36: XDG_CURRENT_DESKTOP=ubuntu:GNOME VTE_VERSION=6800 WAYLAND_DISPLAY=wayland-0 CONDA_PROMPT_MODIFIER=(base) INVOCATION_ID=537fcbf2c14b4c7893a835c41b0df101 TERMINATOR_DBUS_NAME=net.tenshu.Terminator25ef4b219e3b005583550f2b0f9f990c3 MANAGERPID=1465 GJS_DEBUG_OUTPUT=stderr GNOME_SETUP_DISPLAY=:1 LESSCLOSE=/usr/bin/lesspipe %s %s XDG_SESSION_CLASS=user PROJ_DIR=/home/ytrem/anaconda3/envs/python38-ytrem ANDROID_HOME=/home/ytrem/Android/Sdk IBUS_DISABLE_SNOOPER=1 TERM=xterm-256color ECCODES_DIR=/home/ytrem/anaconda3/envs/python38-ytrem/lib _CE_CONDA= LESSOPEN=| /usr/bin/lesspipe %s USER=ytrem CONDA_SHLVL=1 DISPLAY=:0 SHLVL=1 QT_IM_MODULE=ibus CONDA_PYTHON_EXE=/home/ytrem/miniconda3/bin/python XDG_RUNTIME_DIR=/run/user/1000 CONDA_DEFAULT_ENV=base JOURNAL_STREAM=8:30650 XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop PATH=/home/ytrem/miniconda3/bin:/home/ytrem/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ytrem/anaconda3/envs/python38-ytrem/lib:/home/ytrem/anaconda3/envs/python38-ytrem/include:/snap/bin GDMSESSION=ubuntu DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus GRIBAPI_DIR=/home/ytrem/anaconda3/envs/python38-ytrem GIO_LAUNCHED_DESKTOP_FILE_PID=3381 GIO_LAUNCHED_DESKTOPFILE=/usr/share/applications/terminator.desktop OLDPWD=/home/ytrem/temp =/usr/bin/env

mhsmith commented 1 year ago

I've repeatedly asked you to post your meta.yaml file. Here's the one I'm using: if yours is different, please give details:

package:
  name: pygrib
  version: 2.1.4

requirements:
  build:
    - cython 0.29.32
  host:
    - numpy 1.19.5

The NumPy error can be resolved with the following patch, which you should put in packages/pygrib/chaquopy.patch:

--- src-original/setup.py       2021-09-17 21:15:10.000000000 +0000
+++ src/setup.py        2023-04-03 11:54:47.113267448 +0000
@@ -4,6 +4,10 @@
 from Cython.Distutils import build_ext

+import builtins
+builtins.__NUMPY_SETUP__ = True  # Prevent the compiled parts from being imported.
+
+
 class NumpyBuildExtCommand(build_ext):
     """
     build_ext command for use when numpy headers are needed.
@@ -14,7 +18,7 @@
     def run(self):
         import numpy

-        self.distribution.fetch_build_eggs(["numpy"])
+        # Chaquopy disabled: self.distribution.fetch_build_eggs(["numpy"])
         self.include_dirs.append(numpy.get_include())
         build_ext.run(self)

However, the build then fails with this error:

  Running command /home/smith/.venv/pypi/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.p
y'"'"'; __file__='"'"'/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'
"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ez27ne6m 
  eccodes not found, build may fail...
  running bdist_wheel
  running build
  running build_py
  running build_ext
  Running from numpy source directory.
  cythoning src/pygrib/_pygrib.pyx to src/pygrib/_pygrib.c
  /home/smith/.venv/pypi/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/smith/git/chaquo/
chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/src/pygrib/_pygrib.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  building 'pygrib._pygrib' extension
  creating build/temp.linux_aarch64-cpython-38
  creating build/temp.linux_aarch64-cpython-38/src
  creating build/temp.linux_aarch64-cpython-38/src/pygrib
  /home/smith/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include -idirafter /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include/python3.8 -fPIC -I/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include -c src/pygrib/_pygrib.c -o build/temp.linux_aarch64-cpython-38/src/pygrib/_pygrib.o
  In file included from src/pygrib/_pygrib.c:746:
  In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/arrayobject.h:4:
  In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/ndarrayobject.h:12:
  In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/ndarraytypes.h:1822:
  /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
  #warning "Using deprecated NumPy API, disable it with " \
   ^
  src/pygrib/_pygrib.c:753:10: fatal error: 'grib_api.h' file not found
  #include "grib_api.h"
           ^~~~~~~~~~~~
  1 warning and 1 error generated.
  error: command '/home/smith/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang' failed with exit code 1

As pygrib's PyPI page says, this package is a Python interface to the ECCODES library, so you'll have to build that library as a separate wheel first. The two wheels will have the same relationship as pyzmq and chaquopy-libzmq, as described in server/pypi/README.md.

By the way, your email replies are being badly wrapped, making them difficult to read. Please post your replies on the GitHub website from now on.

ytremare commented 1 year ago

Yes , this one correct.

Le lun. 3 avr. 2023 à 14:07, Malcolm Smith @.***> a écrit :

I've repeatedly asked you to post your meta.yaml file. Here's the one I'm using: if yours is different, please give details:

package: name: pygrib version: 2.1.4 requirements: build:

  • cython 0.29.32 host:
  • numpy 1.19.5

The NumPy error can be resolved with the following patch, which you should put in packages/pygrib/chaquopy.patch:

--- src-original/setup.py 2021-09-17 21:15:10.000000000 +0000+++ src/setup.py 2023-04-03 11:54:47.113267448 +0000@@ -4,6 +4,10 @@ from Cython.Distutils import build_ext

+import builtins+builtins.__NUMPY_SETUP__ = True # Prevent the compiled parts from being imported.++ class NumpyBuildExtCommand(build_ext): """ build_ext command for use when numpy headers are needed.@@ -14,7 +18,7 @@ def run(self): import numpy

  • self.distribution.fetch_build_eggs(["numpy"])+ # Chaquopy disabled: self.distribution.fetch_build_eggs(["numpy"]) self.include_dirs.append(numpy.get_include()) build_ext.run(self)

However, the build then fails with this error:

Running command /home/smith/.venv/pypi/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.p y'"'"'; file='"'"'/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"' "', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ez27ne6m eccodes not found, build may fail... running bdist_wheel running build running build_py running build_ext Running from numpy source directory. cythoning src/pygrib/_pygrib.pyx to src/pygrib/_pygrib.c /home/smith/.venv/pypi/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/smith/git/chaquo/ chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/src/pygrib/_pygrib.pyx tree = Parsing.p_module(s, pxd, full_module_name) building 'pygrib._pygrib' extension creating build/temp.linux_aarch64-cpython-38 creating build/temp.linux_aarch64-cpython-38/src creating build/temp.linux_aarch64-cpython-38/src/pygrib /home/smith/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include -idirafter /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include/python3.8 -fPIC -I/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include -c src/pygrib/_pygrib.c -o build/temp.linux_aarch64-cpython-38/src/pygrib/_pygrib.o In file included from src/pygrib/_pygrib.c:746: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/arrayobject.h:4: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/ndarrayobject.h:12: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/ndarraytypes.h:1822: /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

warning "Using deprecated NumPy API, disable it with " \

^ src/pygrib/_pygrib.c:753:10: fatal error: 'grib_api.h' file not found

include "grib_api.h"

       ^~~~~~~~~~~~

1 warning and 1 error generated. error: command '/home/smith/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang' failed with exit code 1

As pygrib's PyPI page https://pypi.org/project/pygrib/ says, this package is a Python interface to the ECCODES library, so you'll have to build that library as a separate wheel first. The two wheels will have the same relationship as pyzmq and chaquopy-libzmq, as described in server/pypi/README.md.

By the way, your email replies are being badly wrapped, making them difficult to read. Please post your replies on the GitHub website from now on.

— Reply to this email directly, view it on GitHub https://github.com/chaquo/chaquopy/issues/826#issuecomment-1494203600, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATPJC4BSRGV3LQIP4CWNR53W7K4R3ANCNFSM6AAAAAAWCIOMC4 . You are receiving this because you authored the thread.Message ID: @.***>

ytremare commented 1 year ago

I'sent it in a previous mail (March 29th), adding also full build log, env Variables and pip list. If it can help.

Le lun. 3 avr. 2023 à 16:29, TREMARE YVES @.***> a écrit :

Yes , this one correct.

Le lun. 3 avr. 2023 à 14:07, Malcolm Smith @.***> a écrit :

I've repeatedly asked you to post your meta.yaml file. Here's the one I'm using: if yours is different, please give details:

package: name: pygrib version: 2.1.4 requirements: build:

  • cython 0.29.32 host:
  • numpy 1.19.5

The NumPy error can be resolved with the following patch, which you should put in packages/pygrib/chaquopy.patch:

--- src-original/setup.py 2021-09-17 21:15:10.000000000 +0000+++ src/setup.py 2023-04-03 11:54:47.113267448 +0000@@ -4,6 +4,10 @@ from Cython.Distutils import build_ext

+import builtins+builtins.__NUMPY_SETUP__ = True # Prevent the compiled parts from being imported.++ class NumpyBuildExtCommand(build_ext): """ build_ext command for use when numpy headers are needed.@@ -14,7 +18,7 @@ def run(self): import numpy

  • self.distribution.fetch_build_eggs(["numpy"])+ # Chaquopy disabled: self.distribution.fetch_build_eggs(["numpy"]) self.include_dirs.append(numpy.get_include()) build_ext.run(self)

However, the build then fails with this error:

Running command /home/smith/.venv/pypi/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.p y'"'"'; file='"'"'/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"' "', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ez27ne6m eccodes not found, build may fail... running bdist_wheel running build running build_py running build_ext Running from numpy source directory. cythoning src/pygrib/_pygrib.pyx to src/pygrib/_pygrib.c /home/smith/.venv/pypi/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/smith/git/chaquo/ chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/src/pygrib/_pygrib.pyx tree = Parsing.p_module(s, pxd, full_module_name) building 'pygrib._pygrib' extension creating build/temp.linux_aarch64-cpython-38 creating build/temp.linux_aarch64-cpython-38/src creating build/temp.linux_aarch64-cpython-38/src/pygrib /home/smith/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include -idirafter /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include/python3.8 -fPIC -I/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include -c src/pygrib/_pygrib.c -o build/temp.linux_aarch64-cpython-38/src/pygrib/_pygrib.o In file included from src/pygrib/_pygrib.c:746: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/arrayobject.h:4: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/ndarrayobject.h:12: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/ndarraytypes.h:1822: /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

warning "Using deprecated NumPy API, disable it with " \

^ src/pygrib/_pygrib.c:753:10: fatal error: 'grib_api.h' file not found

include "grib_api.h"

       ^~~~~~~~~~~~

1 warning and 1 error generated. error: command '/home/smith/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang' failed with exit code 1

As pygrib's PyPI page https://pypi.org/project/pygrib/ says, this package is a Python interface to the ECCODES library, so you'll have to build that library as a separate wheel first. The two wheels will have the same relationship as pyzmq and chaquopy-libzmq, as described in server/pypi/README.md.

By the way, your email replies are being badly wrapped, making them difficult to read. Please post your replies on the GitHub website from now on.

— Reply to this email directly, view it on GitHub https://github.com/chaquo/chaquopy/issues/826#issuecomment-1494203600, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATPJC4BSRGV3LQIP4CWNR53W7K4R3ANCNFSM6AAAAAAWCIOMC4 . You are receiving this because you authored the thread.Message ID: @.***>

ytremare commented 1 year ago

Oups. Mail has been unexpectedly truncated, get full eM now. I'm starting patch and whl for eccodes. Thanks for you spent time. Yves

Le lun. 3 avr. 2023 à 16:36, TREMARE YVES @.***> a écrit :

I'sent it in a previous mail (March 29th), adding also full build log, env Variables and pip list. If it can help.

Le lun. 3 avr. 2023 à 16:29, TREMARE YVES @.***> a écrit :

Yes , this one correct.

Le lun. 3 avr. 2023 à 14:07, Malcolm Smith @.***> a écrit :

I've repeatedly asked you to post your meta.yaml file. Here's the one I'm using: if yours is different, please give details:

package: name: pygrib version: 2.1.4 requirements: build:

  • cython 0.29.32 host:
  • numpy 1.19.5

The NumPy error can be resolved with the following patch, which you should put in packages/pygrib/chaquopy.patch:

--- src-original/setup.py 2021-09-17 21:15:10.000000000 +0000+++ src/setup.py 2023-04-03 11:54:47.113267448 +0000@@ -4,6 +4,10 @@ from Cython.Distutils import build_ext

+import builtins+builtins.__NUMPY_SETUP__ = True # Prevent the compiled parts from being imported.++ class NumpyBuildExtCommand(build_ext): """ build_ext command for use when numpy headers are needed.@@ -14,7 +18,7 @@ def run(self): import numpy

  • self.distribution.fetch_build_eggs(["numpy"])+ # Chaquopy disabled: self.distribution.fetch_build_eggs(["numpy"]) self.include_dirs.append(numpy.get_include()) build_ext.run(self)

However, the build then fails with this error:

Running command /home/smith/.venv/pypi/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.p y'"'"'; file='"'"'/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"' "', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ez27ne6m eccodes not found, build may fail... running bdist_wheel running build running build_py running build_ext Running from numpy source directory. cythoning src/pygrib/_pygrib.pyx to src/pygrib/_pygrib.c /home/smith/.venv/pypi/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/smith/git/chaquo/ chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/src/pygrib/_pygrib.pyx tree = Parsing.p_module(s, pxd, full_module_name) building 'pygrib._pygrib' extension creating build/temp.linux_aarch64-cpython-38 creating build/temp.linux_aarch64-cpython-38/src creating build/temp.linux_aarch64-cpython-38/src/pygrib /home/smith/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include -idirafter /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include/python3.8 -fPIC -I/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include -c src/pygrib/_pygrib.c -o build/temp.linux_aarch64-cpython-38/src/pygrib/_pygrib.o In file included from src/pygrib/_pygrib.c:746: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/arrayobject.h:4: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/ndarrayobject.h:12: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/ndarraytypes.h:1822: /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

warning "Using deprecated NumPy API, disable it with " \

^ src/pygrib/_pygrib.c:753:10: fatal error: 'grib_api.h' file not found

include "grib_api.h"

       ^~~~~~~~~~~~

1 warning and 1 error generated. error: command '/home/smith/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang' failed with exit code 1

As pygrib's PyPI page https://pypi.org/project/pygrib/ says, this package is a Python interface to the ECCODES library, so you'll have to build that library as a separate wheel first. The two wheels will have the same relationship as pyzmq and chaquopy-libzmq, as described in server/pypi/README.md.

By the way, your email replies are being badly wrapped, making them difficult to read. Please post your replies on the GitHub website from now on.

— Reply to this email directly, view it on GitHub https://github.com/chaquo/chaquopy/issues/826#issuecomment-1494203600, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATPJC4BSRGV3LQIP4CWNR53W7K4R3ANCNFSM6AAAAAAWCIOMC4 . You are receiving this because you authored the thread.Message ID: @.***>

ytremare commented 1 year ago

Hi. I succeed to build wheel file for eccodes Fyi (a whl file is already available @ : https://www.piwheels.org/simple/eccodes/ ) Adding this to meta.yaml file, pygrib whl creation still fails, error is : src/pygrib/_pygrib.c:753:10: fatal error: 'grib_api.h' file not found and eccodes not found, build may fail... eccodes and gribapi.h are mandatory to build pygrib see setup.py of pygrib line 47 to 101. I had those requirements on my computer, but remove it because whl file creation fails with following error: /home/ytrem/anaconda3/envs/python38-ytrem/lib/libeccodes.so is incompatible with aarch64linux this lib as buil with conda forge locally with linux. In my mind, I'm may be wrong, goal of chaquopy is to provide package installation without extra external needs (like describe adobe) At this time I don't see how to solve it, I don't have the expected knowledge level for that. I'm ready to perform any action you need me to do, but alone no way for me to progress. If it seems to you too much time consuming task, let me know I'll close the issue BR Yves

Le lun. 3 avr. 2023 à 16:45, TREMARE YVES @.***> a écrit :

Oups. Mail has been unexpectedly truncated, get full eM now. I'm starting patch and whl for eccodes. Thanks for you spent time. Yves

Le lun. 3 avr. 2023 à 16:36, TREMARE YVES @.***> a écrit :

I'sent it in a previous mail (March 29th), adding also full build log, env Variables and pip list. If it can help.

Le lun. 3 avr. 2023 à 16:29, TREMARE YVES @.***> a écrit :

Yes , this one correct.

Le lun. 3 avr. 2023 à 14:07, Malcolm Smith @.***> a écrit :

I've repeatedly asked you to post your meta.yaml file. Here's the one I'm using: if yours is different, please give details:

package: name: pygrib version: 2.1.4 requirements: build:

  • cython 0.29.32 host:
  • numpy 1.19.5

The NumPy error can be resolved with the following patch, which you should put in packages/pygrib/chaquopy.patch:

--- src-original/setup.py 2021-09-17 21:15:10.000000000 +0000+++ src/setup.py 2023-04-03 11:54:47.113267448 +0000@@ -4,6 +4,10 @@ from Cython.Distutils import build_ext

+import builtins+builtins.__NUMPY_SETUP__ = True # Prevent the compiled parts from being imported.++ class NumpyBuildExtCommand(build_ext): """ build_ext command for use when numpy headers are needed.@@ -14,7 +18,7 @@ def run(self): import numpy

  • self.distribution.fetch_build_eggs(["numpy"])+ # Chaquopy disabled: self.distribution.fetch_build_eggs(["numpy"]) self.include_dirs.append(numpy.get_include()) build_ext.run(self)

However, the build then fails with this error:

Running command /home/smith/.venv/pypi/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.p y'"'"'; file='"'"'/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"' "', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ez27ne6m eccodes not found, build may fail... running bdist_wheel running build running build_py running build_ext Running from numpy source directory. cythoning src/pygrib/_pygrib.pyx to src/pygrib/_pygrib.c /home/smith/.venv/pypi/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/smith/git/chaquo/ chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/src/src/pygrib/_pygrib.pyx tree = Parsing.p_module(s, pxd, full_module_name) building 'pygrib._pygrib' extension creating build/temp.linux_aarch64-cpython-38 creating build/temp.linux_aarch64-cpython-38/src creating build/temp.linux_aarch64-cpython-38/src/pygrib /home/smith/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include -idirafter /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include/python3.8 -fPIC -I/home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include -c src/pygrib/_pygrib.c -o build/temp.linux_aarch64-cpython-38/src/pygrib/_pygrib.o In file included from src/pygrib/_pygrib.c:746: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/arrayobject.h:4: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/ndarrayobject.h:12: In file included from /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/ndarraytypes.h:1822: /home/smith/git/chaquo/chaquopy/server/pypi/packages/pygrib/build/2.1.4/cp38-cp38-android_21_arm64_v8a/requirements/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

warning "Using deprecated NumPy API, disable it with " \

^ src/pygrib/_pygrib.c:753:10: fatal error: 'grib_api.h' file not found

include "grib_api.h"

       ^~~~~~~~~~~~

1 warning and 1 error generated. error: command '/home/smith/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang' failed with exit code 1

As pygrib's PyPI page https://pypi.org/project/pygrib/ says, this package is a Python interface to the ECCODES library, so you'll have to build that library as a separate wheel first. The two wheels will have the same relationship as pyzmq and chaquopy-libzmq, as described in server/pypi/README.md.

By the way, your email replies are being badly wrapped, making them difficult to read. Please post your replies on the GitHub website from now on.

— Reply to this email directly, view it on GitHub https://github.com/chaquo/chaquopy/issues/826#issuecomment-1494203600, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATPJC4BSRGV3LQIP4CWNR53W7K4R3ANCNFSM6AAAAAAWCIOMC4 . You are receiving this because you authored the thread.Message ID: @.***>

mhsmith commented 1 year ago

Fyi (a whl file is already available @ : https://www.piwheels.org/simple/eccodes/ )

That's only a Python interface, it doesn't contain the native library.

Installing the library with conda, or a Linux package manager, will also be useless, because it won't be built for Android.

The native library source code is available here: see the Download and Installation links on the right. The build uses CMake, so I recommend you follow the example in server/pypi/packages/chaquopy-crc32. Specifically:

ytremare commented 1 year ago

Hi Malcolm. I'm late, I got some troubles with my computer. I don't want to bother you with my configuration issues, so just one question to make sure I'm on the right way. Have I to install native lib on my computer or do have I to install it under chaquopy using build-wheel tool (build.sh)?

Yves

Le sam. 8 avr. 2023 à 15:59, Malcolm Smith @.***> a écrit :

Fyi (a whl file is already available @ : https://www.piwheels.org/simple/eccodes/ )

That's only a Python interface, it doesn't contain the native library.

Installing the library with conda, or a Linux package manager, will also be useless, because it won't be built for Android.

The native library is available here https://confluence.ecmwf.int/display/ECC: see the Download and Installation links on the right. The build uses CMake, so I recommend you follow the example in server/pypi/packages/chaquopy-crc32. Specifically:

  • Make sure you have CMake installed on the build machine.
  • In the meta.yaml file, add cmake to the build requirements section.
  • In the build.sh file, run cmake with the CMAKE_TOOLCHAIN_FILE and CMAKE_INSTALL_PREFIX options.

— Reply to this email directly, view it on GitHub https://github.com/chaquo/chaquopy/issues/826#issuecomment-1500897869, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATPJC4FRRMRZCIIFAKROX4DXAFVLRANCNFSM6AAAAAAWCIOMC4 . You are receiving this because you authored the thread.Message ID: @.***>

mhsmith commented 1 year ago

As I said above:

this package is a Python interface to the ECCODES library, so you'll have to build that library as a separate wheel first. The two wheels will have the same relationship as pyzmq and chaquopy-libzmq, as described in server/pypi/README.md.

You wouldn't actually install either of these wheels "on your computer", you'd build them into your app, as described in the "Using a package in your app" section of the README.

ytremare commented 1 year ago

It's what I'm trying to do. Just to make sure. Progress is on going, I'm facing issues due to incompatible default options with cross compiling. Solve some of them. Thanks for your support. Yves

Le mer. 26 avr. 2023 à 00:15, Malcolm Smith @.***> a écrit :

You wouldn't actually install either of these wheels "on your computer", you'd build them into your app, as described in the "Using a package in your app" section of the README.

— Reply to this email directly, view it on GitHub https://github.com/chaquo/chaquopy/issues/826#issuecomment-1522490124, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATPJC4CCTGUGX5YCBNTN4CDXDBEIRANCNFSM6AAAAAAWCIOMC4 . You are receiving this because you authored the thread.Message ID: @.***>

ytremare commented 1 year ago

Hi. I'm fighting with this since a long time, and still not able to build it. I've created a dir called eccodes on the fork, you should be able to run it easily. Below are errors (source files are ok I succeed to build the lib on the build machine linux environment). I'm not able to find from where the issue is coming from) If you have some time to spend on this stuff, here the link of the fork ( https://github.com/ytremare/chaquopy) If any thing is missing please let me know. Best Regards ld: error: undefined symbol: grib_long_to_ieee64

referenced by grib_accessor_class_data_sh_packed.cc

CMakeFiles/eccodes.dir/grib_accessor_class_data_sh_packed.cc.o:(.data.rel.ro..Lswitch.table._ZL13unpack_doubleP13grib_accessorPdPm.10+0x10) referenced by grib_accessor_class_data_sh_unpacked.cc

CMakeFiles/eccodes.dir/grib_accessor_class_data_sh_unpacked.cc.o:(.data.rel.ro..Lswitch.table._ZL13unpack_doubleP13grib_accessorPdPm.10+0x10) referenced by grib_accessor_class_data_complex_packing.cc

CMakeFiles/eccodes.dir/grib_accessor_class_data_complex_packing.cc.o:(.data.rel.ro..Lswitch.table._ZL12unpack_floatP13grib_accessorPfPm.20+0x10) referenced 1 more times

ld: error: undefined symbol: int grib_ieee_decode_array(grib_context, unsigned char, unsigned long, int, double*)

referenced by grib_accessor_class_data_raw_packing.cc:213 (//home/ytrem/miniconda3/chaquopy-eccodes/server/pypi/packages/eccodes/build/2.30.0/py3-none-android_21_arm64_v8a/src/src/grib_accessor_class_data_raw_packing.cc:213)

CMakeFiles/eccodes.dir/grib_accessor_class_data_raw_packing.cc.o:(unpack_double(grib_accessor, double, unsigned long*)) referenced by grib_accessor_class_data_raw_packing.cc:333 (//home/ytrem/miniconda3/chaquopy-eccodes/server/pypi/packages/eccodes/build/2.30.0/py3-none-android_21_arm64_v8a/src/src/grib_accessor_class_data_raw_packing.cc:333)

CMakeFiles/eccodes.dir/grib_accessor_class_data_raw_packing.cc.o:(unpack_double_element(grib_accessor, unsigned long, double)) referenced by grib_accessor_class_data_complex_packing.cc:840 (//home/ytrem/miniconda3/chaquopy-eccodes/server/pypi/packages/eccodes/build/2.30.0/py3-none-android_21_arm64_v8a/src/src/grib_accessor_class_data_complex_packing.cc:840)

CMakeFiles/eccodes.dir/grib_accessor_class_data_complex_packing.cc.o:(unpack_double(grib_accessor, double, unsigned long*))

ld: error: undefined symbol: int grib_ieee_decode_array(grib_context, unsigned char, unsigned long, int, float*)

referenced by grib_accessor_class_data_complex_packing.cc:840 (//home/ytrem/miniconda3/chaquopy-eccodes/server/pypi/packages/eccodes/build/2.30.0/py3-none-android_21_arm64_v8a/src/src/grib_accessor_class_data_complex_packing.cc:840)

CMakeFiles/eccodes.dir/grib_accessor_class_data_complex_packing.cc.o:(unpack_float(grib_accessor, float, unsigned long*))

ld: error: undefined symbol: grib_ieee64_to_long

referenced by grib_accessor_class_data_complex_packing.cc

CMakeFiles/eccodes.dir/grib_accessor_class_data_complex_packing.cc.o:(.data.rel.ro..Lswitch.table._ZL11pack_doubleP13grib_accessorPKdPm.18+0x10) referenced by grib_accessor_class_data_g2bifourier_packing.cc

CMakeFiles/eccodes.dir/grib_accessor_class_data_g2bifourier_packing.cc.o:(.data.rel.ro..Lswitch.table._ZL13new_bif_truncP13grib_accessorP38grib_accessor_data_g2bifourier_packing.10+0x10) clang++: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [src/CMakeFiles/eccodes.dir/build.make:6039 : lib/libeccodes.so] Erreur 1 make[2] : on quitte le répertoire « /home/ytrem/miniconda3/chaquopy-eccodes/server/pypi/packages/eccodes/build/2.30.0 » make[1]: [CMakeFiles/Makefile2:1554 : src/CMakeFiles/eccodes.dir/all] Erreur 2 make[1] : on quitte le répertoire « /home/ytrem/miniconda3/chaquopy-eccodes/server/pypi/packages/eccodes/build/2.30.0 » make: *** [Makefile:169 : all] Erreur 2 build-wheel.py: Error: Command returned exit status 2 Yves

Le mer. 26 avr. 2023 à 10:33, TREMARE YVES @.***> a écrit :

It's what I'm trying to do. Just to make sure. Progress is on going, I'm facing issues due to incompatible default options with cross compiling. Solve some of them. Thanks for your support. Yves

Le mer. 26 avr. 2023 à 00:15, Malcolm Smith @.***> a écrit :

You wouldn't actually install either of these wheels "on your computer", you'd build them into your app, as described in the "Using a package in your app" section of the README.

— Reply to this email directly, view it on GitHub https://github.com/chaquo/chaquopy/issues/826#issuecomment-1522490124, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATPJC4CCTGUGX5YCBNTN4CDXDBEIRANCNFSM6AAAAAAWCIOMC4 . You are receiving this because you authored the thread.Message ID: @.***>

mhsmith commented 1 year ago

I don't have time to try building this myself, but looking at your fork, the only thing that looks suspicious is the file TryRunResults.cmake. There's a comment at the top saying "set the variables to appropriate values", and it doesn't look like you've done that.

You'll have to examine eccodes_test_endiness.cmake to see what the expected values are. But if the only function of these tests is to detect endianness, than I can tell you that all of Android's ABIs are little-endian.

As I said before, your email replies are being badly wrapped, making them difficult to read. Unless you can fix this, please DO NOT REPLY TO GITHUB EMAILS from this repository from now on. Post your replies on the GitHub website instead.

ytremare commented 1 year ago

Thanks for your quick reply. Looking at TryRunResults.cmake file, it's written "If the executable would not have been able to run, set IEEE_BE_EXITCODE__TRYRUN_OUTPUT empty."Thinking thats only for test purpose It's the reason I did like this. Anayway I'll investigate this deeper, agree with you it seems issue is around ieee stuff?

ytremare commented 1 year ago

Hi. I attempted to change the ndk (move from 22 to 25) version used in build-wheel tool, I didn't find how/where to do it. Could you help please. Thanks

mhsmith commented 1 year ago

The NDK version is set in target/build-common.sh. But I should warn you, NDK upgrades often cause compatibility problems with build-wheel. Why do you want to change it?

ytremare commented 1 year ago

Looking at some error messages (.data.rel.ro..Lswitch.table._ZL13unpack_doubleP13grib_accessorPdPm.10+0x10) I suspect a lib issue and would try with ndk 25. This will also lead to support Android_Platform level 24 which bring additional feature (memfs).

mhsmith commented 1 year ago

The NDK version numbers don't correspond to API levels. Our current NDK version (22) was released in 2021, so it probably supports all features up to API level 30 or 31.

ytremare commented 1 year ago

Hi Malcolm. I finally succeed to build a wheel (after looking at hundreds of files , I found a couple a parameters to add to cmake command line). It remains me to add some features to eccodes package and to add some more abi's. Moving to NDK 25 brought no change I've came back to 22 version. You told me to take care about pyzmq and libzmq. Could you please be a bit more specific, I don't really catch what you mean.

mhsmith commented 1 year ago

I mean that you should list the non-Python library in the host section of the Python library's meta.yaml. It looks like you've already done that in your fork.

You may also need to patch the Python library to help it find the non-Python library's location, although build-wheel supports a lot of the common cases automatically.

ytremare commented 1 year ago

Hi. I've deleted the previous comments. I found from where issue come from. BR

mhsmith commented 1 year ago

If possible, please explain how you solved the issue, as this may be helpful to other people.

ytremare commented 1 year ago

Hi. Not sure it'll help as it was a mistake on my side. I don't remember the reason but I built libgfortran and the result (successfull) in arm64-v8a wheel was a mix of arm64-v8a and X86-64 libs. Loading this wrongly build lib lead to a unexpected code machine. BR