
On Tue, Feb 2, 2010 at 1:59 PM,
OK, I'm working on matrix stuff in Haskell now (I've been trying to get the professor to approve that) and when I use cabal install to install hmatrix, it fails at HUnit with: ----------- Configuring HUnit-1.2.2.1... Preprocessing library HUnit-1.2.2.1... Preprocessing executables for HUnit-1.2.2.1... Building HUnit-1.2.2.1... [1 of 5] Compiling Test.HUnit.Terminal ( Test/HUnit/Terminal.hs, dist/build/Test/HUnit/Terminal.o ) [2 of 5] Compiling Test.HUnit.Lang ( Test/HUnit/Lang.hs, dist/build/Test/HUnit/Lang.o ) [3 of 5] Compiling Test.HUnit.Base ( Test/HUnit/Base.hs, dist/build/Test/HUnit/Base.o ) [4 of 5] Compiling Test.HUnit.Text ( Test/HUnit/Text.hs, dist/build/Test/HUnit/Text.o ) [5 of 5] Compiling Test.HUnit ( Test/HUnit.hs, dist/build/Test/HUnit.o ) /usr/bin/ar: creating dist/build/libHSHUnit-1.2.2.1.a
Test/HUnit/Lang.hs:22:1: lexical error at character 'i' cabal: Error: some packages failed to install: HUnit-1.2.2.1 failed during the building phase. The exception was: exit: ExitFailure 1 ----------------
Short term question: what the heck do I do with this?
Long term question: how can I handle cabal failures of this type without bothering the list every time?
Dave Barton University of Toronto
Well, the obvious thing to do is to look at the line causing the error. The line and surrounding lines are: ------------------------------- -- Imports -- ------- import Data.List (isPrefixOf) 21: #if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) import Data.Dynamic import Control.Exception as E #else import System.IO.Error (ioeGetErrorString, try) #endif ----------------------------------- Line 12 is the first CPP directive in the file; GHC doesn't understand CPP unless you tell it to. So one could look at the hunit.cabal and try to figure out why CPP wasn't enabled, or one could add into the first line of the file '{-# LANGUAGE CPP #-}' and work around it. But you can't start if you don't know what the problem is. -- gwern