0

似乎使用 crosstool-ng 创建的任何 gcc 都缺少 omp.h,有没有办法解决这个问题?

tomas@ubuntu:~/eHHAlgorithm/infoli_static$ /home/tomas/x-tools/arm-unknown-linux-uclibcgnueabi/bin/arm-unknown-linux-uclibcgnueabi-gcc infoli.c main.c -o infoli_arm_ns100_ss10_noout_nobench -lm -O3 -DNETWORK_SIZE=100 -DSIMULATION_STEPS=10 -DNO_OUTPUT -DNO_BENCH -static
infoli.c:3:10: fatal error: omp.h: No such file or directory
 #include <omp.h>
          ^~~~~~~
compilation terminated.

如果我使用arm-linux-gnueabi-gccapt-get 直接在 Ubuntu 中安装,我不会收到此错误。

4

1 回答 1

2

解决方案:

./ct-ng arm-unknown-linux-uclibcgnueabi

./ct-ng menuconfig -> C compiler -> Compile libgomp(启用按 < y >)。保存更改。

./ct-ng build

这将启用文件LIBGOMP中的选项.config

tomas@ubuntu:~/crosstool-ng$ grep LIBGOMP .config*
.config:CT_CC_GCC_LIBGOMP=y
.config.old:# CT_CC_GCC_LIBGOMP is not set
于 2018-07-12T19:19:58.440 回答