![¿No hay soporte para pthreads de C++ en la granja de compilación?](https://rvso.com/image/1466411/%C2%BFNo%20hay%20soporte%20para%20pthreads%20de%20C%2B%2B%20en%20la%20granja%20de%20compilaci%C3%B3n%3F.png)
Estoy intentando compilar algo de código en una granja de compilación. Cuando lo construyo en mi máquina de desarrollo, todo va bien:
checking if C compiler and POSIX threads work as is... no
checking if C++ compiler and POSIX threads work as is... no
checking if C compiler and POSIX threads work with -Kthread... no
checking if C compiler and POSIX threads work with -kthread... no
checking if C compiler and POSIX threads work with -pthread... yes
checking if C++ compiler and POSIX threads work with -Kthread... no
checking if C++ compiler and POSIX threads work with -kthread... no
checking if C++ compiler and POSIX threads work with -pthread... yes
checking for pthread_mutexattr_setpshared... yes
checking for pthread_condattr_setpshared... yes
checking for PTHREAD_MUTEX_ERRORCHECK_NP... yes
checking for PTHREAD_MUTEX_ERRORCHECK... yes
checking for working POSIX threads package... yes
Pero cuando se lo entrego a la granja de compilación, no encuentra una opción de compilación que funcione para habilitar la compatibilidad con pthread:
[ 87s] checking if C compiler and POSIX threads work as is... no
[ 87s] checking if C++ compiler and POSIX threads work as is... no
[ 87s] checking if C compiler and POSIX threads work with -Kthread... no
[ 87s] checking if C compiler and POSIX threads work with -kthread... no
[ 87s] checking if C compiler and POSIX threads work with -pthread... yes
[ 87s] checking if C++ compiler and POSIX threads work with -Kthread... no
[ 87s] checking if C++ compiler and POSIX threads work with -kthread... no
[ 87s] checking if C++ compiler and POSIX threads work with -pthread... no
[ 87s] checking if C++ compiler and POSIX threads work with -pthreads... no
[ 87s] checking if C++ compiler and POSIX threads work with -mt... no
[ 87s] checking if C++ compiler and POSIX threads work with -mthreads... no
[ 87s] checking if C++ compiler and POSIX threads work with -lpthreads... no
[ 87s] checking if C++ compiler and POSIX threads work with -llthread... no
[ 87s] checking if C++ compiler and POSIX threads work with -lpthread... no
[ 87s] checking for pthread_mutexattr_setpshared... yes
[ 87s] checking for pthread_condattr_setpshared... yes
[ 87s] checking for PTHREAD_MUTEX_ERRORCHECK_NP... yes
[ 87s] checking for PTHREAD_MUTEX_ERRORCHECK... yes
[ 87s] checking for working POSIX threads package... no
[ 87s] configure: WARNING: "*** POSIX threads are not"
[ 87s] configure: WARNING: "*** available on your system "
[ 87s] configure: error: "*** Can not continue"
La caja de desarrollo y la granja de compilación utilizan el mismo sistema operativo base; la única diferencia es que el entorno en la granja de compilación es mínimo: solo se instalan los paquetes requeridos por el archivo de especificaciones encima de un pequeño conjunto de paquetes del sistema operativo base.
No se me ocurre ningún "paquete faltante" que pueda causar este comportamiento. glibc-* están instalados en ambos.
Respuesta1
Crédito / fuente real:https://forums.opensuse.org/showthread.php/509781-No-C-Pthread-support-inside-OBSpor wolfi323
Encontré un problema similar al intentar configurar [Open MPI 3] con:
./configure CC=gcc CXX=gcc FC=gfortran
La respuesta de wolfi323 en forums.opensuse implica que elEl compilador de C++ no se especificó adecuadamente.. Dejé las opciones del compilador c/c++ en blanco:
./configure FC=gfortran
la configuración informó:
checking if C++ compiler and POSIX threads work with -Kthread... no
checking if C++ compiler and POSIX threads work with -kthread... no
checking if C++ compiler and POSIX threads work with -pthread... yes
y completado.
Extra
Configuración
CC=gcc CXX=g++
arrojó resultados iguales o similares a los de permitir que ./configure encuentre los compiladores predeterminados.