diff --git a/CMakeLists.txt b/CMakeLists.txt index 21687eb..4e5f4b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ endif() if(GPU_RUNTIME STREQUAL "CUDA") set(CMAKE_CUDA_ARCHITECTURES 70 75) find_package(CUDAToolkit) - if (CUDAToolkit-NOTFOUND) + if (NOT CUDAToolkit_FOUND) message(WARNING "CUDA toolkit not found, building with CPU support only") set(GPU_RUNTIME "CPU") endif() diff --git a/README.md b/README.md index 5952d80..bc2adb2 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,28 @@ Optional: Edit cuda target (only if required) before `cmake --build .` C:/path_to/OpenSplat/build/gsplat.vcxproj for example: arch=compute_75,code=sm_75 +### macOS + +Support for macOS is very experimental. + +If you're using [brew], you can install OpenCV by running: + +```bash +brew install opencv +``` + +Then run: + +``` +git clone https://github.com/pierotofy/OpenSplat OpenSplat +cd OpenSplat +mkdir build && cd build +cmake -DCMAKE_PREFIX_PATH=/path/to/libtorch/ .. && make -j$(nproc) +./opensplat +``` + +:warning: You will probably get a *libc10.dylib can’t be opened because apple cannot check it for malicious software* error message on first run. Open System Settings and go to Privacy & Security and find the "Allow" button. You might need to repeat this several times until all torch libraries are loaded. + ## Docker Build ### CUDA diff --git a/rasterize_gaussians.cpp b/rasterize_gaussians.cpp index 9023b9b..154b5e9 100644 --- a/rasterize_gaussians.cpp +++ b/rasterize_gaussians.cpp @@ -1,6 +1,8 @@ #include "rasterize_gaussians.hpp" #include "gsplat.hpp" +#if defined(USE_HIP) || defined(USE_CUDA) + std::tuple{ public: