vtraag / louvain-igraph

Implementation of the Louvain algorithm for community detection with various methods for use with igraph in python.
GNU General Public License v3.0
246 stars 46 forks source link

"library not found for -lSystem" on mac due to old gcc via brew #47

Closed ryan-williams closed 5 years ago

ryan-williams commented 5 years ago

(noting an issue I faced while installing)

I was seeing this error from pip install louvain on macOS:

ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

Turns out I had an old version of gcc linked in brew:

$ ls -l /usr/local/bin/g++*
lrwxr-xr-x 1 … /usr/local/bin/g++ -> g++-4.9
lrwxr-xr-x 1 … /usr/local/bin/g++-4.9 -> ../Cellar/gcc@4.9/4.9.4_1/bin/g++-4.9
lrwxr-xr-x 1 … /usr/local/bin/g++-7 -> ../Cellar/gcc@7/7.4.0/bin/g++-7
lrwxr-xr-x 1 … /usr/local/bin/g++-8 -> ../Cellar/gcc/8.3.0/bin/g++-8

This fixed it:

sudo ln -sf /usr/local/bin/g++-8 /usr/local/bin/g++
vtraag commented 5 years ago

Thanks for the issue and fix!

Note that this package is deprecated. You probably want to check out the new package https://github.com/vtraag/leidenalg. Most likely the same issue and fix will apply there. But if this does not work, let me know!