手動インストール
インストール先の変更
以下によると、通常のインストール先は/usr/local/lib/&pythoversions/dist-packagesだが、cmakeのオプション-DCMAKE_INSTALL_PREFIX
によりインストール先を変更できる。
この場合は、../にインストールされる
$ mkdir build # We're currently in the module's top directory
$ cd build/
$ cmake ../ # Tell CMake that all its config files are one dir up
$ make # And start building (should work after the previous section)When you run cmake, you usually run it in a separate directory (e.g.
build/
). This is the build tree. The path to the install tree is$prefix/lib/$pythonversion/dist-packages
, where$prefix
is whatever you specified to CMake during configuration (usually/usr/local/
) with the-DCMAKE_INSTALL_PREFIX
switch.$ cmake -DCMAKE_INSTALL_PREFIX= ../ # should be the configured
Python環境変数の設定
但し、GNURadioのインストール先を指すprefixを変更した場合、以下エラーが表示される。
Cannot import gnuradio
Pythonの環境変数であるPYTHONPATHとLD_LIBRARY_PATHをShellから読めないために発生する。exportにより設定する必要がある。
$ export PYTHONPATH=~/grc3.8.0/gnuradio-3.8.0.0/lib/python3.6/dist-packages:~/grc3.8.0/gnuradio-3.8.0.0/lib/python3.6/site-packages:$PYTHONPATH
$ export LD_LIBRARY_PATH=/home/kenji/grc3.8.0/gnuradio-3.8.0.0/lib:$LD_LIBRARY_PATH
Shellに接続する毎に自動設定する場合は上記設定を~/.bash_aliases
or ~/.bashrc
or ~/.profile
へ追記する。
gnuradio3.8.0手動インストール
最終的に、gnuradio-3.8.0.0の手動インストールは以下のように行うことで、gnuradioが正常起動した。
$ wget https://github.com/gnuradio/gnuradio/releases/download/v3.8.0.0/gnuradio-3.8.0.0.tar.gz
$ tar xvf gnuradio-3.8.0.0.tar.gz
$ cd gnuradio-3.8.0.0
$ mkdir ~/build
$ cd ~/build
$ cmake -DCMAKE_INSTALL_PREFIX= ../
$ make -j3 // If PC have 4 cores, 3 is recommended not to fleez.
$ make test
$ sudo make install$ export PYTHONPATH=~/grc3.8.0/gnuradio-3.8.0.0/lib/python3.6/dist-packages:~/grc3.8.0/gnuradio-3.8.0.0/lib/python3.6/site-packages:$PYTHONPATH
$ export LD_LIBRARY_PATH=/home/kenji/grc3.8.0/gnuradio-3.8.0.0/lib:$LD_LIBRARY_PATH
$ cd ../bin
$ ./gnuradio-companion
参考
ModuleNotFoundError - GNU Radio
OOTブロックのインストール
続いてOOTブロックをインストールする。
OOTブロックをインストールしようとしたが、 missing: Volk::volk エラーが発生。
$ cmake -DCMAKE_INSTALL_PREFIX=../../ ../
CMake Error at CMakeLists.txt:101 (find_package):
Found package configuration file:/home/kenji/grc3.8.0/gnuradio-3.8.0.0/lib/cmake/gnuradio/GnuradioConfig.cmake
but it set Gnuradio_FOUND to FALSE so package "Gnuradio" is considered to
be NOT FOUND. Reason given by package:The following imported targets are referenced, but are missing: Volk::volk
-- Configuring incomplete, errors occurred!
https://kazkojima.github.io/gr-neug.html
結論
Python環境変数等に悩み、解決に多忙な時間を費やすのであれば、
手動インストール先をデフォルトの/usr/local/...に設定し、
各OOTブロックを手動インストールするのが良い。
最終的にgnuradio3.8.0、gr-lora、gr-limeは手動でインストールできた。
同一PCに複数のversionを入れる場合、python仮想環境のvirtualenv、またはdockerでコンテナを作るのが良い。
Dockerによるインストール
Dockerコマンドは以下を参照されたい。