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

compiling on Windows 10 using Visual Studio 2015 fails... #77

Closed HollisJoe closed 6 years ago

HollisJoe commented 6 years ago

Hi, When I cmake appear this 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)

What should I do? Thank you!

HannesSommer commented 6 years ago

@HollisJoe , could you please try again with the new master branch state. I've just merged #72, it should help us find your problem, because now it should additionally output the compiler error.

HollisJoe commented 6 years ago

Hi, I Try again with the new master branch, This appear the error: CMake Error at tests/CMakeLists.txt:95 (message): Compiling a test executable failed. This is an error. Message Change Dir: D:/com-InteriorModeling/buildProjects/ethz-asl/libnabo/build/tests/CMakeFiles/CMakeTmp

Run Build Command:"C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe" "cmTC_80308.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=14.0"

Microsoft (R) ���������汾 14.0.25420.1

��Ȩ����(C) Microsoft Corporation����������Ȩ����

��������ʱ��Ϊ 2017/10/16 15:52:09��

�ڵ� 1 �ϵ���Ŀ��D:\com-InteriorModeling\buildProjects\ethz-asl\libnabo\build\tests\CMakeFiles\CMakeTmp\cmTC_80308.vcxproj��(Ĭ��Ŀ��)��

PrepareForBuild:

���ڴ���Ŀ¼��cmTC_80308.dir\Debug\����

���ڴ���Ŀ¼��D:\com-InteriorModeling\buildProjects\ethz-asl\libnabo\build\tests\CMakeFiles\CMakeTmp\Debug\����

���ڴ���Ŀ¼��cmTC_80308.dir\Debug\cmTC_80308.tlog\����

InitializeBuildStatus:

���ڴ�����cmTC_80308.dir\Debug\cmTC_80308.tlog\unsuccessfulbuild������Ϊ��ָ����AlwaysCreate����

ClCompile:

D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /I"D:/com-InteriorModeling/buildProjects/ethz-asl/libnabo/tests/../" /I"D:/com-InteriorModeling/buildProjects/ethz-asl/libnabo/tests/../third_party/" /ID:/Environment/PCL /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D "NABO_EIGEN_DYNAMIC_TYPE," /D "NABO_TYPE_CREATE," /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /openmp /Fo"cmTC_80308.dir\Debug\\" /Fd"cmTC_80308.dir\Debug\vc140.pdb" /Gd /TP /errorReport:queue  1.8.0_64_VS15/3rdParty/Eigen/eigen3 -lnabo "D:\com-InteriorModeling\buildProjects\ethz-asl\libnabo\tests\invalid_matrix_types.cpp"

���� x64 �� Microsoft (R) C/C++ �Ż������� 19.00.24215.1 ��

��Ȩ����(C) Microsoft Corporation����������Ȩ����

cl /c /I"D:/com-InteriorModeling/buildProjects/ethz-asl/libnabo/tests/../" /I"D:/com-InteriorModeling/buildProjects/ethz-asl/libnabo/tests/../third_party/" /ID:/Environment/PCL /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D "NABO_EIGEN_DYNAMIC_TYPE," /D "NABO_TYPE_CREATE," /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /openmp /Fo"cmTC_80308.dir\Debug\\" /Fd"cmTC_80308.dir\Debug\vc140.pdb" /Gd /TP /errorReport:queue  1.8.0_64_VS15/3rdParty/Eigen/eigen3 -lnabo "D:\com-InteriorModeling\buildProjects\ethz-asl\libnabo\tests\invalid_matrix_types.cpp"

cl : ������ warning D9002: ����δ֪ѡ�-lnabo�� [D:\com-InteriorModeling\buildProjects\ethz-asl\libnabo\build\tests\CMakeFiles\CMakeTmp\cmTC_80308.vcxproj]

eigen3

c1xx : fatal error C1083: �޷�����Դ�ļ�: ��1.8.0_64_VS15/3rdParty/Eigen/eigen3��: No such file or directory [D:\com-InteriorModeling\buildProjects\ethz-asl\libnabo\build\tests\CMakeFiles\CMakeTmp\cmTC_80308.vcxproj]

invalid_matrix_types.cpp

D:\com-InteriorModeling\buildProjects\ethz-asl\libnabo\nabo/nabo.h(35): fatal error C1083: �޷��򿪰����ļ�: ��Eigen/Core��: No such file or directory [D:\com-InteriorModeling\buildProjects\ethz-asl\libnabo\build\tests\CMakeFiles\CMakeTmp\cmTC_80308.vcxproj]

�������ɴ���...

������������Ŀ��D:\com-InteriorModeling\buildProjects\ethz-asl\libnabo\build\tests\CMakeFiles\CMakeTmp\cmTC_80308.vcxproj��(Ĭ��Ŀ��)�IJ���

HannesSommer commented 6 years ago

As you can see now, the compiler is not finding Eigen. I suspect the path 1.8.0_64_VS15/3rdParty/Eigen/eigen3 is not the right relative path for where the compiler is executed from. Please try an absolute path for EIGEN_INCLUDE_DIR. It should point to the folder containing Eigen . Maybe there is an issue with spaces in the path to Eigen involved here. If currently the absolute path contains spaces please try moving it to a path without space and if that helps report back to us - then we know about that limitation and can either fix it or document it.

HollisJoe commented 6 years ago

Yes, There is no mistake when I remove the spaces, But It still have a problem: D:\com-InteriorModeling\buildProjects\ethz-asl\libnabo\tests\invalid_matrix_types.cpp(72): error C2065: ��value��: δ�����ı�ʶ�� [D:\com-InteriorModeling\buildProjects\ethz-asl\libnabo\build\tests\CMakeFiles\CMakeTmp\cmTC_5685b.vcxproj]

  2 ������

  1 ������

����ʱ�� 00:00:00.75

HannesSommer commented 6 years ago

Thanks for reporting back on the spaces issue.

The remaining issue is difficult. It seems for some reasons the macro definitions are not handed over to the compiler. Does this error come when you run cmake or when you try to compile the project?

In the latter case: please exclude the invalid_matrix_types.cpp from compilation. It should not be compiled into the library. It is only there to be test-compiled from within cmake.

HannesSommer commented 6 years ago

Is this solved?

HollisJoe commented 6 years ago

Solved it, Thank you!