build error

118 views
Skip to first unread message

daniell

unread,
Apr 1, 2011, 11:55:42 AM4/1/11
to Haskell Charts
Hi group,

I try to build Chart-0.14 on Windows, used the manual cabal update...
unpack Chart... configure... build approach:

The build breaks with:

ghc.exe: unable to load package `cairo-0.12.0'
ghc.exe: C:/Dokume~1/u/Anwend~1/cabal
\cairo-0.12.0\ghc-7.0.2\HScairo-0.12.0.o: unknown symbol
`_cairo_image_surface_get_data'
c:\Progra~1\Haskel~1\201120~1.0\bin\ghc.exe returned ExitFailure 1
Installing library in C:/Dokume~1/u/Anwend~1/cabal
\Chart-0.14\ghc-7.0.2
cabal.exe: Error: Could not find module:
Graphics.Rendering.Chart.Gtk with any
suffix: ["hi"] in the search path: ["dist\\build"]
cabal.exe: <command line>: Failed to load interface for
`Graphics.Rendering.Chart.Gtk':
Use -v to see a list of the files searched for.

I have the gtk+-bundle_2.22.1-20101227_win32 installed which has
cairo[-dev]_1.10.2-1_win32 (share\doc\gtk+-
bundle_2.22.1-20101227_win32\components.lst) on board
(cairo_image_surface_get_data should be there since version 1.2
http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-data,
maybe the error is related to the leading underscore).

ghc-pkg describe cairo prints:

WARNING: cache is out of date: c:/Progra~1/Haskel~1/201120~1.0\lib
\package.conf.d\package.cache
use 'ghc-pkg recache' to fix.
name: cairo
version: 0.12.0
id: cairo-0.12.0-5352235e6077a87d8a4713bd48e2b50e
license: BSD3
copyright: (c) 2001-2010 The Gtk2Hs Team, (c) Paolo Martini 2005, (c)
Abraham Egnor 2003, 2004, (c) Aetion Technologies LLC 2004
maintainer: gtk2hs...@sourceforge.net
stability: stable
homepage: http://www.haskell.org/gtk2hs/
package-url:
description: Cairo is a library to render high quality vector
graphics. There
exist various backends that allows rendering to Gtk
windows, PDF,
PS, PNG and SVG documents, amongst others.
category: Graphics
author: Axel Simon, Duncan Coutts
exposed: True
exposed-modules: Graphics.Rendering.Cairo
Graphics.Rendering.Cairo.Matrix
Graphics.Rendering.Cairo.Types
Graphics.Rendering.Cairo.Internal
hidden-modules: Graphics.Rendering.Cairo.Internal.Drawing.Cairo
Graphics.Rendering.Cairo.Internal.Drawing.Paths
Graphics.Rendering.Cairo.Internal.Drawing.Patterns

Graphics.Rendering.Cairo.Internal.Drawing.Text

Graphics.Rendering.Cairo.Internal.Drawing.Transformations
Graphics.Rendering.Cairo.Internal.Fonts.FontOptions
Graphics.Rendering.Cairo.Internal.Surfaces.Image
Graphics.Rendering.Cairo.Internal.Surfaces.PNG
Graphics.Rendering.Cairo.Internal.Surfaces.Surface
Graphics.Rendering.Cairo.Internal.Utilities
Graphics.Rendering.Cairo.Internal.Surfaces.PDF
Graphics.Rendering.Cairo.Internal.Surfaces.PS
Graphics.Rendering.Cairo.Internal.Surfaces.SVG
import-dirs: C:/Dokume~1/u/Anwend~1/cabal\cairo-0.12.0\ghc-7.0.2
library-dirs: C:/Dokume~1/u/Anwend~1/cabal\cairo-0.12.0\ghc-7.0.2
H:/Gtk+/lib
hs-libraries: HScairo-0.12.0
extra-libraries: z cairo
extra-ghci-libraries: libz-1 libcairo-script-interpreter-2
include-dirs: H:/Gtk+/include/cairo H:/Gtk+/include/glib-2.0
H:/Gtk+/lib/glib-2.0/include H:/Gtk+/include
H:/Gtk+/include/freetype2 H:/Gtk+/include/libpng14
includes:
depends: array-0.3.0.2-8e9cd0144e87fa9cc86cc9031631c4f3
base-4.3.1.0-f520cd232cc386346843c4a12b63f44b
bytestring-0.9.1.10-cd85f14e02463c02ba4c77d7adcdb54f
haskell98-1.1.0.1-35ec26bae828637c1638c8be441b3d68
mtl-2.0.1.0-fb4d1695269b74308c1517c06b76e6e8
hugs-options:
cc-options:
ld-options:
framework-dirs:
frameworks:
haddock-interfaces: C:/Dokume~1/u/Anwend~1/cabal\haskell-pkgdata\doc
\cairo-0.12.0\html\cairo.haddock
haddock-html: C:/Dokume~1/u/Anwend~1/cabal\haskell-pkgdata\doc
\cairo-0.12.0\html

Do you have an idea whats wrong?

Cheers
Daniel

Tim Docker

unread,
Apr 3, 2011, 10:34:46 PM4/3/11
to haskell...@googlegroups.com, daniell
Hi Daniel,

I've not really had any experience with building haskell apps under
windows - I don't have a windows machine.

However, looking at my linux setup, I can see that the HSCairo 0.12
library references the _cairo_image_surface_get_data symbol, which is
present in the system cairo2 library (V1.8.10)....

Is ghc finding the cairo + gtk libraries correctly?
Does the problem just occur with the Chart library? Can you build the
gtk2hs demo programs successfully?

Tim

Eugene Kirpichov

unread,
Apr 3, 2011, 9:31:55 AM4/3/11
to haskell...@googlegroups.com, haskell...@googlegroups.com, daniell
Daniel, please check if you have another installation of gtk or Cairo in your PATH. Or just put the new installation as the first entry.

04.04.2011, в 6:34, Tim Docker <t...@dockerz.net> написал(а):

> --
> You received this message because you are subscribed to the Google Groups "Haskell Charts" group.
> To post to this group, send email to haskell...@googlegroups.com.
> To unsubscribe from this group, send email to haskell-chart...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/haskell-charts?hl=en.
>

Daniel Kahlenberg

unread,
Apr 21, 2011, 4:31:36 AM4/21/11
to Eugene Kirpichov, haskell...@googlegroups.com
Hi again,

it seems I have no other gtk installation on my path.

1) $ nm /h/Gtk+/bin/libcairo-2.dll | grep -i cairo_image_surface_get_data
68de04d8 T _cairo_image_surface_get_data

2) testwise: renamed the libcairo-2.dll file to libcairo-RENAMED2.dll,
latter resulting in the expected "dll not found" error, so it tries to
access exactly that libcairo-2.dll, doesn't it?

3) Used the isolated repository approach with hackages cab and
cabal-dev packages installed:

3a) Provided myself patched (Gtk2HsSetup.hs) 0.12 versions of the
"gtk2hs" dependencies 'Chart' has, in my /h/.homedir folder and
changed to that folder on the command line.

3b) Did this to fill this private repository: cabal-dev add-source
/h/.homedir/gtk2hs-buildtools-0.12.0/ /h/.homedir/glib-0.12.0/
/h/.homedir/cairo-0.12.0/ /h/.homedir/gio-0.12.0/
/h/.homedir/pango-0.12.0/ /h/.homedir/gtk-0.12.0/
/h/.homedir/glade-0.12.0/cabal-dev add-source
/h/.homedir/gtk2hs-buildtools-0.12.0/ /h/.homedir/glib-0.12.0/
/h/.homedir/cairo-0.12.0/ /h/.homedir/gio-0.12.0/
/h/.homedir/pango-0.12.0/ /h/.homedir/gtk-0.12.0/
/h/.homedir/glade-0.12.0/

3c) Tried to build 'Chart' with: cab install Chart
--sandbox=/h/.homedir/cabal-dev/

The latter ends up: [ 1 of 27] Compiling
Graphics.Rendering.Chart.Types ( Graphics\Rendering\Chart\Types.hs,
dist\build\Graphics\Rendering\Chart\Types.o )
Loading package ghc-prim ... linking ... done.
.....
Loading package mtl-2.0.1.0 ... linking ... done.
Loading package cairo-0.12.0 ... linking ... ghc.exe: unable to load
package `cairo-0.12.0'
ghc.exe: h:/.homedir/cabal-dev//cairo-0.12.0\ghc-7.0.3\HScairo-0.12.0.o:
unknown symbol `_cairo_image_surface_get_data'
cabal.exe: Error: some packages failed to install:
Chart-0.14 failed during the building phase. The exception was:
ExitFailure 1

Anyway it is good to have isolated and clean build conditions for
debugging purpose and the cabal-dev cab combination seems very useful
on that aim.

Do we have alternatives to depend on cairo somehow, at least on MS
Windows, I asked on different mailing lists (gtk2hs-users,
haskell-cafe even glasgow-haskell) for a solution or hint already, but
it seems there's some dead end with that issue??

Anway Chart is good and important work and if I could help to
improve/fix something, please let me know, I would appreciate to see
Chart... cairo working as many packages depend on the combination of
both.

Cheers
Daniel

2011/4/3 Eugene Kirpichov <ekirp...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages