Skip to content

Supplying compilation flags #435

@shawngmc

Description

@shawngmc

I'm in a mood to do some benchmarking, and I was wondering if there's a good way to feed -march flags, etc.

I've been somewhat enamored by the psABI x86_64 levels lately. I know for many things they would make no difference, but AVX2/AVX512 should make a substantial difference for video decoding/encoding. I'm trying to make a reproducible build to test, and I assume that I'll also want to build the library dependencies with similar compiler flags. I was looking at making a Dockerfile of my own, but your Dockerfiles are excellent, and ubuntu2404-edge seems to be a great starting point.

I don't see any straightforward way to add something like that to your build scripts without copying the whole ubuntu2404-edge and modifying each library build and the ffmpeg build.

For example, for another project using CMake, I'm currently setting an arch via:

ARG ARCH=x86-64-v2
ENV ARCH=${ARCH}
#...
RUN echo -e "set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} -march=$ARCH\")" >> ./CMakeLists.txt && \
    echo -e "set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -march=$ARCH\")" >> ./CMakeLists.txt

Is there anything I'm missing? Alternatively, is this something that there would be interest in contributing back?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions