Skip to content

Commit

Permalink
Add supports for Ubuntu 18.04 and other Linux Distro with GLIBC Versi…
Browse files Browse the repository at this point in the history
…on < 2.29 and cmake version < 3.15
  • Loading branch information
ArchieMeng committed May 1, 2021
1 parent 001b279 commit c8734e0
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 6 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/CI.yml
Expand Up @@ -69,6 +69,32 @@ jobs:
cmake ../src
cmake --build . -j 2
ubuntu-1804: # no needs to install swig for it is already there
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: cache-vulkansdk
id: cache-vulkansdk
uses: actions/cache@v1
with:
path: "1.2.162.0"
key: vulkansdk-linux-x86_64-1.2.162.0
- name: vulkansdk
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
wget https://sdk.lunarg.com/sdk/download/1.2.162.0/linux/vulkansdk-linux-x86_64-1.2.162.0.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.2.162.0.tar.gz
tar -xf vulkansdk-linux-x86_64-1.2.162.0.tar.gz
rm -rf 1.2.162.0/source 1.2.162.0/samples
find 1.2.162.0 -type f | grep -v -E 'vulkan|glslang' | xargs rm
- name: build
run: |
export VULKAN_SDK=`pwd`/1.2.162.0/x86_64
mkdir build && cd build
cmake ../src
cmake --build . -j 2
macos:
runs-on: macos-latest
steps:
Expand Down
56 changes: 55 additions & 1 deletion .github/workflows/release.yml
Expand Up @@ -66,6 +66,49 @@ jobs:
name: ${{ env.PACKAGENAME }}
path: ${{ env.PACKAGENAME }}.zip

ubuntu-1804:
needs: [setup]
runs-on: ubuntu-18.04
env:
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-ubuntu-1804
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: cache-vulkansdk
id: cache-vulkansdk
uses: actions/cache@v1
with:
path: "1.2.162.0"
key: vulkansdk-linux-x86_64-1.2.162.0
- name: vulkansdk
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
wget https://sdk.lunarg.com/sdk/download/1.2.162.0/linux/vulkansdk-linux-x86_64-1.2.162.0.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.2.162.0.tar.gz
tar -xf vulkansdk-linux-x86_64-1.2.162.0.tar.gz
rm -rf 1.2.162.0/source 1.2.162.0/samples
find 1.2.162.0 -type f | grep -v -E 'vulkan|glslang' | xargs rm
- name: build
run: |
export VULKAN_SDK=`pwd`/1.2.162.0/x86_64
mkdir build && cd build
cmake ../src
cmake --build . -j 2
- name: package
run: |
mkdir -p ${{ env.PACKAGENAME }}
cp README.md LICENSE ${{ env.PACKAGENAME }}
cp build/rife_ncnn_vulkan.py ${{ env.PACKAGENAME }}
cp build/rife_ncnn_vulkan_wrapper.py ${{ env.PACKAGENAME }}
cp build/_rife_ncnn_vulkan_wrapper.so ${{ env.PACKAGENAME }}
cp -r models/ ${{ env.PACKAGENAME }}
zip -9 -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }}
- name: upload
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGENAME }}
path: ${{ env.PACKAGENAME }}.zip

openmp-macos:
runs-on: macos-latest
steps:
Expand Down Expand Up @@ -254,7 +297,7 @@ jobs:
path: ${{ env.PACKAGENAME }}.zip

release:
needs: [setup, ubuntu, macos, windows]
needs: [setup, ubuntu, ubuntu-1804, macos, windows]
runs-on: ubuntu-latest
steps:
- name: download
Expand Down Expand Up @@ -284,6 +327,17 @@ jobs:
asset_name: ${{ env.PACKAGENAME }}.zip
asset_content_type: application/zip

- name: upload-ubuntu-1804
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-ubuntu-1804
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/${{ env.PACKAGENAME }}/${{ env.PACKAGENAME }}.zip
asset_name: ${{ env.PACKAGENAME }}.zip
asset_content_type: application/zip

- name: upload-macos
uses: actions/upload-release-asset@v1
env:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -9,8 +9,7 @@ rife-ncnn-vulkan-python wraps [rife-ncnn-vulkan project](https://github.com/nihu

## Downloads

Linux/Windos/Mac X86_64 build releases are available now. However, for Linux you may need to compile it yourself if you
are using python version other than 3.8 . (The compiled python C extension library is bound to python version now)
Linux/Windos/Mac X86_64 build releases are available now. **However, for Linux (Like Ubuntu 18.04) with an older GLIBC (version < 2.29), you may try to use the ubuntu-1804 release or just compile it on your own.**

## Build

Expand Down
18 changes: 15 additions & 3 deletions src/CMakeLists.txt
@@ -1,12 +1,18 @@
cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.9)
cmake_policy(SET CMP0091 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

project(rife-ncnn-vulkan-python)

# Python
if (${CMAKE_VERSION} VERSION_LESS "3.15")
find_package(Python REQUIRED)
else()
find_package(Python REQUIRED COMPONENTS Development)
endif()

# SWIG
find_package(Python REQUIRED COMPONENTS Development)
find_package(SWIG REQUIRED COMPONENTS python)
if(SWIG_FOUND)
message("SWIG found: ${SWIG_EXECUTABLE}")
Expand Down Expand Up @@ -282,6 +288,12 @@ set_property(SOURCE rife.i PROPERTY CPLUSPLUS ON DEPENDS generate-spirv)
swig_add_library(rife_ncnn_vulkan_wrapper LANGUAGE python SOURCES rife.i rife.cpp warp.cpp RIFEWrapper.cpp)
add_dependencies(rife_ncnn_vulkan_wrapper generate-spirv)
target_compile_options(rife_ncnn_vulkan_wrapper PUBLIC -fexceptions)
target_link_libraries(rife_ncnn_vulkan_wrapper ${RIFE_LINK_LIBRARIES} Python::Module)

if (${CMAKE_VERSION} VERSION_LESS "3.15")
include_directories(${PYTHON_INCLUDE_DIRS})
target_link_libraries(rife_ncnn_vulkan_wrapper ${RIFE_LINK_LIBRARIES} ${PYTHON_LIBRARIES})
else()
target_link_libraries(rife_ncnn_vulkan_wrapper ${RIFE_LINK_LIBRARIES} Python::Module)
endif()
#
#target_link_libraries(rife-ncnn-vulkan ${RIFE_LINK_LIBRARIES})

0 comments on commit c8734e0

Please sign in to comment.