Last active
July 2, 2019 07:28
-
-
Save kpj/fc5570b9ebd77644c49739a340de42db to your computer and use it in GitHub Desktop.
Compile and install the latest version of python-igraph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -eu | |
#https://github.com/igraph/python-igraph/issues/157 | |
#https://github.com/Homebrew/homebrew-core/blob/master/Formula/igraph.rb | |
#https://github.com/gephi/gephi/wiki/GraphStreaming#Server_Module | |
wd="tmp" | |
rm -rf "$wd" && mkdir "$wd" | |
cd "$wd" | |
# get python-package source | |
git clone https://github.com/igraph/python-igraph/ | |
cd python-igraph | |
# retrieve and compile igraph C-core | |
git clone https://github.com/igraph/igraph igraphcore | |
cd igraphcore | |
./bootstrap.sh | |
mkdir _build && cd _build | |
../configure --prefix=$PWD/../_install | |
make -j4 | |
make install | |
cd ../../ | |
# install python package | |
# `--prefix=` is a fix for "error: can't combine user with prefix, exec_prefix/home, or install_(plat)base" | |
CPPFLAGS=-I$PWD/igraphcore/_install/include/igraph \ | |
LDFLAGS=-L$PWD/igraphcore/_install/lib \ | |
PKG_CONFIG_PATH=igraphcore/_install/lib/pkgconfig/ \ | |
python3 setup.py install --user --prefix= |
Many thanks! I just ran your script and successfully installed python-igraph on an old MacOS: 10.7. I would have given up if it weren't for your script.
I'm not 100% sure, but I think I had to do one thing differently: the cd -
on line 23 seems to go back to the tmp/igraphcore
directory, but the last command needs to be run from the tmp
directory.
BTW, is it OK to delete the tmp
directory once the installation is complete?
Wonderful! I am glad to hear it was of help.
And you are very correct, I replaced line 23 with cd ../../
.
If you have successfully installed the Python package to another directory, it should be fine to get rid of tmp
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The main problem seems to be, that you are missing some dependencies.
I don't use Ubuntu, so I cannot give you the exact solution, but something along the following should get you started:
(source: https://askubuntu.com/questions/45480/how-do-i-install-aclocal)