microsoft / SPTAG

A distributed approximate nearest neighborhood search (ANN) library which provides a high quality vector index build, search and distributed online serving toolkits for large scale vector search scenario.
MIT License
4.83k stars 580 forks source link

SPATAG build failure with cmake #357

Open anujkapoor007 opened 1 year ago

anujkapoor007 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

Trying to build the project and getting following error:-

15>Error copying file "C:/Users/anujkapoor/repos/SPTAG/Wrappers/inc/SPTAG.py" to "C:/Users/anujkapoor/repos/SPTAG/build/Release". 15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: The command "setlocal 15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E copy C:/Users/anujkapoor/repos/SPTAG/Wrappers/inc/SPTAG.py C:/Users/anujkapoor/repos/SPTAG/build/Release 15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd 15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmEnd 15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone 15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmErrorLevel 15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: exit /b %1 15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmDone 15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd 15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :VCEnd" exited with code 1. 15>Done building project "_SPTAG.vcxproj" -- FAILED.

To Reproduce Steps to reproduce the behavior:

  1. Create a build folder inside repo
  2. go inside build folder and execute cmake -A x64 ..
  3. From the build folder, open SPTAGLib.sln solution in Visual Studio and compile all projects
  4. See error

Expected behavior Appliction should compile

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

anujkapoor007 commented 1 year ago

image

JingyuanHe1222 commented 1 year ago

Hi, I'm encountering a similar issue. Have you solve it by any chance?

khaiwang commented 5 months ago

I encountered a similar issue and it was caused by a failure to build the Python bindings for the code. To resolve this, please check the following:

SWIG Library Path:

Ensure that the SWIG_LIB environment variable is correctly set to the directory containing the SWIG library files (e.g., swig.swg and python.swg). This directory is typically found within the SWIG installation directory.

swig -swig_lib
export SWIG_LIB=/usr/local/share/swig/4.0.2  # Adjust the path based on your installation

SWIG Version:

Verify that you are using the correct version of SWIG. The required version should match the version specified by your project. You can check the version by running:

swig -version

Ensure the output meets the swig version requirement (SWIG Version >= 4.0.2).

It works in my case.