Compiling OpenMPI with AOCC clang (configure error: no working posix pthread package)
Compiling OpenMPI with AOCC clang (configure error: no working posix pthread package)
我正在尝试在八核 AMD Ryzen CPU (1700) 上构建 OpenMPI。我已经下载并安装了 AOCC bundle of compilers. The OpenMPI version that I am trying to compile is a clone of the master branch.
导致问题的步骤:
- 来源setenv_AOCC.sh(这设置了 AOCC 包(通过污染您的环境))
- cd 进入构建目录
- $ompisrcdir/configure CC=clang --prefix="$HOME/$localmpiinst"
继续配置直到:
checking for _SC_NPROCESSORS_ONLN... yes
checking whether byte ordering is bigendian... no
checking for broken qsort... no
checking if C compiler and POSIX threads work as is... no
checking if C++ compiler and POSIX threads work as is... no
checking if Fortran 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... no
checking if C++ compiler and POSIX threads work with -pthreads... no
checking if C++ compiler and POSIX threads work with -mt... no
checking if C++ compiler and POSIX threads work with -mthreads... no
checking if Fortran compiler and POSIX threads work with -Kthread... no
checking if Fortran compiler and POSIX threads work with -kthread... no
checking if Fortran compiler and POSIX threads work with -pthread... yes
checking if C++ compiler and POSIX threads work with -lpthreads... no
checking if C++ compiler and POSIX threads work with -llthread... no
checking if C++ compiler and POSIX threads work with -lpthread... no
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... no
configure: WARNING: "*** POSIX threads are not"
configure: WARNING: "*** available on your system "
configure: error: "*** Can not continue"
所以,它死于检查 POSIX 线程 C++ 支持。
clang 的输出 --version:
AOCC.LLVM.1.3.0.B34.2018_10_22 clang version 7.0.0 (CLANG: Jenkins
AOCC_1_3_0_Release-Build#34) (based on LLVM AOCC.LLVM.1.3.0.B34.2018_10_22)
Target: x86_64-unknown-linux-gnu
好吧,其实解决方法很简单。
我应该向配置脚本提供 CXX 标志。所以,而不是,
$ompisrcdir/configure CC=clang --prefix="$HOME/$localmpiinst"
以下作品,
$ompisrcdir/configure CC=clang **CXX=clang++** --prefix="$HOME/$localmpiinst"
我正在尝试在八核 AMD Ryzen CPU (1700) 上构建 OpenMPI。我已经下载并安装了 AOCC bundle of compilers. The OpenMPI version that I am trying to compile is a clone of the master branch.
导致问题的步骤:
- 来源setenv_AOCC.sh(这设置了 AOCC 包(通过污染您的环境))
- cd 进入构建目录
- $ompisrcdir/configure CC=clang --prefix="$HOME/$localmpiinst"
继续配置直到:
checking for _SC_NPROCESSORS_ONLN... yes
checking whether byte ordering is bigendian... no
checking for broken qsort... no
checking if C compiler and POSIX threads work as is... no
checking if C++ compiler and POSIX threads work as is... no
checking if Fortran 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... no
checking if C++ compiler and POSIX threads work with -pthreads... no
checking if C++ compiler and POSIX threads work with -mt... no
checking if C++ compiler and POSIX threads work with -mthreads... no
checking if Fortran compiler and POSIX threads work with -Kthread... no
checking if Fortran compiler and POSIX threads work with -kthread... no
checking if Fortran compiler and POSIX threads work with -pthread... yes
checking if C++ compiler and POSIX threads work with -lpthreads... no
checking if C++ compiler and POSIX threads work with -llthread... no
checking if C++ compiler and POSIX threads work with -lpthread... no
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... no
configure: WARNING: "*** POSIX threads are not"
configure: WARNING: "*** available on your system "
configure: error: "*** Can not continue"
所以,它死于检查 POSIX 线程 C++ 支持。
clang 的输出 --version:
AOCC.LLVM.1.3.0.B34.2018_10_22 clang version 7.0.0 (CLANG: Jenkins
AOCC_1_3_0_Release-Build#34) (based on LLVM AOCC.LLVM.1.3.0.B34.2018_10_22)
Target: x86_64-unknown-linux-gnu
好吧,其实解决方法很简单。
我应该向配置脚本提供 CXX 标志。所以,而不是,
$ompisrcdir/configure CC=clang --prefix="$HOME/$localmpiinst"
以下作品,
$ompisrcdir/configure CC=clang **CXX=clang++** --prefix="$HOME/$localmpiinst"