0

It seems that any gcc created with crosstool-ng is missing omp.h, is there a way to solve this issue?

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.

If I use arm-linux-gnueabi-gcc, which I installed with apt-get directly in Ubuntu I don't get this error.

tgonzalez89
  • 621
  • 1
  • 6
  • 26
  • 1
    Did you try to add `-fopenmp` option to `gcc`? – Mathieu Jul 12 '18 at 08:31
  • 1
    When building crosstool-ng, did you enable openmp? (`./configure --enable-libgomp`) see: https://stackoverflow.com/a/49023600/1212012 – Mathieu Jul 12 '18 at 08:37
  • @purplepsycho I tried compiling my program with -fopenmp, yes. It seems the issue is the configure for crosstool-ng, I didn't enable openmp... Do I need to re-compile everything from scratch? – tgonzalez89 Jul 12 '18 at 17:17
  • `--enable-libgomp` doesn't work for me: `configure: WARNING: unrecognized options: --enable-libgomp` – tgonzalez89 Jul 12 '18 at 17:22

1 Answers1

2

Solution:

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

./ct-ng menuconfig -> C compiler -> Compile libgomp (enable pressing < y >). Save changes.

./ct-ng build

This will enable the LIBGOMP option in the .config file:

tomas@ubuntu:~/crosstool-ng$ grep LIBGOMP .config*
.config:CT_CC_GCC_LIBGOMP=y
.config.old:# CT_CC_GCC_LIBGOMP is not set
tgonzalez89
  • 621
  • 1
  • 6
  • 26