ビルド ファームで 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"

開発ボックスとビルドファームは同じベース OS を使用しています。唯一の違いは、ビルドファームの環境が非常に最小限であり、少数のベース OS パッケージの上に、仕様ファイルで必要なパッケージのみがインストールされることです。

この動作を引き起こす「不足しているパッケージ」は考えられません。 glibc-* は両方にインストールされています。

答え1

実際のクレジット/ソース:https://forums.opensuse.org/showthread.php/509781-No-C-Pthread-support-inside-OBSwolfi323 より

[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 でデフォルトのコンパイラーを検索した場合と同じ/類似の結果が得られました。

関連情報