Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
added pycrypto module build hints for OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
hal0x2328 committed Oct 21, 2017
1 parent 363406f commit c9c7a74
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

## Getting started

You will need to install the libleveldb library. Install [Python 3.5](https://www.python.org/downloads/release/python-354/) to make sure you don't run into any issues with your version of Python being different than the current maintainer's version.
You will need to install the libleveldb library. Install [Python 3.5](https://www.python.org/downloads/release/python-354/) to make sure you don't run into any issues with your version of Python being different than the current maintainer's version. Note that Python 3.6 is not currently supported due to incompatibilities with the byteplay module.

We have published a Youtube [video](https://youtu.be/oy6Z_zd42-4) to help get you started with this library. There are other videos under the CityOfZion Youtube channel.

Expand Down Expand Up @@ -117,17 +117,24 @@ You may need to uninstall plyvel (python libleveldb library), and reinstall with

```
pip uninstall plyvel
CFLAGS='-mmacosx-version-min=10.7 -stdlib=libc++' pip install --no-use-wheel plyvel --no-cache-dir
CFLAGS='-mmacosx-version-min=10.7 -stdlib=libc++' pip install --no-use-wheel plyvel --no-cache-dir --global-option=build_ext --global-option="-I/usr/local/Cellar/leveldb/1.20_2/include/" --global-option="-L/usr/local/lib"
```

Moreover, this pip installation must see the leveldb header file db.h.
You may need to add flags similar to the following to the
installation command
You may also encounter issues when installing the pycrypto module on OSX:

```
--global-option=build_ext
--global-option="-I/usr/local/Cellar/leveldb/1.20_2/include/"
--global-option="-L/usr/local/lib"
src/_fastmath.c:36:11: fatal error: 'gmp.h' file not found
# include <gmp.h>
^~~~~~~
330 warnings and 1 error generated.
error: command 'clang' failed with exit status 1
```

This may be fixed by installing the gmp library using homebrew and running pip install with the following commandline:

```
brew install gmp
CFLAGS='-mmacosx-version-min=10.7 -stdlib=libc++' pip install --no-use-wheel pycrypto --no-cache-dir --global-option=build_ext --global-option="-I/usr/local/Cellar/gmp/6.1.2/include/" --global-option="-L/usr/local/lib"
```

## Running
Expand Down Expand Up @@ -229,4 +236,4 @@ coverage report -m --omit=venv/*

## Donations

Accepted at __ATEMNPSjRVvsXmaJW4ZYJBSVuJ6uR2mjQU__
Accepted at __ATEMNPSjRVvsXmaJW4ZYJBSVuJ6uR2mjQU__

0 comments on commit c9c7a74

Please sign in to comment.