# rm-rf.es

Solaris: No such file or directory limits.h

Un error similar al siguiente se puede presentar en sistemas Solaris durante una compilación:

/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
#include_next   /* recurse down to the real one */
                                                                
compilation terminated.
error: command '/opt/csw/bin/gcc-5.2' failed with exit status 1

En mi caso, el error se presentaba al instalar unos módulos de python vía pip. La compilación falla por no encontrar las fuentes/fichero de cabeceras limits.h. Lo que podemos hacer inicialmente es lanzar una búsqueda para confirmar si efectivamente no tenemos ese archivo en el sistema:

root@solaris:~# find / -type f -name limits.h
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/install-tools/include/limits.h
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/include-fixed/limits.h
/opt/csw/include/c++/4.9.2/tr1/limits.h
/usr/sfw/lib/gcc/sparc-sun-solaris2.11/3.4.3/install-tools/include/limits.h

Se podría decir que lo tenemos, y varias veces, pero realmente el que está buscando es el de las fuentes del propio sistema solaris, no de compiladores añadidos como los que ha mostrado en la salida anterior. Si os sale un error similar a este, el fallo es mucho más claro:

/usr/include/limits.h: No such file or directory

¿Cómo instalamos ese archivo? Si lanzamos una búsqueda al repositorio con pkg search, veremos que forma parte del paquete de base de cabeceras del sistema system/header:

root@foo:~# pkg search -r limits.h
INDEX      ACTION VALUE                                                                          PACKAGE
basename   file   usr/sfw/lib/gcc/sparc-sun-solaris2.11/3.4.3/install-tools/include/limits.h     pkg:/developer/gcc-3@3.4.3-0.175.2.0.0.42.1
basename   file   usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/install-tools/include/limits.h       pkg:/developer/gcc-3@3.4.3-0.175.2.0.0.42.1
basename   file   usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/install-tools/include/limits.h pkg:/developer/gcc-4/gcc-common-48@4.8.2-0.175.2.0.0.42.1
basename   file   usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/include-fixed/limits.h         pkg:/developer/gcc-4/gcc-common-48@4.8.2-0.175.2.0.0.42.1
basename   file   usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/install-tools/include/limits.h   pkg:/developer/gcc-4/gcc-common-48@4.8.2-0.175.2.0.0.42.1
basename   file   usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/include-fixed/limits.h           pkg:/developer/gcc-4/gcc-common-48@4.8.2-0.175.2.0.0.42.1
basename   file   usr/perl5/vendor_perl/5.12/i86pc-solaris-64int/Tk/pTk/compat/limits.h          pkg:/library/perl5/perl-tk-512@804.31-0.175.2.0.0.42.1
basename   file   usr/perl5/vendor_perl/5.12/sun4-solaris-64int/Tk/pTk/compat/limits.h           pkg:/library/perl5/perl-tk-512@804.31-0.175.2.0.0.42.1
basename   file   usr/include/limits.h                                                           pkg:/system/header@0.5.11-0.175.2.0.0.42.2
basename   file   usr/gcc/4.7/include/c++/4.7.3/tr1/limits.h                                     pkg:/developer/gcc-4/gcc-c++-47@4.7.3-0.175.2.0.0.42.1
basename   file   usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/include-fixed/limits.h           pkg:/developer/gcc-45@4.5.2-0.175.2.0.0.42.1
basename   file   usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/install-tools/include/limits.h   pkg:/developer/gcc-45@4.5.2-0.175.2.0.0.42.1
basename   file   usr/gcc/4.5/lib/gcc/sparc-sun-solaris2.11/4.5.2/include-fixed/limits.h         pkg:/developer/gcc-45@4.5.2-0.175.2.0.0.42.1
basename   file   usr/gcc/4.5/lib/gcc/sparc-sun-solaris2.11/4.5.2/install-tools/include/limits.h pkg:/developer/gcc-45@4.5.2-0.175.2.0.0.42.1
basename   file   usr/gcc/4.5/include/c++/4.5.2/tr1/limits.h                                     pkg:/developer/gcc-45@4.5.2-0.175.2.0.0.42.1
basename   file   usr/gcc/4.8/include/c++/4.8.2/tr1/limits.h                                     pkg:/developer/gcc-4/gcc-c++-48@4.8.2-0.175.2.0.0.42.1
basename   file   usr/gcc/4.7/lib/gcc/sparc-sun-solaris2.11/4.7.3/install-tools/include/limits.h pkg:/developer/gcc-4/gcc-common-47@4.7.3-0.175.2.0.0.42.1
basename   file   usr/gcc/4.7/lib/gcc/sparc-sun-solaris2.11/4.7.3/include-fixed/limits.h         pkg:/developer/gcc-4/gcc-common-47@4.7.3-0.175.2.0.0.42.1
basename   file   usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/include-fixed/limits.h           pkg:/developer/gcc-4/gcc-common-47@4.7.3-0.175.2.0.0.42.1
basename   file   usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/install-tools/include/limits.h   pkg:/developer/gcc-4/gcc-common-47@4.7.3-0.175.2.0.0.42.1

Basta entonces con instalar ese paquete y al compilar ya no deberíamos recibir el error:

root@foo:~# pkg install pkg:/system/header

Tras instalar, ya está disponible el archivo limits.h:

root@foo:~# ls -l /usr/include/limits.h 
-rw-r--r--   1 root     bin         9681 May 28 01:37 /usr/include/limits.h
Salir de la versión móvil