Haskell Stack Setup - Unable to recognize CPP program

I'm following the Udemy Haskell course, which at some point showed that Haskell is loading using the Stack option. I configured my $ PATH and installed the stack when I had a problem.

configure: WARNING: configure can't recognize your CPP program, you may need to set --with-hs-cpp-flags=FLAGS explicitly
configure: error: in `/Users/Dylan/.stack/programs/x86_64-osx/ghc-8.0.2.temp/ghc-8.0.2':
configure: error: C compiler cannot create executables

I looked .stack/programs/x86_64-osx/ghc-8.0.2.temp/ghc-8.0.2/config.logand found this ...

configure:2234: checking for path to top of build tree
configure:2255: result: /Users/Dylan/.stack/programs/x86_64-osx/ghc-8.0.2.temp/$
configure:2981: checking for perl
configure:2999: found /usr/bin/perl
configure:3011: result: /usr/bin/perl
configure:3070: checking for a BSD-compatible install
configure:3138: result: /usr/bin/install -c
configure:3152: checking whether ln -s works
configure:3156: result: yes
configure:3168: checking for gsed
configure:3199: result: sed
configure:3211: checking XCode version
configure:3222: result: 8.3.3
configure:3226: XCode version component 1: 8
configure:3228: XCode version component 2: 3
configure:3263: checking for gcc
configure:3281: found /usr/bin/gcc
configure:3293: result: /usr/bin/gcc
configure:3573: WARNING: configure can't recognize your CPP program, you may ne$
configure:3623: checking for llc-3.7
configure:3656: result: no
configure:3739: checking for llc
configure:3772: result: no
configure:3872: checking for opt-3.7
configure:3905: result: no
configure:3988: checking for opt
configure:4021: result: no
configure:4120: checking for ld
configure:4138: found /usr/bin/ld
configure:4150: result: /usr/bin/ld
configure:4388: checking for gcc
configure:4415: result: /usr/bin/gcc
configure:4644: checking for C compiler version
configure:4653: /usr/bin/gcc --version >&5

I can read configure: WARNING: configure can't recognize your CPP program, you may need to set --with-hs-cpp-flags=FLAGS explicitly, but I'm not sure how and where to do it. I found settings.in file ...

[("GCC extra via C opts", "@GccExtraViaCOpts@"),
 ("C compiler command", "@SettingsCCompilerCommand@"),
 ("C compiler flags", "@SettingsCCompilerFlags@"),
 ("C compiler link flags", "@SettingsCCompilerLinkFlags@"),
 ("C compiler supports -no-pie", "@SettingsCCompilerSupportsNoPie@"),
 ("Haskell CPP command","@SettingsHaskellCPPCommand@"),
 ("Haskell CPP flags","@SettingsHaskellCPPFlags@"),
 ("ld command", "@SettingsLdCommand@"),
 ("ld flags", "@SettingsLdFlags@"),
 ("ld supports compact unwind", "@LdHasNoCompactUnwind@"),
 ("ld supports build-id", "@LdHasBuildId@"),
 ("ld supports filelist", "@LdHasFilelist@"),
 ("ld is GNU ld", "@LdIsGNULd@"),
 ("ar command", "@SettingsArCommand@"),
 ("ar flags", "@ArArgs@"),
 ("ar supports at file", "@ArSupportsAtFile@"),
 ("touch command", "@SettingsTouchCommand@"),
 ("dllwrap command", "@SettingsDllWrapCommand@"),
 ("windres command", "@SettingsWindresCommand@"),
 ("libtool command", "@SettingsLibtoolCommand@"),
 ("perl command", "@SettingsPerlCommand@"),
 ("cross compiling", "@CrossCompiling@"),
 ("target os", "@HaskellTargetOs@"),
 ("target arch", "@HaskellTargetArch@"),
 ("target word size", "@WordSize@"),
 ("target has GNU nonexec stack", "@HaskellHaveGnuNonexecStack@"),
 ("target has .ident directive", "@HaskellHaveIdentDirective@"),
 ("target has subsections via symbols", "@HaskellHaveSubsectionsViaSymbols@"),
 ("Unregisterised", "@Unregisterised@"),
 ("LLVM llc command", "@SettingsLlcCommand@"),
 ("LLVM opt command", "@SettingsOptCommand@")
 ]

But then again, I don’t know what to do with it. Sorry if my question is basic, but I haven’t done anything like this before, and what I found on the Internet was hard to interpret how it applies to my situation.

Any help would be greatly appreciated. 😀

+4
1

@n.m , , , xCode. , , .stack/programs/x86_64-osx/ghc-8.0.2.temp/ghc-8.0.2/config.log, .

Agreeing to the Xcode/iOS license requires admin privileges, please run "sudo xcodebuild -license" and then retry this command

sudo xcodebuild -license stack install .

+3

Source: https://habr.com/ru/post/1684119/


All Articles