yahoojapan / NGT

Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data
Apache License 2.0
1.22k stars 112 forks source link

Running sample codes (e.g., qg-l2-float) #151

Closed MINGRUI001 closed 8 months ago

MINGRUI001 commented 8 months ago

Hi,

I'm trying to run the sample codes (mainly qg-l2-float), and followed the procedures (e.g., cmake, make), but confronted some issues.

Firstly, I found the "define.h" cannot be generated from "define.h.in" in the Make process. Secondly, after I added the header file manually, when the executable file is run, it output: ".... (omitted) end of insertion. build-qg: Warning! None is unavailable for the global type. Zero is set to the global type. Error .../NGT-main/NGT-main/lib/NGT/NGTQ/Optimizer.cpp:optimize:251: optimize: No objects" I guess the it may be due to the missing of data files. However, I checked the location of the files, but still not worked. By the way, I found that even if I revised the file "qg-l2-float.cpp", the newly complied file seems to be unchanged, So, may I have your help to fix this? Thanks.

masajiro commented 8 months ago

What is your OS? What is the output message of the command cmake? Didn't you find any error in the message? After running cmake, you can find "define.h" in build/lib/NGT.

MINGRUI001 commented 8 months ago

Hi Masajiro,

Thank you for your reply. My OS is Ubuntu (22.04.2), it output "fatal error, no such file or directory". Then I manually adapted it from "define.h.in" by moving the cmake related lines. By the way, I made the "build" directory at the folder of "samples" directly (i.e., samples/qg-l2-float/build, but I did find "define.h" in the location you mentioned), should I?

Maybe what I care most is how to compile and run the "qg-l2-float.cpp" sample smoothly and easily. May I have your suggestions on achieving this purpose? Thanks for the project you contributed and your reply again!

masajiro commented 8 months ago

You should make the build directory in the root of NGT according to the installation steps. The installation also builds the samples.

masajiro commented 8 months ago

You can find the samples in build/samples.

MINGRUI001 commented 8 months ago

Hi, I re-installed the whole project in a new directory, and rebuilt it. As is instructed by you, I run the generated "qg-l2-float" in "/NGT-main/build/samples/qg-l2-float". However, similar things happened again, which reported " ... end of insertion. build-qg: Warning! None is unavailable for the global type. Zero is set to the global type. Error xxx/NGT-main/lib/NGT/NGTQ/Optimizer.cpp:optimize:251: optimize: No objects" I still think it is because of the location of data files. Then how may I revise it? By the way, if I wanna revise the file "qg-l2-float.cpp" or other header files, do I have to re-complie the whole project again? Thanks, and sorry for the disturbance.

MINGRUI001 commented 8 months ago

I fixed it.. The data directories shall be copied to the folder of "samples/qg-l2-float". Thx, and sorry for the disturbance!