Error installing stylish-haskell on Mac OS X on Haskell Platform 2013.2.0.0

前端 未结 3 2003
囚心锁ツ
囚心锁ツ 2021-01-03 05:50

I get the same error relatively consistently when trying to install the stylish-haskell package off of hackage. The install went swimmingly until it got to installing condui

相关标签:
3条回答
  • 2021-01-03 06:21

    This issue can fix work by following workaround.

    https://github.com/snoyberg/conduit/issues/147

    0 讨论(0)
  • 2021-01-03 06:38

    As mentioned in some of the other answers this is due to gcc being replaced by Clang starting with at least Xcode 5.

    GHC leans on GCC's preprocessor in order to support c++ like #something macros and it looks like Clang behaves slightly differently which causes compilation of haskell sources containing such macros to fail.

    The fix is actually displayed prominently on the Haskell Platform's Mac page: https://www.haskell.org/platform/mac.html

    It consists of a simple bash script which acts as a wrapper around Clang.

    To install it:

    • Go to https://www.haskell.org/platform/ghc-clang-wrapper.
    • Press command-s to save the script in your download folder.
    • Install it by running the following instructions in a terminal:

      cd ~/Downloads
      chmod +x ghc-clang-wrapper
      ./ghc-clang-wrapper
      
    • Then follow the simple instructions it prints.

    Once that's done, simply relaunch the cabal install command and it will run fine.

    0 讨论(0)
  • 2021-01-03 06:45

    I'm not an expert here, but I think this is caused by Mavericks replacing the standard gcc with a version of clang wrapped with a gcc-semi-compatible wrapper. It make GHC choke from time to time. You can fix it by editing /usr/local/lib/ghc-7.6.3/settings so that the "C compiler command" entry points to a valid gcc.

    For instance, I installed gcc 4.8 from Homebrew and then changed the settings line to

     ("C compiler command", "/usr/local/bin/gcc-4.9")
    
    0 讨论(0)
提交回复
热议问题