configure: error: C compiler cannot create executables See `config.log' for more details

在mac下安裝MPI,此前電腦已經安裝了GCC;
安裝以下博客的說明來安裝MPI。
https://blog.csdn.net/yaochuyi/article/details/86939352

S1 雙擊解壓下載的文件openmpi-4.0.0.tar.gz
S2 打開cmd,cd到解壓的文件夾。
S3 輸入 cd /Users/ycy/Desktop/openmpi-4.0.0
S4 安裝在/usr/local下,執行./configure。
S5 輸入 ./configure --prefix=/usr/local

但發現,出錯了,錯誤如下:

*** Startup tests
checking build system type... x86_64-apple-darwin18.5.0
checking host system type... x86_64-apple-darwin18.5.0
checking target system type... x86_64-apple-darwin18.5.0
checking for gcc... x86_64-apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in `/Users/xxx/openmpi-4.0.2':
configure: error: C compiler cannot create executables
See `config.log' for more details

C編譯器出了問題?但我的GCC明明正確安裝了。
查了下,可能是權限問題。於是將S5的命令改爲
sudo ./configure --prefix=/usr/local
然後,就不再出現提示的錯誤了。安裝成功。
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章