'pkg-config' version >=0.9.0 is required but it could not be found."

4,529 views
Skip to first unread message

Kevin Meredith

unread,
May 11, 2016, 9:58:37 PM5/11/16
to haskell-stack
When trying to `stack build` the following repo:

I get this error:

 setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: The program 'pkg-config' version

    >=0.9.0 is required but it could not be found.


I blindly tried:


$cabal install pkg-config

cabal: There is no package named 'pkg-config'.

You may need to run 'cabal update' to get the latest list of available

packages.


But that did not work.


Can you please tell me how to resolve it?


Thanks,

Kevin



Michael Sloan

unread,
May 11, 2016, 10:57:47 PM5/11/16
to Kevin Meredith, haskell-stack
Hey!

Which OS are you on?  If on windows, "stack setup" should install it.  Otherwise, how about searching "install pkg-config _" where "_" is your operating system.

--
You received this message because you are subscribed to the Google Groups "haskell-stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stac...@googlegroups.com.
To post to this group, send email to haskel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/4abe3691-fad1-4f60-8e9b-1be57482bb8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Meredith

unread,
May 12, 2016, 8:30:48 PM5/12/16
to haskell-stack
Hello!

Thanks for your reply.

I'm using Mac OS X Yosemite. I could not figure out which argument to pass (per the _ argument you noted).

So then I ran the following commands successfully from https://twdkz.wordpress.com/2015/02/25/haskell-on-yosemite-osx-10-10/:

brew install pkg-config
brew install pcre

# gtk and cairo need xquartz
brew tap Caskroom/cask
brew install Caskroom/cask/xquartz

# later steps in the build processes need to find libraries
# like xcb-shm via package config. Tell pkg-config
# where they are.
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig

brew install cairo
brew install gtk

But, after running those commands, I re-ran `stack build` to get:

    Configuring zeromq4-haskell-0.6.5...

    setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: The pkg-config package 'libzmq'

    version >=4.0 && <5.0 is required but it could not be found.


How can I resolve this issue?

Lastly, from a conceptual point of view, is it sufficient to specify libraries in the `stack` project (I assume stack.yaml), and then `stack` 
will download all necessary dependencies? I don't have any background with cabal, so I'm confused on this point.

Thanks,
Kevin

Kevin Meredith

unread,
May 12, 2016, 8:37:29 PM5/12/16
to haskell-stack
Actually, I found a solution - https://github.com/JustinTulloss/zeromq.node/issues/283#issuecomment-51431863.

But, if you could please answer my cabal question, I'd appreciate it.

Michael Sloan

unread,
May 12, 2016, 8:48:06 PM5/12/16
to Kevin Meredith, haskell-stack
"stack setup" does install some 3rd party tools.  However, after that, stack does not install 3rd party tools / libraries - it's up to the user to install them.  The metadata for how to automate installation of these things on different OSes usually does not exist, unfortunately.  It may be something that stack tackles in the future, but not at this time.

-Michael

Reply all
Reply to author
Forward
0 new messages