Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error under GCC 14 #414

Open
gus4rs opened this issue Aug 26, 2024 · 4 comments
Open

Compilation error under GCC 14 #414

gus4rs opened this issue Aug 26, 2024 · 4 comments

Comments

@gus4rs
Copy link

gus4rs commented Aug 26, 2024

Linux F40 6.10.6-200.fc40.aarch64 (Fedora 40)
gcc (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1)

When doing pip3 install -r requirements.txt, it causes a C compilation error:

Building wheels for collected packages: lru-dict
  Building wheel for lru-dict (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for lru-dict (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'lru' extension
      creating build
      creating build/temp.linux-aarch64-cpython-310
      gcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fexceptions -fexceptions -fPIC -I/home/koinpeer/staking-deposit-cli/venv/include -I/usr/include/python3.10 -c lru.c -o build/temp.linux-aarch64-cpython-310/lru.o
      lru.c:629:17: error: initialization of ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} from incompatible pointer type ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} [-Wincompatible-pointer-types]
        629 |     {"popitem", (PyCFunctionWithKeywords)LRU_popitem, METH_VARARGS | METH_KEYWORDS,
            |                 ^
      lru.c:629:17: note: (near initialization for ‘LRU_methods[8].ml_meth’)
      error: command '/usr/lib64/ccache/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 lru-dict
Failed to build lru-dict
@yorickdowne
Copy link
Contributor

@gus4rs Can I ask you to try this against our fork please. I don’t have a Fedora and am interested to know whether it’s working. We’ve updated all dependencies throughout, which may be good enough.

https://github.com/eth-educators/ethstaker-deposit-cli

@gus4rs
Copy link
Author

gus4rs commented Aug 29, 2024

The issue is some compiler warnings are now errors in GCC 14.x. I manage to "solve" the compilation problem by using

CFLAGS=-Wno-incompatible-pointer-types pip3 install -r requirements.txt

@gus4rs
Copy link
Author

gus4rs commented Aug 29, 2024

BTW, your branch works fine

@yorickdowne
Copy link
Contributor

Thanks for testing that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@yorickdowne @gus4rs and others