gtk2hsC2hs is broken on Mac OS Mavericks #1

Closed
mjoldfield opened this Issue Oct 26, 2013 · 20 comments

Projects

None yet
@mjoldfield

Trying to build cairo fails with this error:

Preprocessing library cairo-0.12.4...
gtk2hsC2hs: Error in C header file.

/usr/include/stdio.h:437: (column 138) [FATAL] 
  >>> Syntax error!
  The symbol `=' does not fit here.

I think the problem is that Mavericks' cpp is based on clang and has different command line arguments. The same problem affects ghc, and here's a thread discussing it in the context of home brew: Homebrew/legacy-homebrew#20546

When ghc's been fixed, I imagine the patch for gtk2hsC2hs will be obvious to anyone
who knows the code.

In the meantime, if you've installed e.g. gcc 4.8 then one way to work around the problem is to simply put links from gcc to gcc-4.8 earlier in the path, install cairo,
then remove them:

cd /usr/local/bin
ln -s gcc-4.8 gcc
ln -s cpp-4.8 cpp
cabal install cairo
rm gcc
rm cpp

It's hardly elegant though!

@hamishmack
Contributor

Try "cabal install --with-gcc=gcc-4.8".

On 27 Oct 2013, at 10:40, Martin Oldfield notifications@github.com wrote:

Trying to build cairo fails with this error:

Preprocessing library cairo-0.12.4...
gtk2hsC2hs: Error in C header file.

/usr/include/stdio.h:437: (column 138) [FATAL]

Syntax error!
The symbol `=' does not fit here.
I think the problem is that Mavericks' cpp is based on clang and has different command line arguments. The same problem affects ghc, and here's a thread discussing it in the context of home brew: Homebrew/legacy-homebrew#20546

When ghc's been fixed, I imagine the patch for gtk2hsC2hs will be obvious to anyone
who knows the code.

In the meantime, if you've installed e.g. gcc 4.8 then one way to work around the problem is to simply put links from gcc to gcc-4.8 earlier in the path, install cairo,
then remove them:

cd /usr/local/bin
ln -s gcc-4.8 gcc
ln -s cpp-4.8 cpp
cabal install cairo
rm gcc
rm cpp
It's hardly elegant though!


Reply to this email directly or view it on GitHub.

@mjoldfield

Hamish,

This worked perfectly.

Thanks.

@hamishmack hamishmack closed this Dec 8, 2013
@knardi
knardi commented Mar 5, 2014

This can't be the real fix, can it? Is there an issue tracking clang support?

@robx
robx commented Apr 11, 2014

Hi, just tried compiling cairo on OS X with ghc-7.8.1, and still get this error. I think I have everything up to date (built and installed alex and happy with the new ghc, as well as gtk2hs-buildtools). I built gtk2hs-buildtools from current git, which also didn't seem to help.

I don't really understand what's going on, I take it the relevant ghc bug was this: https://ghc.haskell.org/trac/ghc/ticket/8528 ? Since that was apparently fixed by a patch to alex, I would expect gtk2hsC2hs not to need a separate fix, but maybe something's missing?

It's also quite possible that my ghc installation is broken in some other way, what with the various tweaking to get ghc-7.6 to work back when. Let me know if you'd like my try something else, list some versions, etc. Or whether this is still expected to be broken.

@robx
robx commented May 22, 2014

Still need to pass '--with-gcc=...' to build cairo, otherwise I get the error reported above.

gtk2hs-buildtools 0.12.5.2
cairo 0.12.5.3
Happy Version 1.19.3
Alex version 3.1.3
The Glorious Glasgow Haskell Compilation System, version 7.8.2
gcc --version: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)

@jonashaag

still an issue for me.

@etrepum
etrepum commented Jul 3, 2014

--with-gcc is a workaround, not a fix. I don't get why this was closed?

@hamishmack
Contributor

Quite right reopening.

I expected the issue to go away when the similar looking GHC compilation issue was fixed, but it did not. Instead I think we need to wait until this c2hs issue is fixed then merge the fix into gtk2hsC2Hs. Please help out on the c2hs issue if you can.

@hamishmack hamishmack reopened this Jul 3, 2014
@hamishmack
Contributor

Hmm. Can someone try this out on gtk2hsC2hs?

@hamishmack hamishmack added a commit that closed this issue Jul 7, 2014
@hamishmack hamishmack Fixes #1 aa22754
@hamishmack hamishmack closed this in aa22754 Jul 7, 2014
@ilkka
ilkka commented Sep 20, 2014

I just installed Cairo and Glib (as dependencies of Helm) and had to do this to make 'em work:

$ PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig cabal install glib --with-gcc=gcc-4.9

The env var setting is related to Homebrew more than anything else, but if I don't pass the --with-gcc arg, Glib fails with a very similar error to what @mjoldfield posted.

I'm using GHC 7.8 from http://ghcformacosx.github.io.

@FranklinChen

It was pretty annoying finding out about the --with-gcc=gcc-4.9 workaround on Mac OS Homebrew just now only by searching online for the error message when I was installing ghc-vis, which depends on svgcairo, but I'm glad I found the workaround here!

@EDmitry
EDmitry commented Mar 8, 2015

This still reproduces, why is it closed?

@hamishmack
Contributor

If you can still reproduce this issue please provide a log. Use cabal install -v to get detailed logs and post them here.

@FranklinChen

I'm on Yosemite now and still have this problem.

$ cabal install svgcairo -v
/Users/chen/.cabal/bin/alex --version
/Users/chen/.cabal/bin/c2hs --numeric-version
/Users/chen/.cabal/bin/cpphs --version
/usr/bin/gcc -dumpversion
/Users/chen/.cabal/bin/ghcjs --numeric-ghcjs-version
/Users/chen/.cabal/bin/ghcjs-pkg --ghcjs-version
/Users/chen/.cabal/bin/haddock --version
/Users/chen/.cabal/bin/happy --version
/usr/local/bin/hpc version
looking for tool hsc2hs near compiler in /usr/local/bin
found hsc2hs in /usr/local/bin/hsc2hs
/usr/local/bin/hsc2hs --version
/Users/chen/.cabal/bin/HsColour -version
/usr/local/bin/ghc -c /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/41167.c -o /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/41167.o
/usr/local/Library/ENV/4.3/ld -x -r /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/41167.o -o /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/41168.o
/usr/local/bin/pkg-config --version
Warning: cannot determine version of /usr/bin/strip :
""
/usr/bin/tar --help
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Ready to install svgcairo-0.13.0.1
Extracting
/Users/chen/.cabal/packages/hackage.haskell.org/svgcairo/0.13.0.1/svgcairo-0.13.0.1.tar.gz
to /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167...
Updating svgcairo.cabal with the latest revision from the index.
Configuring svgcairo-0.13.0.1...
creating
/var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup
creating
/var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist
creating
/var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup
copy
/var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/Setup.hs
to
/var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup/setup.hs
/usr/local/bin/ghc --make -odir /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup -hidir /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup -i -i/var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1 -package-id Cabal-1.18.1.5-68e024223ee1f3fdafc9645fde8d0e7d /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup/setup.hs -o /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup/setup -threaded
Waiting for install task to finish...
/var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup/setup
configure --verbose=2 --ghc --prefix=/Users/chen/.cabal
--bindir=/Users/chen/.cabal/bin --libdir=/Users/chen/.cabal/lib
--libsubdir=x86_64-osx-ghc-7.8.4/svgcairo-0.13.0.1
--libexecdir=/Users/chen/.cabal/libexec --datadir=/Users/chen/.cabal/share
--datasubdir=x86_64-osx-ghc-7.8.4/svgcairo-0.13.0.1
--docdir=/Users/chen/.cabal/share/doc/x86_64-osx-ghc-7.8.4/svgcairo-0.13.0.1
--htmldir=/Users/chen/.cabal/share/doc/x86_64-osx-ghc-7.8.4/svgcairo-0.13.0.1/html
--haddockdir=/Users/chen/.cabal/share/doc/x86_64-osx-ghc-7.8.4/svgcairo-0.13.0.1/html
--sysconfdir=/Users/chen/.cabal/etc --user
--extra-prog-path=/Users/chen/.cabal/bin --constraint=text ==1.2.0.4
--constraint=mtl ==2.1.3.1 --constraint=glib ==0.13.1.0 --constraint=cairo
==0.13.1.0 --constraint=base ==4.7.0.2 --disable-tests --disable-benchmarks
Redirecting build log to {handle:
/Users/chen/.cabal/logs/svgcairo-0.13.0.1.log}
Building svgcairo-0.13.0.1...
creating
/var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup
/var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup/setup
build --verbose=2
Redirecting build log to {handle:
/Users/chen/.cabal/logs/svgcairo-0.13.0.1.log}
Failed to install svgcairo-0.13.0.1
Build log ( /Users/chen/.cabal/logs/svgcairo-0.13.0.1.log ):
[1 of 2] Compiling SetupWrapper     ( /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/SetupWrapper.hs, /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main             ( /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup/setup.hs, /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup/Main.o )
Linking /var/folders/v9/kb5mlpr08xjcvb001s75jlj80000gr/T/svgcairo-0.13.0.1-41167/svgcairo-0.13.0.1/dist/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup      ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main             ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Configuring svgcairo-0.13.0.1...
Dependency base ==4.7.0.2: using base-4.7.0.2
Dependency cairo ==0.13.1.0: using cairo-0.13.1.0
Dependency glib ==0.13.1.0: using glib-0.13.1.0
Dependency mtl ==2.1.3.1: using mtl-2.1.3.1
Dependency text ==1.2.0.4: using text-1.2.0.4
Dependency librsvg-2.0 >=2.16.0: using version 2.36.3
/usr/local/bin/ghc --info
Using Cabal-1.18.1.5 compiled by ghc-7.8
Using compiler: ghc-7.8.4
Using install prefix: /Users/chen/.cabal
Binaries installed in: /Users/chen/.cabal/bin
Libraries installed in:
/Users/chen/.cabal/lib/x86_64-osx-ghc-7.8.4/svgcairo-0.13.0.1
Private binaries installed in: /Users/chen/.cabal/libexec
Data files installed in:
/Users/chen/.cabal/share/x86_64-osx-ghc-7.8.4/svgcairo-0.13.0.1
Documentation installed in:
/Users/chen/.cabal/share/doc/x86_64-osx-ghc-7.8.4/svgcairo-0.13.0.1
Configuration files installed in: /Users/chen/.cabal/etc
Using alex version 3.1.4 found on system at: /Users/chen/.cabal/bin/alex
Using ar found on system at: /usr/bin/ar
Using c2hs version 0.23.1 found on system at: /Users/chen/.cabal/bin/c2hs
Using cpphs version 1.18.9 found on system at: /Users/chen/.cabal/bin/cpphs
No ffihugs found
Using gcc version 4.2.1 found on system at: /usr/bin/gcc
Using ghc version 7.8.4 found on system at: /usr/local/bin/ghc
Using ghc-pkg version 7.8.4 found on system at: /usr/local/bin/ghc-pkg
No greencard found
Using gtk2hsC2hs version 0.13.12 found on system at:
/Users/chen/.cabal/bin/gtk2hsC2hs
Using gtk2hsHookGenerator found on system at:
/Users/chen/.cabal/bin/gtk2hsHookGenerator
Using gtk2hsTypeGen found on system at: /Users/chen/.cabal/bin/gtk2hsTypeGen
Using haddock version 2.15.0.2 found on system at:
/Users/chen/.cabal/bin/haddock
Using happy version 1.19.5 found on system at: /Users/chen/.cabal/bin/happy
No hmake found
Using hpc version 0.67 found on system at: /usr/local/bin/hpc
Using hsc2hs version 0.67 found on system at: /usr/local/bin/hsc2hs
Using hscolour version 1.21 found on system at:
/Users/chen/.cabal/bin/HsColour
No hugs found
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
Using pkg-config version 0.28 found on system at: /usr/local/bin/pkg-config
Using ranlib found on system at: /usr/bin/ranlib
Using strip found on system at: /usr/bin/strip
Using tar found on system at: /usr/bin/tar
No uhc found
/usr/local/bin/pkg-config --modversion librsvg-2.0
Component build order: library
creating dist/build
creating dist/build/autogen
Building svgcairo-0.13.0.1...
Preprocessing library svgcairo-0.13.0.1...
creating dist/build/Graphics/Rendering/Cairo
creating dist/build/Graphics/Rendering
creating dist/build/Graphics
creating dist/build/Graphics/Rendering
creating dist/build/Graphics/Rendering/Cairo
/Users/chen/.cabal/bin/gtk2hsC2hs --include=dist/build --include=/usr/local/Cellar/ghc/7.8.4/lib/ghc-7.8.4/base-4.7.0.2 --include=/Users/chen/.cabal/lib/x86_64-osx-ghc-7.8.4/cairo-0.13.1.0 --include=/Users/chen/.cabal/lib/x86_64-osx-ghc-7.8.4/glib-0.13.1.0 --include=/Users/chen/.cabal/lib/x86_64-osx-ghc-7.8.4/mtl-2.1.3.1 --include=/Users/chen/.cabal/lib/x86_64-osx-ghc-7.8.4/text-1.2.0.4 --cpp=/usr/bin/gcc --cppopts=-E --cppopts=-Idist/build/autogen --cppopts=-Idist/build --cppopts=-I. --cppopts=-I/usr/local/Cellar/librsvg/2.36.3_1/include/librsvg-2.0 --cppopts=-I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 --cppopts=-I/usr/local/Cellar/libpng/1.6.16/include/libpng16 --cppopts=-I/usr/local/Cellar/cairo/1.14.0/include/cairo --cppopts=-I/usr/local/Cellar/glib/2.42.2/include/glib-2.0 --cppopts=-I/usr/local/Cellar/glib/2.42.2/lib/glib-2.0/include --cppopts=-I/usr/local/opt/gettext/include --cppopts=-I/usr/local/Cellar/pixman/0.32.6/include/pixman-1 --cppopts=-I/usr/local/Cellar/fontconfig/2.11.1/include --cppopts=-I/usr/local/Cellar/freetype/2.5.3_1/include/freetype2 --cppopts=-I/usr/local/Cellar/freetype/2.5.5/include/freetype2 --cppopts=-I/opt/X11/include --cppopts=-D_REENTRANT --cppopts=-D__GLASGOW_HASKELL__=708 --output-dir=dist/build/Graphics/Rendering/Cairo/ --output=SVG.hs --precomp=dist/build/precompchs.bin svgcairo.h ./Graphics/Rendering/Cairo/SVG.chs
gtk2hsC2hs: Error in C header file.

/usr/include/sys/qos.h:124: (column 34) [FATAL] 
  >>> Syntax error!
  The symbol `__attribute__' does not fit here.

World file is already up to date.
cabal: Error: some packages failed to install:
svgcairo-0.13.0.1 failed during the building phase. The exception was:
ExitFailure 1
@hamishmack
Contributor

That is svgcairo (not one of the packages in this repo). I have pushed a fix to the svgcairo repo and uploaded a new version of svgcairo to hackage.

@FranklinChen

Ah, thanks for the svgcairo fix!

@edsko
edsko commented Mar 11, 2015

I'm still getting this.

# cabal install poppler -v
Using a sandbox located at /Users/e/opt/sandboxes/gtk
/Users/e/opt/util/bin/alex --version
/usr/bin/gcc -dumpversion
/Users/e/opt/ghc/7.8.4-patched/bin/haddock --version
/Users/e/opt/util/bin/happy --version
/Users/e/opt/ghc/7.8.4-patched/bin/hpc version
looking for tool hsc2hs near compiler in /Users/e/opt/ghc/7.8.4-patched/bin
found hsc2hs in /Users/e/opt/ghc/7.8.4-patched/bin/hsc2hs
/Users/e/opt/ghc/7.8.4-patched/bin/hsc2hs --version
/Users/e/opt/ghc/7.8.4-patched/bin/ghc -c /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/65541.c -o /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/65541.o
/usr/bin/ld -x -r /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/65541.o -o /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/65542.o
/Users/e/homebrew/bin/pkg-config --version
/usr/bin/tar --help
Reading available packages...
Reading installed packages...
/Users/e/opt/ghc/7.8.4-patched/bin/ghc-pkg dump '--package-db=/Users/e/opt/sandboxes/gtk/x86_64-osx-ghc-7.8.4.20141229-packages.conf.d' -v0
/Users/e/opt/ghc/7.8.4-patched/bin/ghc --print-libdir
Found no modified add-source deps.
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Notice: installing into a sandbox located at /Users/e/opt/sandboxes/gtk
Ready to install poppler-0.13
Waiting for install task to finish...
Extracting
/Users/e/.cabal/packages/hackage.haskell.org/poppler/0.13/poppler-0.13.tar.gz
to /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541...
Updating poppler.cabal with the latest revision from the index.
Configuring poppler-0.13...
creating
/var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup
creating
/var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22
creating
/var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist
creating
/var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22
creating
/var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup
copy
/var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/Setup.hs
to
/var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup/setup.hs
/Users/e/opt/ghc/7.8.4-patched/bin/ghc --make -odir /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup -hidir /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup -i -i/var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13 -package-db /Users/e/opt/sandboxes/gtk/x86_64-osx-ghc-7.8.4.20141229-packages.conf.d -package-id Cabal-1.18.1.5-inplace /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup/setup.hs -o /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup/setup -threaded
/var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup/setup
configure --verbose=2 --builddir=dist/dist-sandbox-d101ed22 --ghc
--prefix=/Users/e/opt/sandboxes/gtk --bindir=/Users/e/opt/sandboxes/gtk/bin
--libdir=/Users/e/opt/sandboxes/gtk/lib
--libsubdir=x86_64-osx-ghc-7.8.4.20141229/poppler-0.13
--libexecdir=/Users/e/opt/sandboxes/gtk/libexec
--datadir=/Users/e/opt/sandboxes/gtk/share
--datasubdir=x86_64-osx-ghc-7.8.4.20141229/poppler-0.13
--docdir=/Users/e/opt/sandboxes/gtk/share/doc/x86_64-osx-ghc-7.8.4.20141229/poppler-0.13
--htmldir=/Users/e/opt/sandboxes/gtk/share/doc/x86_64-osx-ghc-7.8.4.20141229/poppler-0.13/html
--haddockdir=/Users/e/opt/sandboxes/gtk/share/doc/x86_64-osx-ghc-7.8.4.20141229/poppler-0.13/html
--sysconfdir=/Users/e/opt/sandboxes/gtk/etc --global
--package-db=/Users/e/opt/sandboxes/gtk/x86_64-osx-ghc-7.8.4.20141229-packages.conf.d
--flags=-gtk3 --extra-prog-path=/Users/e/.cabal/bin --constraint=mtl ==2.2.1
--constraint=gtk ==0.13.4 --constraint=glib ==0.13.1.0 --constraint=containers
==0.5.5.1 --constraint=cairo ==0.13.1.0 --constraint=bytestring ==0.10.4.0
--constraint=base ==4.7.0.2 --constraint=array ==0.5.0.0 --disable-tests
--disable-benchmarks
Redirecting build log to {handle:
/Users/e/opt/sandboxes/gtk/logs/poppler-0.13.log}
Building poppler-0.13...
creating
/var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup
/var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup/setup
build --verbose=2 --builddir=dist/dist-sandbox-d101ed22
Redirecting build log to {handle:
/Users/e/opt/sandboxes/gtk/logs/poppler-0.13.log}
Failed to install poppler-0.13
Build log ( /Users/e/opt/sandboxes/gtk/logs/poppler-0.13.log ):
[1 of 2] Compiling SetupWrapper     ( /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/SetupWrapper.hs, /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup/SetupWrapper.o )
[2 of 2] Compiling Main             ( /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup/setup.hs, /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup/Main.o )
Linking /var/folders/94/vkm1c1l17cddyvzk2252hnp40000gs/T/poppler-0.13-65541/poppler-0.13/dist/dist-sandbox-d101ed22/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup      ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main             ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Configuring poppler-0.13...
Flags chosen: gtk3=False
Dependency array ==0.5.0.0: using array-0.5.0.0
Dependency base ==4.7.0.2: using base-4.7.0.2
Dependency bytestring ==0.10.4.0: using bytestring-0.10.4.0
Dependency cairo ==0.13.1.0: using cairo-0.13.1.0
Dependency containers ==0.5.5.1: using containers-0.5.5.1
Dependency glib ==0.13.1.0: using glib-0.13.1.0
Dependency gtk ==0.13.4: using gtk-0.13.4
Dependency mtl ==2.2.1: using mtl-2.2.1
Dependency poppler-glib >=0.12.4: using version 0.29.0
Dependency gobject-2.0 -any: using version 2.42.2
Dependency glib-2.0 -any: using version 2.42.2
Dependency cairo >=1.2.0: using version 1.12.16
Dependency gdk-2.0 -any: using version 2.24.25
Dependency gdk-pixbuf-2.0 -any: using version 2.30.8
Dependency pango -any: using version 1.36.8
/Users/e/opt/ghc/7.8.4-patched/bin/ghc --info
Using Cabal-1.18.1.5 compiled by ghc-7.8
Using compiler: ghc-7.8.4.20141229
Using install prefix: /Users/e/opt/sandboxes/gtk
Binaries installed in: /Users/e/opt/sandboxes/gtk/bin
Libraries installed in:
/Users/e/opt/sandboxes/gtk/lib/x86_64-osx-ghc-7.8.4.20141229/poppler-0.13
Private binaries installed in: /Users/e/opt/sandboxes/gtk/libexec
Data files installed in:
/Users/e/opt/sandboxes/gtk/share/x86_64-osx-ghc-7.8.4.20141229/poppler-0.13
Documentation installed in:
/Users/e/opt/sandboxes/gtk/share/doc/x86_64-osx-ghc-7.8.4.20141229/poppler-0.13
Configuration files installed in: /Users/e/opt/sandboxes/gtk/etc
Using alex version 3.1.4 found on system at: /Users/e/opt/util/bin/alex
Using ar found on system at: /usr/bin/ar
No c2hs found
No cpphs found
No ffihugs found
Using gcc version 4.2.1 found on system at: /usr/bin/gcc
Using ghc version 7.8.4.20141229 found on system at:
/Users/e/opt/ghc/7.8.4-patched/bin/ghc
Using ghc-pkg version 7.8.4.20141229 found on system at:
/Users/e/opt/ghc/7.8.4-patched/bin/ghc-pkg
No greencard found
Using gtk2hsC2hs version 0.13.12 found on system at:
/Users/e/opt/sandboxes/gtk/bin/gtk2hsC2hs
Using gtk2hsHookGenerator found on system at:
/Users/e/opt/sandboxes/gtk/bin/gtk2hsHookGenerator
Using gtk2hsTypeGen found on system at:
/Users/e/opt/sandboxes/gtk/bin/gtk2hsTypeGen
Using haddock version 2.14.3 found on system at:
/Users/e/opt/ghc/7.8.4-patched/bin/haddock
Using happy version 1.19.5 found on system at: /Users/e/opt/util/bin/happy
No hmake found
Using hpc version 0.67 found on system at:
/Users/e/opt/ghc/7.8.4-patched/bin/hpc
Using hsc2hs version 0.67 found on system at:
/Users/e/opt/ghc/7.8.4-patched/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
Using pkg-config version 0.28 found on system at:
/Users/e/homebrew/bin/pkg-config
Using ranlib found on system at: /usr/bin/ranlib
Using strip found on system at: /usr/bin/strip
Using tar found on system at: /usr/bin/tar
No uhc found
/Users/e/homebrew/bin/pkg-config --modversion poppler-glib
/Users/e/homebrew/bin/pkg-config --modversion gobject-2.0
/Users/e/homebrew/bin/pkg-config --modversion glib-2.0
/Users/e/homebrew/bin/pkg-config --modversion cairo
/Users/e/homebrew/bin/pkg-config --modversion gdk-2.0
/Users/e/homebrew/bin/pkg-config --modversion gdk-pixbuf-2.0
/Users/e/homebrew/bin/pkg-config --modversion pango
creating dist/dist-sandbox-d101ed22/build/autogen
creating dist/dist-sandbox-d101ed22/build
creating dist/dist-sandbox-d101ed22/build/autogen
/Users/e/homebrew/bin/pkg-config --modversion poppler-glib
/Users/e/homebrew/bin/pkg-config --modversion gobject-2.0
/Users/e/homebrew/bin/pkg-config --modversion glib-2.0
/Users/e/homebrew/bin/pkg-config --modversion cairo
/Users/e/homebrew/bin/pkg-config --modversion gdk-2.0
/Users/e/homebrew/bin/pkg-config --modversion gdk-pixbuf-2.0
/Users/e/homebrew/bin/pkg-config --modversion pango
Ensuring that class hierarchy in Graphics/UI/Gtk/Poppler/Types.chs is
up-to-date.
/Users/e/opt/sandboxes/gtk/bin/gtk2hsTypeGen '--modname=Graphics.UI.Gtk.Poppler.Types' '--import=System.Glib.GObject' '--lib=poppler' '--prefix=poppler' '--tag=poppler' '--hierarchy=hierarchy.list' '--tag=popplerglib' '--tag=popplerglib-0.0' '--tag=popplerglib-0.2' '--tag=popplerglib-0.4' '--tag=popplerglib-0.6' '--tag=popplerglib-0.8' '--tag=popplerglib-0.10' '--tag=popplerglib-0.12' '--tag=popplerglib-0.14' '--tag=popplerglib-0.16' '--tag=popplerglib-0.18' '--tag=popplerglib-0.20' '--tag=popplerglib-0.22' '--tag=popplerglib-0.24' '--tag=popplerglib-0.26' '--tag=popplerglib-0.28' '--tag=gobject' '--tag=gobject-2.0' '--tag=gobject-2.2' '--tag=gobject-2.4' '--tag=gobject-2.6' '--tag=gobject-2.8' '--tag=gobject-2.10' '--tag=gobject-2.12' '--tag=gobject-2.14' '--tag=gobject-2.16' '--tag=gobject-2.18' '--tag=gobject-2.20' '--tag=gobject-2.22' '--tag=gobject-2.24' '--tag=gobject-2.26' '--tag=gobject-2.28' '--tag=gobject-2.30' '--tag=gobject-2.32' '--tag=gobject-2.34' '--tag=gobject-2.36' '--tag=gobject-2.38' '--tag=gobject-2.40' '--tag=gobject-2.42' '--tag=glib' '--tag=glib-2.0' '--tag=glib-2.2' '--tag=glib-2.4' '--tag=glib-2.6' '--tag=glib-2.8' '--tag=glib-2.10' '--tag=glib-2.12' '--tag=glib-2.14' '--tag=glib-2.16' '--tag=glib-2.18' '--tag=glib-2.20' '--tag=glib-2.22' '--tag=glib-2.24' '--tag=glib-2.26' '--tag=glib-2.28' '--tag=glib-2.30' '--tag=glib-2.32' '--tag=glib-2.34' '--tag=glib-2.36' '--tag=glib-2.38' '--tag=glib-2.40' '--tag=glib-2.42' '--tag=cairo' '--tag=cairo-1.0' '--tag=cairo-1.2' '--tag=cairo-1.4' '--tag=cairo-1.6' '--tag=cairo-1.8' '--tag=cairo-1.10' '--tag=cairo-1.12' '--tag=gdk' '--tag=gdk-2.0' '--tag=gdk-2.2' '--tag=gdk-2.4' '--tag=gdk-2.6' '--tag=gdk-2.8' '--tag=gdk-2.10' '--tag=gdk-2.12' '--tag=gdk-2.14' '--tag=gdk-2.16' '--tag=gdk-2.18' '--tag=gdk-2.20' '--tag=gdk-2.22' '--tag=gdk-2.24' '--tag=gdkpixbuf' '--tag=gdkpixbuf-2.0' '--tag=gdkpixbuf-2.2' '--tag=gdkpixbuf-2.4' '--tag=gdkpixbuf-2.6' '--tag=gdkpixbuf-2.8' '--tag=gdkpixbuf-2.10' '--tag=gdkpixbuf-2.12' '--tag=gdkpixbuf-2.14' '--tag=gdkpixbuf-2.16' '--tag=gdkpixbuf-2.18' '--tag=gdkpixbuf-2.20' '--tag=gdkpixbuf-2.22' '--tag=gdkpixbuf-2.24' '--tag=gdkpixbuf-2.26' '--tag=gdkpixbuf-2.28' '--tag=gdkpixbuf-2.30' '--tag=pango' '--tag=pango-1.0' '--tag=pango-1.2' '--tag=pango-1.4' '--tag=pango-1.6' '--tag=pango-1.8' '--tag=pango-1.10' '--tag=pango-1.12' '--tag=pango-1.14' '--tag=pango-1.16' '--tag=pango-1.18' '--tag=pango-1.20' '--tag=pango-1.22' '--tag=pango-1.24' '--tag=pango-1.26' '--tag=pango-1.28' '--tag=pango-1.30' '--tag=pango-1.32' '--tag=pango-1.34' '--tag=pango-1.36'
Component build order: library
creating dist/dist-sandbox-d101ed22/build
creating dist/dist-sandbox-d101ed22/build/autogen
Building poppler-0.13...
Preprocessing library poppler-0.13...
creating dist/dist-sandbox-d101ed22/build/Graphics/UI/Gtk/Poppler
creating dist/dist-sandbox-d101ed22/build/Graphics/UI/Gtk
creating dist/dist-sandbox-d101ed22/build/Graphics/UI
creating dist/dist-sandbox-d101ed22/build/Graphics
creating dist/dist-sandbox-d101ed22/build/Graphics/UI
creating dist/dist-sandbox-d101ed22/build/Graphics/UI/Gtk
creating dist/dist-sandbox-d101ed22/build/Graphics/UI/Gtk/Poppler
/Users/e/opt/sandboxes/gtk/bin/gtk2hsC2hs --include=dist/dist-sandbox-d101ed22/build --include=/Users/e/wt/projects/fpco/ghc/7.8.4/libraries/array/dist-install/build --include=/Users/e/wt/projects/fpco/ghc/7.8.4/libraries/base/dist-install/build --include=/Users/e/wt/projects/fpco/ghc/7.8.4/libraries/bytestring/dist-install/build --include=/Users/e/opt/sandboxes/gtk/lib/x86_64-osx-ghc-7.8.4.20141229/cairo-0.13.1.0 --include=/Users/e/wt/projects/fpco/ghc/7.8.4/libraries/containers/dist-install/build --include=/Users/e/opt/sandboxes/gtk/lib/x86_64-osx-ghc-7.8.4.20141229/glib-0.13.1.0 --include=/Users/e/opt/sandboxes/gtk/lib/x86_64-osx-ghc-7.8.4.20141229/gtk-0.13.4 --include=/Users/e/opt/sandboxes/gtk/lib/x86_64-osx-ghc-7.8.4.20141229/mtl-2.2.1 --cpp=/usr/bin/gcc --cppopts=-E --cppopts=-Idist/dist-sandbox-d101ed22/build/autogen --cppopts=-Idist/dist-sandbox-d101ed22/build --cppopts=-I. --cppopts=-I/opt/X11/include/cairo --cppopts=-I/opt/X11/include/pixman-1 --cppopts=-I/opt/X11/include --cppopts=-I/opt/X11/include/freetype2 --cppopts=-I/opt/X11/include/libpng15 --cppopts=-I/Users/e/homebrew/Cellar/poppler/0.29.0/include/poppler/glib --cppopts=-I/Users/e/homebrew/Cellar/poppler/0.29.0/include/poppler --cppopts=-I/Users/e/homebrew/Cellar/gtk+/2.24.25/include/gtk-2.0 --cppopts=-I/Users/e/homebrew/Cellar/gtk+/2.24.25/lib/gtk-2.0/include --cppopts=-I/Users/e/homebrew/Cellar/pango/1.36.8/include/pango-1.0 --cppopts=-I/Users/e/homebrew/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 --cppopts=-I/Users/e/homebrew/Cellar/libpng/1.6.16/include/libpng16 --cppopts=-I/Users/e/homebrew/Cellar/glib/2.42.2/include/glib-2.0 --cppopts=-I/Users/e/homebrew/Cellar/glib/2.42.2/lib/glib-2.0/include --cppopts=-I/Users/e/homebrew/opt/gettext/include --cppopts=-D_REENTRANT --cppopts=-D__GLASGOW_HASKELL__=708 --output-dir=dist/dist-sandbox-d101ed22/build/Graphics/UI/Gtk/Poppler/ --output=Types.hs --precomp=dist/dist-sandbox-d101ed22/build/precompchs.bin glib/poppler.h ./Graphics/UI/Gtk/Poppler/Types.chs
gtk2hsC2hs: Error in C header file.

/usr/include/dirent.h:150: (column 10) [FATAL] 
  >>> Syntax error!
  The symbol `^' does not fit here.

World file is already up to date.
cabal: Error: some packages failed to install:
poppler-0.13 failed during the building phase. The exception was:
ExitFailure 1

though that might be a problem with poppler rather than gtk2hsC2hs itself of course.

@FranklinChen

Ah, poppler is still failing for me also, in exactly the same way.

@edsko
edsko commented Mar 11, 2015

Note that just reported another, unrelated, issue with compiling poppler: wavewave/poppler#12. TL;DR is install with

# cabal install poppler --with-gcc=gcc-4.9 --extra-include-dirs=/path/to/homebrew/include
@wavewave
Member
wavewave commented Jun 7, 2016

@edsko now I got to know the above The symbol^does not fit here issue. will examine it. thanks.

@wavewave wavewave referenced this issue in wavewave/poppler Jun 7, 2016
Closed

poppler installation is broken on OS X #18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment