Open charlesmartin14 opened 2 years ago
On macOS Big Sur(11.6.4) and python 3.9.10, I had a similar problem. I found the following two workarounds to solve it:
to update bindings for python, by running
pip install cython
cd python/ad3
cython *.pyx --cplus
as written in https://github.com/andre-martins/AD3/tree/master/python
I think this is the workaround for the error:
python/ad3/factor_graph.cpp:20831:26: error: no member named 'tp_print' in '_typeobject'
to link correctly libad3.a, by apply patch to setup.py as
@@ -50,6 +50,7 @@ class our_build_ext(build_ext):
for e in self.extensions:
e.extra_compile_args.extend(compile_args)
+ e.extra_link_args.append('-Lad3')
build_ext.build_extensions(self)
Can not compile on MacOS High Sierra, using Python 3.10
cpp --version Apple LLVM version 9.0.0 (clang-900.0.38) Target: x86_64-apple-darwin17.7.0
Here's the error message:
building 'ad3.factor_graph' extension clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/charleshmartin/anaconda3/envs/ssvm/include -fPIC -O2 -isystem /Users/charleshmartin/anaconda3/envs/ssvm/include -I. -Iad3 -I/Users/charleshmartin/anaconda3/envs/ssvm/include/python3.10 -c python/ad3/factor_graph.cpp -o build/temp.macosx-10.9-x86_64-3.10/python/ad3/factor_graph.o -O3 -Wall -Wno-sign-compare -Wno-overloaded-virtual -c -fmessage-length=0 -fPIC -ffast-math -march=native python/ad3/factor_graph.cpp:19366:5: error: expression is not assignable ++Py_REFCNT(o); ^
~~~~ python/ad3/factor_graph.cpp:19368:5: error: expression is not assignable --Py_REFCNT(o); ^~~~~ python/ad3/factor_graph.cpp:19492:5: error: expression is not assignable ++Py_REFCNT(o); ^~~~~ python/ad3/factor_graph.cpp:19494:5: error: expression is not assignable --Py_REFCNT(o); ^~~~~ python/ad3/factor_graph.cpp:19781:5: error: expression is not assignable ++Py_REFCNT(o); ^~~~~ python/ad3/factor_graph.cpp:19783:5: error: expression is not assignable --Py_REFCNT(o); ^~~~~ python/ad3/factor_graph.cpp:20020:5: error: expression is not assignable ++Py_REFCNT(o); ^~~~~ python/ad3/factor_graph.cpp:20022:5: error: expression is not assignable --Py_REFCNT(o); ^~~~~ python/ad3/factor_graph.cpp:20824:47: error: no member named 'tp_print' in '_typeobject' __pyx_type_3ad3_12factor_graph_PFactorGraph.tp_print = 0;