0

I run the following command to install faiss directly from source (I cloned https://github.com/facebookresearch/faiss) and once inside the folder I run:

cmake -B build .

I get the error below:

-- The C compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter
-- Configuring done (7.3s)
CMake Error at faiss/gpu/CMakeLists.txt:263 (target_link_libraries):
  Target "faiss" links to:

    CUDA::cublas

  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.



CMake Error at faiss/gpu/CMakeLists.txt:264 (target_link_libraries):
  Target "faiss_avx2" links to:

    CUDA::cublas

  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.



-- Generating done (0.2s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
tmd13
  • 55
  • 2
  • 6
  • Have you installed all prerequisites, as listed in [documentation](https://github.com/facebookresearch/faiss/blob/main/INSTALL.md#building-from-source)? E.g., have you installed BLAS? – Tsyvarev Jul 13 '23 at 14:17
  • @Tsyvarev, yes I have already installed all the prerequisites per documentation. – tmd13 Jul 13 '23 at 14:29
  • Hmm, at the line [faiss/gpu/CMakeLists.txt:262](https://github.com/facebookresearch/faiss/blob/main/faiss/gpu/CMakeLists.txt#L262) there is a call `find_package(CUDAToolkit REQUIRED)`. Among other things, this call should create `CUDA::cublas` target. But I don't see output of this call in your trace... – Tsyvarev Jul 13 '23 at 14:36
  • When I change that in the specified folder as you suggested to find_package(CUDA::cublas REQUIRED). I now get an error on an earlier step. /*CMake Error at faiss/gpu/CMakeLists.txt:262 (find_package): By not providing "FindCUDA::cublas.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "CUDA::cublas", but CMake did not find one.*/ – tmd13 Jul 13 '23 at 14:46
  • Related content in faiss/gpu/CMakeLists.txt: find_package(CUDAToolkit REQUIRED) target_link_libraries(faiss PRIVATE CUDA::cudart CUDA::cublas $<$:raft::raft> $<$:nvidia::cutlass::cutlass>) target_link_libraries(faiss_avx2 PRIVATE CUDA::cudart CUDA::cublas $<$:raft::raft> $<$:nvidia::cutlass::cutlass>) – tmd13 Jul 13 '23 at 15:04
  • I didn't suggest to change `find_package` call. I noted, that the output which you provide - `The C compiler identification is GNU 9.4.0`, etc. - doesn't contain messages generated by that call. – Tsyvarev Jul 13 '23 at 15:43
  • Do you have any suggestions, some say that when I execute cmake -B build . I may be missing some env variables that can point to the location of the cublas but on my machine the only thing with cublas on it is located here and has a different name: /usr/local/cuda-10.1/lib64/libcublas.so.10.1 – tmd13 Jul 13 '23 at 16:17

0 Answers0