0

Previously I had been able to use flycheck for fortran files, but something seems to have broken perhaps during an update.

Mac OSX catalina (latest)
gfortran 9.3.0 from homebrew
emacs 26.3 from homebrew

When I call flycheck-select-checker and then select fortran-gfortran I get the following error buffer:

Syntax checker in buffer test.f90 in f90-mode:

  fortran-gfortran (disabled)
    - major mode: `f90-mode' supported
    - may enable: Automatically disabled!
    - executable: Not found

Flycheck cannot use this syntax checker for this buffer.

Flycheck Mode is enabled.  Use M-x universal-argument C-c ! x to enable disabled
checkers.

--------------------

Flycheck version: 32snapshot (package: 20191108.2129)
Emacs version:    26.3
System:           x86_64-apple-darwin18.2.0
Window system:    ns

perhaps relevant is that it cannot find gfortran from within a shell inside emacs, but it is available from a regular mac osx terminal

4
  • 1
    Make sure fortran-gfortran is in your exec-path. You can check your exec-path with C-h v exec-path. Or, explicitly set somewhere in your init flycheck-fortran-gfortran-executable to point to the executable.
    – caisah
    Commented Jun 17, 2020 at 15:02
  • that was the problem, and in fact I had another problem where pyvenv-activate was overwriting my exec-path changes
    – Vince W.
    Commented Jun 17, 2020 at 16:42
  • @caisah - please make your comment an answer! The OP should then accept it, since it solves his problem.
    – NickD
    Commented Jun 17, 2020 at 20:10
  • I have added the comment as answer.
    – caisah
    Commented Jun 18, 2020 at 9:03

2 Answers 2

1

Make sure fortran-gfortran is in your exec-path. (You can check your exec-path with C-h v exec-path.)

Or, explicitly set somewhere in your init flycheck-fortran-gfortran-executable to point to the executable.

0

This method worked for me. I have Emacs on Windows and Flycheck could not find the executable for my c/c++-gcc checker.

I have added:

(setq flycheck-c/c++-gcc-executable "D:\\StandaloneApps\\strawberry\\c\\bin\\gcc.exe")

in my init.el file, and now .. Flycheck works in C/C++ mode.

( now, you can guess that I point to the gcc.exe packaged with perl :) ;) ;D )

1
  • Those double backslashes are pretty hideous, IMO. Emacs will generally be happier if you use forward slashes instead.
    – Stefan
    Commented Jul 22, 2020 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.