DTC compiler make failure on Ubuntu 16.04, how to debug this?

legendbb

New Member
Hi all,

I was trying to build Device Tree Compiler from source (
Code:
git clone https://git.kernel.org/pub/scm/utils/dtc/dtc.git
) in Ubuntu 16.04

Code:
## Skipping pylibfdt (install python dev and swig to build)
googled around and tried installing missing packages
Code:
python-dev swig
, after still get the same error. I understand there is a prebuild binary can be install by
Code:
sudo apt-get install device-tree-compiler
. I'd like to learn how to figure out how to fix dependency issue like this.

Please comment,

Thanks,
 


legendbb

New Member
Indeed it's "python3-dev", now it works for me. Please let me know how to troubleshoot this kind of issue. How would I know in the future, it's some other package is needed.
Great thanks!
 

stephanos

New Member
Indeed it's "python3-dev", now it works for me. Please let me know how to troubleshoot this kind of issue. How would I know in the future, it's some other package is needed.
Great thanks!
You need to look into the Makefile (and/or other files that are part of the build system). Searching for the displayed error message in the Makefile would help trace the exact problem.


Note that the Makefile 'pkg-config's $(PYTHON), which is set to python3 in the line 28; so I figured I need to install python3-dev, instead of python-dev which is 2.7.
 

JasKinasis

Well-Known Member
If you are running a Debian based distro and there is already a binary in the repos for the program/package you want to build from source - you can install all of the build dependencies using:
sudo apt build-dep nameofpackage

But for this to work, you need to have the source repos enabled/uncommented in /etc/apt/sources.list

What this does is installs all of the build dependencies for the version of the program/package that is in the repos.

In my experience - 99% of the time - doing this will allow you to build the newest version of any given program from source control.

The only time it will fail is if there are new dependencies in the newer version from source control. E.g. if it uses newer versions of a library, or it requires a library that the version in the repos doesn't use.

In which case - you'd have to get the new versions of the dependencies from the repos. Or if they aren't available in the repos yet - you need to download the source code and dependencies for any new dependencies and build and install them from source before being able to build and install the new version of the program.

But I've literally only had to do that a handful of times in all of the years I've been using Linux. Most of the time installing the build deps for the version in the repos is good enough to build the latest version from source control.
 

Members online

No members online now.

Top