Reputation: 3627
YCM autocompletes and highlights errors on C++ standard library. However, if I download another library such as OpenMPI and write code that imports <mpi.h>
I can compile it with mpicc but YCM tells me that <mpi.h>
file was not found and all it's provided functions seem to by marked invalid by YCM. Is there a way to fix this ? What changes should I make to ycm_extra_conf_py
file to support other downloaded libraries?
Upvotes: 0
Views: 398
Reputation: 395
I found this question while searching for an answer myself. The only solution I have found so far is to manually edit compile_commands.json and add the required mpi include dir, eg run
mpicc -showme
and append the relevant
-I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi
options to the conf file. I haven't seen the contents of ycm_extra_conf_py but I guess there is something similar to do. I hope this helps.
Upvotes: 2