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

missing limits.h during install #3353

Closed
sjanssen2 opened this issue Feb 14, 2024 · 1 comment · Fixed by #3354
Closed

missing limits.h during install #3353

sjanssen2 opened this issue Feb 14, 2024 · 1 comment · Fixed by #3354

Comments

@sjanssen2
Copy link
Contributor

sudo apt install gcc # alternatively, you can install clang instead

I just set up a new virtual machine, Linux Mint, which is based on Ubuntu Jammy and followed the installation instructions.
I hit an issue with pip install . --no-binary redbiom which failed to compile with the error message:

gcc -pthread -B /home/qiita/miniforge3/envs/qiita/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/qiita/miniforge3/envs/qiita/include -fPIC -O2 -isystem /home/qiita/miniforge3/envs/qiita/include -fPIC "-DPSYCOPG_VERSION=2.9.9 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=130014 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/home/qiita/miniforge3/envs/qiita/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-39/psycopg/adapter_asis.o -Wdeclaration-after-statement
      In file included from /usr/include/postgresql/limits.h:34,
                       from /home/qiita/miniforge3/envs/qiita/include/python3.9/Python.h:11,
                       from ./psycopg/psycopg.h:35,
                       from psycopg/adapter_asis.c:28:
      /usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h:7:15: fatal error: limits.h: No such file or directory
          7 | #include_next <limits.h>
            |               ^~~~~~~~~~
      compilation terminated.
      
      It appears you are missing some prerequisite to build the package from source.
      
      You may install a binary package by installing 'psycopg2-binary' from PyPI.
      If you want to install psycopg2 from source, please install the packages
      required for the build and try again.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
      
      error: command '/usr/bin/gcc' failed with exit code 1

It turned out, that the machine had gcc but no g++ installed. After adding thus, installation ran smoothly. I therefor recommend adding g++ in line 167 to the install instructions.

@antgonza
Copy link
Member

Thank you @sjanssen2, I think that sounds good. Could you issue a PR adding that dependency to the instructions?

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

Successfully merging a pull request may close this issue.

2 participants