Skip to content
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

dlopen failed #35

Open
tchemaly opened this issue Dec 3, 2019 · 9 comments
Open

dlopen failed #35

tchemaly opened this issue Dec 3, 2019 · 9 comments

Comments

@tchemaly
Copy link

tchemaly commented Dec 3, 2019

Although my app works on Unity, it is not working when I build it on the Magic Leap device.
I have these errors in mldb:

Plugins: Couldn't open /package/bin/liblsl64.so, error: dlopen failed: "package/bin/liblsl64.so has unexpected e_machine: 62

DllNotFoundException: Unable to load DLL 'liblsl64': The specified module could not be found.

Note that:
-my dlls are in Assets>LSL4Unity>Plugins
-I have added the following condition to the LSL script in the dll class:
#elif UNITY_ANDROID || PLATFORM_LUMIN
const string libname = "liblsl64";

@cwule
Copy link

cwule commented Dec 3, 2019

I got the same error. Tried changing to liblsl32 but then it complains
Plugins: Couldn't open /package/bin/liblsl32.so, error: dlopen failed: "/package/bin/liblsl32.so" is 32-bit instead of 64-bit

@tstenner
Copy link
Contributor

tstenner commented Dec 3, 2019

Are any dependencies missing, i.e. what's the output of ldd /package/bin/liblsl64.so?

@cwule
Copy link

cwule commented Dec 3, 2019

$ ldd liblsl64.so 
 

ldd: warning: you do not have execution permission for ./liblsl64.so.  

linux-vdso.so.1 =>  (0x00007ffc22267000).  

librt.so.1 => /lib64/librt.so.1 (0x00007f344c1c3000).  

libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f344bebc000).  

libm.so.6 => /lib64/libm.so.6 (0x00007f344bbba000). 

libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f344b9a4000). 

libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f344b788000). 

libc.so.6 => /lib64/libc.so.6 (0x00007f344b3bb000). 

/lib64/ld-linux-x86-64.so.2 (0x00007f344c6f9000)

@tstenner
Copy link
Contributor

tstenner commented Dec 4, 2019

I suspect an architecture mismatch. What's the output of file liblsl64.so?

@cwule
Copy link

cwule commented Dec 4, 2019

$ file liblsl64.so
liblsl64.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=793a68998fa33198e0385039a13935d7afa1fbad, stripped

@tstenner
Copy link
Contributor

tstenner commented Dec 5, 2019

liblsl64.so: ELF 64-bit LSB shared object, x86-64

I dimly recall that the Magic Leap is an ARM device, so the x64 binaries won't work (more in-depth explanation).

The easiest way would be to recompile liblsl for the magic leap with the standalone_compilation.sh script.

@tchemaly
Copy link
Author

tchemaly commented Dec 5, 2019

@tstenner Can you please indicate where I can find the standalone_compilation.sh script and how I can use it? It would be great if there is a resource.

@tstenner
Copy link
Contributor

tstenner commented Dec 6, 2019

The documentation is a work in progress, e.g. the bit I linked to was added about 2 minutes before my comment.

I don't have a Magic Leap, but if you can SSH into it, you just need to download the liblsl source code (repository, zip), install g++ and then run standalone_compilation_linux.sh.

If the binary is only meant for the magic leap, you could tailor it for this specific processor (CFLAGS="-march=native" ./standalone_compilation_linux.sh)

@syeddanishdev
Copy link

The documentation is a work in progress, e.g. the bit I linked to was added about 2 minutes before my comment.

I don't have a Magic Leap, but if you can SSH into it, you just need to download the liblsl source code (repository, zip), install g++ and then run standalone_compilation_linux.sh.

If the binary is only meant for the magic leap, you could tailor it for this specific processor (CFLAGS="-march=native" ./standalone_compilation_linux.sh)

@tstenner Can you kindly share the procedure for Unity 3d for Android Platform (Quest)

Because I am facing issue

DllNotFoundException: lsl
LSL.liblsl+StreamInfo..ctor (System.String name, System.String type, System.Int32 channel_count, System.Double nominal_srate, LSL.liblsl+channel_format_t channel_format, System.String source_id) (at Assets/LSL.cs:156)
EventLSLOutlet.Start () (at Assets/Scripts/EventLSLOutlet.cs:29)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants