[英]Issue with Intel compilation on macOS 10.15 Catalina : catastrophic error: cannot open source file "stdlib.h"
我拼命地嘗試用 c++ intel 編譯器 ( icpc
) 編譯一個簡單的代碼,我用來在我以前的 macBook 10.14 上編譯。
現在,由於 10.15 Catalina 不再存在 Headers,編譯器很難找到stdlib.h
。 這是我得到的輸出:
icpc -std=c++11 -O3 -xHost -fp-model strict -prec-div -prec-sqrt -fma -ftz -mp1 -qopenmp -Wall -c -I/opt/intel/compilers_and_libraries_2020.2.258/mac/mkl/include -mkl=parallel main.cpp -o main.o
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/math.h(301),
from /opt/intel/compilers_and_libraries_2020.2.258/mac/compiler/include/math.h(177),
from /Library/Developer/CommandLineTools/usr/include/c++/v1/cmath(304),
from TSAF.h(1),
from main.cpp(1):
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h(20): catastrophic error: cannot open source file "stdlib.h"
#include_next <stdlib.h>
^
compilation aborted for main.cpp (code 4)
make: *** [Makefile:13: main.o] Error 4
./main_intel.exe: No such file or directory
我從網上嘗試了很多潛在的解決方法,但都沒有奏效。 我想通過刪除我的 MacBook 的安全系統來避免創建目錄/usr/include/
。
我想也許這可以通過下載 XCode_12.0.1 來工作,但同樣的問題仍然存在。
目前,我有 Catalina OS 10.15.7 版本,所有內容都已更新。
編輯 1:有些我不明白:在我以前的 macBook 10.14 上,我不需要使用 clang c++ 的頭文件進行 intel 編譯。
如果有人能給我一個建議/線索/跟蹤,那就沒問題了。
在終端中運行命令
sudo xcode-select --reset
然后檢查是否選擇了正確的開發人員工具而不是命令行工具
xcode-select -p
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.