mikeizbicki / HLearn

Homomorphic machine learning
Other
1.62k stars 135 forks source link

Compile issue with branch dev-7.8 #41

Closed reckbo closed 10 years ago

reckbo commented 10 years ago

I'm struggling to get HLearn working on my Mac. Installing via hackage gives Constraintkind errors, so I'm trying to install from source using branch dev-7.8. I get the error below. Any ideas?

Building HLearn-2.0.0.0... Preprocessing library HLearn-2.0.0.0... [13 of 68] Compiling HLearn.DataStructures.StrictList ( src/HLearn/DataStructures/StrictList.hs, dist/build/HLearn/DataStructures/StrictList.o )

src/HLearn/DataStructures/StrictList.hs:59:10: Warning: ‘List’ is an instance of Monad but not Applicative - this will become an error in GHC 7.10, under the Applicative-Monad Proposal. [14 of 68] Compiling HLearn.Algebra.Structures.CanError ( src/HLearn/Algebra/Structures/CanError.hs, dist/build/HLearn/Algebra/Structures/CanError.o ) [18 of 68] Compiling HLearn.Algebra.History ( src/HLearn/Algebra/History.hs, dist/build/HLearn/Algebra/History.o )

src/HLearn/Algebra/History.hs:71:10: Warning: ‘LazyIO’ is an instance of Monad but not Applicative - this will become an error in GHC 7.10, under the Applicative-Monad Proposal. [19 of 68] Compiling HLearn.Algebra.LinearAlgebra ( src/HLearn/Algebra/LinearAlgebra.hs, dist/build/HLearn/Algebra/LinearAlgebra.o )

src/HLearn/Algebra/LinearAlgebra.hs:306:10: Duplicate instance declarations: instance LA.Field a => Monoid (LA.Matrix a) -- Defined at src/HLearn/Algebra/LinearAlgebra.hs:306:10 instance (LA.Container LA.Vector t, Eq t, Num (LA.Vector t), LA.Product t) => Monoid (LA.Matrix t) -- Defined in ‘hmatrix-0.16.0.4:Numeric.Matrix’ Failed to install HLearn-2.0.0.0 cabal: Error: some packages failed to install: HLearn-2.0.0.0 failed during the building phase. The exception was: ExitFailure 1

mikeizbicki commented 10 years ago

I believe you're running into the same problem as issue 40: the latest version of hmatrix does not work. It adds a Monoid instance that (IMHO) doesn't make sense and breaks the code. Under that issue is a link to a modified version of hmatrix that you should be able to compile with.

reckbo commented 10 years ago

Great, it worked, thanks!