src-d / lapjv

Linear Assignmment Problem solver using Jonker-Volgenant algorithm - Python 3 native module.
MIT License
252 stars 29 forks source link

Unable to install 1.3.26 with Python3.12 #88

Closed raphaelreme closed 3 months ago

raphaelreme commented 3 months ago

Hi,

It seems that the PR https://github.com/src-d/lapjv/pull/87 is breaking the installation for Python3.12 on Ubuntu.

I had the error on github actions with Ubuntu-latest and python3.12 but I'm able to reproduce it with Conda, Python 3.12 and Ubuntu 20.04.

Here is how to reproduce the error using a conda environment on Ubuntu:

$ conda create -n lapjv python=3.12
$ conda activate lapjv
$ pip install lapjv  # Will fail (See the following error message)
$ pip install lapjv==1.3.257  # Will work

The error message:

Collecting lapjv
  Using cached lapjv-1.3.26.tar.gz (10 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting numpy>=1.20.0 (from lapjv)
  Using cached numpy-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
Using cached numpy-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.0 MB)
Building wheels for collected packages: lapjv
  Building wheel for lapjv (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for lapjv (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'lapjv' extension
      creating build
      creating build/temp.linux-x86_64-cpython-312
      gcc -pthread -B /home/rreme/miniconda3/envs/lapjv/compiler_compat -fno-strict-overflow -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/rreme/miniconda3/envs/lapjv/include -fPIC -O2 -isystem /home/rreme/miniconda3/envs/lapjv/include -fPIC -I/tmp/pip-build-env-l9965rvc/overlay/lib/python3.12/site-packages/numpy/_core/include -I/home/rreme/miniconda3/envs/lapjv/include/python3.12 -c python.cc -o build/temp.linux-x86_64-cpython-312/python.o -fopenmp -std=c++17 -mavx2 -ftree-vectorize -march=haswell -maes -mno-pku -mno-sgx --param l1-cache-line-size=64 --param l1-cache-size=32 --param l2-cache-size=33792 -mabm
      python.cc:6:10: fatal error: cpu_id.h: No such file or directory
          6 | #include "cpu_id.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for lapjv
Failed to build lapjv
ERROR: Could not build wheels for lapjv, which is required to install pyproject.toml-based projects
vmarkovtsev commented 3 months ago

@joerowell It looks like we must list cpu_id.h somewhere so that it is included in the source distribution.

... found it - in MANIFEST.in