简体   繁体   English

macOS 10.15 Catalina 上的 Intel 编译问题:灾难性错误:无法打开源文件“stdlib.h”

[英]Issue with Intel compilation on macOS 10.15 Catalina : catastrophic error: cannot open source file "stdlib.h"

I try desperatly to compile with c++ intel compiler ( icpc ) a simple code that I was used to compile on my previous macBook 10.14.我拼命地尝试用 c++ intel 编译器 ( icpc ) 编译一个简单的代码,我用来在我以前的 macBook 10.14 上编译。

Now, since Headers don't exist anymore with 10.15 Catalina, the compiler has difficulties to find stdlib.h .现在,由于 10.15 Catalina 不再存在 Headers,编译器很难找到stdlib.h Here the output I get :这是我得到的输出:

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

I tried a lot of potential workarounds from the net but none works.我从网上尝试了很多潜在的解决方法,但都没有奏效。 I would like to avoid to create a directory /usr/include/ by removing the security system of my macBook.我想通过删除我的 MacBook 的安全系统来避免创建目录/usr/include/

I thought maybe this would work by downloading XCode_12.0.1 but same problems remain.我想也许这可以通过下载 XCode_12.0.1 来工作,但同样的问题仍然存在。

For the moment, I have the version Catalina OS 10.15.7, all has been updated.目前,我有 Catalina OS 10.15.7 版本,所有内容都已更新。

EDIT 1: There is something that I don't understand : on my previous macBook 10.14, I didn't need to use the headers of clang c++ for intel compilation.编辑 1:有些我不明白:在我以前的 macBook 10.14 上,我不需要使用 clang c++ 的头文件进行 intel 编译。

If anyone could give me a suggestion/clue/track, this would be fine.如果有人能给我一个建议/线索/跟踪,那就没问题了。

Run the command in the Terminal在终端中运行命令

sudo xcode-select --reset

And then check if proper developer tools are selected instead of the command line tools然后检查是否选择了正确的开发人员工具而不是命令行工具

xcode-select -p

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 灾难性错误:无法打开源文件“stdlib.h” - catastrophic error: cannot open source file "stdlib.h" Windows上的Intel C ++编译器发生灾难性错误:无法打开源文件“ bits / unique_ptr.h” - Intel C++ compiler on Windows catastrophic error: cannot open source file “bits/unique_ptr.h” 无法在Visual Studio 2010中打开包含文件&#39;stdlib.h&#39; - Cannot open include file 'stdlib.h' in Visual Studio 2010 致命错误:stdlib.h:没有这样的文件或目录 - fatal error: stdlib.h: No such file or directory 75:15:致命错误:stdlib.h:没有这样的文件或目录#include_next <stdlib.h> - 75:15: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h> 无法在 mint 20.1 上编译:stdlib.h:没有这样的文件或目录 - cannot compile on mint 20.1: stdlib.h: No such file or directory / usr / include / c ++ / 7 / cstdlib:75:15:致命错误:stdlib.h:没有这样的文件或目录#include_next <stdlib.h> - /usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h> /usr/include/c++/8/cstdlib:75:15:致命错误:stdlib.h:没有这样的文件或目录 - /usr/include/c++/8/cstdlib:75:15: fatal error: stdlib.h: No such file or directory Visual Studio 2010不能包含stdlib.h - visual studio 2010 cannot include stdlib.h mingw / include / c ++ / cstdlib:stdlib.h:没有这样的文件或目录 - mingw/include/c++/cstdlib: stdlib.h: No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM