mikeizbicki / HLearn

Homomorphic machine learning
Other
1.62k stars 135 forks source link

Compilation error when building HLearn-distributions #34

Closed ababkin closed 10 years ago

ababkin commented 10 years ago

(found similar report here (see the last comment): http://izbicki.me/blog/markov-networks-monoids-and-futurama)

(also see the proposed solution below)

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeFreeze’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeThaw’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicLength’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeSlice’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeIndexM’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeCopy’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: elemseq’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeFreeze’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeThaw’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicLength’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeSlice’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeIndexM’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeCopy’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: elemseq’ is not a (visible) method of classData.Vector.Generic.Base.Vector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicLength’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeSlice’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicOverlaps’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeNew’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeReplicate’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeRead’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeWrite’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicClear’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicSet’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeCopy’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeMove’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeGrow’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicLength’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeSlice’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicOverlaps’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeNew’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeReplicate’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeRead’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeWrite’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicClear’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicSet’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeCopy’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeMove’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’

src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs:32:1: basicUnsafeGrow’ is not a (visible) method of classData.Vector.Generic.Mutable.MVector’ Failed to install HLearn-distributions-1.1.0.1

Proposed solution: The problem occurs on mavericks OSX (haven't tried others) on the latest relased version of the package = 1.1.0.1 (it seems that the file looks different on current master) Looks like bos had similar problem and solved it this way: https://github.com/bos/math-functions/commit/ace6a55

I tried this and added the following two lines to src/HLearn/Models/Distributions/Univariate/Internal/Moments.hs

import Data.Vector.Generic (Vector(..)) import Data.Vector.Generic.Mutable (MVector(..))

and that suppressed the errors

olorin commented 10 years ago

Reproduced this with GHC 7.6.3 and cabal-install 1.18.0.3.

mikeizbicki commented 10 years ago

Thanks for the fix. I've uploaded a new version to hackage.