建構農場中沒有 C++ pthread 支援嗎?

建構農場中沒有 C++ pthread 支援嗎?

我正在嘗試在建置場中編譯一些程式碼。當我在我的開發機器上建立它時,事情進展順利:

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

但是當我將其交給建置場時,它無法找到可用的編譯器選項來啟用 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"

開發盒和 buildfarm 使用相同的基本作業系統 - 唯一的區別是 buildfarm 上的環境非常小,僅在一小組基本作業系統軟體包之上安裝規範檔案所需的軟體包。

我想不出任何“丟失的包”會導致這種行為。 glibc-* 都安裝在兩者上。

答案1

實際信用/來源:https://forums.opensuse.org/showthread.php/509781-No-C-Pthread-support-inside-OBS通過 沃爾夫323

我在嘗試配置 [Open MPI 3] 時遇到了類似的問題:

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

Wolfi323 在 forums.opensuse 上的回答意味著c++ 編譯器未充分指定。我將 c/c++ 編譯器選項留空:

./configure FC=gfortran

配置報告:

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

並完成。

額外的

環境

CC=gcc CXX=g++

產生與讓 ./configure 尋找預設編譯器相同/相似的結果。

相關內容