Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using stack build causing ghci to segfault #8

Open
gautammohan opened this issue Mar 15, 2019 · 0 comments
Open

using stack build causing ghci to segfault #8

gautammohan opened this issue Mar 15, 2019 · 0 comments

Comments

@gautammohan
Copy link

Hi there,

I am running into an issue where running stack ghci after building will cause a segfault. I am running on Mac OSX (High Sierra if it makes a difference...). Here is what I did:

  1. installed llvm-4.0 via Homebrew, which created an installation in homebrew's directory, and every llvm executable has a "-4.0" suffix. Because of this, I have resolved the dependency on llvm-config by symlinking llvm-config to llvm-config-4.0 and adding the project root directory to my path.

  2. stack build succeeds on all the chapters, but when trying to run stack ghci gets me the following error:

bash-3.2$ stack ghci
Configuring GHCi with the following packages: kaleidoscope

* * * * * * * *

Error: Multiple files use the same module name:
       * Codegen found at the following paths
         * /Users/gautam/research/llvm/kaleidoscope/src/chapter3/Codegen.hs (kaleidosco
pe:exe:chapter3)                                                                      
         * /Users/gautam/research/llvm/kaleidoscope/src/chapter4/Codegen.hs (kaleidosco
pe:exe:chapter4)                                                                      
         * /Users/gautam/research/llvm/kaleidoscope/src/chapter5/Codegen.hs (kaleidosco
pe:exe:chapter5)                                                                      
         * /Users/gautam/research/llvm/kaleidoscope/src/chapter6/Codegen.hs (kaleidosco
pe:exe:chapter6)                                                                      
         * /Users/gautam/research/llvm/kaleidoscope/src/chapter7/Codegen.hs (kaleidosco
pe:exe:chapter7)                                                                      

(Repeated for Emit, Jit, Lexer, Parser, etc for all the chapters)

To mitigate this issue, I commented out all chapters in the kaleidoscope.cabal file except for chapter 3, and tried again using stack clean --full and stack build. Running this command from the kaleidoscope root (so that my llvm-config symlink can be seen), I get a bunch of linking errors (attached in the error.log) file. error.log

Note that stack exec works fine, just like what was specified in the example. However, intero relies on ghci and I'd love to figure out how to get all of its benefits on files using llvm-hs.

Not sure if this is the right place to post this issue. Thanks in advance for any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant