how to build pixhawk application - toolchain

I am new in building PIXHAWK application. I am following the Pixhawk Pilot Support Package (PSP) User Guide. But I receive an error in running make px4fmu-v2_default and finally I can't finish it.
CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
couldn't find python module jinja2:
For debian systems I tried:
sudo apt-get install python-jinja2
or for all other OSs/debian:
pip install jinja2
(missing: PY_JINJA2)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:377 (FPHSAFAILURE_MESSAGE)
cmake/common/px4_base.cmake:622 (find_package_handle_standard_args)
CMakeLists.txt:293 (px4_find_python_module)
-- Configuring incomplete, errors occurred!
See also "C:/pixhawk_toolchain/Firmware/build_px4fmu-v2_default/CMakeFiles/CMakeOutput.log".
rm: cannot remove directory `/c/pixhawk_toolchain/Firmware/build_px4fmu-v2_default': Permission denied
make: *** [px4fmu-v2_default] Error 1
How can I solve this?

For Ubuntu it can be
sudo apt-get install python-dev

Can you please try:
pip install -U Jinja2

Related

Installing Vivado ML 2021.2 in CentOs but process is hang in 'Generating installed device list'

anybody can help me figure out why the installation is hanging on 'Generating installed device list' and how to solve it without starting the process all over. I am working on CentOs.
Thanks in advance
I think this happens due to following missing packages:
libstdc++6:i386
libgtk2.0-0:i386
dpkg-dev:i386
ncurses5-compat-libs
python3-pip
libtinfo5
libncurses5
As BKN mentioned, you need to install the missing packages.
To avoid starting all over again, you can do the following:
Check the log: cat ~/.Xilinx/xinstall/*.log
Locate the error message. It should look something like:
2022-01-09 10:53:11,458 DEBUG: n.t:? - Executing script Generating installed device list: /tools/Xilinx/Vivado/2021.2/bin/vivado [-nolog, -nojournal, -mode, batch, -source, /tools/Xilinx/Vivado/2021.2/scripts/sysgen/tcl/xlpartinfo.tcl, -tclargs, /tools/Xilinx/Vivado/2021.2/data/parts/installed_devices.txt]
2022-01-09 12:05:35,319 DEBUG: n.t:? - Unable to run GenerateDevListFileLin, exit code: 130, stdout: , stderr: application-specific initialization failed: couldn't load file "librdi_commontasks.so": libtinfo.so.5: cannot open shared object file: No such file or directory failure msg:
application-specific initialization failed: couldn't load file "librdi_commontasks.so": libtinfo.so.5: cannot open shared object file: No such file or directory
2022-01-09 12:05:35,319 DEBUG: n.t:? - Executing script Generating installed device list for Model Composer: /tools/Xilinx/Vivado/2021.2/bin/vivado [-nolog, -nojournal, -mode, batch, -source, /tools/Xilinx/Model_Composer/2021.2/data/xmcGenBoardParts.tcl, -tclargs, /tools/Xilinx/Model_Composer/2021.2/../../Vivado/2021.2, librdi_dsp_tcltasks.so, /tools/Xilinx/Model_Composer/2021.2/data]
The log informs you exactly what the missing package is (in this case it was libtinfo), and also provides you with the script to run after you install the package:
/tools/Xilinx/Vivado/2021.2/bin/vivado -nolog -nojournal -mode batch -source /tools/Xilinx/Vivado/2021.2/scripts/sysgen/tcl/xlpartinfo.tcl -tclargs /tools/Xilinx/Vivado/2021.2/data/parts/installed_devices.txt
Notes:
Make sure to use the Vivado version (here it was 2021.2) and location (here it was /tools/Xilinx) according to your system.
You may need to run the script in sudo if the the permissions for writing are not available in user mode.
I also encounterd this problem on Archlinux with Vivado 2018.3.
But I just installed the library ncurses5-compat-libs, then the problem is solved.
Perhaps you can solve this by checking the library ncurses5-compat-libs.
Download the tar package instead of the self-extracting bin package
Update the java and python version
sudo apt-get install -y python3-pip
Install Dependencies
sudo apt-get install -y libstdc++6
sudo apt-get install -y libgtk2.0-0
sudo apt-get install -y dpkg-dev
NOTE: Without ibtinfo5 the application will not start and without libncurses5 the simulation will fail
`sudo apt-get install -y libtinfo5 libncurses5`
Restart the system
Untar that Vivado package
tar -xzvf Xilinx_Unified_2021.2_1021_0703.tar.gz
Locate the xsetup file in the package
Install the package in batch mode
./xsetup --agree 3rdPartyEULA,XilinxEULA --batch Install --product "Vivado" --edition "Vivado ML Enterprise" --location "/home/USER"
Once the installation has been successfully completed
Locate the settings64.sh file
./settings64.sh
Locate the cable drivers
cd Vivado/2021.2/data/xicom/cable_drivers/lin64/install_scripts/install_drivers
./install_drivers
Installing Vivado Board Files
Get the board package from the git https://github.com/Digilent/vivado-boards.git
From the vivado-board-master package copy the folder board_files undert /vivado-board-master/new/board_files
Paste the board files to Vivado/2021.2/data/boards
From the vivado-board-master package copy the file Vivado_init.tcl under /vivado-board-master/utility
Paste the file Vivado_init.tcl to the Vivado installation
That's it!! You might not need to do all these steps but that is what I ended up doing and it worked for the two machines where I installed Vivado. The installation took less than one hour.
This was originally edited into the question itself by the OP.

Exception: Failed to attach BPF to kprobe when executing sudo opensnoop-bpfcc

When I try to execute sudo opensnoop-bpfcc I get this message:
In file included from /virtual/main.c:4:
In file included from include/linux/sched.h:14:
In file included from include/linux/pid.h:5:
In file included from include/linux/rculist.h:11:
In file included from include/linux/rcupdate.h:40:
In file included from include/linux/preempt.h:81:
In file included from ./arch/x86/include/asm/preempt.h:7:
In file included from include/linux/thread_info.h:38:
In file included from ./arch/x86/include/asm/thread_info.h:53:
./arch/x86/include/asm/cpufeature.h:150:2: warning: "Compiler lacks ASM_GOTO support. Add -D __BPF_TRACING__ to your compiler arguments"
[-W#warnings]
#warning "Compiler lacks ASM_GOTO support. Add -D __BPF_TRACING__ to your compiler arguments"
^
1 warning generated.
Traceback (most recent call last):
File "/usr/sbin/opensnoop-bpfcc", line 127, in <module>
b.attach_kprobe(event="sys_open", fn_name="trace_entry")
File "/usr/lib/python2.7/dist-packages/bcc/__init__.py", line 526, in attach_kprobe
raise Exception("Failed to attach BPF to kprobe")
Exception: Failed to attach BPF to kprobe
I don't understand how to fix it. I've just installed bcc tools using this command
sudo apt-get install bpfcc-tools linux-headers-$(uname -r)
as suggested on the github page https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---binary
The running OS is 18.04.2 LTS (Bionic Beaver).
I had to compile bcc from source code instead of installing it using the package.
Install linux kernel headers
sudo apt install linux-headers-$(uname -r)
Install required dependencies
sudo apt-get -y install bison build-essential cmake flex git libedit-dev \ libllvm6.0 llvm-6.0-dev libclang-6.0-dev python zlib1g-dev libelf-dev
Compile bcc from source code
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
#Maicake is right. Compiling and installing from source did work for me. Here are the steps to install on Ubuntu 22.04:
Follow the steps described here. Specifically for Ubuntu 22.04 you may need to make some changes after cloning the bcc repository.
Add the following line to your .bashrc file:
export PATH=$PATH:/usr/share/bcc/tools
Create a symlink to python3 as most of the tools use python (not python3) to run the scripts.
sudo ln -s /usr/bin/python3 /usr/bin/python

Problam with apt-get install

I'm using ubuntu 16.04 and last week I try to install some virtual machine on my computer but I failed to do it.
Now when I try to install any program from the apt-get install I got this text:
sudo apt-get install build-essential git libssl-dev
[sudo] password for eliya:
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
git is already the newest version (1:2.7.4-0ubuntu1.5).
libssl-dev is already the newest version (1.0.2g-1ubuntu4.13).
The following packages were automatically installed and are no longer required:
libavdevice-ffmpeg56 linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic
linux-image-4.4.0-134-generic linux-image-extra-4.4.0-134-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 103 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up virtualbox-ext-pack (5.1.38-0ubuntu1.16.04.1) ...
removing old virtualbox extension packs
virtualbox-ext-pack: downloading: http://download.virtualbox.org/virtualbox/5.1.38/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack
The file will be downloaded into /usr/share/virtualbox-ext-pack
License accepted.
0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to install "/usr/share/virtualbox-ext-pack/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack"
VBoxManage: error: The installer failed with exit code 1: VBoxExtPackHelperApp: error: World writable: '/usr'
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManagerWrap, interface IExtPackManager
VBoxManage: error: Context: "RTEXITCODE handleExtPack(HandlerArg*)" at line 1201 of file VBoxManageMisc.cpp
Hash mismatch Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack: expected e93d87b0f5de50369baca0a48082236b947df5b922ffd0233c0fa92c1206defd, or wrong accept-license key, removing the file.
dpkg: error processing package virtualbox-ext-pack (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
virtualbox-ext-pack
E: Sub-process /usr/bin/dpkg returned an error code (1)
And now i can't install anything because this problam.
Thank you
1.Reconfigure Package Database
sudo dpkg --configure -a
2.force install
sudo apt-get install -f
Then try again installing virtualbox

pyenv install 3.6.3 error occurring : why?

user#syyun:~$ pyenv install 3.6.3
Downloading Python-3.6.3.tar.xz...
-> https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
Installing Python-3.6.3...
BUILD FAILED (Ubuntu 16.04 using python-build 1.1.5-8-g7b9d1a4)
Inspect or clean up the working tree at /tmp/python-build.20171020004725.32507
Results logged to /tmp/python-build.20171020004725.32507.log
Last 10 log lines:
ensurepip._main()
File "/tmp/python-build.20171020004725.32507/Python-3.6.3/Lib/ensurepip/__init__.py", line 189, in _main
default_pip=args.default_pip,
File "/tmp/python-build.20171020004725.32507/Python-3.6.3/Lib/ensurepip/__init__.py", line 102, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/tmp/python-build.20171020004725.32507/Python-3.6.3/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip
zipimport.ZipImportError: can't decompress data; zlib not available
Makefile:1079: recipe for target 'install' failed
make: *** [install] Error 1
Can't locate any related google-search record for above given error on pyenv install command.
Any guidance would be appreciate
This question is answered in the pyenv wiki. You have to prep your build environment first before trying to build a Python interpreter using pyenv.
According to the wiki, you need the following packages installed for Ubuntu:
apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev

Installing CKAN error - cannot determine reason

Here is a list of packages I had to install for CKAN 2.7.0
python-setuptools-36.2.4-4.mga7.noarch.rpm
pgdg-redhat96-9.6-3.noarch.rpm
xml-commons git subversion mercurial postgresql96-server postgresql96-devel postgresql96 python-devel libxslt libxslt-devel libxml2 libxml2-devel python-virtualenv gcc gcc-c++ make java-1.6.0-openjdk redis tomcat tomcat-webapps tomcat-admin-webapps xalan-j2unzip policycoreutils-python mod_wsgi httpd tcl-devel redis
after installing these tools i was able to download the git successfully using
pip install --ignore-installed -e git+https://github.com/okfn/ckan.git#ckan-2.7.0#egg=ckan
I then added pgsql-9.6 to the path in order for ckan to recognize pg_config
PATH=$PATH:/usr/pgsql-9.6/bin
Now when I attempt to run the requirements.txt installation it fails with this error
ImportError: No module named pytz
----------------------------------------
Cleaning up...
Command /usr/lib/ckan/default/bin/python -c "import setuptools;__file__='/usr/lib/ckan/default/build/pbr/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Aun2rR-record/install-record.txt --single-version-externally-managed --install-headers /usr/lib/ckan/default/include/site/python2.7 failed with error code 1 in /usr/lib/ckan/default/build/pbr
Storing complete log in /usr/lib/ckan/.pip/pip.log
If anybody can explain what the error means and what I need to install/modify I would greatly appreciate it. Seems there is a package called pytz missing but I cannot find information about it.
Thanks
pytz must must installed inside the virtualenv and the pip-requirements-docs.txt must be run prior to running requirements.txt.