Search code examples
haskellz3haskell-stack

Cannot install z3 package for Haskell on OS X


I'm trying to install the z3 package as follows:

stack install z3 --extra-lib-dirs=/usr/local/bin --extra-include-dirs=/usr/local/bin

Which brings up the following errors:

Configuring z3-4.3.1...
Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3: Missing dependency on a foreign
library:
* Missing (or bad) header file: z3.h
* Missing (or bad) C library: z3
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

I originally installed z3 as so:

brew install z3

and verified the installation location by running

which z3 #=> /usr/local/bin/z3

Let me know what I could try!


Solution

  • You are probably need to pass --extra-lib-dirs=/usr/local/lib --extra-include-dirs=/usr/local/include.