KmolYuan / Pyslvs-UI

An open source planar linkage mechanism simulation and mechanical synthesis system.
https://pyslvs-ui.readthedocs.io
GNU Affero General Public License v3.0
182 stars 37 forks source link

Compilation error on Mac OSX - symbol(s) not found #17

Closed matthieu-lapeyre closed 6 years ago

matthieu-lapeyre commented 6 years ago

Hi,

I would like to try your software but I get the following error during compilation (make build-kernel):

[...]
 slvs_wrap.o
      SWIG_Py_Void() in slvs_wrap.o
      SWIG_Python_NewShadowInstance(SwigPyClientData*, _object*) in slvs_wrap.o
      SWIG_Python_AppendOutput(_object*, _object*) in slvs_wrap.o
  "__Py_NotImplementedStruct", referenced from:
      SwigPyObject_richcompare(SwigPyObject*, SwigPyObject*, int) in slvs_wrap.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [_slvs.so] Error 1
make: *** [build-solvespace] Error 2

I tried few workaround with no success. Any idea ?

KmolYuan commented 6 years ago

I have not test Pyslvs yet on MacOS, there might be something wrong when I try to catching library path and include path of Python:

https://github.com/KmolYuan/python-solvespace/blob/0dc66c815bb400c24a056b9bad5b2e64edccde3c/Makefile#L82

It seems like this: Compiling C++ with SWIG on Mac OS X - Stack Overflow

KmolYuan commented 6 years ago

Added support, tested on macOS Sierra (https://github.com/KmolYuan/python-solvespace/commit/ce38a199d260851fda037fb9679f17fc23bb95c3).

Adjusted linking method for Python library:

https://github.com/KmolYuan/python-solvespace/blob/ce38a199d260851fda037fb9679f17fc23bb95c3/Makefile#L83

But using make command will cause error because AppImage recipe script is currently not supported.

Using PyInstaller might be a good way to build standalong executable files.

KmolYuan commented 6 years ago

Already added command to build standalong executable files(99df1f848708a622dd6298ee83cc9ad2c309593d) by PyInstaller.

More information can see the section of readme file.