OptimoJoe / Optizelle

Optizelle [op-tuh-zel] is an open source software library designed to solve general purpose nonlinear optimization problems.
www.optimojoe.com/products/optizelle
63 stars 13 forks source link

PyThreadState_Get: no current thread on MacOS #62

Closed IIlllII closed 4 years ago

IIlllII commented 4 years ago

It seems that I can not run prebuilt Optizelle with any python on my system except the original macOs one.

The problem is probably the same as this in pythorch: https://github.com/pytorch/pytorch/commit/73f6715f4725a0723d8171d3131e09ac7abf0666 https://github.com/facebookarchive/caffe2/issues/854

Similar issue in cmake: https://gitlab.kitware.com/cmake/cmake/issues/18536

Once I build from source using: LINK_FLAGS "-undefined dynamic_lookup" All my python versions work again.

There are some tests failing when I run make test though, so I am bit unsure if I broke something. The tests seem bit unrelated, but I can not get them to run properly from source without first adding the link flag.

Will add a PR with my changes for the working builds.

josyoun commented 4 years ago

Ok, cool and thanks for tracking that down! I'm currently on travel and my mac server is down, but I'll try and reverify in a few days.

josyoun commented 4 years ago

This should be fixed by your pull request and commit 7a28222d7762ef59ab545e22c62c044dcd872ed0. Thanks for the help!