Closed jeremysalwen closed 9 years ago
$ ~/.emacs.d/irony/bin/irony-server diagnostics /home/jeremy/deeplearning/HessianFree/src/Optimizable.cpp
Getting the diagnostics is a 2-step operation (it's recent), you have to do this:
~/.emacs.d/irony/bin/irony-server -i
parse /home/jeremy/deeplearning/HessianFree/src/Optimizable.cpp
-x c++ -working-directory /home/jeremy/deeplearning/HessianFree/ -std=c++11 -Iinclude
t
diagnostics
<diagnostics...>
What is the output for the diagnostics?
jeremy@jeremy-laptop:~$ ~/.emacs.d/irony/bin/irony-server -i
parse /home/jeremy/deeplearning/HessianFree/src/Optimizable.cpp
-x c++ -working-directory /home/jeremy/deeplearning/HessianFree/ -std=c++11 -Iinclude
execute: Command{action=Command::Parse, file='/home/jeremy/deeplearning/HessianFree/src/Optimizable.cpp', line=0, column=0, flags=['-x', 'c++', '-working-directory', '/home/jeremy/deeplearning/HessianFree/', '-std=c++11', '-Iinclude'], unsavedFiles.count=0, opt=off}
t
;;EOT
diagnostics
execute: Command{action=Command::Diagnostics, file='', line=0, column=0, flags=[], unsavedFiles.count=0, opt=off}
(
)
That looks about fine.
Can you check the irony-server log file in /tmp/
?
And see what is the parse command flags?
execute: Command{action=Command::Parse, file..., flags=[???], ...}
You can edit the irony-server command to add more logging by adding "-d" after "-i", here: https://github.com/Sarcasm/irony-mode/blob/1241a6941628224bed7936605c3c1bb44869cf19/irony.el#L566
The contents of /tmp/irony*.log are
execute: Command{action=Command::Parse, file='/home/jeremy/deeplearning/HessianFree/test/testmnist.cpp', line=0, column=0, flags=['-x', 'c++', '-working-directory', '/home/jeremy/deeplearning/HessianFree/', '-std=c++11 -Iinclude'], unsavedFiles.count=1, opt=off}
execute: Command{action=Command::Diagnostics, file='', line=0, column=0, flags=[], unsavedFiles.count=0, opt=off}
Okay, I'm a bit clueless as it is.
Does this happen only with this file or any other file? Would you be able to provide me with a reduced test-case?
What is your platform? OS, Emacs version, irony and flycheck-irony version, ...
It is only with this project, a previous project worked fine.
I am running latest debian unstable, emacs 24.4.1, with packages irony, irony-company, irony-flycheck, company, flycheck, yasnippet, magit.
All packages are installed from MELPA and are up to date.
This is my entire .emacs
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
(require 'comint)
(setq comint-prompt-read-only t)
(setq comint-scroll-to-bottom-on-input t)
(load-library "yasnippet")
(require 'yasnippet)
(yas-global-mode 1)
(load-library "magit")
(require 'magit)
(load-library "irony")
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
(load-library "company")
(add-hook 'after-init-hook 'global-company-mode)
(load-library "company-irony")
(eval-after-load 'company
'(add-to-list 'company-backends 'company-irony))
;; (optional) adds CC special commands to `company-begin-commands' in order to
;; trigger completion at interesting places, such as after scope operator
;; std::|
(add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)
(load-library "flycheck")
(add-hook 'after-init-hook #'global-flycheck-mode)
(load-library "flycheck-irony")
(eval-after-load 'flycheck
'(add-to-list 'flycheck-checkers 'irony))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(company-idle-delay 0.2)
'(company-minimum-prefix-length 2)
)
(require 'server)
(server-start)
(setq redisplay-dont-pause t
scroll-margin 1
scroll-step 1
scroll-conservatively 10000
scroll-preserve-screen-position 1)
(provide '.emacs)
;;; .emacs ends here
The project I am using is available on github: https://github.com/jeremysalwen/HessianFreePP. None of the files that require c++11 or includes have proper syntax checking, but in particular test/testmnist.cpp is the one I care about.
Hi,
I'm sorry but testing is a bit difficult for me due to the few libraries that are involved.
It looks like Optimizable.hpp is lacking a header guard. It also doesn't include the <armadillo>
explicitly.
The format for .clang_complete is one flag per line. In your case you have multiple flags and I cannot guarantee that it will work.
If you are able to reproduce the issue without external libraries that would be helpful so I can test as well.
Hi, thank you very much! The problem was that .clang_complete requires one flag per line. When I fixed that, it worked perfectly. Is there a reason why it is necessary to have one flag per line?
On Sun, Mar 1, 2015 at 2:31 PM, Guillaume Papin notifications@github.com wrote:
Hi,
I'm sorry but testing is a bit difficult for me due to the few libraries that are involved.
It looks like Optimizable.hpp is lacking a header guard. It also doesn't include the
explicitly. The format for .clang_complete is one flag per line. In your case you have multiple flags and I cannot guarantee that it will work.
If you are able to reproduce the issue without external libraries that would be helpful so I can test as well.
— Reply to this email directly or view it on GitHub https://github.com/Sarcasm/irony-mode/issues/177#issuecomment-76625715.
That's the way Rip-Rip/clang_complete works, I wanted the .clang_complete
to work with it: https://github.com/Rip-Rip/clang_complete/blob/1724008e987de584bec0823bfb8959b0a3183c51/doc/clang_complete.txt#L56
It allows to work with compile definition that contains space (in path or defines that may happen), e.g:
-DFOO="foo bar baz"
-Iblah/blih blouh/
I seem to be having a similar problem as issue #171 , except when I run the same diagnostics, I don't have the same issue with linking to different versions of libLLVM. I am running the latest version from MELPA.
Here are the results of all the same diagnostics tests:
directory structure is
I open Optimizable.cpp
irony-cdb-menu:
irony--adjust-complie-options:
$ ~/.emacs.d/irony/bin/irony-server diagnostics /home/jeremy/deeplearning/HessianFree/src/Optimizable.cpp
$ ldd ~/.emacs.d/irony/bin/irony-server
$ ldd /usr/bin/clang++
irony-flycheck still gives warnings such as
and errors such as