I'm trying to install the pynauty Python package. When I ran python setup.py build
, I got the following error. I have installed the dependencies. How can I successfully install this Python package?
$ python setup.py build
running build
running build_py
running build_ext
building 'pynauty._pynauty' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Inauty -Isrc -I/usr/include/python2.7 -c src/pynauty.c -o build/temp.linux-x86_64-2.7/src/pynauty.o -O4
In file included from src/pynauty.c:16:0:
nauty/nauty.h:40:0: warning: "_FILE_OFFSET_BITS" redefined
#define _FILE_OFFSET_BITS 0
^
In file included from /usr/include/python2.7/pyconfig.h:3:0,
from /usr/include/python2.7/Python.h:8,
from src/pynauty.c:15:
/usr/include/x86_64-linux-gnu/python2.7/pyconfig.h:1157:0: note: this is the location of the previous definition
#define _FILE_OFFSET_BITS 64
^
src/pynauty.c: In function ‘_make_nygraph’:
src/pynauty.c:363:33: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
while (PyDict_Next(adjdict, &i, &key, &adjlist)) {
^
In file included from /usr/include/python2.7/Python.h:101:0,
from src/pynauty.c:15:
/usr/include/python2.7/dictobject.h:114:17: note: expected ‘Py_ssize_t *’ but argument is of type ‘int *’
PyAPI_FUNC(int) PyDict_Next(
^
src/pynauty.c: In function ‘init_pynauty’:
src/pynauty.c:537:15: warning: variable ‘m’ set but not used [-Wunused-but-set-variable]
PyObject *m;
^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/pynauty.o nauty/nauty.o nauty/nautil.o nauty/naugraph.o -o build/lib.linux-x86_64-2.7/pynauty/_pynauty.so
/usr/bin/ld: nauty/nauty.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
nauty/nauty.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1