Compilation problem

233 views
Skip to first unread message

John J. Camilleri

unread,
May 1, 2012, 6:12:57 AM5/1/12
to gf-...@googlegroups.com
I am getting a new error today when trying to compile GF from source:

Resolving dependencies...
unrecognized option `--disable-benchmarks'
cabal: Error: some packages failed to install:
gf-3.3.3 failed during the configure step. The exception was:
ExitFailure 1

My versions:
  • Ubuntu 12.04 (32-bit)
  • The Glorious Glasgow Haskell Compilation System, version 7.4.1
  • cabal-install version 0.14.0
    using version 1.14.0 of the Cabal library 

Thomas Hallgren

unread,
May 1, 2012, 6:41:57 AM5/1/12
to gf-...@googlegroups.com
Perhaps that can be solved with 'cabal clean' (or 'rm -r dist')?

Thomas H

On 2012-05-01 12:12 , John J. Camilleri wrote:
> I am getting a new error today when trying to compile GF from source:
>
> Resolving dependencies...
> unrecognized option `--disable-benchmarks'
> cabal: Error: some packages failed to install:
> gf-3.3.3 failed during the configure step. The exception was:
> ExitFailure 1
>
> My versions:
>
> * Ubuntu 12.04 (32-bit)
> * The Glorious Glasgow Haskell Compilation System, version 7.4.1
> * cabal-install version 0.14.0

John J. Camilleri

unread,
May 1, 2012, 6:58:51 AM5/1/12
to gf-...@googlegroups.com
That seems to have worked, although now I get a dependency problem:

Resolving dependencies...
Configuring gf-3.3.3...
setup: The program alex version >=2 && <3 is required but the version found at
/usr/bin/alex is version 3.0.1
cabal: Error: some packages failed to install:
gf-3.3.3 failed during the configure step. The exception was:
ExitFailure 1


Thomas Hallgren

unread,
May 1, 2012, 7:19:16 AM5/1/12
to gf-...@googlegroups.com
GF has not yet been adapted to the backward incompatible changes in alex 3, so
the easiest solution is to install alex 2:

cabal install alex-2.3.5

Make sure it is installed in a directory on your $PATH that is searched before
/usr/bin.

Another quick workaround could be to remove the dependency on alex from gf.cabal
and remove src/compiler/GF/Grammar/Lexer.x, relying on the Lexer.hs that is
present in the darcs repository.

Thomas H

PS
Is there haskell-platform package available for Ubuntu 12.04? If so, which
version of alex does it include?


On 2012-05-01 12:58 , John J. Camilleri wrote:
> That seems to have worked, although now I get a dependency problem:
>
> Resolving dependencies...
> Configuring gf-3.3.3...
> setup: The program alex version >=2 && <3 is required but the version found at
> /usr/bin/alex is version 3.0.1
> cabal: Error: some packages failed to install:
> gf-3.3.3 failed during the configure step. The exception was:
> ExitFailure 1
>
>
> On 1 May 2012 12:41, Thomas Hallgren <hall...@chalmers.se

Dinesh Simk

unread,
May 1, 2012, 8:13:53 AM5/1/12
to gf-...@googlegroups.com
I am getting the similar issue as well when tried installing on ubuntu 12.04

first I got  unrecognized option `--disable-benchmarks' error

on the second try with cabal clean, the error says

dist/build/gf/gf-tmp/GF/Grammar/Lexer.hs:417:17:
    Illegal bang-pattern (use -XBangPatterns):
    ! (base)
cabal: Error: some packages failed to install:
gf-3.3.3 failed during the building phase. The exception was:
ExitFailure 1

I have Alex version 2.3.3

surprisingly when I tried installing alex-2-3-5, got similar error

dist/build/alex/alex-tmp/Scan.hs:344:17:
    Illegal bang-pattern (use -XBangPatterns):
    ! (base)
cabal: Error: some packages failed to install:
alex-2.3.5 failed during the building phase. The exception was:
ExitFailure 1

I am using
GHC, version 7.4.1
Ubuntu 12.04
cabal 1.14.0

/Dinesh
--
Best Regards
Dinesh Simkhada



John J. Camilleri

unread,
May 1, 2012, 8:33:14 AM5/1/12
to gf-...@googlegroups.com
Unfortunately I had problems trying to install alex-2.3.5, and the workaround you suggested produced some other compiler errors.

Yes there is haskell-platform for 12.04, details here: http://packages.ubuntu.com/precise/haskell-platform
Seems like it contains alex-3.0.1

Thomas Hallgren

unread,
May 1, 2012, 6:52:26 PM5/1/12
to gf-...@googlegroups.com

The changes needed to compile GF with ghc>=7.2 went in after gf-3.3.3 was
released, so you need to get the latest version from darcs...

darcs get --lazy http://www.grammaticalframework.org/ GF


And it seems alex-2.3.5 needs similar changes, but if you already have
alex-2.3.3 working, that should be fine too.

Thomas H


On 2012-05-01 14:13 , Dinesh Simk wrote:
> I am getting the similar issue as well when tried installing on ubuntu 12.04
>
> first I got unrecognized option `--disable-benchmarks' error
>
> on the second try with cabal clean, the error says
>
> /
> dist/build/gf/gf-tmp/GF/Grammar/Lexer.hs:417:17:
> Illegal bang-pattern (use -XBangPatterns):
> ! (base)
> cabal: Error: some packages failed to install:
> gf-3.3.3 failed during the building phase. The exception was:
> ExitFailure 1
> /
>
> I have Alex version 2.3.3
>
> surprisingly when I tried installing alex-2-3-5, got similar error
>
> /dist/build/alex/alex-tmp/Scan.hs:344:17:/
> / Illegal bang-pattern (use -XBangPatterns):/
> / ! (base)/
> /cabal: Error: some packages failed to install:/
> /alex-2.3.5 failed during the building phase. The exception was:/
> /ExitFailure 1/

Thomas Hallgren

unread,
May 1, 2012, 6:58:43 PM5/1/12
to gf-...@googlegroups.com
It is getting more complicated than I expected... We should really make GF
compile with alex 3.

I am surprised that the haskell-package in Ubuntu 12.04 is version 2012.1.0.0,
when the latest version available on the Haskell Platform web page is
2011.4.0.0. GF compiles fine with that version...

Thomas H

John J. Camilleri

unread,
May 2, 2012, 3:33:06 PM5/2/12
to gf-...@googlegroups.com
After testing on another machine running Ubuntu 12.04, I can confirm that everything works fine as long as I have alex-2.3.5 installed.
However on my laptop alex-3.0.1 is already installed (both via cabal and via apt) and when I try to downgrade I get a similar error about bang-patterns:

$ cabal install 'alex < 3'
Resolving dependencies...
[1 of 1] Compiling Main             ( /tmp/alex-2.3.524493/alex-2.3.5/Setup.lhs, /tmp/alex-2.3.524493/alex-2.3.5/dist/setup/Main.o )

/tmp/alex-2.3.524493/alex-2.3.5/Setup.lhs:6:52:
    Warning: In the use of `buildVerbose'
             (imported from Distribution.Simple.Setup):
             Deprecated: "Use buildVerbosity instead"

/tmp/alex-2.3.524493/alex-2.3.5/Setup.lhs:7:52:
    Warning: In the use of `defaultUserHooks'
             (imported from Distribution.Simple):
             Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
             compatibility in which case you must stick with defaultUserHooks"

/tmp/alex-2.3.524493/alex-2.3.5/Setup.lhs:12:26:
    Warning: In the use of `try'
             (imported from System.IO.Error):
             Deprecated: "Please use the new exceptions variant, Control.Exception.try"
Linking /tmp/alex-2.3.524493/alex-2.3.5/dist/setup/setup ...
Warning: defaultUserHooks in Setup script is deprecated.
Configuring alex-2.3.5...
Building alex-2.3.5...
Preprocessing executable 'alex' for alex-2.3.5...
[ 1 of 16] Compiling Set              ( src/Set.hs, dist/build/alex/alex-tmp/Set.o )
[ 2 of 16] Compiling DFS              ( src/DFS.hs, dist/build/alex/alex-tmp/DFS.o )
[ 3 of 16] Compiling Sort             ( src/Sort.hs, dist/build/alex/alex-tmp/Sort.o )
[ 4 of 16] Compiling Paths_alex       ( dist/build/autogen/Paths_alex.hs, dist/build/alex/alex-tmp/Paths_alex.o )
[ 5 of 16] Compiling Util             ( src/Util.hs, dist/build/alex/alex-tmp/Util.o )
[ 6 of 16] Compiling Map              ( src/Map.hs, dist/build/alex/alex-tmp/Map.o )
[ 7 of 16] Compiling CharSet          ( src/CharSet.hs, dist/build/alex/alex-tmp/CharSet.o )
[ 8 of 16] Compiling AbsSyn           ( src/AbsSyn.hs, dist/build/alex/alex-tmp/AbsSyn.o )
[ 9 of 16] Compiling Info             ( src/Info.hs, dist/build/alex/alex-tmp/Info.o )
[10 of 16] Compiling Output           ( src/Output.hs, dist/build/alex/alex-tmp/Output.o )
[11 of 16] Compiling ParseMonad       ( src/ParseMonad.hs, dist/build/alex/alex-tmp/ParseMonad.o )
[12 of 16] Compiling Scan             ( dist/build/alex/alex-tmp/Scan.hs, dist/build/alex/alex-tmp/Scan.o )

dist/build/alex/alex-tmp/Scan.hs:344:17:
    Illegal bang-pattern (use -XBangPatterns):
    ! (base)
cabal: Error: some packages failed to install:
alex-2.3.5 failed during the building phase. The exception was:
ExitFailure 1

John J. Camilleri

unread,
May 4, 2012, 3:19:14 AM5/4/12
to gf-...@googlegroups.com
Ok, I finally managed to get alex-2.3.5 on my laptop by essentially copying the files from a computer with alex-2.3.5 installed.
The files I needed to create/overwrite are:

~/.cabal/bin/alex (binary, replacing the 3.0.1 binary)
~/.cabal/share/alex-2.3.5/ (entire directory)
/usr/lib/libffi.so.5.0.10 (and a soft link to it in the same directory named "libffi.so.5")

For anyone else who might need to do this, I have put the required files online here: http://johnjcamilleri.com/files/alex-2.3.5.zip

John J. Camilleri

unread,
May 4, 2012, 3:22:09 AM5/4/12
to gf-...@googlegroups.com
Also as Thomas mentioned earlier, you need to make sure that ~/.cabal/bin comes before /usr/bin in your $PATH environment variable.

Thomas Hallgren

unread,
May 4, 2012, 9:29:46 AM5/4/12
to gf-...@googlegroups.com
I have just pushed another quick fix for the problem with Alex 3. Aarne
suggested that since the lexer is rarely updated these days, we can simply hide
Lexer.x from cabal and include the generated Lexer.hs in the source repository
instead.

So, by eliminating the dependency on Alex, GF should now compile both with
haskell-platform-2012.1.0.0 (Ubuntu 12.04) and with older versions of the
haskell-platform. Developers who nevertheless want to change the lexer will need
to run Alex 2 manually to update Lexer.hs.

But I consider this a temporary workaround. At some point Lexer.x should be made
compatible with Alex 3, but this does not seem urgent.

Thomas H

Fer

unread,
May 9, 2012, 9:05:40 PM5/9/12
to Grammatical Framework
Hello all,


I have been trying to make GF compile and I got the same messages as
John:

setup: The program alex version >=2 && <3 is required but it could
not be
found.
World file is already up to date.
cabal: Error: some packages failed to install:
gf-3.3.3 failed during the configure step. The exception was:
ExitFailure 1

Also, when I execute ghc-pkg check, some packages get broken:

The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.

warp-1.2.0.1
network-conduit-0.4.0
wai-1.2.0.1
simple-sendfile-0.2.3
network-2.3.0.11
HTTP-4000.2.3
regex-tdfa-1.1.8
scion-browser-0.2.8
hoogle-4.2.11
simple-sendfile-0.2.2
buildwrapper-0.5.2

If I reinstall some of them, in the end I have scion-browser-0.2.8 as
the last package being broken.

fer@router-vm:~/.cabal$ ghc-pkg check
There are problems in package scion-browser-0.2.8:
dependency "HTTP-4000.2.3-af5251d1ef77b2ff8a23233211d2404c" doesn't
exist
dependency "aeson-0.6.0.2-49fe5fdc248c2747e1a31151cbbf3fae" doesn't
exist
dependency "conduit-0.4.1.1-92ab70311aa681a7f5cbda5ff4176ddf"
doesn't exist
dependency "parsec-3.1.2-00e7a56c324cb20db344ae336fa70293" doesn't
exist
dependency "persistent-0.9.0.3-8ba99a4cf62ddc86d9af66c3b2a984ba"
doesn't exist
dependency "persistent-
sqlite-0.9.0.1-75b64a1012e33c5f4452510aedf9e4b5" doesn't exist
dependency "persistent-
template-0.9.0.1-5c9f970c4e24a1ddad3d6d37fe63ecc5" doesn't exist

The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
scion-browser-0.2.8


If I reinstall it, once again a lot of packets get broken. I'm not
sure why this is happening or how I could fix this. The only thing I
know is that GF is doing the same thing when I install it and I get
the same message as John. Now I have installed the 2.3.5 version of
Alex and deleted the 3.0 one. Furthermore, I don't know how to
eliminate that dependency on Alex so I can compile it, but maybe the
problem is from before.


If you have something similar, I would appreciate if you can share
your experience.

Fer

unread,
May 9, 2012, 9:16:00 PM5/9/12
to Grammatical Framework
Also, and sorry for the double post, since I can not install properly
GF, I do not have some packages ready as PGF, basic for my application
with Haskell. More or less the same as Hannes here:
http://groups.google.com/group/gf-dev/browse_thread/thread/17623db8e968677b

Any ideas?

On May 4, 3:29 pm, Thomas Hallgren <hallg...@chalmers.se> wrote:

Thomas Hallgren

unread,
May 10, 2012, 4:16:26 PM5/10/12
to gf-...@googlegroups.com
Hi,

To avoid the problem with alex, get the latest version of GF from darcs:
cd GF
cabal install

or download the snapshot I made today (probably faster than 'darcs get'...)


http://www.grammaticalframework.org/~hallgren/tmp/gf-darcs-snapshot-120510.tar.gz


It also seems like you might have some dependency problems that are unrelated to
GF, so I am not sure if it will actually prevent you from building GF
successfully. If it does, one way around it could be to delete everything and
then reinstall the things you really need, starting with GF.

Other less drastic options could be to log in as a different user before
building GF (assuming most things are installed with --user rather than
--global), or to use cabal-dev to compile GF in its own separate build
environment, unaffected by anything else you might have installed (but I haven't
tried this myself).

http://hackage.haskell.org/package/cabal-dev

Thomas H

Rogan Creswick

unread,
May 10, 2012, 4:39:24 PM5/10/12
to gf-...@googlegroups.com
On Thu, May 10, 2012 at 1:16 PM, Thomas Hallgren <hall...@chalmers.se> wrote:
> use cabal-dev to compile GF in its own separate build
> environment, unaffected by anything else you might have installed (but I haven't
> tried this myself).
>
>    http://hackage.haskell.org/package/cabal-dev
>

Cabal-dev should work well :) (I've used it, but it's been a while
since I've built GF.)

--Rogan /one of the cabal-dev maintainers

Fer

unread,
May 20, 2012, 8:26:21 PM5/20/12
to Grammatical Framework
Hello again,

After some other issues I managed to unregister package by package
from cabal and reinstalled everything once again. This way finally I
did not get any dependency problems and all the packages were
unbroken. Afterwards, I checked the "darcs" solution, working
perfectly fine after some time (it is long process, indeed). Now I can
work with GF. Thanks to both!


Best regards.

On May 10, 10:39 pm, Rogan Creswick <cresw...@gmail.com> wrote:

olga.caprotti

unread,
May 25, 2012, 12:06:28 PM5/25/12
to gf-...@googlegroups.com
Thomas,

do I have to do a clean before running the install update?
I wanted to update my GF installation and found no instructions on how to proceed from an older installation.

See log here below for issue with gcc path:


SuperSoulFighter:~ olgacaprotti$ cabal install gf
Resolving dependencies...
Downloading gf-3.3.3...
[1 of 2] Compiling WebSetup         ( /var/folders/vf/kynvd57s2x31bqjtnqy_k7z00000gn/T/gf-3.3.38408/gf-3.3.3/WebSetup.hs, /var/folders/vf/kynvd57s2x31bqjtnqy_k7z00000gn/T/gf-3.3.38408/gf-3.3.3/dist/setup/WebSetup.o )
ghc: could not execute: /Developer/usr/bin/gcc

cabal: Error: some packages failed to install:
gf-3.3.3 failed during the configure step. The exception was:
ExitFailure 1
SuperSoulFighter:~ olgacaprotti$ /Developer/usr/bin/gcc
-bash: /Developer/usr/bin/gcc: No such file or directory
SuperSoulFighter:~ olgacaprotti$ which gcc
/usr/bin/gcc


Help is appreciated.
Thanks.
--olga

Thomas Hallgren

unread,
May 25, 2012, 12:25:53 PM5/25/12
to gf-...@googlegroups.com
Hi Olga,

I am guessing that /Developer/usr/bin/gcc comes from the Xcode package, perhaps
you don't have it? You can check under System Preferences -> Software Update ->
Installed Software. I think you need to have at least Xcode 3.2.3. (Actually I
have 3.2.2 and it works.)

Thomas H

Olga Caprotti

unread,
May 25, 2012, 12:43:19 PM5/25/12
to gf-...@googlegroups.com
There is no version number listed after XCode in my installation.
I have Version 4.3.2 - according to its splash screen.

--olga

Thomas Hallgren

unread,
May 28, 2012, 8:44:58 AM5/28/12
to gf-...@googlegroups.com
A little later than I'd hoped: RC4 release candidates of the source tar ball and mac builds


For mac, these require the command line tools be installed. You can check if you have them by seeing if you have /usr/bin/gcc present on your system (the installer will do this check, too).  If you don't have them, you can get these via:

10.7: You can just download, mount, and install "Command Line Tools for Xcode" from Apple's Developer Downloads page. You don't need Xcode installed, despite the title.

10.7 & Xcode 4.3: If you installed Xcode 4.3. You can go to Preferences, then the Downloads tab. There you can download the Command Line Tools as an optional component. This installs the same package as listed in the above option.

older Xcode: If you installed Xcode 4.2 or earlier on 10.7, or Xcode 3.2 on 10.6, be sure that you installed the Command Line Tools component. In some versions of Xcode this option was called "Unix Development Tools".

-- Mark

Reply all
Reply to author
Forward
0 new messages