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

build failed on colab!! #706

Open
sg0771 opened this issue Jul 28, 2023 · 7 comments
Open

build failed on colab!! #706

sg0771 opened this issue Jul 28, 2023 · 7 comments

Comments

@sg0771
Copy link

sg0771 commented Jul 28, 2023

A

!apt update
!apt install subversion ragel curl texinfo g++ ed bison flex cvs yasm automake libtool autoconf gcc cmake git make pkg-config zlib1g-dev unzip pax nasm gperf autogen bzip2 autoconf-archive p7zip-full meson clang python3-distutils python-is-python3 -y
!git clone https://github.com/rdp/ffmpeg-windows-build-helpers.git

B
!cd ffmpeg-windows-build-helpers && bash ./cross_compile_ffmpeg.sh
input 1, build x64 and Win32

when build frei0r

In file included from /content/ffmpeg-windows-build-helpers/sandbox/win32/frei0r_git/src/filter/kaleid0sc0pe/kaleid0sc0pe.cpp:28:
/content/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include/c++/10.2.0/future:125:11: note: declaration of 'std::iterator_traits<std::future*>::value_type' {aka 'class std::future'}
125 | class future;
| ^~~~~~
make[2]: *** [src/filter/kaleid0sc0pe/CMakeFiles/kaleid0sc0pe.dir/build.make:92: src/filter/kaleid0sc0pe/CMakeFiles/kaleid0sc0pe.dir/kaleid0sc0pe.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:3441: src/filter/kaleid0sc0pe/CMakeFiles/kaleid0sc0pe.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 29%] Linking CXX shared module lightgraffiti.dll
[ 29%] Built target lightgraffiti
make: *** [Makefile:136: all] Error 2

@sg0771
Copy link
Author

sg0771 commented Jul 28, 2023

frei0r build error!!

@mitchcapper
Copy link
Contributor

This is a new module added to frei0r. To avoid needing to use a threads support lib you can disable the module. sed -i.bak -E 's/^([^#].+kaleid0sc0pe.*)/#\1/g' src/filter/CMakeLists.txt can be added to the build_frei0r near the other sed call.

@xengine-qyt
Copy link

xengine-qyt commented Jul 31, 2023

...and me has a same error

@mitchcapper
Copy link
Contributor

yes make the above change to the main helper script and it will work

@timothymowens
Copy link
Contributor

timothymowens commented Aug 5, 2023

Another alternative, I made the following edit to the build_frei0r() function in the cross_compile_ffmpeg.sh script and was able to successfully move on past the frei0r issue. This simply downloads the previous v2.3.0 build instead of latest, which doesn't have the offending kaleid0sc0pe module:

build_frei0r() {
  #do_git_checkout https://github.com/dyne/frei0r.git
  #cd frei0r_git
  download_and_unpack_file https://github.com/dyne/frei0r/archive/refs/tags/v2.3.0.tar.gz frei0r-2.3.0
  cd frei0r-2.3.0
    sed -i.bak 's/-arch i386//' CMakeLists.txt # OS X https://github.com/dyne/frei0r/issues/64
    do_cmake_and_install "-DWITHOUT_OPENCV=1" # XXX could look at this more...

    mkdir -p $cur_dir/redist # Strip and pack shared libraries.
    if [ $bits_target = 32 ]; then
      local arch=x86
    else
      local arch=x86_64
    fi
    archive="$cur_dir/redist/frei0r-plugins-${arch}-$(git describe --tags).7z"
    if [[ ! -f "$archive.done" ]]; then
      for sharedlib in $mingw_w64_x86_64_prefix/lib/frei0r-1/*.dll; do
        ${cross_prefix}strip $sharedlib
      done
      for doc in AUTHORS ChangeLog COPYING README.md; do
        sed "s/$/\r/" $doc > $mingw_w64_x86_64_prefix/lib/frei0r-1/$doc.txt
      done
      7z a -mx=9 $archive $mingw_w64_x86_64_prefix/lib/frei0r-1 && rm -f $mingw_w64_x86_64_prefix/lib/frei0r-1/*.txt
      touch "$archive.done" # for those with no 7z so it won't restrip every time
    fi
  cd ..
}

@gbendy
Copy link

gbendy commented Aug 6, 2023

This is due to the mingw cross-compiler you're building using the win32 thread model, not posix, and the win32 model doesn't support future

✔ ~/git/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/bin [master|…1]
09:28 $ ./x86_64-w64-mingw32-g++ -v
Using built-in specs.
COLLECT_GCC=./x86_64-w64-mingw32-g++
COLLECT_LTO_WRAPPER=/home/bendy/git/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/libexec/gcc/x86_64-w64-mingw32/10.2.0/lto-wrapper
Target: x86_64-w64-mingw32
Configured with: ../source/gcc-10.2.0/configure --build=x86_64-pc-linux-gnu --target=x86_64-w64-mingw32 --disable-shared --enable-static --disable-nls --disable-multilib --prefix=/home/bendy/git/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64 --with-sysroot=/home/bendy/git/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64 --with-mpc=/home/bendy/git/ffmpeg-windows-build-helpers/sandbox/cross_compilers/pkgs/mpc/mpc-1.2.1-x86_64 --with-mpfr=/home/bendy/git/ffmpeg-windows-build-helpers/sandbox/cross_compilers/pkgs/mpfr/mpfr-4.1.0-x86_64 --with-gmp=/home/bendy/git/ffmpeg-windows-build-helpers/sandbox/cross_compilers/pkgs/gmp/gmp-6.2.1-x86_64 --with-isl=/home/bendy/git/ffmpeg-windows-build-helpers/sandbox/cross_compilers/pkgs/isl/isl-0.23-x86_64 --enable-languages=c,c++ --enable-fully-dynamic-string --enable-lto
Thread model: win32
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC)

I have in PR in for frei0r that detects this case and disables multithreading,

@rdp
Copy link
Owner

rdp commented Aug 10, 2023

OK see #707 for now

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

No branches or pull requests

6 participants