In emacs, stack-ghci cannot load interface files, but `stack build` from the command line

I can stack buildproject from the command line, but when I try C-c C-lin emacs (c (custom-set-variables '(haskell-process-type 'stack-ghci))), I get an error message that all imported modules of the package cannot be found.

/home/amcp011/bec/amcp011/accelerate/gpe/src/Numeric/GPE/Utils.hs:30:1: error:
    Failed to load interface for ‘Data.Array.Accelerate’
    Locations searched:
      Data/Array/Accelerate.hs
      Data/Array/Accelerate.lhs
      Data/Array/Accelerate.hsig
      Data/Array/Accelerate.lhsig
      /home/amcp011/bec/amcp011/accelerate/gpe/src/Data/Array/Accelerate.hs
      /home/amcp011/bec/amcp011/accelerate/gpe/src/Data/Array/Accelerate.lhs
      /home/amcp011/bec/amcp011/accelerate/gpe/src/Data/Array/Accelerate.hsig
      /home/amcp011/bec/amcp011/accelerate/gpe/src/Data/Array/Accelerate.lhsig

gpe.cabal:

build-depends:       base >= 4.7 && < 5
                   , bytestring
                   , bytestring-conversion
                   , mtl
                   , time
                   , filepath
                   , directory
                   , accelerate
                   , accelerate-io

stack.yaml:

extra-deps: [accelerate-1.0.0.0
            ,accelerate-io-1.0.0.0
            ]
+6
source share
1 answer

I was able to compile your project using stack build(of course, after installing several dependencies on the system, such as llvm, cuda, fftw3, etc.) and load it using C-c C-lemacs.

Here is the minimal emacs configuration that worked for me:

(defun haskell-mode-setup ()
  (setq haskell-process-type 'stack-ghci))

(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
(add-hook 'haskell-mode-hook 'haskell-mode-setup)

, , inf-haskell-mode, interactive-haskell-mode, (setq haskell-process-type 'ghci). , , emacs stack.

, - , , , : (setq haskell-process-path-stack "/path/to/stack").

, , $PATH, , , , . exec-path-from-shell emacs (exec-path-from-shell-initialize) ~/.emacs.

, , haskell . (setq haskell-process-log t) haskell-mode-setup, .

:

  • , stack.yaml, , dirs /home/amcp011/local/, , gcc, RHEL6.3.
  • emacs haskell-mode, . intero flycheck .
  • stack upgrade haskell-mode, , . stack-1.5.1 haskell-mode-20170824.1124 emacs-25.2.2
+5

All Articles