taichi-unity2 icon indicating copy to clipboard operation
taichi-unity2 copied to clipboard

CMake Error

Open sarahhaha opened this issue 2 years ago • 3 comments

I am trying to build with cmake .. -DTAICHI_C_API_INSTALL_DIR="$env:TAICHI_REPO_DIR/build", but I am getting the following error.

CMake Error at CMakeLists.txt:50 (target_link_libraries): Target "taichi_unity" links to:

Taichi::Runtime

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

I have tried with CMake Integration in VisualStudio 2022 as well but I'm still getting the same error. Is there anything I can look into?

sarahhaha avatar Mar 17 '23 21:03 sarahhaha

I wonder how you built Taichi? If you installed Taichi with setup.py you should find the C-API installation in something like _skbuild/macosx-13.0-arm64-3.10/cmake-install/c_api and that's TAICHI_C_API_INSTALL_DIR.

PENGUINLIONG avatar Mar 18 '23 00:03 PENGUINLIONG

I don't exactly recall how I built taichi, but I have set TAICHI_C_API_INSTALL_DIR to be something like .../taichi/c_api but I am still getting the same error. I have also tried running FindTaichi.cmake and it seems like it finds Taichi Runtime but Taichi_Runtime_Library is still missing. Do I need to rebuild taichi_c_api and set it as a cache variable for this?

sarahhaha avatar Apr 14 '23 20:04 sarahhaha

I guess you built Taichi Runtime with msbuild or something alike. FindTaichi.cmake currently doesn't support multiconfig build system. Try ninja build in stead

PENGUINLIONG avatar Apr 15 '23 03:04 PENGUINLIONG