How do I transcribe audio with modern tooling on Manjaro?

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, and chrootbuild.

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.

Thanks for creating a new topic and explaining what you’re trying to do.

Arch builds audacity just fine with the current verison of gcc (14). I highly doubt that the audacity-git VCS package would require an older version of GCC–especially three versions behind.

By the way, CXX11 does not mean GCC 11. This explains a bit about it, however I can’t claim to understand all of it since I’m not a programmer: Dual ABI

Just the above. Well, except for a I made a typo earlier, packages have the .pkg.tar.zst extension.

No idea what that is. It’s not in the AUR by that name, at least. :man_shrugging:

Thanks mate. Yeah, I can build audacity-git myself with gcc14, it is when I include mod-openvino which is an audacity module into the audacity build that I get the error. Which leads me to believe that mod-openvino needs the older gcc.

_GLIBCXX_USE_CXX11_ABI is not what made me think gcc11.

My reasoning was

error: invalid use of member function ā€˜bool Track::Any() const’ (did you forget the ā€˜()’ ?)

looks like a syntax error (I’m a PHP dev not C)… so given that this is supposed to build on ubuntu 22.04, but I get this error, I reason that perhaps mod-open vino was built for an older gcc. I checked what version of gcc is installed on ubuntu22.04 and it is gcc11… I maybe get away with 12 or 13, I don’t know, gcc11 seems the safe bet.

Thanks for the tip on chrootbuild, I am digging into the code for that and getting my head around it.

thanks so much, I’ll see how I go with chrootbuild.


Moderator edit: fixed formatting

Ah, right.

Makes sense.

I had to resign as iso and package maintainer a couple of years back - still participate as code maintainer though.

There is a lot of team related stuff I haven’t been able to keep up with but for what I recall

  • makepkg is the native Arch Linux tool for creating local packages
  • buildpkg is manjaro’s extended version of makepkg
  • chrootbuild is an enhanced version of buildpkg to be used with CI builds

chrootbuild places the package in the current folder $PWD.

You can control where the result is stored by using a local .makepkg.conf.

Start by creating a local copy of /etc/makepkg.conf

cp /etc/makepkg.conf ~/.makepkg.conf

Edit the file and locate the lines and fill in an existing path to your storage location.

#-- Destination: specify a fixed directory where all packages will be placed
PKGDEST=""
1 Like

OK. Thank you so much. Now I am able to get back to working on the PKGBUILD for my custom audacity with mod-openvino.

I have built a number of dependencies from the AUR that are required and run a chrootbuild for my package.

I still have some more dependencies that need to be met.

After having used chrootbuild to generate the package for each each dependency, I can run:

$ cd /home/build
$ ls audacity-git-custom
PKGBUILD
$ sudo chrootbuild -cp audacity-git-custom -i /home/bevan/build/openvino-2024.1.0-3-x86_64.pkg.tar.zst -i /home/bevan/build/whisper.cpp-openvino-1.6.2-1-x86_64.pkg.tar.zst -i /home/bevan/build/gcc12-12.3.0-6-x86_64.pkg.tar.zst -i /home/bevan/build/gcc12-fortran-12.3.0-6-x86_64.pkg.tar.zst -i /home/bevan/build/gcc12-libs-12.3.0-6-x86_64.pkg.tar.zst

My package still has some missing dependencies I need to work through, but this is a huge win.

additional info

bash script build_dependencies_recursive.sh
I have written a bash script that looks through the dependencies in the PGKBUILD and identifies those dependencies that are in the AUR, and recurses through those packages for each subsequent dependency and builds them, ultimately generates the chrootbuild command and parameters for my custom package, passing in all the AUR dependencies via -i.

Having this script makes my life easier and limits mistakes such as typos.

autogit
I have seen this project: GitHub - puxplaying/autogit: Arch/Manjaro auto build, update, install tool for PKGBUILD's from Github, Gitlab and AUR via "makepkg", "devtools", "chrootbuild" which looks like it does what my script does, but with many more features.
I have avoided using it so far as I am having enough trouble learning without having to learn yet another abstraction on top. In my experience I’d find issues with that too and have to diagnose those.

dependency availability
Some of my required dependencies (such as OpenVINO Tokenizers) may not be available as a pre-built package, so I may need to build those myself.

Thank you

However, THANK YOU!!! Yochanan and linux-aarhus for your help so far, it has been invaluable. I have a way to go yet and I have learned a lot so far.

Good to be of help.

The inhouse package manager has some neat built-in features when it comes to build custom packages.

Take you PKGBUILD as example. Navigate into the folder and run pamac build - no other options.

If there is any dependencies which needs building e.g. your gcc11 pamac will clone that dependency just outside your folder and build the dependency then install it before building the original target package.

That is what scripts are for … eliminating the tedious boring work where mistakes often happen :slight_smile:

do you mean I could have just run pacmac build? (I vaguely recall attempt just that days ago), dang.

Anyway, I can build in an environment that I somewhat understand now (sort of lol).

as for
ā€œ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.ā€
well that’s presenting me with the challenges that caused me to ensure a clean build environment in the first place.
It’s a bit like whack-a-mole. I’m currently having issues with it linking vst3sdk

/build/audacity-git-custom/src/build/vst3sdk/VST3/Release/dataexchange.vst3/Contents/x86_64-linux/dataexchange.so: undefined symbol: _ZN9Steinberg3Vst19WaveformViewManager26createNanoVGViewAndContextEvmake[2]: *** [public.sdk/samples/vst/dataexchange/CMakeFiles/dataexchange.dir/build.make:198: VST3/Release/dataexchange.vst3/Contents/x86_64-linux/dataexchange.so] Error 1

====

I am thinking about taking yet another step back and attempting to build this in ubuntu22.04 to confirm I can actually build it at all. As for the best way to get an ubuntu22.04, well I have never used distrobox , it might be worth a go. Or I could install ubuntu22.04 in a VirtualBox, heck, maybe even docker. Decisions are hard.

VitrtualBox is probably the most straight forward way, but as openvino is very GPU related I wonder about hardware compatibility int a VM.

This is a big job I have set for myself.

Either I achieve it or I don’t, either way I am learning heaps, and plan to document it if I’m not too worn out.

The _GLIBCXX_USE_CXX11_ABI warning is unrelated to the compilation error, and that error is nothing to do with gcc version.

It’s almost certainly caused by a mismatch between latest audacity source code and openvino source code. Try using version 3.5.1 of audacity source as per Error during Compilation, Mint 21.3 Ā· Issue #223 Ā· intel/openvino-plugins-ai-audacity Ā· GitHub

Yeah. I had issue building gcc11, so I’m working with 12… but I have other issues in the way for now. Gcc compatibility might be a red herring for sure.

My current issue is with linking : undefined symbol: _ZN9Steinberg3Vst19WaveformViewManager26createNanoVG.

I am building:
Audacity-3.4.2
and
openvino plugsin: v3.4.2-R1

because that is the version that the readme refers too (appears the readme has not been upated for newer releases) openvino-plugins-ai-audacity/doc/build_doc/linux/README.md at main Ā· intel/openvino-plugins-ai-audacity Ā· GitHub

Thanks heaps for the link to that issue… That is providing some clues too.

bit by bit I’m figuring it all out.

I just attempted to build audacity-git from the AUR using chrootbuid, just to get working baseline, but it depends on jack (from the AUR) which in turn depends on celt (from the AUR) and chrootbuild -cp celt results in errors. :frowning:

@linux-aarhus when you say ā€œbuild the dependency then install itā€ does that mean install in my host? Due to all the issues i’m trying to keep my build environment isolated from the host, hence the whole chroot business in the first place. I think I understand the manjaro-centric chroot stuff well enough to create an independent build environment.

OK,. I might be talking too much when I have lots to do and need to stay focused.

thanks everyone I will keep you posted.

I’m not sure what I don’t understand.

From this discussion I was under the impression that if I had PKGBUILD that specified a dependency that is in the AUR then I had to build that dependency and pass it to in a -i option into chrootbuild.

But, this suggest that is not the case:

$ yay -G audacity
:: (1/1) Downloaded PKGBUILD: audacity-git
 cat audacity-git/PKGBUILD 
# 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
pkgver=3.4.2.r93.g86a6b6df8
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=(
	'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' 'gcc' 'git' 'nasm')
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/audacity/audacity.git")
sha256sums=('SKIP')

pkgver() {
  cd audacity
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | cut -d'.' -f2-
}

build() {
  export CC=gcc
  export VST3_SDK_DIR=/usr/src/vst3sdk

  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
  )

  cmake -S audacity -B build "${cmake_args[@]}"
  cmake --build build
}

package() {
  cd build
  make DESTDIR="${pkgdir}" install
}

Not that jack is listed in the depends, and that hack is in the AUR.
Yet when I now run:

sudo chrootbuild -cp audacity-git

that builds successfully although I have not build jack and have not passed the package into -i, and thus my impression that I have to pass the AUR dependencies to chrootbuild is incorrect. :frowning:

edit: It installs jack2

==> Installing missing dependencies...
:: There are 2 providers available for jack:
:: Repository extra
   1) jack2  2) pipewire-jack

Enter a number (default=1): 

OMG, whoo

mod-openvino module is in the module’s list in audacity!!
OMG!!

I’m not done yet, but this is a HUGE win.

My brain is mush.

For reference, here is the PKGBUILD that I used:

USE_OPENVINO=true # Set to false to build without OpenVINO plugins

pkgname=audacity-git-custom
pkgver=3.4.2.r919.gc87964f2a  # Update version to match the tag
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=(
	'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' 'gcc' 'git' 'nasm')
if [ "$USE_OPENVINO" = true ]; then

  depends+=(
    'openvino'
    'openvino-tokenizers'
    'whisper.cpp-openvino'
    'libtorch-cuda'
  )
  makedepends+=(
    'cuda'
    'opencl-headers'
    'ocl-icd'
    'nvidia-utils'
    'xcb-util-keysyms'
    'opencl-clhpp'
    #'nanovg-git'
  )
fi
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/audacity/audacity.git")
sha256sums=('SKIP')
if [ "$USE_OPENVINO" = true ]; then
  source+=("git+https://github.com/intel/openvino-plugins-ai-audacity.git")
  sha256sums+=('SKIP')
fi

pkgver() {
  cd audacity
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | cut -d'.' -f2-
}

prepare() {
  echo "Running prepare step..."

  cd "${srcdir}/audacity"
  git checkout Audacity-3.5.1

  if [ "$USE_OPENVINO" = true ]; then
    cd "${srcdir}/openvino-plugins-ai-audacity"
    git checkout v3.5.1-R2.2 

    cd "${srcdir}"
    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

    sed -i '/endforeach()/a add_subdirectory(mod-openvino)' "${srcdir}/audacity/modules/CMakeLists.txt"
    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
  fi
}

build() {
  export CC=gcc
  #export CXX=g++
  export VST3_SDK_DIR=/usr/src/vst3sdk

  if [ "$USE_OPENVINO" = true ]; then
    # Source the OpenVINO setupvars.sh script
    source /opt/intel/openvino/setupvars.sh

    # Set up environment variables for Libtorch
    export LIBTORCH_ROOTDIR="/opt/libtorch"

    # 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

    # Set the TORCH_CUDA_ARCH_LIST to valid architectures
    # This addresses the issue where the CUDA architecture 9.0a is not recognized by CMake,
    # causing build failures. The relevant issue can be found here:
    # https://github.com/pytorch/pytorch/issues/113948
    # A fix was proposed in PR 123243 to update the CMake regex to recognize 9.0a, but until
    # that fix is in place in the installed version, we manually specify the architectures.
    # Reference: https://github.com/pytorch/pytorch/pull/123243
    export TORCH_CUDA_ARCH_LIST="8.0 8.6 8.9 9.0"
  fi

  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
  )

  cmake -S audacity -B build "${cmake_args[@]}"
  if [ $? -eq 0 ]; then
    echo "CMake configuration successful."
  else
    echo "CMake configuration failed."
    exit 1
  fi

  #make -C build -j$(nproc) VERBOSE=1  # Use parallel build
  cmake --build build
  if [ $? -eq 0 ]; then
    echo "Build successful."
  else
    echo "Build failed."
    exit 1
  fi
}

package() {
  cd build
  make DESTDIR="${pkgdir}" install
}

I also had to build openvino-tokenizers, with this PKGBUILD:

# Maintainer: Your Name <your.email@example.com>

pkgname=openvino-tokenizers
pkgver=2024.1.0.0
pkgrel=1
pkgdesc="OpenVINO Tokenizers adds text processing operations to OpenVINO"
arch=('x86_64')
url="https://github.com/openvinotoolkit/openvino_tokenizers"
license=('Apache')
depends=('openvino' 'python' 'python-pip' 'python-virtualenv' 'snappy')
makedepends=('git' 'python-setuptools')
source=(
  "git+https://github.com/openvinotoolkit/openvino_tokenizers.git#tag=2024.1.0.0"
)
sha256sums=('SKIP')

prepare() {
  cd "$srcdir/openvino_tokenizers"
}

build() {
  source /opt/intel/openvino/setupvars.sh
  cd "$srcdir/openvino_tokenizers"

  # Create a virtual environment
  python -m venv venv
  source venv/bin/activate

  # Install the package and dependencies
  pip install --no-deps .
  pip install transformers[sentencepiece] tiktoken
  pip install pytest
  pip install torch
}

check() {
  source /opt/intel/openvino/setupvars.sh
  cd "$srcdir/openvino_tokenizers/tests"
  
  # Activate the virtual environment
  source ../venv/bin/activate

  # Run pytest and capture the exit status
  pytest |& tee /build/openvino-tokenizers-check.log
  test_status=${PIPESTATUS[0]}

  # Check if pytest failed
  if [ $test_status -ne 0 ]; then
    echo "Tests failed. Check /build/openvino-tokenizers-check.log for details."
    exit 1
  fi
}

package() {
  cd "$srcdir/openvino_tokenizers"

  # Install the virtual environment into the package directory
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -dm755 "$pkgdir/usr/share/$pkgname"
  cp -r venv "$pkgdir/usr/share/$pkgname/"
}

I hope if I clean build it works again lol.

Anyway, felt the win was worth an update… and I couldn’t have done it without your help.

====
edit:

I may have spoke to soon, when I enabled mod-openvino in the drop down, closed audacity and opened it, I got a dialog:

"Unable to load the ā€œmod-openvinoā€ module.

Error: Inappropriate ioctl for device"

So still have got a way to go it seems.
The fact that the package built and the module is listed is still a huge win.

OMG. when you don’t know what you don’t know.

I didn’t know what whisper was, and that occured me to today.
Now I can achieve my end goal of transcribing the audio in my video file using whisper directly on the command line.

I don’t need to use audacity and mod-openvino.

yay -S whisper
whisper audio.wav > transcription.txt

it’s that easy.

Well, I learned a lot more about manjaro and package and build management!

I’ve got what I needed, and I went the really long way around to get there.

3 Likes

If you’d mentioned what you were trying to accomplish at the start then someone here might have known the easy way to do it - XY problem - Wikipedia

But never mind, it wasn’t a wasted journey if you learned something :slight_smile:

Oh. I am well aware of that. I was so far in the weeds that, well.
I had no idea I could just run something directly on the machine, there was so much hype of ā€œNow you can transcribe audio on your machine, just use install this audacity pluginā€ that I didn’t think there was another way, and didn’t think to ask. It’s a lesson for sure.

Now that I know that ā€˜whisper’ is the answer, there are resources galore.

1 Like

In addition. Can I say the people who helped on this post have been some of the most helpful I have ever got in the opensource community.
Patient, knowledgeable, accepting of mistakes, and allow for me to be naive.

I’m often hesitant to ask for help because it usually makes things more painful than just doing it myself… but this experience has been a breath of fresh air.

I said a big thank you earlier, but I’ll say it again…

and hey, I may come back to getting that packaging working, but my particular problem ā€œhow to transcribe audio with modern tooling on Manjaroā€ is solved, so my mission is fulfilled,

THANK YOU.

4 Likes

I’m glad you accomplished your mission no matter how you arrived there. :+1:

Honestly your journey with all this reminds me of things I’ve experienced as well with attempting to package things in a certain way to accomplish a certain goal. Sometimes it worked, sometimes it didn’t–and sometimes I realized I went down a rabbit hole for nothing. :laughing: Either way, I learned something.

2 Likes

Thanks for the support.
My motivation to continue to package it as receded, not surprising.
But I’m a little bit interested in seeing if I can still package it up as someone else may want the audacity plugin.

Although I have amd/nvidia prime graphics cards, and this comment suggests openvion only supports intel after all: [CLDNN ERROR]. No GPU device was found. Ā· Issue #452 Ā· openvinotoolkit/openvino Ā· GitHub

Yet that comment is also 2 years old, yet there is anecdotal evidence, see my screen shot of a youtube comment on a video about the plugin that it does work with nvidia.

So I even if I continued it still may be a fool’s errand.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.