4

I'd like to add path to the openMPI library headers. So, after i found all openMPI headers are in /usr/lib/openmpi/include/* i added these two lines to my .emacs:

(semantic-add-system-include "/usr/lib/openmpi/include" 'c-mode)
(semantic-add-system-include "/usr/lib/openmpi/include" 'c++-mode)

I think this is ok, but it's not working!
This is the result of semantic-c-describe-envirnoment command:

This file's system include path is:
/usr/include
/usr/local/include/
/usr/lib/gcc/i486-linux-gnu/4.4.3/include/
/usr/lib/gcc/i486-linux-gnu/4.4.3/include-fixed/
/usr/include/

Can't figure out what's wrong or what i'm missing

Thanks

synasius
  • 323
  • 3
  • 7

2 Answers2

4

I have no explanation as to why it doesn't work. Since I had the same problem, experimenting I found a fix that worked for me:

(defun my-semantic-hook ()
  (semantic-add-system-include "/usr/lib/openmpi/include" 'c-mode)
  (semantic-add-system-include "/usr/lib/openmpi/include" 'c++-mode))
(add-hook 'semantic-init-hooks 'my-semantic-hook)
Milan
  • 15,389
  • 20
  • 57
  • 65
  • Just to chime in, this is STILL the only way to get this to work. –  Oct 10 '14 at 05:12
  • This worked for me too. I believe irony and/or company-irony were causing issues as well. After commenting them out everything works. – mrbean Jul 11 '20 at 20:24
2

I've given this example a try, and find that it "works for me". Your best bet is to join the cedet-devel mailing list where it will be easier to help your through the process of debugging the issue in your Emacs.

https://lists.sourceforge.net/lists/listinfo/cedet-devel

Eric
  • 3,959
  • 17
  • 15