Instll Python packages librosa and llvm on Jetson nano developer kit problem

I’m trying to make signal processing environment in Jetson nano developer kit, but being stuck for lots of errors.
Please, give me feedback

llvm error : ERROR: Complete output from command /usr/bin/python3 -u -c ‘import setuptools, tokenize;file=’“'”‘/tmp/pip-install-y7tctrjp/llvmlite/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ install --record /tmp/pip-record-9j4qibo7/install-record.txt --single-version-externally-managed --compile: ERROR: running install running build got version from file /tmp/pip-install-y7tctrjp/llvmlite/llvmlite/_version.py {‘version’: ‘0.28.0’, ‘full’: ‘685b7b6941617f616f3f0b609e381af52da26782’} running build_ext /usr/bin/python3 /tmp/pip-install-y7tctrjp/llvmlite/ffi/build.py LLVM version… # static-libstdc++ avoids runtime dependencies on a # particular libstdc++ version. g++ -shared -I/usr/lib/llvm-7/include -std=c++0x -fuse-ld=gold -Wl,–no-keep-files-mapped -Wl,–no-map-whole-files -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -DNDEBUG -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -g -flto assembly.cpp bitcode.cpp core.cpp initfini.cpp module.cpp value.cpp executionengine.cpp transforms.cpp passmanagers.cpp targets.cpp dylib.cpp linker.cpp object_file.cpp -o libllvmlite.so -L/usr/lib/llvm-7/lib -flto -Wl,–exclude-libs=ALL -lLLVM-7 7.0.0

SVML not detected
running build_py
creating build
creating build/lib.linux-aarch64-3.6
creating build/lib.linux-aarch64-3.6/llvmlite
copying llvmlite/utils.py → build/lib.linux-aarch64-3.6/llvmlite
copying llvmlite/_version.py → build/lib.linux-aarch64-3.6/llvmlite
copying llvmlite/six.py → build/lib.linux-aarch64-3.6/llvmlite
copying llvmlite/init.py → build/lib.linux-aarch64-3.6/llvmlite
creating build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/dylib.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/initfini.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/analysis.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/executionengine.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/context.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/passmanagers.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/targets.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/options.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/ffi.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/transforms.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/init.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/object_file.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/value.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/common.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/module.py → build/lib.linux-aarch64-3.6/llvmlite/binding
copying llvmlite/binding/linker.py → build/lib.linux-aarch64-3.6/llvmlite/binding
creating build/lib.linux-aarch64-3.6/llvmlite/ir
copying llvmlite/ir/_utils.py → build/lib.linux-aarch64-3.6/llvmlite/ir
copying llvmlite/ir/context.py → build/lib.linux-aarch64-3.6/llvmlite/ir
copying llvmlite/ir/transforms.py → build/lib.linux-aarch64-3.6/llvmlite/ir
copying llvmlite/ir/builder.py → build/lib.linux-aarch64-3.6/llvmlite/ir
copying llvmlite/ir/init.py → build/lib.linux-aarch64-3.6/llvmlite/ir
copying llvmlite/ir/types.py → build/lib.linux-aarch64-3.6/llvmlite/ir
copying llvmlite/ir/module.py → build/lib.linux-aarch64-3.6/llvmlite/ir
copying llvmlite/ir/values.py → build/lib.linux-aarch64-3.6/llvmlite/ir
copying llvmlite/ir/instructions.py → build/lib.linux-aarch64-3.6/llvmlite/ir
creating build/lib.linux-aarch64-3.6/llvmlite/llvmpy
copying llvmlite/llvmpy/core.py → build/lib.linux-aarch64-3.6/llvmlite/llvmpy
copying llvmlite/llvmpy/passes.py → build/lib.linux-aarch64-3.6/llvmlite/llvmpy
copying llvmlite/llvmpy/init.py → build/lib.linux-aarch64-3.6/llvmlite/llvmpy
creating build/lib.linux-aarch64-3.6/llvmlite/tests
copying llvmlite/tests/test_valuerepr.py → build/lib.linux-aarch64-3.6/llvmlite/tests
copying llvmlite/tests/customize.py → build/lib.linux-aarch64-3.6/llvmlite/tests
copying llvmlite/tests/test_llvmpy.py → build/lib.linux-aarch64-3.6/llvmlite/tests
copying llvmlite/tests/init.py → build/lib.linux-aarch64-3.6/llvmlite/tests
copying llvmlite/tests/main.py → build/lib.linux-aarch64-3.6/llvmlite/tests
copying llvmlite/tests/test_ir.py → build/lib.linux-aarch64-3.6/llvmlite/tests
copying llvmlite/tests/test_binding.py → build/lib.linux-aarch64-3.6/llvmlite/tests
copying llvmlite/binding/libllvmlite.so → build/lib.linux-aarch64-3.6/llvmlite/binding
UPDATING build/lib.linux-aarch64-3.6/llvmlite/_version.py
running install_lib
creating /usr/local/lib/python3.6/dist-packages/llvmlite
error: could not create ‘/usr/local/lib/python3.6/dist-packages/llvmlite’: Permission denied

ERROR: Command “/usr/bin/python3 -u -c ‘import setuptools, tokenize;file=’”‘"’/tmp/pip-install-y7tctrjp/llvmlite/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’“‘))’ install --record /tmp/pip-record-9j4qibo7/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-install-y7tctrjp/llvmlite/

librosa error : ERROR: Complete output from command /usr/bin/python3 -u -c ‘import setuptools, tokenize;file=’“'”‘/tmp/pip-install-t_eshkrx/llvmlite/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ bdist_wheel -d /tmp/pip-wheel-4zxmrt0h --python-tag cp36: ERROR: running bdist_wheel /usr/bin/python3 /tmp/pip-install-t_eshkrx/llvmlite/ffi/build.py LLVM version… 6.0.0

Traceback (most recent call last): File “/tmp/pip-install-t_eshkrx/llvmlite/ffi/build.py”, line 167, in main() File “/tmp/pip-install-t_eshkrx/llvmlite/ffi/build.py”, line 157, in main main_posix(‘linux’, ‘.so’) File “/tmp/pip-install-t_eshkrx/llvmlite/ffi/build.py”, line 119, in main_posix raise RuntimeError(msg) RuntimeError: Building llvmlite requires LLVM 7.0.x. Be sure to set LLVM_CONFIG to the right executable path. Read the documentation at http://llvmlite.pydata.org/ for more information about building llvmlite.

error: command ‘/usr/bin/python3’ failed with exit status 1

ERROR: Failed building wheel for llvmlite Running setup.py clean for llvmlite Failed to build llvmlite Installing collected packages: llvmlite Running setup.py install for llvmlite … error ERROR: Complete output from command /usr/bin/python3 -u -c ‘import setuptools, tokenize;file=’“'”‘/tmp/pip-install-t_eshkrx/llvmlite/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ install --record /tmp/pip-record-f8_mqj6e/install-record.txt --single-version-externally-managed --compile: ERROR: running install running build got version from file /tmp/pip-install-t_eshkrx/llvmlite/llvmlite/_version.py {‘version’: ‘0.28.0’, ‘full’: ‘685b7b6941617f616f3f0b609e381af52da26782’} running build_ext /usr/bin/python3 /tmp/pip-install-t_eshkrx/llvmlite/ffi/build.py LLVM version… 6.0.0

Traceback (most recent call last):
File “/tmp/pip-install-t_eshkrx/llvmlite/ffi/build.py”, line 167, in
main()
File “/tmp/pip-install-t_eshkrx/llvmlite/ffi/build.py”, line 157, in main
main_posix(‘linux’, ‘.so’)
File “/tmp/pip-install-t_eshkrx/llvmlite/ffi/build.py”, line 119, in main_posix
raise RuntimeError(msg)
RuntimeError: Building llvmlite requires LLVM 7.0.x. Be sure to set LLVM_CONFIG to the right executable path.
Read the documentation at http://llvmlite.pydata.org/ for more information about building llvmlite.

error: command ‘/usr/bin/python3’ failed with exit status 1

ERROR: Command “/usr/bin/python3 -u -c ‘import setuptools, tokenize;file=’”‘"’/tmp/pip-install-t_eshkrx/llvmlite/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’“‘))’ install --record /tmp/pip-record-f8_mqj6e/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-install-t_eshkrx/llvmlite/

what do you execute while getting these errors?
how to reproduce your steps?
I did not install it at nano. However, I would use virtual environment if you are dealing with python. Moreover, I can see that guys have support channel at IRC Channel: irc.oftc.net #llvm

1 Like

Thanks your comment Andrey1984.

Before I tried this precess, followed this steps (Getting started with the NVIDIA Jetson Nano - PyImageSearch), successfully made virtual environment.

As same as errors when I tried in virtual environment.

This is what I executed.
pip3 install llvmlite
pip3 install librosa

“Building llvmlite requires LLVM 7.0.x. Be sure to set LLVM_CONFIG to the right executable path. Read the documentation at http://llvmlite.pydata.org/ for more information about building llvmlite.”

It seems that llvm needs to be installed, as per the definition above. Once the llvm is installed you could approach installing the python llvmlite
However,I would ask the guys in the IRC chat, if I were you.

1 Like

I reached the same impass on Jetson TX2, but now I got it.
The way to go is:

$wget http://releases.llvm.org/7.0.1/llvm-7.0.1.src.tar.xz
$tar -xvf llvm-7.0.1.src.tar.xz
$cd llvm-7.0.1.src.tar.xz
$mkdir llvm_build_dir
$cd llvm_build_dir/
$cmake ../ -DCMAKE_BUILD_TYPE=Release                     -DLLVM_TARGETS_TO_BUILD="ARM;X86;AArch64"
$make -j4 (in case of TX2)
$cd bin/
$echo "export LLVM_CONFIG=\""`pwd`"/llvm-config\"" >> ~/.bashrc
$echo "alias llvm='"`pwd`"/llvm-lit'" >> ~/.bashrc
$source ~/.bashrc
$pip install llvmlite

Now I’m attempting Librosa, got to make LLVM and llvmlite to work just fine on the TX2 on versions 7.0.1 and 0.29.0.
LLVM and llvmlite also install with success on versions 6.0.1 for LLVM and (0.23.0 - 0.26.0) for llvmlite. I recommend this link for compatibility checks: llvmlite · PyPI

1 Like

Update:

I finally got librosa to work on my TX2.
LLVM - 6.0.1
llvmlite - 0.23.0 - 0.26.0

I suggest librosa 0.6.3. (https://github.com/librosa/librosa/releases/tag/0.6.3), because librosa 0.7.0 requires audioread deps, whilst librosa 0.6.3 does not.But before you start installing librosa, it’s better to install a substitute of audioread.

If you are using pip, I suggest you follow the steps from (PySoundFile — PySoundFile 0.9.0 documentation) to install PySoundFile, which works as audioread.

Also, I recommend the installation of ffmpeg and gstreamer for reading MP3 files:

apt-get install ffmpeg
apt-get install gstreamer1.0-plugins-base gstreamer1.0-plugins-ugly
pip install pygobject

Finally, follow with librosa 0.6.3 installation by downloading the source code (.tar.gz) and running the setup.py by python setup.py install.

If these versions do not work, I suggest you to find an earlier release of Librosa, with dependencies easier to address, seek which LLVM and llvmlite versions you should install and proceed from there.

Compatibility table can be found at llvmlite · PyPI

Hope this helps!

1 Like

Dear brenozanchetta

I find the compatibility in the llvmlight website: GitHub - numba/llvmlite: A lightweight LLVM python binding for writing JIT compilers. Numba needs llvm v0.31.0 based on LLVM 7.0.x or higher versions. How to change the following steps with regard to Jetson Nano rather than TX2?

  1. $cmake …/ -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=“ARM;X86;AArch64”
    Question: There is a long space between "Release“ and “-DLLVM”. Can I need to keep the space no changed or shorten the long space.

  2. $make -j4 (in case of TX2)
    Question: I see that TX2 is j4. The Jetson Nano has NVIDIA Tegra X1 Graphics. Do I need to change it to "$make - x1?

Notes:

My env is listed as follows.
System: JatPacl 4.2.1 [L4T 32.1.0]
OS: Ubuntu 18.04 LTS

Appreciate for your reply in advance,

Mike

1 Like

Hi Mike, you can install LLVM 7 from the Ubuntu apt repo, you shouldn’t need to build it from source. Here is how I do it:

$ sudo apt-get install llvm-7 llvm-7-dev
$ export LLVM_CONFIG=/usr/bin/llvm-config-7
1 Like

Hi Dusty:

Even though I solved the above-mentioned issue by building it from source one year ago, I still think that your method is more elegant and straightforward.

In fact, I adopt your method to build LLVM 7 and llvmlite in a virtual environment of the JetPack 4.3 on Jetson Nano. It is very quick to build them and paves the way for librosa.

Wish you a nice week,

Mike

Wish you a nice weekend.

1 Like

Hi All,

This thread was very helpful when I was trying to install llvm, llvmlite, and eventually librosa on my Jetson nano. Would love to share with everyone the recipe I used to successfully got everything installed:

Dependencies:
numpy 1.19.2
llvm-7
llvmlite 0.31.0
numba 0.48.0
[I did find the numpy version is very important since with 1.19.5 I could not install numba]

Before you run the following commands, please make sure you have installed necessary system packages and prerequisites (e.g. pip, setuptools, etc.). Upgrade if needed. [ref: How to install the Librosa library in Jetson Nano or aarch64 module – learninone.com]

Commands:
$ sudo apt-get install llvm-7

$ cd /usr/bin

$ sudo ln -s llvm-config-7 llvm-config

$ sudo pip3 install llvmlite==0.31.0

$ sudo pip3 install numba==0.48

$ sudo pip3 install librosa

Note that if you have ever tried other llvm versions (e.g. llvm-9, llvm-10, etc.), uninstall other llvm versions, install the correct version llvm-7, remove the file ‘llvm-config’ under /usr/bin if it exists, and re-run “sudo ln -s llvm-config-7 llvm-config” before attempting installation of numba.

Good luck!

BR,
Esther

5 Likes

Thank you. This worked.