I am trying to build ffmpeg with dav1d. I've successfully built davit using the following commands:
git clone --depth=1 https://code.videolan.org/videolan/dav1d.git && \
cd dav1d && \
mkdir build && cd build && \
meson .. && \
ninja
After that, I am running a config command for the FFmpeg and get the error:
PKG_CONFIG_PATH="/app/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="/app/ffmpeg_build" \
--pkg-config-flags="--static" \
--extra-cflags="-I/app/ffmpeg_build/include" \
--extra-ldflags="-L/app/ffmpeg_build/lib" \
--extra-libs="-lpthread -lm" \
--bindir="/usr/local/bin" \
--enable-gpl \
--enable-libass \
--enable-libmp3lame \
--enable-libfreetype \
--enable-libopus \
--enable-libvorbis \
--enable-libx264 \
--enable-libdav1d \
--enable-nonfree
(All other libs are installed and FFmpeg configures and builds correctly with them if I omit --enable-libdav1d, but in case of the above command I get):
ERROR: dav1d >= 0.2.1 not found using pkg-config
I think the reason could be that meson puts bin files in the wrong directory. Could anyone please help?
P.S. I am using Ubuntu 18.04.
Example of build commands for the other libs:
git -C x264 pull 2> /dev/null || git clone --depth 1 https://code.videolan.org/videolan/x264.git && \
cd x264 && \
PKG_CONFIG_PATH="/app/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/app/ffmpeg_build" --bindir="/usr/local/bin" --enable-static --enable-pic && \
make && \
make install
To pass the build you have to add ninja install:
git clone --depth=1 https://code.videolan.org/videolan/dav1d.git && \
cd dav1d && \
mkdir build && cd build && \
meson --bindir="/usr/local/bin" .. && \
ninja && \
ninja install
But this not enough, if you run FFmpeg after, you'll get:
ffmpeg: error while loading shared libraries: libdav1d.so.4: cannot open shared object file: No such file or directory
To fix this issue add /usr/local/lib/x86_64-linux-gnu to the LD_LIBRARY_PATH:
export LD_LIBRARY_PATH+=":/usr/local/lib/x86_64-linux-gnu"
Related
I’m compiling the ffmpeg on an ec2 amazon linux instance, but it threw me an error ERROR: libfdk_aac not found.
I'm following this guide http://trac.ffmpeg.org/wiki/CompilationGuide/Centos to first install the dependencies and compile the package.
yum install autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="$HOME/ffmpeg_build" \
--pkg-config-flags="--static" \
--extra-cflags="-I$HOME/ffmpeg_build/include" \
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \
--extra-libs=-lpthread \
--extra-libs=-lm \
--bindir="$HOME/bin" \
--enable-gpl \
--enable-libfdk_aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-nonfree
make
make install
hash -d ffmpeg
and this is the error message I've got
ec2-user#ip-xx-xxx-xx-xx ffmpeg]$ PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
> --prefix="$HOME/ffmpeg_build" \
> --pkg-config-flags="--static" \
> --extra-cflags="-I$HOME/ffmpeg_build/include" \
> --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
> --extra-libs=-lpthread \
> --extra-libs=-lm \
> --bindir="$HOME/bin" \
> --enable-gpl \
> --enable-libfreetype \
> --enable-libmp3lame \
> --enable-libopus \
> --enable-libvpx \
> --enable-libx264 \
> --enable-libx265 \
> --enable-nonfree
ERROR: libfdk_aac >= 3.98.3 not found
I tried installing libfdk_aac but there's no package found. I don't seem to come across any posts discussing this issue, or at least recently. Appreciate any pointers. thanks!
[ec2-user#ip-xx-xxx-xx-xx ffmpeg]$ sudo yum install libfdk-aac
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package libfdk-aac available.
Error: Nothing to do
I am trying to run this docker image, but not sure why I am getting this error:
/usr/bin/time: cannot run /usr/bin/java: No such file or directory
Command exited with non-zero status 127
Can someone please help me debug this error?
My docker file:
FROM openjdk:8-jre
LABEL maintainer="APN <xxx#xxx.edu>"
LABEL org.label-schema.schema-version="1.0"
# LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.name="apn/addreadgroups"
LABEL org.label-schema.description="Image for adding read groups in .bam"
ENV PICARD_VERSION 2.20.8
WORKDIR /tmp
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
make \
gcc \
g++ \
libz-dev \
libbz2-dev \
liblzma-dev \
ncurses-dev \
bc \
libnss-sss \
time \
&& cd /tmp \
&& wget -q -O /usr/bin/picard.jar https://github.com/broadinstitute/picard/releases/download/${PICARD_VERSION}/picard.jar \
&& ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime \
&& echo "America/Chicago" > /etc/timezone \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& apt-get clean all \
&& rm -rfv /var/lib/apt/lists/* /tmp/* /var/tmp/*
# This makes the image crazy large -- will find a workaround
# COPY human_g1k_v37_decoy* /usr/local/
COPY ./entrypoint.sh /usr/local/bin/
ENV PICARD /usr/bin/picard.jar
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# CMD ["/bin/bash"]
and the entrypoint.sh:
JAVAOPTS="-Xms2g -Xmx${MEM}g -XX:+UseSerialGC -Dpicard.useLegacyParser=false"
CUR_STEP="AddOrReplaceReadGroups"
/usr/bin/java ${JAVAOPTS} -jar "${PICARD}" \
"${CUR_STEP}" \
I="${INBAM}" \
O=${BAMFILE} \
RGID=${FLOWCELL} \
RGLB=${LIBRARY} \
RGPL=${PLATFORM} \
RGPU=${FLOWCELL} \
RGSM=${SM}
Exit status 127 means no command found.
This is due to the java command in openjdk:8-jre not located in /usr/bin/java, see next:
$ docker run -it openjdk:8-jre which java
/usr/local/openjdk-8/bin/java
I failed to compile opencv3.2.0 on ubuntu 16.04,that is the error:
Build output check failed:Regex: 'command line option .* is valid for .* but not for C++'
I tried to add -D CMAKE_C_COMPILER=/usr/bin/gcc-5 and -D ENABLE_CXX11=ON but it didn't work...So how can i solve this problem?
Ubuntu 16.04.6 - amd64 : Build opencv-3.2.0
sudo apt build-dep opencv
sudo apt install cmake python3-dev python3-numpy libgl1-mesa-dev libgoogle-glog-dev \
libgphoto2-dev liblapack-dev libleptonica-dev libprotobuf-dev libraw1394-dev libtbb-dev \
libtesseract-dev libv4l-dev maven-repo-helper ocl-icd-opencl-dev protobuf-compiler \
python-dev libtiff-dev libswscale-dev python-vtk *gstreamer*-dev linux-libc-dev \
libavresample-dev libatlas-cpp-0.6-dev libopenblas-dev doxygen \
libinsighttoolkit4-dev liblapacke-dev
tar xvf opencv_3.2.0+dfsg.orig.tar.gz
cd opencv-3.2.0+dfsg/
tar xvf ../opencv_3.2.0+dfsg-6.debian.tar.xz
mkdir build && cd build/
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DOPENCV_MATHJAX_RELPATH=/usr/share/javascript/mathjax/ \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_EXAMPLES=ON \
-DINSTALL_C_EXAMPLES=ON \
-DINSTALL_PYTHON_EXAMPLES=ON \
-DWITH_FFMPEG=ON \
-DWITH_GSTREAMER=OFF \
-DWITH_GTK=ON \
-DWITH_JASPER=OFF \
-DWITH_JPEG=ON \
-DWITH_PNG=ON \
-DWITH_TIFF=ON \
-DWITH_OPENEXR=ON \
-DWITH_PVAPI=ON \
-DWITH_UNICAP=OFF \
-DWITH_EIGEN=ON \
-DWITH_VTK=ON \
-DWITH_GDAL=ON \
-DWITH_GDCM=ON \
-DWITH_XINE=OFF \
-DWITH_IPP=OFF \
-DBUILD_TESTS=OFF \
-DCMAKE_SKIP_RPATH=ON \
-DWITH_CUDA=OFF \
-DENABLE_PRECOMPILED_HEADERS=OFF \
-DWITH_IPP=OFF \
-DWITH_CAROTENE=OFF \
-DOPENCL_INCLUDE_DIR:PATH="/usr/include/CL/" ../
make ## no errors
.
[100%] Linking CXX executable ../../bin/opencv_version
.
[100%] Built target opencv_version
I am building TensorFlow 1.10.1 from sources on Alpine Linux Docker image with Python 3.6. The Dockerfile was built successfully. Nevertheless running the following code:
import tensorflow
fails with:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/usr/local/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/usr/local/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: Error relocating /usr/local/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: __longjmp_chk: symbol not found
I assumed the problem was in ld lib and added glibc, but still error appeared. I install Python packages with dependency management tool poetry.
Dockerfile:
FROM python:3.6-alpine
WORKDIR /app
COPY pyproject.toml /app/pyproject.toml
COPY pyproject.lock /app/pyproject.lock
# Install TensorFlow CPU version
ENV TENSORFLOW_VERSION 1.10.1
RUN apk update \
&& apk add bash \
ca-certificates \
libstdc++ \
libgfortran \
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk \
&& apk add glibc-2.28-r0.apk \
&& apk add --virtual build-deps \
curl \
gcc \
gfortran \
g++ \
libstdc++ \
libxml2-dev \
libxslt-dev \
linux-headers \
make \
musl-dev \
python3-dev \
py-numpy-dev \
&& apk --no-cache add --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
hdf5 \
hdf5-dev \
&& mkdir -p /tmp/build \
&& cd /tmp/build/ \
&& wget http://www.netlib.org/blas/blas-3.6.0.tgz \
&& wget http://www.netlib.org/lapack/lapack-3.6.1.tgz \
&& tar xzf blas-3.6.0.tgz \
&& tar xzf lapack-3.6.1.tgz \
&& cd /tmp/build/BLAS-3.6.0/ \
&& gfortran -O3 -std=legacy -m64 -fno-second-underscore -fPIC -c *.f \
&& ar r libfblas.a *.o \
&& ranlib libfblas.a \
&& mv libfblas.a /tmp/build/. \
&& cd /tmp/build/lapack-3.6.1/ \
&& sed -e "s/frecursive/fPIC/g" -e "s/ \.\.\// /g" -e "s/^CBLASLIB/\#CBLASLIB/g" make.inc.example > make.inc \
&& make lapacklib \
&& make clean \
&& mv liblapack.a /tmp/build/. \
&& cd / \
&& export BLAS=/tmp/build/libfblas.a \
&& export LAPACK=/tmp/build/liblapack.a \
&& python3.6 -m pip install --default-timeout=100 future \
&& curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python3.6 \
# Download Tensorflow package
&& cd /app \
&& which ld \
&& wget -q https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-${TENSORFLOW_VERSION}-cp36-cp36m-linux_x86_64.whl \
&& python3.6 -m poetry config settings.virtualenvs.create false \
&& python3.6 -m poetry install \
&& apk del build-deps \
&& rm -rf /tmp/build \
/var/cache/apk/*
# Make sure Tensorflow built properly
RUN python3.6 -c 'import tensorflow'
COPY . /app
COPY bin/docker_entrypoint.sh /app/entrypoint.sh
COPY --from=0 /app/train app/train
EXPOSE 80
ENTRYPOINT ["/app/entrypoint.sh"]
I'm trying to build the library trilinos on a 32bit ubuntu virtual machine. I wrote the following configuration script:
cmake \
-D CMAKE_INSTALL_PREFIX:FILEPATH=./ \
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
-D Trilinos_ENABLE_Anasazi:BOOL=ON \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_EpetraEXt:BOOL=ON \
-D Trilinos_ENABLE_Triutils:BOOL=ON \
-D Trilinos_ENABLE_Belos:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
-D TPL_BLAS_LIBRARIES=/usr/lib/libblas.so.3 \
-D TPL_LAPACK_LIBRARIES=/usr/lib/liblapack.so.3 \
-D CMACKE_VERBOSE_MAKEFILE:BOOL=ON \
-D Trilinos_ENABLE_DEBUG:BOOL=ON \
-D CMACK_BUILD_TYPE:STRING=DEBUG \
-D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON \
../
When I execute it with the ksh command in the terminal, I get the following error:
CMake Error: CMAKE_Fortran_Compiler not set, after EnableLanguage
It appears you do not have a Fortran compiler installed. This is why cmake cannot set CMAKE_Fortran_Compiler on its own, and requests you to manually specify one.
Since you are using Ubuntu, I would recommend using gfortran from the GCC suite. If you install the compiler from the repository, cmake should be fine.
You can install the compiler using
sudo apt-get install gfortran