qiita icon indicating copy to clipboard operation
qiita copied to clipboard

missing `limits.h` during install

Open sjanssen2 opened this issue 1 year ago • 1 comments
trafficstars

https://github.com/qiita-spots/qiita/blob/57d1b146729223da9daa286a1cc75db6f2923746/INSTALL.md?plain=1#L167

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.

sjanssen2 avatar Feb 14 '24 12:02 sjanssen2