aacgain icon indicating copy to clipboard operation
aacgain copied to clipboard

Unable to compile on Fedora 41

Open HironoKenta opened this issue 1 year ago • 1 comments

I'm trying to compile aacgain on fedora 41 but I'm getting some errors

git clone https://github.com/dgilman/aacgain
cd aacgain
mkdir build
cd build 
cmake '../CMakeLists.txt'
CMake Error at /usr/share/cmake/Modules/ExternalProject/shared_internal_commands.cmake:1331 (message):
  No download info given for 'faad2_proj' and its source directory:

   /#######/aacgain/3rdparty/faad2

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /usr/share/cmake/Modules/ExternalProject.cmake:3035 (_ep_add_download_command)
  3rdparty/CMakeLists.txt:7 (ExternalProject_Add)
-- Configuring incomplete, errors occurred!

then doing as suggested on r/linuxquestions

$ cd ..
/aacgain$ git submodule update --init --recursive
Sottomodulo '3rdparty/faad2' (https://github.com/dgilman/faad2.git) registrato per il percorso '3rdparty/faad2'
Sottomodulo '3rdparty/mp4v2' (https://github.com/dgilman/mp4v2.git) registrato per il percorso '3rdparty/mp4v2'
Clone in '/aacgain/3rdparty/faad2' in corso...
Clone in '/aacgain/3rdparty/mp4v2' in corso...
Submodule path '3rdparty/faad2': checked out 'a65ecabd13a6b991781d75856e1b6870ce00fc70'
Submodule path '3rdparty/mp4v2': checked out 'cf634bb7ed2d3bd453d707a5c7896dcd6f12e458'
/aacgain$ cd build 
/aacgain/build$ cmake '../CMakeLists.txt' 
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for 4 include files stdlib.h, ..., float.h
-- Looking for 4 include files stdlib.h, ..., float.h - found
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /aacgain/build
/aacgain/build$ make
[  2%] Creating directories for 'faad2_proj'
[  5%] No download step for 'faad2_proj'
[  8%] No update step for 'faad2_proj'
[ 11%] No patch step for 'faad2_proj'
[ 13%] Performing configure step for 'faad2_proj'
configure.ac:41: warning: The macro 'AC_HEADER_STDC' is obsolete.
configure.ac:41: You should run autoupdate.
./lib/autoconf/headers.m4:663: AC_HEADER_STDC is expanded from...
configure.ac:41: the top level
configure.ac:47: warning: The macro 'AC_HEADER_TIME' is obsolete.
configure.ac:47: You should run autoupdate.
./lib/autoconf/headers.m4:702: AC_HEADER_TIME is expanded from...
configure.ac:47: the top level
configure.ac:117: warning: The macro 'AC_TRY_LINK' is obsolete.
configure.ac:117: You should run autoupdate.
./lib/autoconf/general.m4:2918: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:690: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:697: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
configure.ac:90: AC_C99_FUNC_LRINTF is expanded from...
configure.ac:117: the top level
configure.ac:119: warning: The macro 'AC_TRY_COMPILE' is obsolete.
configure.ac:119: You should run autoupdate.
./lib/autoconf/general.m4:2845: AC_TRY_COMPILE is expanded from...
configure.ac:64: MY_CHECK_TYPEDEF_FROM_INCLUDE is expanded from...
configure.ac:119: the top level
configure.ac:15: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: error: /usr/bin/autoconf failed with exit status: 1
make[2]: *** [3rdparty/CMakeFiles/faad2_proj.dir/build.make:92: 3rdparty/faad2_proj-prefix/src/faad2_proj-stamp/faad2_proj-configure] Error 1
make[1]: *** [CMakeFiles/Makefile2:154: 3rdparty/CMakeFiles/faad2_proj.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
/aacgain/build$

HironoKenta avatar Jan 08 '25 13:01 HironoKenta

I haven’t touched this in some time. Given the Autoconf errors I wonder if this stems from the big 2.70 release a few years ago and it needs maintenance. Unfortunately I can’t promise time to fix this up, you either need to get hacking, find a binary or build it in a container. You might find it helpful to look at the CI in this repository for a working example.

dgilman avatar Jan 08 '25 13:01 dgilman

I got it to build on Fedora 41 and Ubuntu 24.04 in a container. You have to install the libtool package.

FROM registry.fedoraproject.org/fedora:41 as build

RUN dnf install -y \
make \
gcc-c++ \
cmake \
autoconf \
libtool \
git

RUN git clone --recursive https://github.com/dgilman/aacgain.git /aacgain && \
mkdir /aacgain/build

WORKDIR /aacgain

RUN cmake -H. -Bbuild

WORKDIR /aacgain/build

RUN make

FROM registry.fedoraproject.org/fedora:41

COPY --from=build /aacgain/build/aacgain/aacgain /usr/local/bin/aacgain

CMD ["aacgain"]
FROM docker.io/ubuntu:24.04 as build

RUN apt update && apt install -y \
build-essential \
cmake \
autoconf \
libtool \
git

RUN git clone --recursive https://github.com/dgilman/aacgain.git /aacgain && \
mkdir /aacgain/build

WORKDIR /aacgain

RUN cmake -H. -Bbuild

WORKDIR /aacgain/build

RUN make

FROM docker.io/ubuntu:24.04

COPY --from=build /aacgain/build/aacgain/aacgain /usr/local/bin/aacgain

CMD ["aacgain"]

antonc42 avatar Apr 26 '25 18:04 antonc42

Thank you so much for your prompt support and for addressing the issue so efficiently. Your insights and assistance were extremely helpful, and I'm really grateful for your dedication and expertise.

Thanks again for your continued hard work and contributions!

Best regards.

HironoKenta avatar May 12 '25 23:05 HironoKenta