Replies: 5 comments 1 reply
|
vcpkg installer is finally working. But Halide cmake is still failing: |
Are you using AOT Halide Generators or using the Halide JIT libraries. If you're going AOT, you should only need to build the Halide libraries once for the host platform that's running the Generators. Halide can cross-compile from any supported platform to any supported platform (plus device platforms). You can even build Windows libraries from Linux if you want.
This sounds like an AOT scenario. It will probably be best to factor your Halide generators into their own CMake project.
We do not support using
Many reasons. For starters, it would add at least two hours to the build if we built from source. Downloading binaries opens a whole other can of worms. If you're on macOS or Linux, there are good binaries available from popular repositories: we support using the Homebrew We also build our own stripped down LLVM binaries in our CI system. If you want to use them, you can download them with $ uv init --python 3.12
Initialized project `tmp`
$ uv add halide-llvm --index https://pypi.halide-lang.org
Using CPython 3.12.12
Creating virtual environment at: .venv
Resolved 2 packages in 477ms
Prepared 1 package in 1m 14s
Installed 1 package in 89ms
+ halide-llvm==22.1.7Then CMake will pick up on the LLVM binaries as long as the virtual environment is active. You can also ask the $ source .venv/bin/activate
(tmp) $ halide-llvm
/Users/areinking/tmp/.venv/lib/python3.12/site-packages/halide_llvm/dataThen you would set |
|
I'm using both JIT and AOT scenario. JIT is only used in windows debug builds. All other platforms use AOT. Yesterday i was able to compile LLVM + Halide from sources and integrated those to my project. it is working fine in both AOT and JIT modes on windows build. But i have trouble using those libs for WebAssembly AOT. set(HALIDE_DEBUG_TREE "${PROJECT_ROOT_DIR}/third_party/Halide/Debug") if (EMSCRIPTEN) find_package(Halide REQUIRED) When i tried to configure cmake build for WebAssembly - i get errors: CMake Error at mediapipe/CMakeLists.txt:2548 (find_package): The following configuration files were considered but not accepted: -- Configuring incomplete, errors occurred! Not sure why cmake wasn't accepted. There are no additional information about the issue. |
|
Just googled a little bit, and in most cases errors in cmake like this: |
|
Ok, i was able to compile AOT libs for WASM using custom commands in cmake with precompiled generators. Seems like using add_halide_generator / add_halide_library is very tricky in cross compile configs. I didn't figure out how to do this... |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I'm trying to setup universal multiplatform Halide builder in my project's cmake, so it should build out of the box.
I need to support Windows, WebAssembly, Android, iOS, Linux, etc
Unfortunately this is not so simple. The problem lies in LLVM which is building differently for different platforms.
But i do not get this, if LLVM is mandatory part of Halide why it cannot download and install it automatically during Halide cmake invoking?
So question is how to integrate Halide to the projects via simple:
add_subdirectory(third_party/Halide)
without manual LLVM setup, vcpkg hassle, etc.
Currently - the only way for me to integrate it - is to build Halide manually for each platform and link the project to precompiled libs. Which is quite bad solution, because libs are quite huge in size. Especially when i need Debug and Release libs.
P.S.
Tried to manually build Halide for Windows:
cmake ....\ -G "Visual Studio 17 2022" -Thost=x64 -A x64 --toolchain C:/Projects/Third/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_TOOLCHAIN_FILE=C:/Projects/Third/vcpkg/scripts/buildsystems/vcpkg.cmake
And get errors:
-- Running vcpkg install
read_contents("C:\Projects\Third\vcpkg\scripts\vcpkgTools.xml"): no such file or directory
-- Running vcpkg install - failed
CMake Error at C:/Projects/Third/vcpkg/scripts/buildsystems/vcpkg.cmake:984 (message):
vcpkg install failed. See logs for more information:
C:\Projects\Third\ai\Halide_build\VS\vcpkg-manifest-install.log
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.30/Modules/CMakeDetermineSystem.cmake:146 (include)
CMakeLists.txt:2 (project)
Not sure what is going on, but vcpkg\scripts\vcpkgTools.xml does not exists...
vcpkg is the latest. Tried all boostraps i found inside vcpkg, didn't help.
Any ideas ?
All reactions