codac-team / codac

Codac is a library for constraint programming over reals, trajectories and sets.
http://www.codac.io
GNU Lesser General Public License v3.0
39 stars 17 forks source link

Problems running codac on Mac m2 chip #88

Closed marialuizacvianna closed 1 year ago

marialuizacvianna commented 1 year ago

For example the following line SIVIA(IntervalVector([[-30,30],[-30,30]]),SepProj(SepFwdBwd(Function("x","y","mx","my", "(x-mx)^2+(y-my)^2"),[-oo,100]),IntervalVector([[0,1],[2,10]])),0.5) returns the error _Assertion failed: ((XinFull | XoutFull) == cart_prod(x, y)), function process, file codacSepProj.cpp, line 72.

Also a call of function compute_detections() from a TPlane object results in the following error python3(32091,0x102cac580) malloc: Heap corruption detected, free list is damaged at 0x600000e9dc00 *** Incorrect guard value: 102058021869322

lebarsfa commented 1 year ago

Hello,

I can confirm the same issue for the first point on our MacBook with M1 chip, contrary to other configurations. For this type of Mac, Codac was built with FILIB interval library (because it was the only one that builds easily in this configuration), contrary to Intel x86_64 Mac or PC with Ubuntu which are with GAOL. With some changes including those proposed in https://github.com/goualard-f/GAOL/pull/4 , here are some temporary Python 3.9 and 3.10 wheels using GAOL, which would need to be installed with something similar to sudo pip3 uninstall -y codac ; pip3 uninstall -y codac ; pip3 install *.whl to overwrite the existing version :

Note that I tried also to find a solution for FILIB by adding compiler flags such as -ffloat-store -frounding-math -fno-fast-math -ffp-contract=off to the build process but that did not seem to completely solve the problem, contrary to GAOL. To be checked...

For the second point, do you have an example to reproduce the problem, it might be a separate issue?

marialuizacvianna commented 1 year ago

Thank you very much for your answer, Fabrice. First problem is now solved. You can reproduce the second problem with the example code for tplanes that you can find on the following link:

https://github.com/codac-team/codac/blob/master/examples/robotics/06_loops_proofs/06_loops_proofs.py

lebarsfa commented 1 year ago

OK, I can confirm the problem on our Mac M1, we will need to check more in details...

lebarsfa commented 1 year ago

Here are new Python .whl with preliminary fixes for both problems: https://github.com/lebarsfa/codac/releases/tag/v1.2.1-tplane-fix. Download the .whl corresponding to your Python version, e.g. https://github.com/lebarsfa/codac/releases/download/v1.2.1-tplane-fix/codac-1.2.1-cp39-cp39-macosx_11_0_arm64.whl for Python 3.9, and e.g. run in your download folder sudo pip3 uninstall -y codac ; pip3 uninstall -y codac ; pip3 install *.whl to overwrite the existing version.

marialuizacvianna commented 1 year ago

Problems solved, thank you so much!