Skip to content

Instantly share code, notes, and snippets.

@asmaier
Forked from andrisasuke/install_m2crypto.txt
Last active May 18, 2020 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asmaier/c0cc95a823264c90ce080754d5f5a68e to your computer and use it in GitHub Desktop.
Save asmaier/c0cc95a823264c90ce080754d5f5a68e to your computer and use it in GitHub Desktop.
python install m2crypto on Mac OS X

Do

$> brew install openssl
$> brew install swig

Now add these lines to your ~/.zshrc file on Mac OS X

# this is very slow, see https://github.com/Homebrew/brew/issues/3327
# OPENSSL=$(brew --prefix openssl)
# this is much faster
# OPENSSL=$(dirname $(dirname $(which openssl)))
# hardcoding is fastest
OPENSSL=/usr/local/opt/openssl@1.1
export PATH="$OPENSSL/bin:$PATH"
export LDFLAGS="-L$OPENSSL/lib"
export CPPFLAGS="-I$OPENSSL/include"
export PKG_CONFIG_PATH="$OPENSSL/lib/pkgconfig"
export SWIG_FEATURES="-cpperraswarn -includeall -I$OPENSSL/include"

Then in a new terminal do

$> pip install m2crypto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment