nardis_miles
nardis_miles

Reputation: 21

openmpi-4.1.5 issues witrh finding mpi.h

I'm running kubuntu 22.04 on a framework laptop.

I have just built openmpi-4.1.5, and installed it in /opt. When I run a 'Hello World' program compiling with mpicc, which points to the correct file, I get

mpi_test.c:1:10: fatal error: mpi.h: No such file or directory 1 | #include <mpi.h>

. When I issue mpicc -showme gcc -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi -lopen-rte -lopen-pal -lhwloc -levent_core -levent_pthreads -lm -lz

It doesn't point to the include directory in /opt/openmpi_4.1.5

I have looked at the prior question where it was stated that the problem was surely this error indicates not using the wrappers. I'm using the wrappers, so any further insight would be reallyh appreciated.

Upvotes: 0

Views: 308

Answers (1)

nardis_miles
nardis_miles

Reputation: 21

Solved: The issue was in the LD_LIBRARPY_PATH. Order matters. By putting the nonstandard openmpi installation library first, mpicc finds the correct include files.

Upvotes: 0

Related Questions