error while installing caffe: fatal error: mpi.h: No such file or directory

83 views
Skip to first unread message

Shahad Hassan

unread,
Jul 1, 2020, 6:59:29 AM7/1/20
to Caffe Users
Hello, I'm trying to build caffe on my computer (ubuntu 16.04), "make all" successfully worked good, but "make pycaffe" occurred an error, I think it is from openmpi but I'm not sure. BTW, I have openmpi and I checked it before via ompi_info command.
Error:
...
...
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
In file included from ./include/caffe/blob.hpp:8:0,
                 from ./include/caffe/caffe.hpp:7,
                 from python/caffe/_caffe.cpp:17:
./include/caffe/common.hpp:20:12: fatal error: mpi.h: No such file or directory
   #include "mpi.h"
            ^~~~~~~
compilation terminated.
Makefile:450: recipe for target 'python/caffe/_caffe.so' failed
make: *** [python/caffe/_caffe.so] Error 1

In Makefile.config:
CUSTOM_CXX := mpic++
I think make pycaffe use g++ as a compiler, but I should use mpic++ instead.

Hope I provided you all information, let me know if you need another information.
Thanks,

Tamas Nemes

unread,
Jul 1, 2020, 7:59:08 AM7/1/20
to Caffe Users
I can't say anything specific here because I never compiled with MPI. Why do you have to use MPI again?
But the path to "mpi.h" must be in the INCLUDE_DIRS in the Makefile.config. Look for the file on your computer via search and check if the path is included in INCLUDE_DIRS.
Reply all
Reply to author
Forward
0 new messages