MODEP/Mod Duo cross-compile kpp with meson

All your LV2 and LADSPA goodness and more.

Moderators: MattKingUSA, khz

Post Reply
robin
Established Member
Posts: 40
Joined: Wed Nov 04, 2020 10:56 am
Been thanked: 3 times

MODEP/Mod Duo cross-compile kpp with meson

Post by robin »

Hi there!
I'm trying to compile Kapitonov-Plugin-Pack by @olegkapitonov (https://github.com/olegkapitonov/Kapitonov-Plugins-Pack) for armv7 to use it with MODEP (and with a Moddevice in the future if the cross compile works, this is kind of a proof of concept)
I'm using the mod-plugin-builder local.env variant, which fails saying:

Code: Select all

[build@arch build]$ cat meson-logs/meson-log.txt 
Build started at 2020-11-16T21:00:10.584189
Main binary: /usr/bin/python
Build Options: 
Python system: Linux
The Meson build system
Version: 0.56.0
Source dir: /home/build/Kapitonov-Plugins-Pack
Build dir: /home/build/Kapitonov-Plugins-Pack/build
Build type: native build
Project name: kpp
Project version: 1.2
Using 'CC' from environment with value: 'arm-mod-linux-gnueabihf-gcc'
Using 'CFLAGS' from environment with value: '-O3 -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -mvectorize-with-neon-quad -ffast-math -fno-finite-math-only -fprefetch-loop-arrays -funroll-loops -funsafe-loop-optimizations -D__MOD_DEVICES__ -isystem /home/build/mod-workdir/modduo/staging/usr/include'
Using 'LDFLAGS' from environment with value: '-Wl,-O1 -Wl,--as-needed -Wl,--strip-all -isystem /home/build/mod-workdir/modduo/staging/usr/lib'
None of 'CPPFLAGS' are defined in the environment, not changing global flags.
None of 'CC_LD' are defined in the environment, not changing global flags.
Sanity testing C compiler: arm-mod-linux-gnueabihf-gcc
Is cross compiler: False.
None of 'CC_LD' are defined in the environment, not changing global flags.
Sanity check compiler command line: arm-mod-linux-gnueabihf-gcc /home/build/Kapitonov-Plugins-Pack/build/meson-private/sanitycheckc.c -o /home/build/Kapitonov-Plugins-Pack/build/meson-private/sanitycheckc.exe -O3 -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -mvectorize-with-neon-quad -ffast-math -fno-finite-math-only -fprefetch-loop-arrays -funroll-loops -funsafe-loop-optimizations -D__MOD_DEVICES__ -isystem /home/build/mod-workdir/modduo/staging/usr/include -pipe -D_FILE_OFFSET_BITS=64 -Wl,-O1 -Wl,--as-needed -Wl,--strip-all /home/build/mod-workdir/modduo/staging/usr/lib
Sanity check compile stdout:

-----
Sanity check compile stderr:
/home/build/mod-workdir/modduo/staging/usr/lib: file not recognized: Is a directory
collect2: error: ld returned 1 exit status

-----

meson.build:1:0: ERROR: Compiler arm-mod-linux-gnueabihf-gcc can not compile programs.
The only thing I could make sense of was adding a slash at the end of the path in the meson.build, which didn't help and resulted in the very same error. The setup is a freshly installed Archlinux running in chroot/lxc (tried both, just to make sure, didn't make a difference) only containing the build and runtime dependencies of kpp, it cross-compiles the eg-amp (makefile) coming with mod-plugin-builder succesfully, and native-compilation of kpp works as well. I didn't try any other meson based plugins though. Has anyone built a meson-based project for MODEP/Mod Duo et al. yet or can anyone make sense of the error? Looking forward to any replies!
robin
Established Member
Posts: 40
Joined: Wed Nov 04, 2020 10:56 am
Been thanked: 3 times

Re: MODEP/Mod Duo cross-compile kpp with meson

Post by robin »

So I got a little further:

Code: Select all

g++ -shared kpp_tubeamp.cpp "-DPLUGIN_URI=\"https://faustlv2.bitbucket.io/kpp_tubeamp\"" -lzita-convolver -lzita-resampler -fPIC -o kpp_tubeamp.lv2/kpp_tubeamp.so
builds the tubeamp-so succesfully on Arch (native). The same line fails using local.env or compiling on patchboxOS directly saying "This program requires zita-convolver 4.x.x", so its not going to work even if could get past the error from the first post.
Out of interest I installed current zita-convolver and zita-resampler from source on patchboxOS and tried to build using meson again, but the compiler (ninja) fails again, this time saying:

Code: Select all

ninja: Entering directory `build/'
[5/5] Linking target LV2/kpp_tubeamp.so.
FAILED: LV2/kpp_tubeamp.so 
c++  -o LV2/kpp_tubeamp.so 'LV2/87d5cba@@kpp_tubeamp@sha/kpp_tubeamp_kpp_tubeamp.cpp.o' -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -shared -fPIC -Wl,--start-group -Wl,-soname,kpp_tubeamp.so -lzita-convolver -lzita-resampler -Wl,--end-group
/usr/bin/ld: LV2/87d5cba@@kpp_tubeamp@sha/kpp_tubeamp_kpp_tubeamp.cpp.o: in function `stPlugin::load_profile(char const*, int)':
kpp_tubeamp.cpp:(.text._ZN8stPlugin12load_profileEPKci[_ZN8stPlugin12load_profileEPKci]+0x784): undefined reference to `Convproc::configure(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, float)'
/usr/bin/ld: kpp_tubeamp.cpp:(.text._ZN8stPlugin12load_profileEPKci[_ZN8stPlugin12load_profileEPKci]+0x7b8): undefined reference to `Convproc::impdata_create(unsigned int, unsigned int, int, float*, int, int)'
/usr/bin/ld: kpp_tubeamp.cpp:(.text._ZN8stPlugin12load_profileEPKci[_ZN8stPlugin12load_profileEPKci]+0x7f4): undefined reference to `Convproc::configure(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, float)'
/usr/bin/ld: kpp_tubeamp.cpp:(.text._ZN8stPlugin12load_profileEPKci[_ZN8stPlugin12load_profileEPKci]+0x81c): undefined reference to `Convproc::impdata_create(unsigned int, unsigned int, int, float*, int, int)'
/usr/bin/ld: kpp_tubeamp.cpp:(.text._ZN8stPlugin12load_profileEPKci[_ZN8stPlugin12load_profileEPKci]+0x844): undefined reference to `Convproc::impdata_create(unsigned int, unsigned int, int, float*, int, int)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Seems to be referring to "Convproc", is this a convolver thing again?
User avatar
olegkapitonov
Established Member
Posts: 30
Joined: Wed Feb 27, 2019 9:26 am
Location: Belarus
Contact:

Re: MODEP/Mod Duo cross-compile kpp with meson

Post by olegkapitonov »

Hi, @robin !

Yes, Convolver is zita-convolver.
This problem may be caused by old version of zita-convolver,
maybe 3.x instead of 4.x.
tramp
Established Member
Posts: 2348
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 468 times

Re: MODEP/Mod Duo cross-compile kpp with meson

Post by tramp »

olegkapitonov wrote: Wed Nov 25, 2020 10:28 am This problem may be caused by old version of zita-convolver,
maybe 3.x instead of 4.x
Yes, the mod-plugin-builder comes with version 3.1.0 with the ffmpeg-patch for performance reason.
https://github.com/moddevices/mod-plugi ... nvolver.mk

you may be able to update this to version 4.x by edit this build script locally,remove the ffmpeg-patch, and rebuild your env.

@olegkapitonov
On the other hand it's relative trivial to support both versions, here is how I do it for guitarix:
https://github.com/brummer10/guitarix/c ... ef8f96be8f
On the road again.
robin
Established Member
Posts: 40
Joined: Wed Nov 04, 2020 10:56 am
Been thanked: 3 times

Re: MODEP/Mod Duo cross-compile kpp with meson

Post by robin »

@olegkapitonov
I already tried that, the second codebox of my previous post is the result of the ninja build with zita-convolver 4.0.3 and zita-resampler 1.6.2 installed from source and compiling on MODEP directly, not cross using env. Before doing that, meson refuses to do its thing and I cant even start to compile.
@tramp
You mentioned removing a ffmpeg-patch, where would I do that? I cant find any reference to that in the build scripts of either kpp or zita...
tramp
Established Member
Posts: 2348
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 468 times

Re: MODEP/Mod Duo cross-compile kpp with meson

Post by tramp »

robin wrote: Thu Nov 26, 2020 7:52 am You mentioned removing a ffmpeg-patch, where would I do that? I cant find any reference to that in the build scripts of either kpp or zita...
Oh, that is only related when you use the mod-blugin-builder and want to update zita-convolver in the mod-plugin-builder environment, it's this one:
https://github.com/moddevices/mod-plugi ... mpeg.patch
you need to remove it from the folder (locally) before rebuild
On the road again.
Post Reply