Opened 6 years ago

Closed 6 years ago

#7846 closed bug (fixed)

GHC 7.7 cannot link primitives

Reported by: kazu-yamamoto Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.7
Keywords: Cc: pho@…
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Compile-time performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


When I tries to install the vector library on Linux, GHC 7.7 cannot find a necessary primitive library:

% cabal install vector
[ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( Data/Vector/Fusion/Stream/Monadic.hs, dist/build/Data/Vector/Fusion/Stream/Monadic.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package primitive- ... <command line>: can't load .so/.DLL for: ( cannot open shared object file: No such file or directory)
cabal: Error: some packages failed to install:
vector- failed during the building phase. The exception was:
ExitFailure 1

Note that static library of primitive is installed but dynamic one is not.

Change History (4)

comment:1 Changed 6 years ago by PHO

Cc: pho@… added

comment:2 Changed 6 years ago by kazu-yamamoto

FYI. If I do

% cabal install --enable-shared primitives

, I can install the vector libraries.

comment:3 Changed 6 years ago by kazu-yamamoto

After adding mk/ with the following contents, I don't have to install vector by hand.

InstallExtraPackages = YES

comment:4 Changed 6 years ago by igloo

difficulty: Unknown
Resolution: fixed
Status: newclosed

Thanks for the report. I've made Cabal build the shared library by default (although note that you'll need to build cabal-install against the HEAD Cabal in order for the 'cabal' program to do so).

commit 8743f4ef5937f050458186058057f0e538d1d37b
Author: Ian Lynagh <>
Date:   Thu Apr 25 17:52:56 2013 +0100

    Build shared libraries by default when building for a dynamic ghc; fixes #7846
    GHCi will need a shared library, so we build it by default
Note: See TracTickets for help on using tickets.