mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.6k stars 1.63k forks source link

CMake module fails to import Faiss library #13197

Open artem opened 6 months ago

artem commented 6 months ago

Describe the bug Meson fails to import faiss as cmake subproject using cmake module

To Reproduce

  1. Put https://github.com/facebookresearch/faiss into the subprojects directory

  2. Import faiss using cmake module:

    cmake = import('cmake')
    faiss_opts = cmake.subproject_options()
    faiss_opts.add_cmake_defines({'FAISS_ENABLE_GPU': false, 'FAISS_ENABLE_PYTHON': false, 'BUILD_TESTING': false})
    faiss_proj = cmake.subproject('faiss', options: faiss_opts)
    faiss_lib = faiss_proj.dependency('faiss')
  3. The following error is observed during meson setup:

    subprojects/faiss/meson.build:127:0: ERROR: Invalid variable name: 1_Flat_dir

P.S. I have narrowed the issue to the following CMake expressions in the Faiss: https://github.com/facebookresearch/faiss/blob/3121fc6/tutorial/cpp/CMakeLists.txt#L7-L8 . Seems like Meson fails to handle them properly. Commenting them out workarounds the issue.

Expected behavior Meson configures the project successfully

system parameters

artem commented 4 months ago

In which direction should we proceed with this issue?

If this issue is not considered a priority to be fixed, what are the approximate steps so I could try to contribute the fix myself?

artem commented 3 months ago

Ping @eli-schwartz @dcbaker