I am trying to build the mod-openvino
plugin into Audacity on Manjaro by converting these instructions that are for Ubuntu: OpenVINO Plugins AI Audacity Build Instructions.
This issue is a follow up from the XY problem: Issue with arch-nspawn creating incorrect mirror list
So far, I have successfully downloaded the audacity-git
package and built it in my host environment, along with installing openvino
and whisper.cpp-openvino
from the AUR. However, when I added in mod-openvino
, I encountered compiler errors. Here is the error message that led me to believe I needed an older version of GCC:
<command-line>: warning: "_GLIBCXX_USE_CXX11_ABI" redefined
<command-line>: note: this is the location of the previous definition
[ 99%] Building CXX object modules/mod-openvino/CMakeFiles/mod-openvino.dir/noise_suppression/noise_suppression_df_model.cpp.o
<command-line>: warning: "_GLIBCXX_USE_CXX11_ABI" redefined
<command-line>: note: this is the location of the previous definition
/home/bevan/audacity-git-custom/src/audacity/modules/mod-openvino/OVNoiseSuppression.cpp: In member function āvirtual bool EffectOVNoiseSuppression::Process(EffectInstance&, EffectSettings&)ā:
/home/bevan/audacity-git-custom/src/audacity/modules/mod-openvino/OVNoiseSuppression.cpp:500:51: error: invalid use of member function ābool Track::Any() constā (did you forget the ā()ā ?)
500 | auto pCopiedTrack = *copiedTrackList->Any<WaveTrack>().begin();
| ~~~~~~~~~~~~~~~~~^~~
| ()
To ensure an environment in which to build mod-openvino
, I moved to creating a chroot with GCC 11 (this is what Ubuntu22.04 installs), along with openvino
and whisper.cpp-openvino
. I have been struggling to learn how to properly build a package in chroot in Manjaro. I have looked at arch-nspawn
, manjaro-chroot
, buildpkg
, and have recently been pointed at chrootbuild
. I have read various documentation such as Buildiso with AUR packages: Using buildpkg to try and answer the question: āHow do I build from a local PKGBUILD in a chroot when that PKGBUILD depends on packages from the AUR?ā
The linked forum post suggested:
With manjaro-chrootbuild:
sudo chrootbuild -cp <package-name> -i </path/to/dependency/package.tar.zst> -i </path/to/dependency/package.tar.zst>
Having read those other documents, I interpreted that as something like:
ls /build/mypackage/PKGBUILD
cd /build
git clone https://aur.archlinux.org/gcc11
buildpkg -p gcc11
sudo chrootbuild -cp mypackage -i /var/cache/manjaro-tools/pkg/stable/x86_64/gcc.tar.zst
Yet I have been told that ābuildpkg is deprecated in favor of chrootbuild.ā
Iām struggling with not knowing what I donāt know. I donāt know where chrootbuild
puts the resulting built packages, for example.
The Manjaro tools documentation (Manjaro Tools) doesnāt mention chrootbuild
, and I donāt know where the deprecated buildpkg
is documented. I can read chrootbuild
ās documentation here: Manjaro-chrootbuild Documentation.
At some point, I realized that to build a package with buildpkg
, I need to cd
to the directory above the directory that contains my PKGBUILD
and run it from there with the PKGBUILD
ās directory as the package name. I assume chrootbuild
works the same.
System Information:
- OS: Manjaro
- GCC Version: 14
- Installed Packages:
audacity-git
,openvino
,whisper.cpp-openvino
Summary of Attempts:
- Built
mod-openvino
locally and encountered compiler errors. - Built
audacity-git-custom
locally. - Attempted to set up a chroot environment to ensure correct dependencies.
- Explored various Manjaro-centric tools for building in chroot, including
arch-nspawn
,manjaro-chroot
,buildpkg
, andchrootbuild
.
Current Issues:
- Understanding how to properly use
chrootbuild
. - Locating where
chrootbuild
places the resulting built packages. - Ensuring a clean environment with the correct dependencies for building
mod-openvino
.
Custom PKGBUILD:
Here is my working version of the PKGBUILD for my custom Audacity:
# Maintainer: Ong Yong Xin <ongyongxin2020+github@gmail.com>
# Contributor: Fabio 'Lolix' Loli <fabio.loli@disroot.org> -> https://github.com/FabioLolix
# Contributor: Bernhard Landauer <oberon@manjaro.org>
# Contributor: Eric BƩlanger <eric@archlinux.org>
pkgname=audacity-git-custom
pkgver=3.5.1.r919.gc87964f2a
pkgrel=1
pkgdesc="A program that lets you manipulate digital audio waveforms"
arch=('i686' 'x86_64')
url="https://www.audacityteam.org/"
license=('GPL2' 'CCPL')
groups=('pro-audio')
depends=(
'openvino'
'whisper.cpp-openvino'
'alsa-lib'
'expat'
'flac'
'gtk3'
'gtkmm3'
'gst-plugins-bad-libs'
'jack'
'lame'
'libid3tag'
'libmad'
'libogg'
'libsbsms'
'libsndfile'
'libsoxr'
'libvorbis'
'libx11'
'lilv'
'lv2'
'mpg123'
'opusfile'
'portaudio'
'portmidi'
'portsmf'
'rapidjson'
'soundtouch'
'sqlite'
'suil'
'twolame'
'vamp-plugin-sdk'
'vst3sdk'
'wavpack'
'wxwidgets-gtk3'
'xcb-util-cursor'
'zlib'
)
makedepends=('cmake' 'gcc11' 'git' 'nasm' 'cuda')
optdepends=('ffmpeg: additional import/export capabilities')
provides=(
'audacity'
'ladspa-host'
'lv2-host'
'vamp-host'
'vst-host'
'vst3-host'
)
conflicts=('audacity')
source=(
"git+https://github.com/intel/openvino-plugins-ai-audacity#tag=v3.5.1-R2.2"
"git+https://github.com/audacity/audacity.git"
)
sha256sums=('SKIP' 'SKIP')
pkgver() {
cd audacity
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | cut -d'.' -f2-
}
prepare() {
echo "Running prepare step..."
cd "${srcdir}/openvino-plugins-ai-audacity"
git checkout v3.5.1-R2.2
cd "${srcdir}"
# Copy the mod-openvino folder into the Audacity source tree
cp -r "${srcdir}/openvino-plugins-ai-audacity/mod-openvino" "${srcdir}/audacity/modules/"
if [ -d "${srcdir}/audacity/modules/mod-openvino" ]; then
echo "mod-openvino directory copied successfully."
else
echo "Failed to copy mod-openvino directory."
exit 1
fi
# Update CMakeLists.txt to add mod-openvino as a build target
sed -i '/endforeach()/a add_subdirectory(mod-openvino)' "${srcdir}/audacity/modules/CMakeLists.txt"
# Check if CMakeLists.txt is updated correctly
if grep -q "add_subdirectory(mod-openvino)" "${srcdir}/audacity/modules/CMakeLists.txt"; then
echo "CMakeLists.txt updated successfully."
else
echo "Failed to update CMakeLists.txt."
exit 1
fi
}
build() {
export CC=gcc-11
export CXX=g++-11
export VST3_SDK_DIR=/usr/src/vst3sdk
# Source the OpenVINO setupvars.sh script
source /opt/intel/openvino/setupvars.sh
# Set up environment variables for Libtorch
export LIBTORCH_ROOTDIR="/opt/lib
torch"
# Set up environment variables for whisper.cpp
export WHISPERCPP_ROOTDIR="/usr"
export LD_LIBRARY_PATH="${WHISPERCPP_ROOTDIR}/lib:$LD_LIBRARY_PATH"
# Set up environment variables for CUDA
export CUDA_TOOLKIT_ROOT_DIR=/opt/cuda
export PATH=$CUDA_TOOLKIT_ROOT_DIR/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_TOOLKIT_ROOT_DIR/lib64:$LD_LIBRARY_PATH
export CUDNN_INCLUDE_DIR=$CUDA_TOOLKIT_ROOT_DIR/include
export CUDNN_LIB_DIR=$CUDA_TOOLKIT_ROOT_DIR/lib64
cmake_args=(
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=/usr
-D audacity_lib_preference=system
-D audacity_obey_system_dependencies=On
-D audacity_conan_enabled=Off
-D audacity_use_wxwidgets=system
-D CMAKE_CUDA_ARCHITECTURES="86"
)
cmake -S audacity -B build "${cmake_args[@]}"
if [ $? -eq 0 ]; then
echo "CMake configuration successful."
else
echo "CMake configuration failed."
exit 1
fi
cmake --build build
if [ $? -eq 0 ]; then
echo "Build successful."
else
echo "Build failed."
exit 1
fi
}
package() {
cd build
make DESTDIR="${pkgdir}" install
}
Can someone please help me resolve the issue with setting up a chroot environment or suggest an alternative approach? Any guidance on building mod-openvino
for Audacity would also be greatly appreciated.