Reputation: 22596
I'm trying to install GhC 7.8.3 on mac os and that's driving me mad.
What should I do ?
I've downloaded the binary installation from here. First I need to do sudo make install
instead of install
. Is that normal ?
Then it stop with the following error message :
/usr/bin/gcc -E -m64 -undef -traditional -Wno-invalid-pp-token -Wno-unicode -
Wno-trigraphs -P -DINSTALLING -DLIB_DIR='"/usr/local/lib/ghc-7.8.3"' -DINCLUDE
_DIR='"/usr/local/lib/ghc-7.8.3/include"' -DPAPI_INCLUDE_DIR="" -DPAPI_LIB_DIR
="" -DFFI_INCLUDE_DIR= -DFFI_LIB_DIR= '-DFFI_LIB="Cffi"' -x c -Iincludes -Iinc
ludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstant
s/header rts/package.conf.in -o rts/dist/package.conf.install.raw
cc1: error: unrecognized command line option "-Wno-invalid-pp-token"
cc1: error: unrecognized command line option "-Wno-unicode"
make[1]: *** [rts/dist/package.conf.install] Error 1
I tried downloading the ghc-clang-wrapper. But that doesn't change anything. It complains about haskell platform not being installed so I changed the setting file manually, but still no result.
Also, that might be a daft question, if it's a binary package why is trying to compile stuff ?
Upvotes: 1
Views: 311
Reputation: 26742
The problem you're running into is https://ghc.haskell.org/trac/ghc/ticket/9257
A workaround which seems to work for me is to edit mk/config.mk
, removing the two offending flags from RAWCPP_FLAGS
.
Update: Actually, it looks like this may not work hard enough, since this caused my GHC just to fail later. A more complete workaround is to create a file named gcc with the following contents:
#!/usr/bin/python
import sys
import os
os.execv("/usr/bin/gcc", ["/usr/bin/gcc"] + [i for i in sys.argv[1:] if i != "-Wno-invalid-pp-token" and i != "-Wno-unicode"])
Replace both instances of /usr/bin/gcc
if your GCC is in an unusual place. Chmod it executable. Now, when configuring your bindist, pass the configure flag --with-gcc=/path/to/your/gcc
. This will strip out the warning flags and make things work.
Upvotes: 1