diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index bbb98391..bf7ac25c 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -6,15 +6,15 @@ on: # pull_request: # branches: [ "main" ] workflow_dispatch: - inputs: - python-version: - required: false - type: string - default: '3.11' + inputs: + compiler: + required: false + type: string + default: latest workflow_call: inputs: - python-version: + compiler: required: true type: string @@ -38,15 +38,21 @@ jobs: # with: # name: 3rd_64 - - name: Set up Python ${{ inputs.python-version }} - - uses: actions/setup-python@v4 + - name: Install compiler ${{ inputs.compiler }} + id: install_cc + uses: rlalik/setup-cpp-compiler@master with: - python-version: ${{ inputs.python-version }} + compiler: ${{ inputs.compiler }} + + # - name: Set up compiler ${{ inputs.compiler }} + + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ inputs.python-version }} - - name: Install python dependencies - run: | - python -m pip install --upgrade pip + # - name: Install python dependencies + # run: | + # python -m pip install --upgrade pip - name: Build on Linux diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 82873333..e6612481 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -6,15 +6,15 @@ on: # pull_request: # branches: [ "main" ] workflow_dispatch: - inputs: - python-version: - required: false - type: string - default: '3.11' + inputs: + compiler: + required: false + type: string + default: clang workflow_call: inputs: - python-version: + compiler: required: true type: string @@ -24,16 +24,24 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ inputs.python-version }} - - uses: actions/setup-python@v4 + + + - name: Install compiler ${{ inputs.compiler }} + id: install_cc + uses: rlalik/setup-cpp-compiler@master with: - python-version: ${{ inputs.python-version }} + compiler: ${{ inputs.compiler }} + + # - name: Set up Python ${{ inputs.python-version }} + + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ inputs.python-version }} - - name: Install python dependencies - run: | - python -m pip install --upgrade pip + # - name: Install python dependencies + # run: | + # python -m pip install --upgrade pip - name: Build on Windows run: ./build.bat diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6cf47177..68fa25eb 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -17,30 +17,24 @@ jobs: needs: build-ffmpeg strategy: matrix: - # python-version: ["py37", "py38", "py39", "py310", "py311"] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - # python-version: ["3.9"] + compiler: [ latest, gcc-latest, gcc-9, gcc-10, g++-11, clang, clang-10, clang-11, clang++-12 ] uses: ./.github/workflows/build-linux.yml with: - python-version: ${{ matrix.python-version }} + compiler: ${{ matrix.compiler }} build-windows: strategy: matrix: - # python-version: ["py37", "py38", "py39", "py310", "py311"] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - # python-version: ["3.9"] + compiler: [ latest, gcc-latest, gcc-6.4.0, gcc-10.2.0, g++-11.2.0, clang, clang-8.0.0, clang-11.1.0, clang++-12.0.1 ] uses: ./.github/workflows/build-windows.yml with: - python-version: ${{ matrix.python-version }} + compiler: ${{ matrix.compiler }} tests-linux: strategy: matrix: - # python-version: ["py37", "py38", "py39", "py310", "py311"] python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - # python-version: ["3.9"] needs: build-linux uses: ./.github/workflows/test.yml with: @@ -50,170 +44,9 @@ jobs: tests-windows: strategy: matrix: - # python-version: ["py37", "py38", "py39", "py310", "py311"] python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - # python-version: ["3.9"] needs: build-windows uses: ./.github/workflows/test.yml with: python-version: ${{ matrix.python-version }} os: windows-latest - -# name: build - -# on: -# push: -# branches: [ "main" ] -# pull_request: -# branches: [ "main" ] -# workflow_dispatch: - -# env: -# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) -# BUILD_TYPE: Release - -# jobs: - -# build-ffmpeg: -# runs-on: ubuntu-latest - -# steps: -# - uses: actions/checkout@v3 - -# - name: Cache Dependencies -# id: cache-dependencies -# uses: actions/cache@v3 -# with: -# path: 3rd_64 -# key: ${{ github.ref }}-3rd_64 - -# - if: ${{ (steps.cache-dependencies.outputs.cache-hit != 'true') }} -# run: ./configure_ffmpeg - -# build-linux: -# # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. -# # You can convert this to a matrix build if you need cross-platform coverage. -# # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix -# runs-on: ubuntu-latest -# needs: build-ffmpeg - -# strategy: -# matrix: -# # python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] -# # os: [ubuntu-latest, windows-latest] -# python-version: ["3.9"] -# steps: -# - uses: actions/checkout@v3 -# - name: Set up Python ${{ matrix.python-version }} - -# uses: actions/setup-python@v4 -# with: -# python-version: ${{ matrix.python-version }} - -# - name: Install python dependencies -# run: | -# python -m pip install --upgrade pip - - - -# - name: Cache Dependencies -# id: cache-dependencies -# uses: actions/cache@v3 -# with: -# path: 3rd_64 -# key: ${{ github.ref }}-3rd_64 - - - -# - name: Build Linux -# run: ./build.sh - - -# build-windows: -# # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. -# # You can convert this to a matrix build if you need cross-platform coverage. -# # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix -# runs-on: windows-latest - -# strategy: -# matrix: -# # python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] -# # os: [ubuntu-latest, windows-latest] -# python-version: ["3.9"] -# steps: -# - uses: actions/checkout@v3 - -# # - name: Cache Build -# # id: cache-build -# # uses: actions/cache@v3 -# # with: -# # path: build -# # key: ${{ github.ref }}-build - -# - name: Set up Python ${{ matrix.python-version }} - -# uses: actions/setup-python@v4 -# with: -# python-version: ${{ matrix.python-version }} - -# - name: Install python dependencies -# run: | -# python -m pip install --upgrade pip - -# - name: Build MSVC -# run: ./build.bat - -# - name: Upload artifact -# uses: actions/upload-artifact@v3 -# with: -# name: install-librir -# path: build/install - - -# test: -# runs-on: ${{ matrix.os }} -# needs: [build-linux, build-windows] - -# strategy: -# matrix: -# # python-version: ["py37", "py38", "py39", "py310", "py311"] -# python-version: ["3.9"] -# os: [ubuntu-latest, windows-latest] - - -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/download-artifact@v3 -# with: -# name: install-librir -# path: build/install - -# - name: Set up Python ${{ matrix.python-version }} - -# uses: actions/setup-python@v4 -# with: -# python-version: ${{ matrix.python-version }} - -# - name: Install python dependencies -# run: | -# python -m pip install --upgrade pip -# pip install ruff pytest pytest-cov -# pip install -e build/install - -# - name: Test with pytest -# continue-on-error: true -# run: | -# pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=librir tests/python -m "not thermavip" | tee pytest-coverage.txt - -# - name: Pytest coverage comment -# uses: MishaKav/pytest-coverage-comment@main -# with: -# pytest-coverage-path: ./pytest-coverage.txt -# junitxml-path: ./pytest.xml - -# - name: Lint with ruff -# run: | -# # stop the build if there are Python syntax errors or undefined names -# ruff --format=github --select=E9,F63,F7,F82 --target-version=${{ matrix.python-version }} . -# # default set of ruff rules with GitHub Annotations -# ruff --format=github --target-version=${{ matrix.python-version }} . diff --git a/3rd_64/build-gcc.sh b/3rd_64/build-gcc.sh index e791b35f..82cc2924 100755 --- a/3rd_64/build-gcc.sh +++ b/3rd_64/build-gcc.sh @@ -177,7 +177,7 @@ else sed -i '/AM_PROG_AR/c\m4_ifdef([AM_PROG_AR], [AM_PROG_AR])' ./configure.ac ./autogen.sh ./configure --enable-static=yes --enable-shared=no --prefix=$PWD/install CFLAGS="-fPIC" #--extra-ldflags="-Wl,-rpath='$ORIGIN'" - make -j4 + make -j make install # Add -lm -lpthread to kvazaar libs @@ -208,7 +208,7 @@ else echo 'Configuring x264...' #sed -i 's/asm=\"auto\"/asm=\"nasm\"/' configure ./configure --enable-static --enable-pic --prefix=$PWD/install --enable-strip #--enable-rpath --extra-ldflags="-Wl,-rpath='$ORIGIN'" - make -j4 + make -j make install # libx264 already produces a valid pc file cd .. @@ -255,7 +255,7 @@ if [ -d $FILE ]; then else echo 'Building ffmpeg...' #make clean - make -j4 + make -j make install fi cd .. diff --git a/CMakeLists.txt b/CMakeLists.txt index 3dfd152c..1a8717b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,14 +116,14 @@ add_subdirectory(plugins) # enable_testing() # TOREMOVE -find_package(Python COMPONENTS Interpreter) -IF(NOT Python_FOUND) +# find_package(Python COMPONENTS Interpreter) +# IF(NOT Python_FOUND) - MESSAGE(STATUS "PYTHON NOT FOUND") +# MESSAGE(STATUS "PYTHON NOT FOUND") -endif() +# endif() -MESSAGE(STATUS "found python") +# MESSAGE(STATUS "found python") # Perform this action once more (already done in src/CMakeLists.txt) to copy plugins binaries diff --git a/build.sh b/build.sh index a3bce927..a5ab7d2d 100755 --- a/build.sh +++ b/build.sh @@ -99,7 +99,7 @@ chmod 777 configure_ffmpeg mkdir -p build cd build $CMAKE ./.. -G "Unix Makefiles" $CMAKE_OPTIONS -make +make -j make install # Build wheel if necessary diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ad8a0203..e21dae23 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,6 +5,9 @@ add_subdirectory(geometry) add_subdirectory(signal_processing) add_subdirectory(video_io) +# some dependency to prevent from making librir before building ffmpeg +add_dependencies(video_io dummy) + install(TARGETS ${TARGETS} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install (TARGETS ${TARGETS} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) install (TARGETS ${TARGETS} LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR} )