Closed dromer closed 11 years ago
Ok, figured it out and was rather trivial. Compiling it was a little more work. Here is what I did:
package.txt
NAME=leapmotion
SRCDIR=.
SRCS=main.cpp Dispatcher.cpp
And to compile with flext:
LDFLAGS='-L../../leapmotion/Leap_Dev_Kit_0.7.9_3461/LeapSDK/lib/x86 -lLeap' CPLUS_INCLUDE_PATH=../../leapmotion/Leap_Dev_Kit_0.7.9_3461/LeapSDK/include bash ../flext/build.sh pd gcc
Now trying to figure out how it works, would be nice to set up a leapmotion-help.pd that shows some of the basics. If you have any comments, please don't hesitate to mention ;)
Hi,
I just installed leapmotion in my ubuntu 12.04. Could you tell me the steps necessary to compile there?
Thanks,
jmmmp
The exact steps are right there in my previous post.
First you install flext. Then you make a file 'package.txt' containing what I already showed. Then you run the line I put after this.
You have to make sure that all the paths are correct of course. Then you end up with a 'leapmotion.pd_linux' external that you put in the path of puredata to load.
Thanks. It worked with the compiling, but the external doesn't load. I get the message "load_object: Symbol "leapmotion_setup" not found". I compiled it in ubuntu 12.04 32b (under xfce). Besides that, the leapmotion seems to be working in my system.
Ok, I haven't tried it with the latest dev-kit, but my object was built with the version in my previous post and still works with the new API. (although I haven't had much time to play with it).
I really don't have time now, but next week I'll try compiling against the new sdk.
Ok. Could you send me your binary meanwhile? That would be great. My mail is jmmmpais at googlemail dot com.
http://mrtoasted.com/~dreamer/leapmotion.pd_linux
Not guaranteed, since I don't run Ubuntu ;)
Thanks. I got the line "/home/jmmmp/software/Pd_leapmotion_0.1/leapmotion.pd_linux: libLeap.so: cannot open shared object file: No such file or directory", even though I copied the .so file to the same folder of your binary. But strangely, I noticed that your file is ~200K big, and mine was only 5K. I guess the different distros might not be an enough reason for the different sizes? Or I'll just wait until you can try the latest sdk. I really don't know anything of programming, besides following instructions someone else wrote down.
I just followed the instructions that I found as well. Plus a little bit of tinkering perhaps ..
I haven't installed the SDK so I have to preload the library like this:
LD_PRELOAD=/<path-to>/Leap_Dev_Kit_0.7.9_3461/LeapSDK/lib/x86/libLeap.so pdextended
Check if this works for you.
Also, I am pretty sure you compiled the external wrong. Make sure to check the paths to the dependencies, the example was on my system.
Eh eh. A new error appears. Unless there are other steps you took to make the external work, it might be better to fix this at compiling level. /home/jmmmp/software/Pd_leapmotion_0.1/leapmotion.pd_linux: /home/jmmmp/software/Pd_leapmotion_0.1/leapmotion.pd_linux: undefined symbol: _ZN17flext_root_singlenwEj
About the compilation: I don't get any errors in the terminal, and all the paths are correct (tested them with ls). Here is the console output:
jmmmp@jmmmp-x61s:~/software/Pd_leapmotion_0.1$ LDFLAGS='-L../Leap_Developer_Kit_0.8.0_5302_Linux/LeapSDK/lib/x86 -lLeap' CPLUS_INCLUDE_PATH=../Leap_Developer_Kit_0.8.0_5302_Linux/LeapSDK/include bash ../flext/build.sh pd gcc make -f ../flext/buildsys/gnumake-sub.mak PLATFORM=lnx RTSYS=pd COMPILER=gcc BUILDPATH=../flext/buildsys/ PKGINFO=package.txt BUILDCLASS=ext TARGETMODE=release TARGETTYPE=single build make[1]: Betrete Verzeichnis '/home/jmmmp/software/Pd_leapmotion_0.1' mkdir -p pd-linux/release-single mkdir -p pd-linux/release-single/ g++ -c -msse -mfpmath=sse -ffast-math -DFLEXT_USE_CMEM -O3 -march=pentium4 -pthread -fPIC -fvisibility-inlines-hidden -DNDEBUG -DFLEXT_SYS=2 -DPD -I/usr//src -I/usr//include -I/usr//include/pd -I/usr/local/include/stk -I/usr/local/include/sndobj -I/usr/local/include/flext main.cpp -o pd-linux/release-single/main.opp mkdir -p pd-linux/release-single/ g++ -c -msse -mfpmath=sse -ffast-math -DFLEXT_USE_CMEM -O3 -march=pentium4 -pthread -fPIC -fvisibility-inlines-hidden -DNDEBUG -DFLEXT_SYS=2 -DPD -I/usr//src -I/usr//include -I/usr//include/pd -I/usr/local/include/stk -I/usr/local/include/sndobj -I/usr/local/include/flext Dispatcher.cpp -o pd-linux/release-single/Dispatcher.opp g++ -L../Leap_Developer_Kit_0.8.0_5302_Linux/LeapSDK/lib/x86 -lLeap -pthread -shared -Wl,-S -L/usr//bin -L/usr/local/lib -o pd-linux/release-single/leapmotion.pd_linux pd-linux/release-single/main.opp pd-linux/release-single/Dispatcher.opp -lflext-pd_s chmod 755 pd-linux/release-single/leapmotion.pd_linux strip --strip-unneeded pd-linux/release-single/leapmotion.pd_linux make[1]: Verlasse Verzeichnis '/home/jmmmp/software/Pd_leapmotion_0.1'
And it creates the pd-linux/release-single folder, with the files Dispatcher.opp, main.opp and the external (again with only 5Kb size).
Hey jmmmp,
$ sudo LD_PRELOAD=path/to/folder/libLeap.so pd
I compiled it for Ubuntu 12.04(32bit) https://drive.google.com/folderview?id=0B42bn7ncw918RUVWWFFtZVZpVEE&usp=sharing
My blog, sorry it's written in korean, but it helps you. http://jonghyunkim816.blogspot.de/2013/12/compiling-leapmotionpdlinux-on-ubuntu.html
using that provided binary gives me: leapmotion.pd_linux: wrong ELF class: ELFCLASS32
^ you are trying to run a 32 bit binary on a 64 bit system.
Just compile it yourself, works fine with the latest SDK.
Also don't forget the help-patch included with the mac-zip here: http://puredatajapan.info/?page_id=1514
thanks - struggling with flext 64bit at the moment.
I'm trying to build this external under linux. It's my first time using flext and it seems to be needing a 'package.txt' with configuration.
Since I do not have any experience with this could you perhaps provide one (at least as example) in the repo?
regards, dromer