Keine C++-Pthread-Unterstützung in der Build-Farm?

Keine C++-Pthread-Unterstützung in der Build-Farm?

Ich versuche, Code in einer Build-Farm zu kompilieren. Wenn ich ihn auf meiner Entwicklungsmaschine kompiliere, läuft alles reibungslos:

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

Aber wenn ich es an die Build-Farm weitergebe, findet es keine funktionierende Compiler-Option zum Aktivieren der Pthread-Unterstützung:

[   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"

Die Dev-Box und die Buildfarm verwenden dasselbe Basisbetriebssystem. Der einzige Unterschied besteht darin, dass die Umgebung auf der Buildfarm sehr minimal ist und nur die in der Spezifikationsdatei erforderlichen Pakete zusätzlich zu einem kleinen Satz von Basisbetriebssystempaketen installiert.

Mir fällt kein „fehlendes Paket“ ein, das dieses Verhalten verursachen würde. glibc-* ist auf beiden installiert.

Antwort1

Tatsächlicher Kredit / Quelle:https://forums.opensuse.org/showthread.php/509781-No-C-Pthread-support-inside-OBSvon wolfi323

Ich bin auf ein ähnliches Problem gestoßen, als ich versucht habe, [Open MPI 3] mit Folgendem zu konfigurieren:

./configure CC=gcc CXX=gcc FC=gfortran

Die Antwort von wolfi323 auf forums.opensuse impliziert, dass dieDer C++-Compiler wurde nicht ausreichend spezifiziert. Ich habe die C/C++-Compileroptionen leer gelassen:

./configure FC=gfortran

die Konfiguration meldete:

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

und abgeschlossen.

Extra

Einstellung

CC=gcc CXX=g++

führte zu denselben/ähnlichen Ergebnissen, als wenn man ./configure die Standardcompiler suchen ließe.

verwandte Informationen