norlab-ulaval / libnabo

A fast K Nearest Neighbor library for low-dimensional spaces
http://norlab-ulaval.github.io/libnabo/
BSD 3-Clause "New" or "Revised" License
440 stars 144 forks source link

cmake configuration error: compiling a test executable failed #67

Closed bishesh closed 6 years ago

bishesh commented 7 years ago

I'm trying to install from source in ubuntu 16.04 but configuring using cmake fails with the following error:

OpenCL disabled, not looking for it

 ANN not found, disabling it in benchmarks

 FLANN not found, disabling it in benchmarks

 CMake Error at tests/CMakeLists.txt:95 (message):
   Compiling a test executable failed.
 Call Stack (most recent call first):
   tests/CMakeLists.txt:104 (try_compile_cloud_types)

Attached are the cmakecache and log files (log file renamed since uploading .log is not supported). CMakeCache.txt

CMakeOutputlog.txt

SaiPrabhaMergu commented 7 years ago

I face the same issue, How did you solve this? , could you share the solution

HannesSommer commented 7 years ago

Which compiler are you using? It is tested with (mostly vanilla) 16.04. And I cannot reproduce myself neither with g++ 5.4 nor clang 3.8.

Could you please provide the output of cmake --trace ?

bishesh commented 7 years ago

@HannesSommer The output of cmake --trace is attached here. My g++ version: g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609. @SaiPrabhaMergu The problem is not solved yet.

cmakeTrace.txt

HannesSommer commented 7 years ago

Very strange. Given these versions I must assume the difference is somewhere else. Maybe in cmake? (could you please report cmake --version). Also, based on that idea could you please try out the PR #71 (branch fix/removeOutOfPlaceCommas), and report back if it fixes the issue?

bishesh commented 7 years ago

ccmake version 3.5.1 I also tried PR #71 removing commas, but I still get exactly the same error.

SaiPrabhaMergu commented 7 years ago

I am trying to build it on windows, using cmake. The error which I see is as follows:

CMake Error at tests/CMakeLists.txt:95 (message): Compiling a test executable failed. Call Stack (most recent call first): tests/CMakeLists.txt:104 (try_compile_cloud_types)

I have tried PR #71, but still it failed.

HannesSommer commented 7 years ago

Thanks for the feedback. This seems to be a tough one. As I cannot reproduce I need more help from you. Could you please try #72 and upload the output of cmake --trace 2>&1 (assuming bash syntax to merge the error stream into the standard output) ?

SaiPrabhaMergu commented 6 years ago

I am trying to build this code for Visual Studio 2015 x64. cmake-gui version :3.3 Eigen version:3.3.4 Boost version:1.65.1 grep version:2.5.4 I face another error now.

cmake warning Policy CMP0054 is not set:

Can I get your comment on this

HannesSommer commented 6 years ago

I have no experience with libnabo on Windows. Maybe others do?

In any case: you posted a warning (that should not be triggered through the changes in #72). Are you sure that it is your actual problem?

bishesh commented 6 years ago

Thanks @HannesSommer ! Trying #72 helped me figure out the problem. In the error output I could now see "Eigen/Core not found". The EIGEN_INCLUD_DIR path I was providing until now TOP-MOST-EIGEN-DIR/Eigen, but I now see that I should rather provide TOP-MOST-EIGEN-DIR. It should have issued proper error of not getting the expected path for Eigen! Anyway, thanks for your help. I have now successfully built the library.

HannesSommer commented 6 years ago

Awesome. This is great news! This issue helped improving the feedback of the CMake code!

SaiPrabhaMergu commented 6 years ago

I was able to build the library too, Following are the steps I followed 1) To escape error: "cmake warning Policy CMP0054 is not set:" add line "cmake_policy(SET CMP0054 OLD)" in CMakeLists.txt(I added in line 2) 2) I also had to remove the line "add_definitions(-Wall -Wextra)" line 44 in CMakeLists.txt, this was stopping the nabo.lib from forming. The above steps helped me solve the issues. So I thought I should share.

HannesSommer commented 6 years ago

Ah, great. Thanks for sharing. I'll incorporate these changes soon ( recent Cmake versions / for windows)

SaiPrabhaMergu commented 6 years ago

@HannesSommer sure, I will get back to you.