Robotics StackExchange | Archived questions

avcodec.h -- no such file (Fedora 24)

I've spent the last few days getting my ROS stack to compile on Fedora 24. It has been quite a process. I'm almost there; I have 196 out of 197 projects compiling. I have one project that won't compile: gazebo_ros. It gives this error:

fatal error: libavcodec/avcodec.h: No such file or directory

However, the file clearly exists as a locate call shows it here:

/usr/include/ffmpeg/libavcodec/avcodec.h

I'm building the package like this:

catkin_make_isolated --force-cmake --pkg gazebo_ros -DCMAKE_BUILD_TYPE=Release

I attempted to add --make-args -I /usr/include/ffmpeg but the error persists. What can I do to resolve this error? Thanks for your time.

For those others attempting to run ROS on Fedora 24, here are my notes:

I had to use Fedora 24 because Ubuntu 15.10, 16.04, and 16.10 beta all failed to handle the graphics driver properly on a new MacPro with Radeon HD 7870 cards. I tried fglrx (latest) in 15.10 with no success either.

Fedora has basic catkin packages included: sudo dnf install rospack rospack-devel python3-rosdep python3-rosinstall python3-rospkg python3-rosdistro catkin catkin-devel

I had to install these additional packages (using sudo dnf install) before the catkinmakeisolated would succeed:

freetype-freeworld cabextract xorg-x11-font-utils fontconfig curl curl-devel unzip git cmake pkg-config opencl-headers opencl-utils opencl-utils-devel libusb libusb-devel libjpeg-turbo libjpeg-turbo-devel doxygen opencl-utils clinfo mesa-libOpenCL-devel eigen3-devel gdal-devel gtest gtest-devel protobuf protobuf-c-devel protobuf-devel libdc1394 libdc1394-devel tesseract tinyxml tinyxml-devel ffmpeg ffmpeg-devel libstdc++ libstdc++-devel libstdc++-static libpng-devel jasper-devel openexr-devel libtiff-devel libwebp-devel libv4l-devel tbb-devel python-sphinx lapack lapack-devel libgphoto2-devel python-nose python-devel libudev libudev-dev orocos-kdl orocos-kdl-devel python-rosdep python-rosinstall_generator python-wstool python-rosinstall python-empy console-bridge console-bridge-devel extra-cmake-modules cmake-gui poco poco-devel boost boost-random boost-static boost-system boost-thread boost-timer sip sip-devel python3-sip python3-sip-devel pyside-tools python-pyside python-pyside-devel python2-pyudev-pyside python-qt5 python-qt5-devel redhat-rpm-config lz4 lz4-devel lzma lzma-devel urdfdom urdfdom-devel urdfdom-headers-devel qhull qhull-devel assimp assimp-devel collada-dom collada-dom-devel python2-numpy python2-numpy-f2py python3-numpy python3-numpy-f2py ogre ogre-devel libyaml libyaml-devel yaml-cpp yaml-cpp-devel yaml-cpp03 yaml-cpp03-devel python-netifaces python3-netifaces python2-defusedxml python3-defusedxml

I was also working on kinect2 at the same time so some of those projects may apply to that.

Had to make these links: sudo ln -s /usr/bin/qmake-qt5 /usr/bin/qmake sudo ln -s /usr/lib64/libassimp.so /usr/lib64/libassimpd.so

I did openCV 3.1 straight from Github because the catkin auto-dep wouldn't compile: Use the git clone and then go to that folder and run this: cmake -D WITHTBB=ON -D WITHEIGEN=ON -D CMAKEBUILDTYPE=RELEASE -D BUILDTESTS=OFF -D BUILDPERFTESTS=OFF BUILDEXAMPLES=OFF .. make && make install

That bit me later when I had to do this for RViz and gazebo: sudo ldconfig /usr/local/lib64 /usr/local/lib

and excluded it from Catkin's pull like this: rosinstall_generator desktop --rosdistro kinetic --deps --wet-only --tar --exclude opencv3 > kinetic-desktop-wet.rosinstall

one of the projects fails to detected ASSIMPUNIFIED, so I had to compile Catkin like this: ./src/catkin/bin/catkinmakeisolated --install -DCMAKEBUILDTYPE=Release -DASSIMPUNIFIEDHEADERNAMES=ON

RViz failed with this error: /home/sbir/Workspace/Catkin/src/rviz/src/rviz/defaultplugin/effortdisplay.h:45:36: error: unable to find string literal operator ‘operator""fmt’ with ‘const char [28]’, ‘long unsigned int’ arguments
ROSWARNNAMED("messagefilter", "MessageFilter [target=%s]: "fmt, getTargetFramesString().cstr(), VA_ARGS) To fix it I had to modify effort_display.h to put a space before fmt, (after the doublequote)

There is a package for gazebo, but I could not get it to run. I removed it. To build gazebo: hg clone https://bitbucket.org/osrf/gazebo -r gazebo7 (I was also able to build the qt5 branch) I manually pulled all the ign-* stuff and built and installed it, though I'm not sure that was necessary now.

sudo dnf install ignition-math ignition-math-devel sdformat sdformat-devel libtar libtar-devel tinyxml2 tinyxml2-devel freeimage freeimage-devel

That was the wrong version of sdformat, so compile it but do this first: sudo dnf install psutils python2-psutil python3-psutil ruby rubygem-ronn sudo dnf install openal openal-soft hdf5 hdf5-devel gts gts-devel bullet bullet-devel graphviz graphviz-devel

Couldn't find these optionals readily available: simbody dart gts (triangulation) spanv libgvc libcgraph libcdt

I couldn't get the gazebo head branch to compile; there is some bug with ign-transport-dev missing. I manually compiled and installed ign-transport (and its deps), but that did not fix it.

Asked by BrannonKing on 2016-06-24 11:36:19 UTC

Comments

I think the best way to approach this would be to find the package/CMakeLists.txt that does a find_package(..) (or the pkg-config equivalent) for ffmpeg. Somehow not all include paths are setup correctly on F24. Or some pkg is depending transitively on ffmpeg (through another dep).

Asked by gvdhoorn on 2016-06-25 02:43:58 UTC

Could that simlink sudo ln -s /usr/bin/qmake-qt5 /usr/bin/qmake break something else ? I'm having trouble understanding what it does. Culd you please quickly explain ?

Asked by Maya on 2016-10-20 09:44:44 UTC

I think if you had both QT4 and QT5 installed, one would expect /usr/bin/qmake to correspond to version 4.

Asked by BrannonKing on 2016-10-20 11:11:10 UTC

@BrannonKing Hello, I am also having some trouble to build ROS Kinetic with Fedora 24. If you have some time, maybe you can take a look to my question and somehow compare the configuration?

Asked by Kabe on 2016-10-24 04:04:48 UTC

Answers

As suggested in the comment, I proceeded to modify all the CMakeLists.txt in the gazebo_ros_pkgs. The modification was to add /usr/include/ffmpeg to the include_directories list. After that gazebo_ros_pkgs compiled fine. Alas, they don't run right on Fedora 24 even after that. They continue to look for Gazebo in the wrong location.

Asked by BrannonKing on 2016-06-30 11:24:53 UTC

Comments