Giter Site home page Giter Site logo

kivy / cymunk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from minou/chipmunk-android

45.0 9.0 29.0 348 KB

Cython port of Pymunk

Home Page: http://readthedocs.org/docs/cymunk/en/latest/

License: MIT License

Makefile 0.02% C++ 13.35% C 63.94% Python 17.64% CMake 0.35% Objective-C 4.70%

cymunk's Introduction

Cymunk

Cymunk is a cython wrapper for Chipmunk Physics
Some code is ported from pymunk and much of the API is compatable

Cymunk should be significantly faster than pymunk and run on android with p4a - but it is currently less feature complete.

Check out the examples folder, cymunk docs and pymunk docs

To build for windows you should use MinGW - setup or python setup.py build --compiler=mingw32

To install to Python's site-packges
python setup.py build_ext --compiler=mingw32 install

cymunk's People

Contributors

chozabu avatar jnoortheen avatar keyweeusr avatar kovak avatar maho avatar minou avatar mkmiller avatar nskrypnik avatar peithvergil avatar sleepprogger avatar svineet avatar tito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cymunk's Issues

Can't build on Arch Linux

The program won't build on Arch Linux with the following error code:

python setup.py build_ext --inplace
running build_ext
skipping 'cymunk/python/cymunk.c' Cython extension (up-to-date)
building 'cymunk' extension
gcc -pthread -Wno-unused-result -Werror=declaration-after-statement -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -Icymunk/Chipmunk-Physics/include -Icymunk/Chipmunk-Physics/include/chipmunk -I/usr/include/python3.4m -c cymunk/python/cymunk.c -o build/temp.linux-x86_64-3.4/cymunk/python/cymunk.o -std=c99 -ffast-math -fPIC -DCHIPMUNK_FFI
In file included from cymunk/Chipmunk-Physics/include/chipmunk/chipmunk.h:116:0,
                 from cymunk/python/cymunk.c:349:
cymunk/Chipmunk-Physics/include/chipmunk/constraints/cpConstraint.h: In function ‘cpConstraintActivateBodies’:
cymunk/Chipmunk-Physics/include/chipmunk/constraints/cpConstraint.h:94:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  cpBody *b = constraint->b; if(b) cpBodyActivate(b);
  ^
cymunk/python/cymunk.c: At top level:
cymunk/python/cymunk.c:1179:1: warning: useless type name in empty declaration
 cpVect;
 ^
cymunk/python/cymunk.c:1203:1: warning: useless type name in empty declaration
 cpBB;
 ^
cymunk/python/cymunk.c: In function ‘__pyx_pf_6cymunk_6Circle_2unsafe_set_radius’:
cymunk/python/cymunk.c:17424:3: warning: implicit declaration of function ‘cpCircleShapeSetRadius’ [-Wimplicit-function-declaration]
   cpCircleShapeSetRadius(__pyx_v_self->__pyx_base._shape, __pyx_t_1);
   ^
cymunk/python/cymunk.c: In function ‘__pyx_pf_6cymunk_6Circle_4unsafe_set_offset’:
cymunk/python/cymunk.c:17494:3: warning: implicit declaration of function ‘cpCircleShapeSetOffset’ [-Wimplicit-function-declaration]
   cpCircleShapeSetOffset(__pyx_v_self->__pyx_base._shape, cpv(__pyx_t_2, __pyx_t_3));
   ^
cymunk/python/cymunk.c: In function ‘__pyx_f_6cymunk_5Space__add_c_collision_handler’:
cymunk/python/cymunk.c:28142:3: warning: passing argument 6 of ‘cpSpaceAddCollisionHandler’ from incompatible pointer type
   cpSpaceAddCollisionHandler(__pyx_v_self->_space, __pyx_t_1, __pyx_t_2, __pyx_f_6cymunk__call_collision_begin_func, __pyx_f_6cymunk__call_collision_pre_solve_func, __pyx_f_6cymunk__call_collision_post_solve_func, __pyx_f_6cymunk__call_collision_separate_func, ((void *)__pyx_v_self));
   ^
In file included from cymunk/Chipmunk-Physics/include/chipmunk/chipmunk.h:118:0,
                 from cymunk/python/cymunk.c:349:
cymunk/Chipmunk-Physics/include/chipmunk/cpSpace.h:165:6: note: expected ‘cpCollisionPostSolveFunc’ but argument is of type ‘__pyx_t_6cymunk_bool (*)(struct cpArbiter *, struct cpSpace *, void *)’
 void cpSpaceAddCollisionHandler(
      ^
cymunk/python/cymunk.c:28142:3: warning: passing argument 7 of ‘cpSpaceAddCollisionHandler’ from incompatible pointer type
   cpSpaceAddCollisionHandler(__pyx_v_self->_space, __pyx_t_1, __pyx_t_2, __pyx_f_6cymunk__call_collision_begin_func, __pyx_f_6cymunk__call_collision_pre_solve_func, __pyx_f_6cymunk__call_collision_post_solve_func, __pyx_f_6cymunk__call_collision_separate_func, ((void *)__pyx_v_self));
   ^
In file included from cymunk/Chipmunk-Physics/include/chipmunk/chipmunk.h:118:0,
                 from cymunk/python/cymunk.c:349:
cymunk/Chipmunk-Physics/include/chipmunk/cpSpace.h:165:6: note: expected ‘cpCollisionSeparateFunc’ but argument is of type ‘__pyx_t_6cymunk_bool (*)(struct cpArbiter *, struct cpSpace *, void *)’
 void cpSpaceAddCollisionHandler(
      ^
cymunk/python/cymunk.c: In function ‘__pyx_pf_6cymunk_5Space_58set_default_collision_handler’:
cymunk/python/cymunk.c:28702:3: warning: passing argument 4 of ‘cpSpaceSetDefaultCollisionHandler’ from incompatible pointer type
   cpSpaceSetDefaultCollisionHandler(__pyx_v_self->_space, __pyx_f_6cymunk__collision_begin_func, __pyx_f_6cymunk__collision_pre_solve_func, __pyx_f_6cymunk__collision_post_solve_func, __pyx_f_6cymunk__collision_seperate_func, ((PyObject *)__pyx_v_self));
   ^
In file included from cymunk/Chipmunk-Physics/include/chipmunk/chipmunk.h:118:0,
                 from cymunk/python/cymunk.c:349:
cymunk/Chipmunk-Physics/include/chipmunk/cpSpace.h:154:6: note: expected ‘cpCollisionPostSolveFunc’ but argument is of type ‘__pyx_t_6cymunk_bool (*)(struct cpArbiter *, struct cpSpace *, void *)’
 void cpSpaceSetDefaultCollisionHandler(
      ^
cymunk/python/cymunk.c:28702:3: warning: passing argument 5 of ‘cpSpaceSetDefaultCollisionHandler’ from incompatible pointer type
   cpSpaceSetDefaultCollisionHandler(__pyx_v_self->_space, __pyx_f_6cymunk__collision_begin_func, __pyx_f_6cymunk__collision_pre_solve_func, __pyx_f_6cymunk__collision_post_solve_func, __pyx_f_6cymunk__collision_seperate_func, ((PyObject *)__pyx_v_self));
   ^
In file included from cymunk/Chipmunk-Physics/include/chipmunk/chipmunk.h:118:0,
                 from cymunk/python/cymunk.c:349:
cymunk/Chipmunk-Physics/include/chipmunk/cpSpace.h:154:6: note: expected ‘cpCollisionSeparateFunc’ but argument is of type ‘__pyx_t_6cymunk_bool (*)(struct cpArbiter *, struct cpSpace *, void *)’
 void cpSpaceSetDefaultCollisionHandler(
      ^
cymunk/python/cymunk.c: In function ‘__pyx_pw_6cymunk_5Shape_9segment_query’:
cymunk/python/cymunk.c:17132:16: warning: ‘__pyx_v_info’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   __pyx_t_6 = (cpShapeSegmentQuery(__pyx_v_self->_shape, cpv(__pyx_t_2, __pyx_t_3), cpv(__pyx_t_4, __pyx_t_5), __pyx_v_info) != 0);
                ^
cymunk/python/cymunk.c:17093:23: note: ‘__pyx_v_info’ was declared here
   cpSegmentQueryInfo *__pyx_v_info;
                       ^
cc1: some warnings being treated as errors
error: command 'gcc' failed with exit status 1

free(): invalid pointer error

Commentary after fix
This problem wasn't actually caused by creating multiple spaces as I initially assumed. If you are debugging a similar Cymunk issue, I'd recommend setting your space attribute to None to try to force earlier garbage collection. In my case, this happens in Screen.on_leave

For some reason Kivy Screen Widgets (and their contained Cymunk Spaces) took a while to be garbage collected until I explicitly set self.space=None and I made the false assumption that somehow creating multiple spaces was the problem.

Also, you might try removing all constraints, shapes, and bodies from your Space (see comment bellow for code)

Original issue:

First, thanks for creating cymunk, I got it working quickly and was able to just add it to buildozer and have it work on Android without any issues.

Unfortunately, I'm encountering this error frequently in my Kivy application.
*** Error in `/path/to/virtualenvs/kivy_py2/bin/python': free(): invalid pointer: 0x0000000003003978 ***

Kivy 1.9.0
Cython: 0.21.2
cymunk (master May 14): commit 09dcea7

I'm fairly certain it's related to Cymunk because it only occurs after I navigate to a game screen that creates a physics space and Cymunk is in the backtrace.

I have a game where a Kivy Screen contains a Cymunk Space using these Cymunk objects:
Space, Body, Circle, DampedSpring

Switching from this Screen and back to it many times causes this crash. Switching away from the screen should remove the Widget and garbage collect the Space. (Though I'm still working on detecting if I have a memory leak)

There are two times I see the free error:

On app close if I created more than 1 physics space

If I just create the physics space once, the app shutsdown cleanly, but if I visit the physics screen twice, I see the error at shutdown. (Much shorter backtrace)
gdb backtrace: https://gist.github.com/arlowhite/7b8b251402763e54e6ae

Opening many physics spaces causes crash

Going back and forth to the physics screen causes a crash after about 10 times.
Backtrace from gdb:
https://gist.github.com/arlowhite/c1cac9f04b24cfb01128

Final thoughts

Currently I am not bothering to clean-up the Space in any way. The documentation doesn't seem to indicate this is necessary, but I should I try Space.remove() on everything?

I haven't tried creating a simpler test case yet, I was hoping to figure it out with debugging tools. Are there any debugging techniques/tools for this kind of error you suggest I try? (I haven't done C level debugging in a while) Let me know what other information would help or code changes to try.

Shape Layers and Sensors

I am in the process of trying to make a 2.5D game and using just the shape groups isn't sufficient for what I have in mind. I've been trying to look through the source code to figure out how to use the layers for the shapes but I don't think this has been implemented in cymunk.

Also, I am trying to play around with the sensor attribute on the shapes however my code doesn't seem to register a shape colliding with a sensor even if I define a collision_handler for those two shapes. Do you know if there is a special way I need to define a collision handler to register a collision/sense between a collider and sensor?

Error when I try make.

After run

$ sudo python setup.py install

I try:

$ sudo make

And got this Error:

============================= test session starts ==============================
platform linux -- Python 3.5.0, pytest-2.8.2, py-1.4.30, pluggy-0.3.1
rootdir: /home/edu/lib/cymunk, inifile:
collected 2 items / 1 errors

tests/test_vec2d.py ..

==================================== ERRORS ====================================
_____________________ ERROR collecting tests/test_space.py _____________________
/usr/lib/python3.5/site-packages/_pytest/python.py:591: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python3.5/site-packages/py/_path/local.py:650: in pyimport
import(modname)
E File "/home/edu/lib/cymunk/tests/test_space.py", line 23
E assert(space.collision_persistence == 3L)
E ^
E SyntaxError: invalid syntax
====================== 2 passed, 1 error in 0.13 seconds =======================
Makefile:6: recipe for target 'tests' failed
make: *** [tests] Error 1

The ' ^ ' was pointing to 3L
Anyone knows why i got this error?

Thank you.

Error running setup.py on macOS

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/[email protected]/include -I/usr/local/opt/sqlite/include -I/Users/me/kivy_venv/include -I/usr/local/opt/[email protected]/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) ^ <scratch space>: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) ^ <scratch space>: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

Python 3.6 - doesn't compile on either MSVC or mingw

So, following the install guide you get this on windows using python 3.6:

E:\cymunk-master>py setup.py build --compiler=mingw32
Using distutils
running build
running build_py
running build_ext
Traceback (most recent call last):
  File "setup.py", line 72, in <module>
    version='0.0.0.dev0'
  File "C:\Program Files\Python36\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Program Files\Python36\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Program Files\Python36\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Program Files\Python36\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "C:\Program Files\Python36\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Program Files\Python36\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Program Files\Python36\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "C:\Program Files\Python36\lib\distutils\command\build_ext.py", line 308, in run
    force=self.force)
  File "C:\Program Files\Python36\lib\distutils\ccompiler.py", line 1031, in new_compiler
    return klass(None, dry_run, force)
  File "C:\Program Files\Python36\lib\distutils\cygwinccompiler.py", line 282, in __init__
    CygwinCCompiler.__init__ (self, verbose, dry_run, force)
  File "C:\Program Files\Python36\lib\distutils\cygwinccompiler.py", line 126, in __init__
    if self.ld_version >= "2.10.90":
TypeError: '>=' not supported between instances of 'NoneType' and 'str'

if you just google for if self.ld_version >= "2.10.90": you will find plenty of other modules with the same-ish issue. Some modules will work if you patch distutils to not have None there, but for the majority of packages, the maintainers recommend using MSVC. Which doesn't work here, because you don't have alternate pxi files set up. "alloca.h" vs. "_alloca.h" for example.

gcc: error: cymunk/cymunk.c: No such file or directory

$ python3 setup.py build_ext --inplace
Using distutils
running build_ext
building 'cymunk.cymunk' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Icymunk/Chipmunk-Physics/include -Icymunk/Chipmunk-Physics/include/chipmunk -I/home/user/.pyenv/versions/3.6.2/include/python3.6m -c cymunk/cymunk.c -o build/temp.linux-x86_64-3.6/cymunk/cymunk.o -std=c99 -ffast-math -fPIC -DCHIPMUNK_FFI
gcc: error: cymunk/cymunk.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
error: command 'gcc' failed with exit status 1

Why is it missing?

shape.pxi - Poly __init__ i_vs possibly unitialised

around line 315: i_vs is not always set but is always used in the for loop

    #original: if auto_order_vertices and not u.is_clockwise(vertices):
    self._vertices_count = len(vertices)
    if auto_order_vertices and not is_clockwise(vertices):
        i_vs = zip(range(len(vertices)-1, -1, -1), vertices)

    self._vertices = <cpVect *>malloc(sizeof(cpVect) * self._vertices_count)
    for i, vertex in i_vs:
        self._vertices[i] = cpv(vertex[0], vertex[1])

Cymunk License

Most (if not all) Kivy projects I've seen use an MIT license, but I'm having trouble finding a license file here. Is this true for Cymunk as well?

precompiled version for windows?

Hello,

I've tried to follow the basic guide shown in the README.md but after install MinGW and run the command

python setup.py build --compiler=mingw32

always i get:

running build
running build_py
running build_ext
skipping 'cymunk\cymunk.c' Cython extension (up-to-date)
building 'cymunk.cymunk' extension
gcc -mno-cygwin -mdll -O -Wall -Icymunk\Chipmunk-Physics\include -Icymunk\Chipmu
nk-Physics\include\chipmunk "-IC:\Program Files\Python27x64\include" "-IC:\Progr
am Files\Python27x64\PC" -c cymunk\cymunk.c -o build\temp.win-amd64-2.7\Release\
cymunk\cymunk.o -std=gnu99 -ffast-math -fPIC -DCHIPMUNK_FFI
error: command 'gcc' failed: No such file or directory

I've tested it on Windows Vista 64bit and Windows 10 64bit and the error happens on both OSes.

Now my last hope is to find a pre-compiled version.
Someone get one to share?

thanks

Crashes on windows 8.1, build with gcc-tdm 4.8

My gcc:
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=d:/codeblocks/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wra
pper.exe
Target: mingw32
Configured with: ../../../src/gcc-4.8.1/configure --build=mingw32 --enable-langu
ages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-g
raphite --enable-libstdcxx-debug --enable-threads=posix --enable-version-specifi
c-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-threads --enable
-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-reg
istry --disable-symvers --enable-cxx-flags='-fno-function-sections -fno-data-sec
tions -DWINPTHREAD_STATIC' --prefix=/mingw32tdm --with-local-prefix=/mingw32tdm
--with-pkgversion=tdm-2 --enable-sjlj-exceptions --with-bugurl=http://tdm-gcc.td
ragon.net/bugs
Thread model: posix
gcc version 4.8.1 (tdm-2)

Build command:
python setup.py build -c mingw32

And example crashes.

scalar production of vec2d gives error

`>>> a=pm.Vec2d(1,1)

a
<cymunk.Vec2d x=1.000000 y=1.000000>
a.normalized
<built-in method normalized of cymunk.cymunk.Vec2d object at 0x7f11d6cfd090>
a.normalized()
<cymunk.Vec2d x=0.707107 y=0.707107>
40*a.normalized()
Traceback (most recent call last):
File "", line 1, in
File "cymunk/core.pxi", line 256, in cymunk.cymunk.Vec2d.mul (cymunk/cymunk.c:14152)
TypeError: 'int' object has no attribute 'getitem'
`

Chipmunk 7 is out

Updating would benefit this module in several ways:
Support for MSVC Compiler
Hasty Space for Multithreading
Pro Features now available for everyone, such as autogeometry.

problems building/importing on windows

I get a crash upon entering "import cymunk" log below

Reading symbols from c:\kivy-1.8.0-py2.7-win32\python27\python.exe...(no debuggi
ng symbols found)...done.
(gdb) run
Starting program: c:\kivy-1.8.0-py2.7-win32\python27\python.exe
[New Thread 8180.0x1e84]
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.

import cymunk

Program received signal SIGSEGV, Segmentation fault.
0x778a8dc9 in ntdll!TpCallbackMayRunLong () from C:\Windows\system32\ntdll.dll
(gdb) bt
#0 0x778a8dc9 in ntdll!TpCallbackMayRunLong ()

from C:\Windows\system32\ntdll.dll
#1 0x74d57408 in iob ()

from C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161
_none_50934f2ebcb7eb57\msvcr90.dll
#2 0x74d5740c in iob ()

from C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161
_none_50934f2ebcb7eb57\msvcr90.dll

tested with regular python 2.7 and kivy portable package
gcc info:
C:\Users\chozabu\cymunk\build\lib.win32-2.7>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,obj
c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgo
mp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-r
untime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.6.2 (GCC)

cython info
Cython version 0.21b1
from pip or easy_install

while writing this, I also tried upgrading to:
Cython version 0.20.2
from a pre-compiled binary, and rebuilding with no luck

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.