Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm support #103

Open
sedlund opened this issue Apr 27, 2018 · 20 comments
Open

arm support #103

sedlund opened this issue Apr 27, 2018 · 20 comments
Assignees

Comments

@sedlund
Copy link

sedlund commented Apr 27, 2018

has anyone attempted to get this to build on ARM64? I don't want to spend hours just find out something is blocking.

@GnaphronG GnaphronG self-assigned this Apr 27, 2018
@GnaphronG
Copy link
Collaborator

Not yet, sounds like a fun project.

@jidckii
Copy link
Contributor

jidckii commented Jul 4, 2018

This nice idea!
I would also like to use these builds on rastberry pi3.
If @jrottenberg does not have this in mind, I think I can try to prepare images and send PR.

@tsjsdbd
Copy link

tsjsdbd commented Mar 17, 2020

How's it going now

@deltoss
Copy link

deltoss commented May 15, 2020

This wouldn't work on the ARM (and the Raspberry Pi), as of time of writing, the only supported architecture for the docker images is only amd64.

image

You can check for the supported architectures through going to this page:
https://hub.docker.com/r/jrottenberg/ffmpeg/tags

@andrewchen5678
Copy link

+1, just ran into this issue

@mrpeu
Copy link

mrpeu commented Apr 12, 2022

Any update on this?

@gmarchand
Copy link

it could be usefull on AWS Graviton2 and Graviton3

@sedlund
Copy link
Author

sedlund commented Apr 18, 2022

@gmarchand cost per encoded frame was 16x more on Graviton2 than Ryzen, so I did not pursue it.

@gmarchand
Copy link

@sedlund interesting, could you share your reference?

@sedlund
Copy link
Author

sedlund commented Apr 18, 2022

@sedlund interesting, could you share your reference?

@gmarchand here you go

Provider Size Cost/H FPS Cost/FPS Rel. Value Notes
Hetzner CPX21 3x4 0.012 29.10 0.000411 1.000 AMD EPYC 2nd Gen processors
Hetzner CPX11 2x2 0.008 18.34 0.000414 0.992 AMD EPYC 2nd Gen processors
Hetzner CPX31 4x8 0.022 36.30 0.000599 0.686 AMD EPYC 2nd Gen processors
AWS c6a.large 2x4 0.034 11.58 0.002936 0.140 3rd generation AMD EPYC
AWS c6i.large 2x4 0.034 11.32 0.003004 0.137 3rd generation Intel Xeon Scalable
AWS c6g.large 2x4 0.034 4.93 0.006897 0.060 Graviton2

@Wxh16144
Copy link

Wxh16144 commented Jul 2, 2022

I also have this problem. I use Apple silicon chip.

@Bobronium
Copy link

Haven't tried to build these images, but I had success just installing ffmpeg in my base image, see #99 (comment) for details.

@eddumelendez
Copy link

This would be great to have

@gmarchand
Copy link

I have made a first draft working

FROM        arm64v8/ubuntu:20.04 AS base

WORKDIR     /tmp/workdir

RUN     apt-get -yqq update && \
        apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \
        apt-get autoremove -y && \
        apt-get clean -y

FROM base as build

ENV         FFMPEG_VERSION=5.1.2 \
        AOM_VERSION=v1.0.0 \
        FDKAAC_VERSION=0.1.5 \
        FONTCONFIG_VERSION=2.12.4 \
        FREETYPE_VERSION=2.10.4 \
        FRIBIDI_VERSION=0.19.7 \
        KVAZAAR_VERSION=2.0.0 \
        LAME_VERSION=3.100 \
        LIBASS_VERSION=0.13.7 \
        OGG_VERSION=1.3.2 \
        OPENCOREAMR_VERSION=0.1.5 \
        OPUS_VERSION=1.2 \
        OPENJPEG_VERSION=2.1.2 \
        THEORA_VERSION=1.1.1 \
        VORBIS_VERSION=1.3.5 \
        VPX_VERSION=1.8.0 \
        WEBP_VERSION=1.0.2 \
        X264_VERSION=20170226-2245-stable \
        X265_VERSION=3.4 \
        XVID_VERSION=1.3.4 \
        LIBARIBB24_VERSION=1.0.3 \
        LIBPNG_VERSION=1.6.9 \
        LIBVMAF_VERSION=2.1.1 \
        SRC=/usr/local

ARG         FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz"
ARG         FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz"
ARG         LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz"
ARG         OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz"
ARG         OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9 opus-1.2.tar.gz"
ARG         THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz"
ARG         VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz"
ARG         XVID_SHA256SUM="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f xvidcore-1.3.4.tar.gz"
ARG         LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz"


ARG         LD_LIBRARY_PATH=/opt/ffmpeg/lib
ARG         MAKEFLAGS="-j2"
ARG         PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig"
ARG         PREFIX=/opt/ffmpeg
ARG         LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64"


ARG DEBIAN_FRONTEND=noninteractive

RUN      buildDeps="autoconf \
        automake \
        cmake \
        curl \
        bzip2 \
        libexpat1-dev \
        g++ \
        gcc \
        git \
        gperf \
        libtool \
        make \
        meson \
        nasm \
        perl \
        pkg-config \
        python3 \
        libssl-dev \
        yasm \
        zlib1g-dev" && \
        apt-get -yqq update && \
        apt-get install -yq --no-install-recommends ${buildDeps}

## libvmaf https://github.com/Netflix/vmaf
RUN \
        if which meson || false; then \
        echo "Building VMAF." && \
        DIR=/tmp/vmaf && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://github.com/Netflix/vmaf/archive/v${LIBVMAF_VERSION}.tar.gz && \
        tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \
        cd /tmp/vmaf/libvmaf && \
        meson build --buildtype release --prefix=${PREFIX} && \
        ninja -vC build && \
        ninja -vC build install && \
        mkdir -p ${PREFIX}/share/model/ && \
        cp -r /tmp/vmaf/model/* ${PREFIX}/share/model/ && \
        rm -rf ${DIR}; \
        else \
        echo "VMAF skipped."; \
        fi

## opencore-amr https://sourceforge.net/projects/opencore-amr/
RUN \
        DIR=/tmp/opencore-amr && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sL https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz/download | \
        tar -zx --strip-components=1 && \
        ./configure --prefix="${PREFIX}" --enable-shared  && \
        make && \
        make install && \
        rm -rf ${DIR}
## x264 http://www.videolan.org/developers/x264.html
RUN \
        DIR=/tmp/x264 && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \
        tar -jx --strip-components=1 && \
        ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \
        make && \
        make install && \
        rm -rf ${DIR}
### x265 http://x265.org/
### https://bitbucket.org/multicoreware/x265_git/wiki/Home
### https://gist.github.com/sparrc/026ed9958502072dda749ba4e5879ee3
RUN \
        DIR=/tmp/x265 && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \
        tar -zx && \
        cd x265-${X265_VERSION}/build/aarch64-linux && \
        cmake -DCMAKE_TOOLCHAIN_FILE="crosscompile.cmake" -G "Unix Makefiles" ../../source && \
        cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" ../../source && \
        make && \
        make install && \
        rm -rf ${DIR}


### libogg https://www.xiph.org/ogg/
RUN \
        DIR=/tmp/ogg && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \
        echo ${OGG_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \
        ./configure --prefix="${PREFIX}" --enable-shared  && \
        make && \
        make install && \
        rm -rf ${DIR}
### libopus https://www.opus-codec.org/
RUN \
        DIR=/tmp/opus && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \
        echo ${OPUS_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \
        autoreconf -fiv && \
        ./configure --prefix="${PREFIX}" --enable-shared --build=aarch64-unknown-linux-gnu && \
        make && \
        make install && \
        rm -rf ${DIR}
### libvorbis https://xiph.org/vorbis/
RUN \
        DIR=/tmp/vorbis && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \
        echo ${VORBIS_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \
        ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --build=aarch64-unknown-linux-gnu && \
        make && \
        make install && \
        rm -rf ${DIR}
### libtheora http://www.theora.org/
RUN \
        DIR=/tmp/theora && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \
        echo ${THEORA_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \
        ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --build=aarch64-unknown-linux-gnu && \
        make && \
        make install && \
        rm -rf ${DIR}
### libvpx https://www.webmproject.org/code/
RUN \
        DIR=/tmp/vpx && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \
        tar -zx --strip-components=1 && \
        ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \
        --disable-debug --disable-examples --disable-docs --disable-install-bins && \
        make && \
        make install && \
        rm -rf ${DIR}
### libwebp https://developers.google.com/speed/webp/
RUN \
        DIR=/tmp/vebp && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \
        tar -zx --strip-components=1 && \
        ./configure --prefix="${PREFIX}" --enable-shared --build=aarch64-unknown-linux-gnu  && \
        make && \
        make install && \
        rm -rf ${DIR}
### libmp3lame http://lame.sourceforge.net/
RUN \
        DIR=/tmp/lame && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sL https://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \
        tar -zx --strip-components=1 && \
        ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend --build=aarch64-unknown-linux-gnu && \
        make && \
        make install && \
        rm -rf ${DIR}
### xvid https://www.xvid.com/
RUN \
        DIR=/tmp/xvid && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \
        echo ${XVID_SHA256SUM} | sha256sum --check && \
        tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \
        cd xvidcore/build/generic && \
        ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --build=aarch64-unknown-linux-gnu && \
        make && \
        make install && \
        rm -rf ${DIR}
### fdk-aac https://github.com/mstorsjo/fdk-aac
RUN \
        DIR=/tmp/fdk-aac && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \
        tar -zx --strip-components=1 && \
        autoreconf -fiv && \
        ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" --build=aarch64-unknown-linux-gnu && \
        make && \
        make install && \
        rm -rf ${DIR}
## openjpeg https://github.com/uclouvain/openjpeg
# RUN \
#         DIR=/tmp/openjpeg && \
#         mkdir -p ${DIR} && \
#         cd ${DIR} && \
#         curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \
#         tar -zx --strip-components=1 && \
#         cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
#         make && \
#         make install && \
#         rm -rf ${DIR}
## freetype https://www.freetype.org/
RUN  \
        DIR=/tmp/freetype && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \
        echo ${FREETYPE_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \
        ./configure --prefix="${PREFIX}" --disable-static --enable-shared --build=aarch64-unknown-linux-gnu && \
        make && \
        make install && \
        rm -rf ${DIR}

## fribidi https://www.fribidi.org/ (used by libass)
RUN  \
        DIR=/tmp/fribidi && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \
        echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \
        sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \
        ./bootstrap --no-config --auto && \
        ./configure --prefix="${PREFIX}" --disable-static --enable-shared --build=aarch64-unknown-linux-gnu && \
        make -j1 && \
        make install && \
        rm -rf ${DIR}
## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/
RUN  \
        DIR=/tmp/fontconfig && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \
        tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \
        ./configure --prefix="${PREFIX}" --disable-static --enable-shared --build=aarch64-unknown-linux-gnu && \
        make && \
        make install && \
        rm -rf ${DIR}
## libass https://github.com/libass/libass
RUN  \
        DIR=/tmp/libass && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://github.com/libass/libass/releases/download/${LIBASS_VERSION}/libass-${LIBASS_VERSION}.tar.gz && \
        tar -zx --strip-components=1 -f libass-${LIBASS_VERSION}.tar.gz && \
        ./configure --prefix="${PREFIX}" --disable-static --enable-shared --build=aarch64-unknown-linux-gnu && \
        make && \
        make install && \
        rm -rf ${DIR}
## kvazaar https://github.com/ultravideo/kvazaar
RUN \
        DIR=/tmp/kvazaar && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \
        tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \
        ./autogen.sh && \
        ./configure --prefix="${PREFIX}" --disable-static --enable-shared --build=aarch64-unknown-linux-gnu && \
        make && \
        make install && \
        rm -rf ${DIR}

# av1 https://aomedia.googlesource.com/aom
RUN \
        DIR=/tmp/aom && \
        git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \
        cd ${DIR} ; \
        rm -rf CMakeCache.txt CMakeFiles ; \
        mkdir -p ./aom_build ; \
        cd ./aom_build ; \
        cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \
        make ; \
        make install ; \
        rm -rf ${DIR}

## libpng http://www.libpng.org/pub/png/libpng.html
RUN \
        DIR=/tmp/png && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \
        ./autogen.sh && \
        ./configure --prefix="${PREFIX}" --build=aarch64-unknown-linux-gnu && \
        make check && \
        make install && \
        rm -rf ${DIR}

## libaribb24
RUN \
        DIR=/tmp/b24 && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \
        echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \
        tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \
        autoreconf -fiv && \
        ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" --build=aarch64-unknown-linux-gnu && \
        make && \
        make install && \
        rm -rf ${DIR}

## Download ffmpeg https://ffmpeg.org/
RUN  \
        DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \
        curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
        tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
        ./configure     --disable-debug  --disable-doc    --disable-ffplay   --enable-shared --enable-gpl  --extra-libs=-ldl && \
        make ;  make install





## Build ffmpeg https://ffmpeg.org/
RUN  \
        DIR=/tmp/ffmpeg && cd ${DIR} && \
        ./configure \
        --disable-debug \
        --disable-doc \
        --disable-ffplay \
        --enable-fontconfig \
        --enable-gpl \
        --enable-libaom \
        --enable-libaribb24 \
        --enable-libass \
        --enable-libfdk_aac \
        --enable-libfreetype \
        --enable-libkvazaar \
        --enable-libmp3lame \
        --enable-libopencore-amrnb \
        --enable-libopencore-amrwb \
        #--enable-libopenjpeg \
        --enable-libopus \
        --enable-libtheora \
        --enable-libvmaf \
        --enable-libvorbis \
        --enable-libvpx \
        --enable-libwebp \
        --enable-libx264 \
        --enable-libx265 \
        --enable-nonfree \
        --enable-openssl \
        --enable-postproc \
        --enable-shared \
        --enable-small \
        --enable-version3 \
        --disable-static \
        --extra-cflags="-I${PREFIX}/include" \
        --extra-ldflags="-L${PREFIX}/lib" \
        --extra-libs=-ldl \
        --extra-libs=-lpthread \
        --prefix="${PREFIX}" && \
        make clean && \
        make && \
        make install && \
        make distclean && \
        hash -r && \
        cd tools && \
        make qt-faststart && cp qt-faststart ${PREFIX}/bin/

## cleanup
RUN \
        ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \
        for lib in /usr/local/lib/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \
        cp ${PREFIX}/bin/* /usr/local/bin/ && \
        cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \
        LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \
        cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \
        mkdir -p /usr/local/lib/pkgconfig && \
        for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \
        sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \
        done

@konnextv
Copy link

@gmarchand Your draft worked for me except for the cleanup stage (however I deactivated most libs in my case)

It fails creating the symbolic links because the name already exists. Maybe you have an idea what is going wrong here :)

@web-engineer
Copy link

I've been looking at this also - looks like OPENJPEG is a bit of a blocker...

X265_VERSION - I had to opt for 3.3 - 3.4 failed

OpenJPEG gets as far as -

13.32 /usr/lib/gcc/aarch64-alpine-linux-musl/11.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: ../../../thirdparty/lib/libpng.a(pngrutil.c.o): in function `png_init_filter_functions':
13.32 pngrutil.c:(.text+0x6d9c): undefined reference to `png_init_filter_functions_neon'
13.33 collect2: error: ld returned 1 exit status
13.33 make[2]: *** [src/bin/jp2/CMakeFiles/opj_compress.dir/build.make:214: bin/opj_compress] Error 1

No matter what version I use...

For theora - this lib got confused about the architecture - fixed that by getting the arch as below - (I'm planning to cross compile both versions at once).

RUN \
        MACHINE_ARCH=`uname -m` &&\
		DIR=/tmp/theora && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \
        echo ${THEORA_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \
        ./configure	--build="${MACHINE_ARCH}-unknown-linux-gnu" \
		--prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \
        make && \
        make install && \
        rm -rf ${DIR}

This may be due to using a different image base btw - however it is alpine still ... will try a few things yet..

Just got another pass running removing openjpeg.

@web-engineer
Copy link

web-engineer commented Aug 4, 2023

Theora still a problem -

2.940 UNAME_MACHINE = aarch64
2.940 UNAME_RELEASE = 5.15.49-linuxkit-pr
2.940 UNAME_SYSTEM  = Linux
2.940 UNAME_VERSION = #1 SMP PREEMPT Thu May 25 07:27:39 UTC 2023
2.943 configure: error: cannot guess build type; you must specify one

Few issues documented here - https://gitlab.xiph.org/xiph/theora/-/issues/2318

Will explore version and or forking when we get a chance and try again - if anyone manages an ARM build I'd be keen to see how you soved these issues...

To recap - I'm building arm / alpine combination - openjepg and theora are blockers... will remove these and try again to build as knowing what components are probelmatic helps narrow down the tasks I guess... Happy to share what I find...

@zvickery
Copy link

zvickery commented Sep 14, 2023

I was able to get this to build on ARM64 by hacking the 5.1/nvidia2004 base script. Here is how I got it working:

  • Change CUDA base image version to 11.4.3
  • Download latest x265 tarball from bitbucket and use that instead of downloading the pinned version
  • Download latest libtheora tarball from gitlab and run autoreconf -vif before tarring. See https://gitlab.xiph.org/xiph/theora/-/issues/2318
  • Apply the below patch to openjpeg with patch -p0 < /tmp/openjpeg_arm.patch before invoking cmake
  • Add call to autoreconf -vif before running ./configure on xproto

Patch for openjpeg:

--- CMakeLists.txt	2023-09-11 14:49:14.677161012 -0600
+++ CMakeLists.txt	2023-09-11 14:50:35.269952008 -0600
@@ -26,6 +26,10 @@

 project(${OPENJPEG_NAMESPACE} C)

+if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
+  add_definitions(-DPNG_ARM_NEON_OPT=0)
+endif()
+
 # Do full dependency headers.
 include_regular_expression("^.*$")

@zvickery
Copy link

This PR works for 5.1/nvidia2004. It will be hard to test across all of the variants though: #378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests