jpype-project / jpype

JPype is cross language bridge to allow Python programs full access to Java class libraries.
http://www.jpype.org
Apache License 2.0
1.12k stars 183 forks source link

aarch64 support #1227

Closed meijiesky closed 3 weeks ago

meijiesky commented 4 weeks ago

I used conda to create a python 3.8 environment but I cannot pip install jpype1 on the linux aarch64 machine. Please help. Thanks!!!

Error:

# pip install jpype1
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Collecting jpype1
  Using cached http://mirrors.cloud.aliyuncs.com/pypi/packages/25/42/8ca50a0e27e3053829545829e7bcba071cbfa4d5d8fd7fc5d1d988f325b1/JPype1-1.5.0.tar.gz (819 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting packaging (from jpype1)
  Using cached http://mirrors.cloud.aliyuncs.com/pypi/packages/08/aa/cc0199a5f0ad350994d660967a8efb233fe0416e4639146c089643407ce6/packaging-24.1-py3-none-any.whl (53 kB)
Building wheels for collected packages: jpype1
  Building wheel for jpype1 (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for jpype1 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [77 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/dbapi2.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/nio.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jarray.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jinit.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jcollection.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jclass.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/config.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_classpath.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/protocol.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jvmfinder.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jproxy.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_pykeywords.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/__init__.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/beans.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jcustomizer.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jthread.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jmethod.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_core.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/pickle.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jio.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/imports.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_gui.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jexception.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jpackage.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jstring.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/types.py -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jobject.py -> build/lib.linux-aarch64-cpython-38/jpype
      creating build/lib.linux-aarch64-cpython-38/jpype/_pyinstaller
      copying jpype/_pyinstaller/example.py -> build/lib.linux-aarch64-cpython-38/jpype/_pyinstaller
      copying jpype/_pyinstaller/entry_points.py -> build/lib.linux-aarch64-cpython-38/jpype/_pyinstaller
      copying jpype/_pyinstaller/hook-jpype.py -> build/lib.linux-aarch64-cpython-38/jpype/_pyinstaller
      copying jpype/_pyinstaller/test_jpype_pyinstaller.py -> build/lib.linux-aarch64-cpython-38/jpype/_pyinstaller
      copying jpype/_jcollection.pyi -> build/lib.linux-aarch64-cpython-38/jpype
      copying jpype/_jio.pyi -> build/lib.linux-aarch64-cpython-38/jpype
      running build_ext
      Call build extensions
      Using Jar cache
      copying native/jars/org.jpype.jar -> build/lib.linux-aarch64-cpython-38
      Call build ext
      building '_jpype' extension
      creating build/temp.linux-aarch64-cpython-38/native/common
      creating build/temp.linux-aarch64-cpython-38/native/python
      g++ -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -Wall -fPIC -isystem /root/miniforge/envs/panama_env_py38/include -fPIC -isystem /root/miniforge/envs/panama_env_py38/include -fPIC -Inative/common/include -Inative/python/include -Inative/embedded/include -Inative/jni_include -I/root/miniforge/envs/panama_env_py38/include/python3.8 -c native/common/jp_array.cpp -o build/temp.linux-aarch64-cpython-38/native/common/jp_array.o -g0 -std=c++11 -O2
      /tmp/pip-install-slfymkmi/jpype1_5eff3cf79b41465db0338f7ba04175b0/setupext/pytester.py:20: SetuptoolsDeprecationWarning: The test command is disabled and references to it are deprecated.
      !!

              ********************************************************************************
              Please remove any references to `setuptools.command.test` in all supported versions of the affected package.

              By 2024-Nov-15, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
              ********************************************************************************

      !!
        from setuptools.command.test import test as TestCommand
      /tmp/pip-build-env-v_i4w5xp/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
        warnings.warn(msg)
      /tmp/pip-build-env-v_i4w5xp/overlay/lib/python3.8/site-packages/setuptools/dist.py:495: SetuptoolsDeprecationWarning: Invalid dash-separated options
      !!

              ********************************************************************************
              Usage of dash-separated 'index-url' will not be supported in future
              versions. Please use the underscore name 'index_url' instead.

              By 2025-Mar-03, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

      !!
        opt = self.warn_dash_deprecation(opt, section)
      error: command 'g++' failed: No such file or directory
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for jpype1
Failed to build jpype1
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (jpype1)
meijiesky commented 4 weeks ago

According to this post here https://github.com/jpype-project/jpype/pull/910, I tried and found that version 1.2.1 supports aarch64 however the later versions don't. Could you please support aarch64 for versions after 1.2.1 as well?

image

# pip install jpype1==1.2.1
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Requirement already satisfied: jpype1==1.2.1 in ./miniforge/envs/panama_env_py38/lib/python3.8/site-packages (1.2.1)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
ryanmkurtz commented 4 weeks ago

I too went to install JPype1 on Ubuntu 24.10 for ARM the other day and came to the same realization. Would love to see a wheel for it!

astrelsky commented 4 weeks ago

The log says error: command 'g++' failed: No such file or directory. Have you tried installing a c++ compiler and trying again?

ryanmkurtz commented 4 weeks ago

I just tried again, and it was able to build the source. Not sure why it failed for me before.

(venv) ryan@ubuntu2410:~$ pip3 install JPype1
Collecting JPype1
  Downloading JPype1-1.5.0.tar.gz (819 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 819.1/819.1 kB 26.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting packaging (from JPype1)
  Downloading packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
Downloading packaging-24.1-py3-none-any.whl (53 kB)
Building wheels for collected packages: JPype1
  Building wheel for JPype1 (pyproject.toml) ... done
  Created wheel for JPype1: filename=JPype1-1.5.0-cp312-cp312-linux_aarch64.whl size=447131 sha256=b556d5f950b36f344888cee0c0c9454084fcd42241155381169257a29d6c357f
  Stored in directory: /home/ryan/.cache/pip/wheels/62/a4/75/36e26edddd69fa4006421979f7782fa8758f43797474fc7ef6
Successfully built JPype1
Installing collected packages: packaging, JPype1
Successfully installed JPype1-1.5.0 packaging-24.1
meijiesky commented 3 weeks ago

The log says error: command 'g++' failed: No such file or directory. Have you tried installing a c++ compiler and trying again?

This error occurs because it couldn't find the desired package and started to build from source but failed due to the lack of compiling environment. I would prefer to install the pre-built package since it is easier. The doc said it provides arm support for 1.2.1 and future releases but it seems the arm wheels are not built.

meijiesky commented 3 weeks ago

@marscher why is it closed????????????????????

marscher commented 3 weeks ago

I didn't even know we provide arm64 binaries out of the box. I think conda-forge does provide it (external build pipeline). The package there is called jpype1.

If you volunteer to look into it - fine give it a shot. I do not have the time to dig into it and I believe nobody of the volunteers working here for no cash have it at the moment. Watch your tone mate.

meijiesky commented 3 weeks ago

I didn't even know we provide arm64 binaries out of the box. I think conda-forge does provide it (external build pipeline). The package there is called jpype1.

If you volunteer to look into it - fine give it a shot. I do not have the time to dig into it and I believe nobody of the volunteers working here for no cash have it at the moment. Watch your tone mate.

I already posted the screen shot of the release note saying that aarch64 has been added to the built patterns for publication in this and future releases. If you didn't know, look at it, read it and realize there was something wrong instead of closing my issue.

Just because I asked you why you closed the issue, you ask me to watch my tone, LOL. Pathetic, mate.

image

mjsky481 commented 3 weeks ago

I didn't even know we provide arm64 binaries out of the box. I think conda-forge does provide it (external build pipeline). The package there is called jpype1.

If you volunteer to look into it - fine give it a shot. I do not have the time to dig into it and I believe nobody of the volunteers working here for no cash have it at the moment. Watch your tone mate.

Don't speak on behalf of the other volunteers. They are more helpful and better than you.

astrelsky commented 3 weeks ago

I didn't even know we provide arm64 binaries out of the box. I think conda-forge does provide it (external build pipeline). The package there is called jpype1.

If you volunteer to look into it - fine give it a shot. I do not have the time to dig into it and I believe nobody of the volunteers working here for no cash have it at the moment. Watch your tone mate.

Don't speak on behalf of the other volunteers. They are more helpful and better than you.

It takes all of two seconds to install g++ on linux. Having a c/c++ compiler available is expected when installing python packages. Minimal troubleshooting on your end would fix the problem. It is not feasible to provide pre-built wheels for every possible architecture/os combinations.

It also appears that you are using http://mirrors.cloud.aliyuncs.com so if it doesn't have the packages you need that is entirely on you.

I understand that the confusion may cause an emotional reaction but your response to this being closed was not appropriate.

mjsky481 commented 3 weeks ago

I didn't even know we provide arm64 binaries out of the box. I think conda-forge does provide it (external build pipeline). The package there is called jpype1. If you volunteer to look into it - fine give it a shot. I do not have the time to dig into it and I believe nobody of the volunteers working here for no cash have it at the moment. Watch your tone mate.

Don't speak on behalf of the other volunteers. They are more helpful and better than you.

It takes all of two seconds to install g++ on linux. Having a c/c++ compiler available is expected when installing python packages. Minimal troubleshooting on your end would fix the problem. It is not feasible to provide pre-built wheels for every possible architecture/os combinations.

It also appears that you are using http://mirrors.cloud.aliyuncs.com so if it doesn't have the packages you need that is entirely on you.

I understand that the confusion may cause an emotional reaction but your response to this being closed was not appropriate.

Asking why it is closed was "not appropriate". I don't understand what you are talking about here.

Is closing an issue without clarifying any of the questions "appropriate"? Is banning my account from the project just because I had questions on the aarch64 wheels "appropriate"?

Closing the issue means the posted question is fully understood and well answered. I don't see any of these when it's closed as completed. Let alone the person who closed it left no comment on the question.