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

Update deps #84

Merged
merged 12 commits into from
Sep 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: push
jobs:
build_win:
name: build on Windows
runs-on: windows-2019
runs-on: windows-2022
steps:
- name: checkout
uses: actions/checkout@v2
Expand Down
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
find_package(Threads REQUIRED)
find_package(LibObs REQUIRED)

find_package(libobs REQUIRED)
if (EXISTS ${LIBOBS_INCLUDE_DIR}/../cmake/external/ObsPluginHelpers.cmake)
include(${LIBOBS_INCLUDE_DIR}/../cmake/external/ObsPluginHelpers.cmake)
endif()

find_package(OnnxRuntime REQUIRED)

#find_package(HalideHelpers REQUIRED)
Expand Down Expand Up @@ -42,7 +47,7 @@ include_directories(
)

target_link_libraries(${CMAKE_PROJECT_NAME}
${LIBOBS_LIBRARIES}
OBS::libobs
${OnnxRuntime_LIBRARIES}
blur
Halide::RunGenMain
Expand Down
123 changes: 0 additions & 123 deletions cmake/FindLibObs.cmake

This file was deleted.

20 changes: 14 additions & 6 deletions scripts/build_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,34 @@ set -xe
pushd $(dirname $0)/..

OBS_VERSION=$(brew info --json=v2 --cask obs | jq -r .casks[0].version)
LLVM_VERSION=$(brew info --json=v2 llvm@12 | jq -r .formulae[0].installed[0].version)
LLVM_VERSION=$(brew info --json=v2 llvm@13 | jq -r .formulae[0].installed[0].version)

echo "Using OBS ${OBS_VERSION}, LLVM ${LLVM_VERSION}"

[ -d deps ] || mkdir deps
[ -d deps/obs-studio ] && rm -rf deps/obs-studio
git -C deps clone --single-branch --depth 1 -b ${OBS_VERSION} https://github.com/obsproject/obs-studio.git
if [ ! -d deps/obs-studio/build ]; then
[ -d deps/obs-studio ] && rm -rf deps/obs-studio
git -C deps clone --recursive --single-branch --depth 1 -b ${OBS_VERSION} https://github.com/obsproject/obs-studio.git

pushd deps/obs-studio
./CI/build-macos.sh
popd
fi


[ -d build ] && rm -rf build
mkdir build
pushd build
# cmake .. -DobsPath=../deps/obs-studio -DLLVM_DIR=/usr/local/Cellar/llvm/12.0.1/lib/cmake/llvm
cmake .. \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DCMAKE_APPLE_SILICON_PROCESSOR=x86_64 \
-DobsLibPath=/Applications/OBS.app/Contents/Frameworks \
-DobsIncludePath=$(cd ../deps/obs-studio/libobs; pwd) \
-DOnnxRuntimePath=$(cd ../deps/onnxruntime; pwd) \
-DHalide_DIR=$(cd ../deps/Halide; pwd)/lib/cmake/Halide \
-DHalideHelpers_DIR=$(cd ../deps/Halide; pwd)/lib/cmake/HalideHelpers \
-DLLVM_DIR=/usr/local/Cellar/llvm/${LLVM_VERSION}/lib/cmake/llvm
-DLLVM_DIR=/usr/local/Cellar/llvm@13/${LLVM_VERSION}/lib/cmake/llvm \
-DCMAKE_PREFIX_PATH=$(cd ../deps/obs-studio/build; pwd)

cmake --build . --config Release
cpack
popd
44 changes: 19 additions & 25 deletions scripts/build_obs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,73 +6,67 @@ cd ..
set DEPS_DIR=%CD%\deps
cd %DEPS_DIR%

set OBS_VERSION=27.2.2
set OBS_VERSION=28.0.1

set OBS_URL=https://github.com/obsproject/obs-studio/archive/refs/tags/%OBS_VERSION%.zip
set OBS_ZIP=%DEPS_DIR%\obs-studio-%OBS_VERSION%.zip
set OBS_SRC_DIR=%DEPS_DIR%\obs-studio-%OBS_VERSION%
set OBS_BUILD_DIR=%OBS_SRC_DIR%\build
set OBS_INSTALL_DIR=%DEPS_DIR%\obs-studio
set OBS_BUILD_DIR=%OBS_INSTALL_DIR%\build

set OBS_DEPS_URL=https://obsproject.com/downloads/dependencies2019.zip
set OBS_DEPS_ZIP=%DEPS_DIR%\dependencies2019.zip
set OBS_DEPS_DIR=%DEPS_DIR%\dependencies2019
set OBS_DEPS_URL=https://github.com/obsproject/obs-deps/releases/download/2022-08-02/windows-deps-2022-08-02-x64.zip
set OBS_DEPS_ZIP=%DEPS_DIR%\dependencies2022.zip
set OBS_DEPS_DIR=%DEPS_DIR%\dependencies2022

set QT_VERSION=5.15.2
set QT_URL=https://cdn-fastly.obsproject.com/downloads/Qt_%QT_VERSION%.7z
set QT_7Z=%DEPS_DIR%\Qt_%QT_VERSION%.7z
set QT_DIR=%DEPS_DIR%\qt
set QT_VERSION_DIR=%DEPS_DIR%\qt\%QT_VERSION%
set QT_VERSION=6.3.1
set QT_URL=https://github.com/obsproject/obs-deps/releases/download/2022-08-02/windows-deps-qt6-2022-08-02-x64.zip
set QT_ZIP=%DEPS_DIR%\windows-deps-qt6-2022-08-02-x64.zip
rem extract to OBS_DEPS_DIR

set CEF_VERSION=4638
set CEF_VERSION=5060
set CEF_URL=https://cdn-fastly.obsproject.com/downloads/cef_binary_%CEF_VERSION%_windows_x64.zip
set CEF_ZIP=%DEPS_DIR%\cef_binary_%CEF_VERSION%_windows_x64.zip
set CEF_DIR=%DEPS_DIR%\cef
set CEF_VERSION_DIR=%DEPS_DIR%\cef\cef_binary_%CEF_VERSION%_windows_x64

IF exist %OBS_INSTALL_DIR% goto OBS_BUILD_END
IF exist %OBS_BUILD_DIR% goto OBS_BUILD_END

IF not exist %DEPS_DIR% mkdir %DEPS_DIR%

IF not exist %OBS_DEPS_ZIP% curl -L -o %OBS_DEPS_ZIP% %OBS_DEPS_URL%
IF not exist %OBS_DEPS_DIR% mkdir %OBS_DEPS_DIR%
IF not exist %OBS_DEPS_DIR%\win64 7z x -o%OBS_DEPS_DIR% %OBS_DEPS_ZIP%

IF not exist %QT_7Z% curl -L -o %QT_7Z% %QT_URL%
IF not exist %QT_DIR% mkdir %QT_DIR%
IF not exist %QT_VERSION_DIR% 7z x -o%QT_DIR% %QT_7Z%
IF not exist %QT_ZIP% curl -L -o %QT_ZIP% %QT_URL%
7z x -o%OBS_DEPS_DIR% %QT_ZIP%

IF not exist %CEF_ZIP% curl -L -o %CEF_ZIP% %CEF_URL%
IF not exist %CEF_DIR% mkdir %CEF_DIR%
IF not exist %CEF_VERSION_DIR% 7z x -o%CEF_DIR% %CEF_ZIP%

IF not exist %OBS_ZIP% curl -L -o %OBS_ZIP% %OBS_URL%
IF not exist %OBS_SRC_DIR% 7z x -y %OBS_ZIP%
IF exist %OBS_INSTALL_DIR% rmdir /s /q %OBS_INSTALL_DIR%
move %OBS_SRC_DIR% %OBS_INSTALL_DIR%

mkdir %OBS_BUILD_DIR%
pushd %OBS_BUILD_DIR%
cmake ^
-G"Visual Studio 16 2019" -A"x64" ^
-G"Visual Studio 17 2022" -A"x64" ^
-DDepsPath=%OBS_DEPS_DIR%\win64 ^
-DQTDIR=%QT_VERSION_DIR% ^
-DQt5Widgets_DIR=%QT_VERSION_DIR%\msvc2019_64\lib\cmake\Qt5Widgets ^
-DQt5Svg_DIR=%QT_VERSION_DIR%\msvc2019_64\lib\cmake\Qt5Svg ^
-DQt5Xml_DIR=%QT_VERSION_DIR%\msvc2019_64\lib\cmake\Qt5Xml ^
-DQt5Network_DIR=%QT_VERSION_DIR%\msvc2019_64\lib\cmake\Qt5Network ^
-DQt5WinExtras_DIR=%QT_VERSION_DIR%\msvc2019_64\lib\cmake\Qt5WinExtras ^
-DCMAKE_PREFIX_PATH=%OBS_DEPS_DIR% ^
-DBUILD_BROWSER=OFF ^
-DBUILD_VST=OFF ^
-DDISABLE_PLUGINS=ON ^
-DDISABLE_LUA=ON ^
-DDISABLE_PYTHON=ON ^
-DCMAKE_SYSTEM_VERSION=10.0.18363.657 ^
%OBS_SRC_DIR%
%OBS_INSTALL_DIR%
IF ERRORLEVEL 1 GOTO ERR
cmake --build . --config Release
cmake --build . --config RelWithDebInfo
IF ERRORLEVEL 1 GOTO ERR

popd
move %OBS_SRC_DIR% %OBS_INSTALL_DIR%
:OBS_BUILD_END

exit /b 0
Expand Down
6 changes: 3 additions & 3 deletions scripts/build_onnxruntime_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
set -xe
cd $(dirname $0)/..

ORT_VERSION=1.11.0
ORT_VERSION=1.12.1

[ -d deps/onnxruntime ] && exit 0
mkdir -p deps/onnxruntime

# git -C deps clone --single-branch --depth 1 -b v${ORT_VERSION} https://github.com/microsoft/onnxruntime.git
git -C deps clone --recursive --single-branch --depth 1 -b master https://github.com/microsoft/onnxruntime.git
git -C deps clone --recursive --single-branch --depth 1 -b v${ORT_VERSION} https://github.com/microsoft/onnxruntime.git

pushd deps/onnxruntime
./build.sh --config RelWithDebInfo --parallel \
--use_coreml \
Expand Down
12 changes: 6 additions & 6 deletions scripts/build_win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ cd %~dp0
cd ..
set DEPS_DIR=%CD%\deps

set ONNXRUNTIME_VERSION=1.10.0
set DIRECTML_VERSION=1.8.0
set HALIDE_VERSION=13.0.4
set ONNXRUNTIME_VERSION=1.12.1
set DIRECTML_VERSION=1.9.1
set HALIDE_VERSION=14.0.0

set ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v%ONNXRUNTIME_VERSION%/Microsoft.ML.OnnxRuntime.DirectML.%ONNXRUNTIME_VERSION%.zip
set ONNXRUNTIME_ZIP=%DEPS_DIR%\Microsoft.ML.OnnxRuntime.DirectML.%ONNXRUNTIME_VERSION%.zip
Expand All @@ -21,7 +21,7 @@ set DIRECTML_URL=https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/%DIR
set DIRECTML_ZIP=%DEPS_DIR%\Microsoft.AI.DirectML-%DIRECTML_VERSION%.zip
set DIRECTML_DIR=%DEPS_DIR%\directml

set HALIDE_URL=https://github.com/halide/Halide/releases/download/v13.0.4/Halide-13.0.4-x86-64-windows-3a92a3f95b86b7babeed7403a330334758e1d644.zip
set HALIDE_URL=https://github.com/halide/Halide/releases/download/v14.0.0/Halide-14.0.0-x86-64-windows-6b9ed2afd1d6d0badf04986602c943e287d44e46.zip
set HALIDE_ZIP=Halide-%HALIDE_VERSION%.zip
set HALIDE_DIR=%DEPS_DIR%\Halide-%HALIDE_VERSION%-x86-64-windows

Expand Down Expand Up @@ -50,7 +50,7 @@ IF exist build rmdir /s /q build
mkdir build
pushd build
cmake ^
-DobsPath=%DEPS_DIR%\obs-studio ^
-DCMAKE_PREFIX_PATH=%DEPS_DIR%\dependencies2022;%DEPS_DIR%\obs-studio\build;%DEPS_DIR%\obs-studio\build\deps ^
-DOnnxRuntimePath=%ONNXRUNTIME_DIR% ^
-DCMAKE_SYSTEM_VERSION=10.0.18363.657 ^
-DHalide_DIR=%HALIDE_DIR%\lib\cmake\Halide ^
Expand All @@ -68,7 +68,7 @@ mkdir build_gpu
pushd build_gpu
cmake ^
-DOBS_VIRTUALBG_USE_CUDA=ON ^
-DobsPath=%DEPS_DIR%\obs-studio ^
-DCMAKE_PREFIX_PATH=%DEPS_DIR%\dependencies2022;%DEPS_DIR%\obs-studio\build;%DEPS_DIR%\obs-studio\build\deps ^
-DOnnxRuntimePath=%ONNXRUNTIME_GPU_DIR% ^
-DCMAKE_SYSTEM_VERSION=10.0.18363.657 ^
-DHalide_DIR=%HALIDE_DIR%\lib\cmake\Halide ^
Expand Down
6 changes: 3 additions & 3 deletions scripts/install_deps_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ set -xe
cd $(dirname $0)/..
DEPS_DIR=$(pwd)/deps

HALIDE_VERSION=13.0.0
HALIDE_URL=https://github.com/halide/Halide/releases/download/v13.0.0/Halide-13.0.0-x86-64-linux-c3641b6850d156aff6bb01a9c01ef475bd069a31.tar.gz
HALIDE_VERSION=14.0.0
HALIDE_URL=https://github.com/halide/Halide/releases/download/v14.0.0/Halide-14.0.0-x86-64-linux-6b9ed2afd1d6d0badf04986602c943e287d44e46.tar.gz
HALIDE_TGZ=${DEPS_DIR}/Halide-${HALIDE_VERSION}.tar.gz
HALIDE_DIR=${DEPS_DIR}/Halide

ONNXRUNTIME_VERSION=1.10.0
ONNXRUNTIME_VERSION=1.12.1
ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz
ONNXRUNTIME_TGZ=${DEPS_DIR}/onnxruntime-${ONNXRUNTIME_VERSION}.tar.gz
ONNXRUNTIME_GPU_URL=https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/onnxruntime-linux-x64-gpu-${ONNXRUNTIME_VERSION}.tgz
Expand Down
6 changes: 3 additions & 3 deletions scripts/install_deps_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -xeu
cd $(dirname $0)/..
DEPS_DIR=$(pwd)/deps

HALIDE_VERSION=13.0.0
HALIDE_URL=https://github.com/halide/Halide/releases/download/v13.0.0/Halide-13.0.0-x86-64-osx-c3641b6850d156aff6bb01a9c01ef475bd069a31.tar.gz
HALIDE_VERSION=14.0.0
HALIDE_URL=https://github.com/halide/Halide/releases/download/v14.0.0/Halide-14.0.0-x86-64-osx-6b9ed2afd1d6d0badf04986602c943e287d44e46.tar.gz
HALIDE_TGZ=${DEPS_DIR}/Halide-${HALIDE_VERSION}.tar.gz
HALIDE_DIR=${DEPS_DIR}/Halide

Expand All @@ -17,7 +17,7 @@ HALIDE_DIR=${DEPS_DIR}/Halide
brew update

# brew install onnxruntime
brew install llvm@12
brew install llvm@13
brew pin llvm
brew install obs --cask