bytedeco / javacpp-presets

The missing Java distribution of native C++ libraries
Other
2.65k stars 737 forks source link

buiild numpy Failed #1415

Open machh opened 11 months ago

machh commented 11 months ago

When I was build the numpy module of the javacpp-presets on the aarch64 platform,

after mvn clean install

I encountered an error,


WARNING: Target directory /root/.javacpp/cache/cpython-3.7.7-1.5.3-linux-arm64.jar/org/bytedeco/cpython/linux-arm64/lib/python3.7/pycache already exists. Specify --upgrade to force replacement. WARNING: Target directory /root/.javacpp/cache/cpython-3.7.7-1.5.3-linux-arm64.jar/org/bytedeco/cpython/linux-arm64/lib/python3.7/pyximport already exists. Specify --upgrade to force replacement. WARNING: Target directory /root/.javacpp/cache/cpython-3.7.7-1.5.3-linux-arm64.jar/org/bytedeco/cpython/linux-arm64/lib/python3.7/Cython already exists. Specify --upgrade to force replacement. WARNING: Target directory /root/.javacpp/cache/cpython-3.7.7-1.5.3-linux-arm64.jar/org/bytedeco/cpython/linux-arm64/lib/python3.7/Cython-3.0.2.dist-info already exists. Specify --upgrade to force replacement. WARNING: Target directory /root/.javacpp/cache/cpython-3.7.7-1.5.3-linux-arm64.jar/org/bytedeco/cpython/linux-arm64/lib/python3.7/cython.py already exists. Specify --upgrade to force replacement. WARNING: Target directory /root/.javacpp/cache/cpython-3.7.7-1.5.3-linux-arm64.jar/org/bytedeco/cpython/linux-arm64/lib/python3.7/bin already exists. Specify --upgrade to force replacement. WARNING: You are using pip version 19.2.3, however version 23.2.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. Running from numpy source directory. Cythonizing sources Processing numpy/random/_bounded_integers.pxd.in Processing numpy/random/_pcg64.pyx warning: /home/javacpp-presets-1.5.3/numpy/cppbuild/linux-arm64/numpy-1.18.2/numpy/init.pxd:17:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310

Error compiling Cython file:

... def init(self, seed=None): BitGenerator.init(self, seed) self.rng_state.pcg_state = &self.pcg64_random_state

    self._bitgen.state = <void *>&self.rng_state
    self._bitgen.next_uint64 = &pcg64_uint64
                               ^

_pcg64.pyx:113:35: Cannot assign type 'uint64_t ()(void ) except? -1 nogil' to 'uint64_t ()(void ) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'uint64_t (void *) except? -1 nogil'. Traceback (most recent call last): File "/home/javacpp-presets-1.5.3/numpy/cppbuild/linux-arm64/numpy-1.18.2/tools/cythonize.py", line 238, in main() File "/home/javacpp-presets-1.5.3/numpy/cppbuild/linux-arm64/numpy-1.18.2/tools/cythonize.py", line 234, in main find_process_files(root_dir) File "/home/javacpp-presets-1.5.3/numpy/cppbuild/linux-arm64/numpy-1.18.2/tools/cythonize.py", line 225, in find_process_files process(root_dir, fromfile, tofile, function, hash_db) File "/home/javacpp-presets-1.5.3/numpy/cppbuild/linux-arm64/numpy-1.18.2/tools/cythonize.py", line 191, in process processor_function(fromfile, tofile) File "/home/javacpp-presets-1.5.3/numpy/cppbuild/linux-arm64/numpy-1.18.2/tools/cythonize.py", line 81, in process_pyx [sys.executable, '-m', 'cython'] + flags + ["-o", tofile, fromfile]) File "/root/.javacpp/cache/cpython-3.7.7-1.5.3-linux-arm64.jar/org/bytedeco/cpython/linux-arm64/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/root/.javacpp/cache/cpython-3.7.7-1.5.3-linux-arm64.jar/org/bytedeco/cpython/linux-arm64/bin/python3.7', '-m', 'cython', '-3', '--fast-fail', '-o', '_pcg64.c', '_pcg64.pyx']' returned non-zero exit status 1. Traceback (most recent call last): File "setup.py", line 488, in setup_package() File "setup.py", line 469, in setup_package generate_cython() File "setup.py", line 275, in generate_cython raise RuntimeError("Running cythonize failed!") RuntimeError: Running cythonize failed! [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE

Moreover, it seems that cpython has already been build successfully.

CPYTHON_PATH is : /home/javacpp-presets-1.5.3/numpy/cppbuild/linux-arm64/../../../cpython/cppbuild/linux-arm64/

and

ll /home/javacpp-presets-1.5.3/numpy/cppbuild/linux-arm64/../../../cpython/cppbuild/linux-arm64/ total 28 drwxr-xr-x 19 501 501 4096 Sep 15 07:39 Python-3.7.7 drwxr-xr-x 2 root root 4096 Sep 15 07:39 bin drwxr-xr-x 6 root root 4096 Sep 15 07:38 host drwxr-xr-x 4 root root 4096 Sep 15 07:39 include drwxr-xr-x 5 root root 4096 Sep 15 07:39 lib drwxrwxr-x 18 root root 4096 Sep 15 07:38 openssl-1.1.1f drwxr-xr-x 3 root root 4096 Sep 15 07:39 share`

saudet commented 11 months ago

Cython 3.x isn't supported by that version of NumPy

machh commented 11 months ago

@saudet
thanks for your reply.

Cython and NumPy are both modules under the javacpp-presets-1.5.3 project, and Cython has also been compiled from javacpp-presets-1.5.3 cppbuild.sh script.

So, how should I solve this problem?

saudet commented 11 months ago

I'd recommend using the latest version of NumPy