aleator / CV

Haskell wrappers and utilities for OpenCV machine vision library
http://hackage.haskell.org/package/CV
BSD 3-Clause "New" or "Revised" License
51 stars 13 forks source link

CV-0.3.7 doesn't compile #41

Open nebuta opened 11 years ago

nebuta commented 11 years ago

This library looks nice, and I tried to install CV-0.3.7 from cabal, but CV/Transforms.chs caused a compile error. I specified --extra-include-dirs=/usr/local/include, there was no problem with include files. My environment is Mac OSX 10.8.4. Below is the log.

Resolving dependencies...
Configuring CV-0.3.7...
Building CV-0.3.7...
Preprocessing library CV-0.3.7...
[ 1 of 61] Compiling Utils.Stream     ( Utils/Stream.hs, dist/build/Utils/Stream.o )
[ 2 of 61] Compiling Utils.List       ( Utils/List.hs, dist/build/Utils/List.o )
[ 3 of 61] Compiling Utils.Function   ( Utils/Function.hs, dist/build/Utils/Function.o )
[ 4 of 61] Compiling CV.Bindings.Matrix ( dist/build/CV/Bindings/Matrix.hs, dist/build/CV/Bindings/Matrix.o )
[ 5 of 61] Compiling Utils.Pointer    ( Utils/Pointer.hs, dist/build/Utils/Pointer.o )
[ 6 of 61] Compiling Utils.DrawingClass ( Utils/DrawingClass.hs, dist/build/Utils/DrawingClass.o )
[ 7 of 61] Compiling Utils.Point      ( Utils/Point.hs, dist/build/Utils/Point.o )
[ 8 of 61] Compiling Utils.Rectangle  ( Utils/Rectangle.hs, dist/build/Utils/Rectangle.o )
[ 9 of 61] Compiling Utils.GeometryClass ( Utils/GeometryClass.hs, dist/build/Utils/GeometryClass.o )
[10 of 61] Compiling CV.Bindings.Types ( dist/build/CV/Bindings/Types.hs, dist/build/CV/Bindings/Types.o )
[11 of 61] Compiling CV.Bindings.Features ( dist/build/CV/Bindings/Features.hs, dist/build/CV/Bindings/Features.o )
[12 of 61] Compiling CV.Bindings.Fittings ( dist/build/CV/Bindings/Fittings.hs, dist/build/CV/Bindings/Fittings.o )
[13 of 61] Compiling CV.Bindings.Drawing ( dist/build/CV/Bindings/Drawing.hs, dist/build/CV/Bindings/Drawing.o )
[14 of 61] Compiling CV.Bindings.Error ( dist/build/CV/Bindings/Error.hs, dist/build/CV/Bindings/Error.o )
[15 of 61] Compiling CV.Image         ( dist/build/CV/Image.hs, dist/build/CV/Image.o )

CV/Image.chs:534:3: Warning:
    Pattern match(es) are overlapped
    In an equation for `toEnum':
        toEnum 0 = ...
        toEnum 1 = ...
        toEnum 2 = ...
        toEnum 3 = ...
        ...
[16 of 61] Compiling CV.Pixelwise     ( CV/Pixelwise.hs, dist/build/CV/Pixelwise.o )
[17 of 61] Compiling CV.Conversions   ( CV/Conversions.hs, dist/build/CV/Conversions.o )
[18 of 61] Compiling CV.Binary        ( CV/Binary.hs, dist/build/CV/Binary.o )
[19 of 61] Compiling CV.Matrix        ( CV/Matrix.hs, dist/build/CV/Matrix.o )
[20 of 61] Compiling CV.Bindings.Calibrate ( dist/build/CV/Bindings/Calibrate.hs, dist/build/CV/Bindings/Calibrate.o )
[21 of 61] Compiling CV.Calibration   ( dist/build/CV/Calibration.hs, dist/build/CV/Calibration.o )
[22 of 61] Compiling CV.ImageOp       ( CV/ImageOp.hs, dist/build/CV/ImageOp.o )
[23 of 61] Compiling CV.Bindings.Core ( dist/build/CV/Bindings/Core.hs, dist/build/CV/Bindings/Core.o )
[24 of 61] Compiling CV.ImageMath     ( dist/build/CV/ImageMath.hs, dist/build/CV/ImageMath.o )
[25 of 61] Compiling CV.ImageMathOp   ( CV/ImageMathOp.hs, dist/build/CV/ImageMathOp.o )
[26 of 61] Compiling CV.ColourUtils   ( dist/build/CV/ColourUtils.hs, dist/build/CV/ColourUtils.o )
[27 of 61] Compiling CV.Bindings.ImgProc ( dist/build/CV/Bindings/ImgProc.hs, dist/build/CV/Bindings/ImgProc.o )
[28 of 61] Compiling CV.Filters       ( dist/build/CV/Filters.hs, dist/build/CV/Filters.o )
[29 of 61] Compiling CV.Arbitrary     ( CV/Arbitrary.hs, dist/build/CV/Arbitrary.o )
[30 of 61] Compiling CV.ConnectedComponents ( dist/build/CV/ConnectedComponents.hs, dist/build/CV/ConnectedComponents.o )
[31 of 61] Compiling CV.DFT           ( CV/DFT.hs, dist/build/CV/DFT.o )
[32 of 61] Compiling CV.Operations    ( CV/Operations.hs, dist/build/CV/Operations.o )
[33 of 61] Compiling CV.Drawing       ( dist/build/CV/Drawing.hs, dist/build/CV/Drawing.o )
[34 of 61] Compiling CV.DrawableInstances ( CV/DrawableInstances.hs, dist/build/CV/DrawableInstances.o )
[35 of 61] Compiling CV.Edges         ( dist/build/CV/Edges.hs, dist/build/CV/Edges.o )
[36 of 61] Compiling CV.Features      ( CV/Features.hs, dist/build/CV/Features.o )
[37 of 61] Compiling CV.Fitting       ( CV/Fitting.hs, dist/build/CV/Fitting.o )
[38 of 61] Compiling CV.FunnyStatistics ( CV/FunnyStatistics.hs, dist/build/CV/FunnyStatistics.o )
[39 of 61] Compiling CV.Transforms    ( dist/build/CV/Transforms.hs, dist/build/CV/Transforms.o )

CV/Transforms.chs:328:9:
    Couldn't match expected type `IO a0'
                with actual type `CInt -> IO ()'
    In the return type of a call of `cvDistTransform'
    Probable cause: `cvDistTransform' is applied to too few arguments
    In the expression:
      cvDistTransform
        c_source
        c_result
        (fromIntegral . fromEnum $ dtype)
        (fromIntegral . fromEnum $ maskSize)
        nullPtr
        nullPtr
    In the second argument of `($)', namely
      `\ c_result
         -> cvDistTransform
              c_source
              c_result
              (fromIntegral . fromEnum $ dtype)
              (fromIntegral . fromEnum $ maskSize)
              nullPtr
              nullPtr'
Failed to install CV-0.3.7
cabal: Error: some packages failed to install:
CV-0.3.7 failed during the building phase. The exception was:
ExitFailure 1
aleator commented 11 years ago

Hi,

Sorry for not noticing this report earlier. Can you try installing with cabal flag -fopencv24? Also, what is your opencv library version?

nebuta commented 11 years ago

Thanks for the reply! I could get it installed with cabal install cv -fopencv24 OpenCV version is 2.4.5.

mvarela commented 11 years ago

Hi, I'm also having trouble building cv with opencv 2.4.5 on OS X 10.8.4.

Doing cabal install cv -fopencv24 (using the latest haskell platform, GHC 7.4.2) I get

Resolving dependencies...
Configuring CV-0.3.7...
Building CV-0.3.7...
Preprocessing library CV-0.3.7...
Types.hsc: In function 'main':
Types.hsc:59: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:59: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:59: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:59: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:59: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:59: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:75: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:75: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:75: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:75: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:75: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:75: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:107: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:107: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:107: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:107: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:107: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:107: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:124: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:124: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:124: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:124: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:124: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:124: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:152: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:152: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:152: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:152: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:152: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:152: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:161: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:161: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:161: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:161: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:161: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:161: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:172: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:172: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:172: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:172: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:172: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:172: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:177: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:177: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:177: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:177: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:177: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:177: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:187: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:187: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:187: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:187: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:187: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:187: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:209: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:209: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:209: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:209: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:209: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:209: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:243: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:243: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:243: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:243: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:243: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:243: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:254: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:254: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:254: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:254: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:254: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:254: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:260: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:260: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:260: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:260: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:260: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:260: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:327: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:327: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:327: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:327: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:327: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:327: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:335: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:335: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:335: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:335: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:335: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
Types.hsc:335: warning: format '%ju' expects type 'uintmax_t', but argument 2 has type 'int'
c2hs: C header contains errors:

dist/build/CV/Transforms.chs.h:17: (column 14) [ERROR]  >>> Unknown identifier!
  Cannot find a definition for `CV_DIST_LABEL_CCOMP' in the header file.

Failed to install CV-0.3.7
cabal: Error: some packages failed to install:
CV-0.3.7 failed during the building phase. The exception was:
ExitFailure 1

Any suggestions?

TomMD commented 10 years ago

@mvarela I don't know why 0.4 hasn't hit hackage yet, but it fixes some compilation issues for me.