Dear Sir or Madam::
Sorry to trouble you!
I am a beginner of Haskell and I just run into problems to install it. Things went smoothly when I do ./configure,but when I do the command 'make',errors appeared. The errors are as follows(red font):
"/usr/bin/ghc" "--make" "Setup" "-o" "Setup" "-package" "Cabal"
Linking Setup ...
"./Setup" "configure" "--package-db=../../packages/package.conf.inplace" "--prefix=/usr/local" "--with-compiler=/usr/bin/ghc" "--with-hc-pkg=/usr/bin/ghc-pkg" "--with-hsc2hs=/usr/bin/hsc2hs" "--enable-library-profiling"
Setup: Unrecognised flags:
>? I am a beginner of Haskell and I just run into problems to install it...
You seem to be trying to compile the GHC compiler manually.
For most platforms, that is not the recommended way to start
out. It is somewhat complicated, takes a long time, and is not
even all that you need. There is probably a much easier way,
depending on what operating system you are using.
You seem to be using some Unix-like environment. Exactly
what operating system do you have? If Linux, which
distribution and which version? If not Linux, please give us
similar details about your platform.
> You seem to be trying to compile the GHC compiler manually.
> For most platforms, that is not the recommended way to start
> out. It is somewhat complicated, takes a long time, and is not
> even all that you need. There is probably a much easier way,
> depending on what operating system you are using.
If I may offer a contrary opinion for others reading this, one could be a "beginner at Haskell" but otherwise confident with their system, and have a strong preference for manual installs.
Across the board with Mac OS X and various flavors of Linux, my experience with package managers has been that I would have saved time if I'd never heard of them. Telling other people to use such a package manager is like telling them to use your neighborhood fishmonger. If enough people actually take this advice, maybe the fish will stop smelling! ;-)
I'll set up the core part of a Linux release, and various standard components I don't really care about, using the package management system. I care about Haskell. There's no way I'd let a package manager anywhere near Haskell. I've been building from source since I was a Haskell (and Linux) beginner. One needs to understand one's axe. If there's a problem one doesn't understand at the core of one's system, it will surely fester and come back to haunt you.
There's a "rows vs columns" organizational issue with installing any package one cares about. For a Unix distribution, it makes sense to spread out pieces into /usr/local/lib and /usr/local/bin and so forth. One keeps a single version of these components, and tries never to look at them. But did any early adopter of GHC 6.12 want to give up on GHC 6.10? Does anyone really want to type sudo to a pile of scripts one doesn't understand, and hasn't read? For a component one cares about it, it is better to isolate all files in a single directory.
Alas, no canned distribution works this way for global installs, to my knowledge. I'm not sure of the psychology at play here. This is another assumption I'd like to see questioned.
This is one beef I have with package managers and binary installers. For example, to bootstrap a build from source on OS X Snow Leopard, I needed to use the binary installer, which made some unconventional and undocumented choices for file locations. To monitor this (a variant should work on any Unix) I create a file called "timestamp" before such an install, and afterwards run the Unix command
This documents every file that was created or changed across the system during the install. There's a bunch of line noise one gets used to (no system is quiet) but one can easily use this information to rip an install cleanly back out after bootstrapping is complete.
My /usr/local includes
lrwxr-xr-x 1 root wheel 10 Jan 11 21:05 ghc -> ghc-6.12.1
drwxr-xr-x 7 dave wheel 238 Dec 25 07:46 ghc-6.10.4
drwxr-xr-x 7 dave wheel 238 Jan 8 18:52 ghc-6.12.1
The symbolic link points to the currently selected active GHC directory, which is **user writeable** so I don't have to sudo to install into it. This gives me assurance that I'm not writing files elsewhere in the system; my install script doesn't even have permission. This also lets me toggle versions of GHC. I use this same approach to every system like GHC that I install for myself.
I then need to put /usr/local/ghc/bin on my path. That's ok; as I said, I care about GHC.
To build this way, use the --prefix flag for ./configure, as in
Dave Bayer wrote:
> If I may offer a contrary opinion for others reading this,
> one could be a "beginner at Haskell" but otherwise
> confident with their system, and have a strong preference
> for manual installs.
There are many reasons why some people may prefer in
some circumstances, and other people in all circumstances,
to compile from source and not use any of the "easy install"
Let's first find out what platform our original poster is on
so we'll know what the options are, and what their likely
consequences will be. And if the original poster
has a strong preference for manual compilation as you do -
we'll hear about that, too.
> Let's first find out what platform our original poster is on
> so we'll know what the options are, and what their likely
> consequences will be. And if the original poster
> has a strong preference for manual compilation as you do -
> we'll hear about that, too.
Yes, but this isn't a chat room, and archives of this conversation don't auto-delete in a week. Anything one says to the original poster, one is also saying to fifty lurkers and various people googling us years from now. I'm often on the other end of this, trying to resolve a problem by googling an old exchange.
I had to counter the blanket advice that building from scratch is discouraged. That's not an official policy, nor is it necessarily good advice. On a random flavor of Linux, if one is lucky the "package" version of GHC will be sufficiently up-to-date to build a clean version from scratch. I wouldn't use it after that.