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

What to do after MPV-Build on Linux #68

Open
anesuc opened this issue May 18, 2020 · 12 comments
Open

What to do after MPV-Build on Linux #68

anesuc opened this issue May 18, 2020 · 12 comments

Comments

@anesuc
Copy link

anesuc commented May 18, 2020

Hi,

This is slightly linked to my previous issue #67 I added a while back but there hasn't been any response to it. So I've tried to see if I can attempt it either way but I am not sure where to go from here. This is related to this:

Compile static libmpv.so with e.g. mpv-build.

I've compiled with mpv build as instructed on that git. But I don't really know where to go from here. How do I link to this newly compiled one?

Hopefully someone has a solution to this as a project of mine is on standstill due to this sadly.

Thanks

@anesuc
Copy link
Author

anesuc commented May 18, 2020

Update: I've added the .a files for libav I've compiled into the "libraries" binding.gyp and it compiled fully. However I'm now getting undefined symbols errors i.e:

undefined symbol: mpv_create

When I try to run the App

@Kagami
Copy link
Owner

Kagami commented May 18, 2020

Probably you forgot to enable libmpv.

@anesuc
Copy link
Author

anesuc commented May 18, 2020

What do you mean? --enable-libmpv-shared? That just generates the .so one which I can't use because it's a non static one. Either way I did that and included the same .a files still same error. I'll retry in a sec it in case I missed something

@Kagami
Copy link
Owner

Kagami commented May 18, 2020

@anesuc
Copy link
Author

anesuc commented May 18, 2020

This is into the mpv_options file right? Because I did that and got this error:
`make: Leaving directory '/node_modules/mpv.js/mpv-build/ffmpeg_build'
Using mpv options: --libmpv-static
waf [commands] [options]

Main commands (example: ./waf build -j4)
.....(Shows a lot of options I can use here)
.....
waf: error: no such option: --libmpv-static`

One of the options in there just had enable infront of it which was:
--enable-libmpv-static
Did that and it compiled successfully. However, still same problem :(

@anesuc
Copy link
Author

anesuc commented May 18, 2020

Wait, I think I know

@anesuc
Copy link
Author

anesuc commented May 18, 2020

I didn't have the newly created libmpv.a in binding.gyp but after adding it I get errors during buld now which are:

CXX(target) Release/obj.target/mpvjs/index.o SOLINK_MODULE(target) Release/obj.target/mpvjs.node /usr/bin/ld: /home/extern/Downloads/test/lol/lib-retry/node_modules/mpv.js/mpv-build/mpv/build/libmpv.a(mp_image.c.26.o): relocation R_X86_64_PC32 against symbolmp_image_setfmt' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
mpvjs.target.mk:158: recipe for target 'Release/obj.target/mpvjs.node' failed
make: *** [Release/obj.target/mpvjs.node] Error 1
make: Leaving directory '/home/extern/Downloads/test/lol/lib-retry/node_modules/mpv.js/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.3.0-51-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/extern/Downloads/test/lol/lib-retry/node_modules/mpv.js
gyp ERR! node -v v13.14.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
`

Edit: I'm looking into the fPIC flag

@anesuc
Copy link
Author

anesuc commented May 18, 2020

Looked into the fPIC flag which is not a valid flag for mpv_options. The closest was --enable-pic which looked like it was already enabled for ffmpeg_options but I added it anyway. It's not valid for mpv_options though.

Any ideas?

@anesuc
Copy link
Author

anesuc commented May 18, 2020

Update on this tried adding --enable-static-build as well ended up with this error during compile of mpv:

`scripting.c:302: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: cannot find -ldrm
collect2: error: ld returned 1 exit status

Waf: Leaving directory /home/extern/Downloads/test/lol/lib-retry/node_modules/mpv.js/mpv-build/mpv/build' Build failed -> task in 'mpv' failed with exit status 1 (run with -v to display more information)

@Kagami
Copy link
Owner

Kagami commented May 18, 2020

You can ask in https://github.com/mpv-player/mpv how to compile static libmpv.

@anesuc
Copy link
Author

anesuc commented May 18, 2020

Ok I've asked the question there! Hopefully we might get somewhere! Was documenting here so that it might help someone attempting this later

@1056824847
Copy link

Can you tell me how to compile libmpv for linux x64 and arm64, I can’t run it after compiling

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

3 participants