-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swig compilation on Ubuntu #14
Comments
Hi @pluniak , Thanks for trying out the library! The I think you're right that the linux counterpart of the (macOS specific) I was following swig's official tutorial (http://www.swig.org/tutorial.html) when I wrote my shell script, maybe it'll be helpful. A while ago I got swig to work with raspberry pi (on another project). This was my shell script. Since it's also linux, the solution might look similar on ubuntu. Also, there're some clang specific arguments, which might need to be replaced with gcc specific counterparts. I hope this is helpful! I agree swig is not the easiest thing to get working, I remember it took me quite a while to figure it out on my OS too :) |
Thanks for the input @LingDong- . I had a look into it and I'm afraid that is out of scope for me at the moment. I'm more of a pure Pythonist ;-). I'll try to find another solution for making polylines from skeletons first. Cheers! P.S.: Please consider pointing out the macOS restriction of the swig version in your readme. |
Either way will do.
compile.sh
CMakeLIsts.txt
|
The Ubuntu compile.sh script above works for me on Ubuntu 20, Python 3.8 |
I don't know about swig, but I managed to make the c++ code work with pybind |
I was able to build for Windows using: gcc -fPIC -O3 -c trace_skeleton.c trace_skeleton_wrap.c -I%HOMEDRIVE%%HOMEPATH%\AppData\Local\Programs\Python\Python310\include g++ -shared *.o -o _trace_skeleton.pyd -L%HOMEDRIVE%%HOMEPATH%\AppData\Local\Programs\Python\Python310\libs -lpython310 ...and Mac: PYTHON_VERSION=3.10 PYTHON_VERSION_FULL=3.10.6 PYTHON_PATH=~/.pyenv/versions/$PYTHON_VERSION_FULL PYTHON_INCLUDE=$PYTHON_PATH/include/python$PYTHON_VERSION PYTHON_LIB=$PYTHON_PATH/lib/libpython$PYTHON_VERSION.a gcc -O3 -c trace_skeleton.c trace_skeleton_wrap.c -I$PYTHON_INCLUDE gcc $(python3-config --ldflags) -dynamiclib *.o -o _trace_skeleton.so -I$PYTHON_LIB -undefined dynamic_lookup |
Hi @LingDong-
I tested your Python version and it's really nice. I'd need a significant speed up though and I cannot run the swig version:
I'm running this inside a docker container with gcc version:
My Python version is 3.6.9.
I cannot build from source as I don't have a .dylib file in my system (at least I cannot find it). I tried with
instead, but it doesn't work:
I'm unexperienced with gcc (and C in general) and I've spent a few hours on this already. Any suggestions would be greatly appreciated!
The text was updated successfully, but these errors were encountered: