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

[Help] Cross compile movit (shotcut & mlt GPU deps), which can build on-device #20351

Closed
knyipab opened this issue May 29, 2024 · 7 comments
Closed

Comments

@knyipab
Copy link
Contributor

knyipab commented May 29, 2024

movit, which enables the GPU mode of shotcut, seems to require on device compilation (successful on device build shown in this TUR PR). When building the package, it executes a compiled binary to generate .cpp file (see the error log of this cross compile attempt). However, there does not seem to be on device build feature in thistermux-packages repo, right?

If termux-packages does not accpet on-device built package, there seems to be only four options:

  1. Someone figure out how to cross-compile movit
  2. Workaround to bring ondevice built packages to termux-packages
  3. Give up and disable the movit GPU mode for shotcut and any mlt-dependent pacakges
  4. Put movit, shotcut (and possibly mlt) to TUR

May I seek advice from the community? Thanks.

@Biswa96
Copy link
Member

Biswa96 commented May 29, 2024

Yes, it may be possible to build with host program. Shotcut could be added here instead of TUR.

@TomJo2000
Copy link
Member

  1. Is definitely the preferred option.

  2. I'm very reluctant to consider.
    Building packages on-device is a last resort, and generally only acceptable for "simple" packages

  3. If 1 doesn't work out I think this would be the preferred (interim) solution

  4. That is always an option if the standard build infrastructure doesn't fit for shotcut.

@knyipab
Copy link
Contributor Author

knyipab commented May 29, 2024

If someone want to try option 1, may continue the work at PR #20352.

I will do option 3 for now. But fyi, there are still some issues regarding the shotcut package and I will open issue later.

@knyipab knyipab changed the title movit (shotcut & mlt GPU deps) may require on device build [Help] Cross compile movit (shotcut & mlt GPU deps), which can build on-device May 29, 2024
@TomJo2000
Copy link
Member

TomJo2000 commented May 29, 2024

Bingo, found the issue.
The make_bundled_shaders helper binary is of course compiled for the target architecture.
Thus it can't be run during the build, but the build tries to run it.
Now if I can just find where it builds it...

Line 188 in Makefile.in is where it's getting called to do its thing.

bundled_shaders.cpp: make_bundled_shaders $(SHADERS) # L:187
	./make_bundled_shaders $(SHADERS) > $@       # L:188

The make rule for it is just above.

# A program to compile all the shaders into one bundle that we can link into the library.        # L:183
MAKE_BUNDLE_OBJS=make_bundled_shaders.o util.o init.o resource_pool.o                            # L:184
make_bundled_shaders: $(MAKE_BUNDLE_OBJS)                                                        # L:185
    $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o make_bundled_shaders $(MAKE_BUNDLE_OBJS) -lepoxy # L:186

We should be able to patch this part to build the helper binary for the host architecture instead.

@TomJo2000
Copy link
Member

So, in theory yes.
In practice I've not sure how to get it to build make_bundled_shaders such that it can be run by the build system as a native executable (as opposed to the cross compilation target of the rest of the package)

@Biswa96
Copy link
Member

Biswa96 commented May 30, 2024

For building make_bundled_shaders program, the host environment need eigen package.

@TomJo2000
Copy link
Member

Hmm

@knyipab knyipab closed this as completed May 30, 2024
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