- OS: macOS Tahoe 26.5.2
- CPU: Apple Silicon M1
thorVG를 cpu를 사용해서 빌드하고 example을 구동해본다.
프로젝트 클론
git clone https://github.com/thorvg/thorvg.git
git clone https://github.com/thorvg/thorvg.example.git
빌드 도구 및 의존성 설치
brew install meson ninja
brew install sdl2
빌드
cd thorvg
meson setup builddir
ninja -C builddir
cd ..
예제 구동
cd thorvg.example
meson setup builddir
ninja -C builddir
예제 실행
./builddir/src/Lottie
./builddir/src/Animation
webgpu렌더러를 사용해 예제를 실행할 수 있다는 것을 알고 다시 시도해보았다. 이번에는 claude의 skill을 사용했다.
thorVG 프로젝트 루트 폴더에 .claude를 만들고 skill을 클론받는다.
cd thorvg
mkdir .claude
cd .claude
git clone https://github.com/OSSCA-thorvg/skills.git
webGPU를 사용하려면 wgpu-native라는 외부 의존성이 필요하다.
brew install wgpu-native
skills를 사용하기 전에는 wgpu-native를 설치해도 thorVG 프로젝트에서도 wgpu를 찾을 수 없다고 나오고 example에서
webgpu driver is not detected!라는 에러 메시지가 나오면서 구동되지 않았다. ossca-thorvg/skills를 클론받으면 thorvg-setup 폴더의 scripts 내에 install-wgpu-native-mac.sh라는 실행 파일이 있다. skill을 사용하면 claude가 이 파일을 실행해서 pc파일을 만들고 wgpu를 실행할 수 있게 해준다. claude가 없다면 직접 sh 파일을 실행하여 pc 파일을 만들면 된다.
그리고 thorvg 루트 폴더에서 meson setup option에 wg를 추가해서 다시 빌드한다.
meson setup builddir -Dengines="cpu,wg" --reconfigure
ninja -C builddir install
cd ..
그리고 thorvg.example 폴더에서 이전에 생성했던 builddir을 지우고 다시 빌드하여 생성한다.
cd thorvg.example
rm -rf ./builddir
meson setup builddir
ninja -C builddir
이 과정이 끝나면 webGPU로 thorvg example을 구동할 수 있게 된다.
./builddir/src/Lottie wg
./builddir/src/Animation wg
댓글
Discussion 원문