TransWikia.com

flycheck cannot use gfortran, executable not found

Emacs Asked by Vince W. on November 20, 2021

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

2 Answers

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 )

Answered by user3497239 on November 20, 2021

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.

Answered by caisah on November 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP