kivy / cymunk

Cython port of Pymunk
http://readthedocs.org/docs/cymunk/en/latest/
MIT License
45 stars 29 forks source link

Error running setup.py on macOS #56

Open dlwalter opened 3 years ago

dlwalter commented 3 years ago

I get the following error when trying to install cymunk on macOS:

python setup.py build_ext --inplace

`clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/Users/me/Workspace/kivy-projects/cymunk/cymunk/Chipmunk-Physics/include -I/Users/me/Workspace/kivy-projects/cymunk/cymunk/Chipmunk-Physics/include/chipmunk -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/me/kivy_venv/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c cymunk/cymunk.c -o build/temp.macosx-11-x86_64-3.9/cymunk/cymunk.o -std=c99 -ffast-math -fPIC -DCHIPMUNK_FFI cymunk/cymunk.c:28705:112: warning: variable 'pyx_v_info' is uninitialized when used here [-Wuninitialized] ...cpv(pyx_t_2, pyx_t_3), cpv(pyx_t_4, pyx_t_5), pyx_v_info) != 0); ^~~~ cymunk/cymunk.c:28666:35: note: initialize the variable 'pyx_v_info' to silence this warning cpSegmentQueryInfo *pyx_v_info; ^ = NULL cymunk/cymunk.c:29146:3: error: implicit declaration of function 'cpCircleShapeSetRadius' is invalid in C99 [-Werror,-Wimplicit-function-declaration] cpCircleShapeSetRadius(pyx_v_self->pyx_base._shape, __pyx_t_1); ^ cymunk/cymunk.c:29146:3: note: did you mean 'cpCircleShapeGetRadius'? cymunk/chipmunk/cpShape.h:201:1: note: 'cpCircleShapeGetRadius' declared here CP_DeclareShapeGetter(cpCircleShape, cpFloat, Radius); ^ cymunk/chipmunk/cpShape.h:180:56: note: expanded from macro 'CP_DeclareShapeGetter'

define CP_DeclareShapeGetter(struct, type, name) type struct##Get##name(const cpShape *shape)

                                                   ^
:46:1: note: expanded from here cpCircleShapeGetRadius ^ cymunk/cymunk.c:29216:3: error: implicit declaration of function 'cpCircleShapeSetOffset' is invalid in C99 [-Werror,-Wimplicit-function-declaration] cpCircleShapeSetOffset(__pyx_v_self->__pyx_base._shape, cpv(__pyx_t_2, __pyx_t_3)); ^ cymunk/cymunk.c:29216:3: note: did you mean 'cpCircleShapeGetOffset'? cymunk/chipmunk/cpShape.h:200:1: note: 'cpCircleShapeGetOffset' declared here CP_DeclareShapeGetter(cpCircleShape, cpVect, Offset); ^ cymunk/chipmunk/cpShape.h:180:56: note: expanded from macro 'CP_DeclareShapeGetter' #define CP_DeclareShapeGetter(struct, type, name) type struct##Get##name(const cpShape *shape) ^ :44:1: note: expanded from here cpCircleShapeGetOffset ^ cymunk/cymunk.c:37910:13: warning: incompatible pointer types assigning to 'struct __pyx_t_6cymunk_6cymunk_cpArray *' from 'cpArray *' (aka 'struct cpArray *') [-Wincompatible-pointer-types] __pyx_t_3 = __pyx_v_self->_space->arbiters_private; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cymunk/cymunk.c:37999:35: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare] for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { ~~~~~~~~~ ^ ~~~~~~~~~ cymunk/cymunk.c:42083:182: warning: incompatible pointer types passing '__pyx_t_6cymunk_6cymunk_bool (cpArbiter *, cpSpace *, void *)' (aka 'int (struct cpArbiter *, struct cpSpace *, void *)') to parameter of type 'cpCollisionPostSolveFunc' (aka 'void (*)(struct cpArbiter *, struct cpSpace *, void *)') [-Wincompatible-pointer-types] ...__pyx_f_6cymunk_6cymunk__call_collision_post_solve_func, __pyx_f_6cymunk_6cymunk__call_c... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cymunk/chipmunk/cpSpace.h:170:27: note: passing argument to parameter 'postSolve' here cpCollisionPostSolveFunc postSolve, ^ cymunk/cymunk.c:42083:239: warning: incompatible pointer types passing '__pyx_t_6cymunk_6cymunk_bool (cpArbiter *, cpSpace *, void *)' (aka 'int (struct cpArbiter *, struct cpSpace *, void *)') to parameter of type 'cpCollisionSeparateFunc' (aka 'void (*)(struct cpArbiter *, struct cpSpace *, void *)') [-Wincompatible-pointer-types] ...__pyx_f_6cymunk_6cymunk__call_collision_separate_func, ((void *)__pyx_v_self)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cymunk/chipmunk/cpSpace.h:171:26: note: passing argument to parameter 'separate' here cpCollisionSeparateFunc separate, ^ cymunk/cymunk.c:42716:157: warning: incompatible pointer types passing '__pyx_t_6cymunk_6cymunk_bool (cpArbiter *, cpSpace *, void *)' (aka 'int (struct cpArbiter *, struct cpSpace *, void *)') to parameter of type 'cpCollisionPostSolveFunc' (aka 'void (*)(struct cpArbiter *, struct cpSpace *, void *)') [-Wincompatible-pointer-types] ...__pyx_f_6cymunk_6cymunk__collision_post_solve_func, __pyx_f_6cymunk_6cymunk__collision_s... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cymunk/chipmunk/cpSpace.h:158:27: note: passing argument to parameter 'postSolve' here cpCollisionPostSolveFunc postSolve, ^ cymunk/cymunk.c:42716:209: warning: incompatible pointer types passing '__pyx_t_6cymunk_6cymunk_bool (cpArbiter *, cpSpace *, void *)' (aka 'int (struct cpArbiter *, struct cpSpace *, void *)') to parameter of type 'cpCollisionSeparateFunc' (aka 'void (*)(struct cpArbiter *, struct cpSpace *, void *)') [-Wincompatible-pointer-types] ...__pyx_f_6cymunk_6cymunk__collision_seperate_func, ((PyObject *)__pyx_v_self)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cymunk/chipmunk/cpSpace.h:159:26: note: passing argument to parameter 'separate' here cpCollisionSeparateFunc separate, ^ 7 warnings and 2 errors generated. error: command '/usr/bin/clang' failed with exit code 1`
dlwalter commented 3 years ago

I've also attempted the install command from the readme

python setup.py build_ext --compiler=mingw32 install

which results in a different error:

Using distutils running build_ext warning: Python's pyconfig.h doesn't seem to support your compiler. Reason: '/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyconfig.h' does not mention '__GNUC__'. Compiling may fail because of undefined preprocessor macros. @(#)PROGRAM:ld PROJECT:ld64-609.8 BUILD 20:09:52 Nov 4 2020 configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em LTO support using: LLVM version 12.0.0, (clang-1200.0.32.28) (static support for 27, runtime is 27) TAPI support using: Apple TAPI version 12.0.0 (tapi-1200.0.23.5) Traceback (most recent call last): File "/Users/dlw/Workspace/kivy-projects/cymunk/setup.py", line 61, in <module> setup( File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/dlw/kivy_venv/lib/python3.9/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 306, in run self.compiler = new_compiler(compiler=self.compiler, File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/ccompiler.py", line 1032, in new_compiler return klass(None, dry_run, force) File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cygwinccompiler.py", line 280, in __init__ CygwinCCompiler.__init__ (self, verbose, dry_run, force) File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cygwinccompiler.py", line 124, in __init__ if self.ld_version >= "2.10.90": TypeError: '>=' not supported between instances of 'NoneType' and 'str'