abhineet123 / MTF

Modular Tracking Framework
http://webdocs.cs.ualberta.ca/~vis/mtf/
BSD 3-Clause "New" or "Revised" License
100 stars 23 forks source link

Compilation with OpenCV 3.2/Ubuntu 16.10 - undefined reference to `LZ4... #3

Closed kneczaj closed 7 years ago

kneczaj commented 7 years ago

This is another variant of cmake configuration - the default one - which includes FLANN and THIRD_PARTY.

I found, I can get rid of it by disabling FLANN.

The make output:

kamil@kamil-VirtualBox ~/dev/MTF/build $ make Makefile:591: warning: overriding recipe for target 'all' Makefile:127: warning: ignoring old recipe for target 'all' -- Boost version: 1.61.0 -- Found the following Boost libraries: -- random -- filesystem -- system -- Getting Eigen headers from: /usr/include/eigen3 -- Getting OpenCV headers from: /usr/local/include;/usr/local/include/opencv -- Using OpenCV libraries: opencv_calib3d;opencv_core;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab;opencv_aruco;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_datasets;opencv_dnn;opencv_dpm;opencv_face;opencv_freetype;opencv_fuzzy;opencv_line_descriptor;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_reg;opencv_rgbd;opencv_saliency;opencv_stereo;opencv_structured_light;opencv_surface_matching;opencv_text;opencv_tracking;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto -- Getting Boost headers from: /usr/include -- Getting Boost libraries from: /usr/lib/x86_64-linux-gnu -- Using Boost libraries: /usr/lib/x86_64-linux-gnu/libboost_random.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_system.so -- DFT disabled -- PFSL3 disabled -- Getting ViSP headers from: /usr/local/include;/usr/local/include;/usr/local/include/opencv;/usr/include/libxml2;/usr/include -- Using ViSP libraries: visp_vs;visp_visual_features;visp_vision;visp_tt_mi;visp_tt;visp_me;visp_mbt;visp_klt;visp_blob;visp_sensor;visp_robot;visp_io;visp_gui;visp_detection;visp_core;visp_ar -- GOTURN disabled -- Xvision disabled -- Enabled third party trackers: DSST/src/DSST;KCF/src/KCF;CMT/src/CMT;RCT/src/RCT;TLD/src/TLD;Struck/src/Struck;MIL/src/MIL;FRG/src/FRG;ViSP/src/ViSP -- DFM disabled -- OpenCV nonfree module not found so disabling the feature based grid tracker CMake Warning (dev) at SM/SM.cmake:32 (set): Cannot set "FEAT_ENABLED": current scope has no parent. Call Stack (most recent call first): CMakeLists.txt:98 (include) This warning is for project developers. Use -Wno-dev to suppress it.

-- RegNet disabled -- FLANN_ROOT: -- FLANN found (include: /usr/include, lib: optimized;/usr/lib/x86_64-linux-gnu/libflann_cpp.so;debug;/usr/lib/x86_64-linux-gnu/libflann_cpp.so) -- Found HDF5 headers at: /usr/include/hdf5/serial -- Found HDF5 C++ libraries: /usr/lib/x86_64-linux-gnu/hdf5/serial/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so -- PYTHON_INCLUDE_DIRS: /usr/include/python2.7 -- PYTHON_LIBRARIES: /usr/lib/x86_64-linux-gnu/libpython2.7.so -- Could NOT find Matlab (missing: Matlab_INCLUDE_DIRS Matlab_MEX_LIBRARY Matlab_MEX_EXTENSION Matlab_ROOT_DIR MEX_COMPILER MX_LIBRARY) -- Matlab not found so mexMTF is disabled If Matlab is installed but not detected, mexMTF can be compiled by running the command in 'mtf_mex_cmd.txt' at the MATLAB prompt after:

  • removing all semi colons
  • replacing all occurences of the type '-l' with ''
  • replacing all occurences of the type '-l-L' with '-L' -- MTF_COMPILETIME_FLAGS: -std=c++11 -- MTF_RUNTIME_FLAGS: -Wfatal-errors;-Wno-write-strings;-Wno-unused-result;-Wformat=0;-std=c++11;-O3;-msse2 -- MTF_DEFINITIIIONS: NDEBUG;EIGEN_NO_DEBUG;DISABLE_DFT;DISABLE_PFSL3;DISABLE_GOTURN;DISABLE_XVISION;DISABLE_DFM;DISABLE_GRID_FEAT;DISABLE_REGNET;DISABLE_SPI -- CMAKE_CXX_FLAGS: -fopenmp -- CMAKE_C_FLAGS: -- Configuring done -- Generating done -- Build files have been written to: /home/kamil/dev/MTF/build Built target frg Built target cmt Built target cvblobs Scanning dependencies of target opentld Building CXX object ThirdParty/TLD/CMakeFiles/opentld.dir/src/mftracker/BBPredict.cpp.o Linking CXX shared library libopentld.so Built target opentld Built target struck Scanning dependencies of target mil Building CXX object ThirdParty/MIL/CMakeFiles/mil.dir/src/cv_onlineboosting.cpp.o Linking CXX shared library libmil.so Built target mil Scanning dependencies of target mtf_test Building CXX object CMakeFiles/mtf_test.dir/Test/src/Diagnostics.cc.o Linking CXX shared library libmtf_test.so Built target mtf_test [ 2%] Built target frg [ 5%] Built target cmt [ 9%] Built target cvblobs [ 17%] Built target opentld [ 23%] Built target struck [ 25%] Built target mil [ 25%] Linking CXX shared library libmtf.so [ 89%] Built target mtf Scanning dependencies of target pyMTF [ 90%] Building CXX object CMakeFiles/pyMTF.dir/Examples/cpp/pyMTF.cc.o In file included from /usr/include/python2.7/numpy/ndarraytypes.h:1777:0, from /usr/include/python2.7/numpy/ndarrayobject.h:18, from /usr/include/python2.7/numpy/arrayobject.h:4, from /home/kamil/dev/MTF/Examples/cpp/pyMTF.cc:22: /usr/include/python2.7/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

    warning "Using deprecated NumPy API, disable it by " \

    ^~~ [ 90%] Linking CXX shared module pyMTF.so [ 90%] Built target pyMTF [ 91%] Built target mtf_test Scanning dependencies of target testMTF [ 92%] Building CXX object CMakeFiles/testMTF.dir/Examples/cpp/testMTF.cc.o [ 92%] Linking CXX executable testMTF libmtf.so: undefined reference to LZ4_decompress_safe' libmtf.so: undefined reference toLZ4_decompress_safe_continue' libmtf.so: undefined reference to LZ4_resetStreamHC' libmtf.so: undefined reference toLZ4_setStreamDecode' libmtf.so: undefined reference to `LZ4_compress_HC_continue' collect2: error: ld returned 1 exit status CMakeFiles/testMTF.dir/build.make:224: recipe for target 'testMTF' failed make[3]: [testMTF] Error 1 CMakeFiles/Makefile2:353: recipe for target 'CMakeFiles/testMTF.dir/all' failed make[2]: [CMakeFiles/testMTF.dir/all] Error 2 CMakeFiles/Makefile2:289: recipe for target 'CMakeFiles/all.dir/rule' failed make[1]: [CMakeFiles/all.dir/rule] Error 2 Makefile:591: recipe for target 'all' failed make: [all] Error 2 kamil@kamil-VirtualBox ~/dev/MTF/build $

kneczaj commented 7 years ago

I am using this libflann from ubuntu repo: libflann1.9:amd64 1.9.1+dfsg-2 amd64

abhineet123 commented 7 years ago

This seems to have something to do with FLANN itself. I have never encountered it so it probably also has something to do with Ubuntu 16.10. It seems that one solution is to add the -lz4 switch to the linker command. Ideally, the FLANN cmake module should return this as one of the libraries to link to but it appears to not have been updated to keep up with the new OS.

abhineet123 commented 7 years ago

I think that this issue will be resolved if you compile FLANN from source. It is likely that the version in the Ubuntu repo was not updated with the new linker requirement.

kneczaj commented 7 years ago

I saw this solution, but I totally don't know where to put the switch. I'll try with the flann from source.

abhineet123 commented 7 years ago

It is actually very difficult to modify cmake linker commands. I would have to make changes in the FindFLANN.cmake file itself but, as this issue does not occur in all configurations, such a change might well break the cmake system, or at least introduce an unwanted dependency, with other configurations.

kneczaj commented 7 years ago

So FLANN is built from sources, and the problem persists. FLANN logs below:

kamil@kamil-VirtualBox ~/dev/flann/build $ cmake .. -- The C compiler identification is GNU 6.2.0 -- The CXX compiler identification is GNU 6.2.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonInterp: /usr/bin/python (found version "2.7.12") -- Found HDF5: /usr/lib/x86_64-linux-gnu/hdf5/serial/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.8.16") -- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) CMake Warning at CMakeLists.txt:117 (message): gtest library not found, some tests will not be run -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Found OpenMP: -fopenmp
CMake Warning (dev) at src/matlab/CMakeLists.txt:19 (get_property): Policy CMP0026 is not set: Disallow use of the LOCATION target property. Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The LOCATION property should not be read from target "flann_s". Use the target name directly with add_custom_command, or use the generator expression $, as appropriate. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning at src/matlab/CMakeLists.txt:87 (message): Cannot find MATLAB or Octave instalation. Make sure that the 'bin' directory from the MATLAB instalation or that mkoctfile is in PATH CMake Warning (dev) at test/CMakeLists.txt:4 (add_custom_target): Policy CMP0037 is not set: Target names should not be reserved and should match a validity pattern. Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The target name "test" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. This warning is for project developers. Use -Wno-dev to suppress it. -- Could NOT find LATEX (missing: LATEX_COMPILER) -- Install prefix: /usr/local -- Build type: RelWithDebInfo -- Building C bindings: ON -- Building examples: ON -- Building tests: ON -- Building documentation: ON -- Building python bindings: ON -- Building matlab bindings: ON -- Building CUDA library: OFF -- Using OpenMP support: ON -- Using MPI support: OFF -- Configuring done -- Generating done -- Build files have been written to: /home/kamil/dev/flann/build

kamil@kamil-VirtualBox~/dev/flann/build $ make Scanning dependencies of target flann_s [ 7%] Building CXX object src/cpp/CMakeFiles/flann_s.dir/flann/flann.cpp.o In file included from /home/kamil/dev/flann/src/cpp/flann/util/params.h:33:0, from /home/kamil/dev/flann/src/cpp/flann/flann.hpp:42, from /home/kamil/dev/flann/src/cpp/flann/flann.h:603, from /home/kamil/dev/flann/src/cpp/flann/flann.cpp:31: /home/kamil/dev/flann/src/cpp/flann/util/any.h: In member function ‘virtual void flann::anyimpl::big_any_policy::static_delete(void)’: /home/kamil/dev/flann/src/cpp/flann/util/any.h:81:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if ( x) delete ( reinterpret_cast<T>(x)); x = NULL; ^~ /home/kamil/dev/flann/src/cpp/flann/util/any.h:81:55: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ if ( x) delete (* reinterpret_cast<T>(x)); *x = NULL; ^ [ 14%] Building C object src/cpp/CMakeFiles/flann_s.dir/flann/ext/lz4.c.o [ 21%] Building C object src/cpp/CMakeFiles/flann_s.dir/flann/ext/lz4hc.c.o [ 28%] Linking CXX static library ../../lib/libflann_s.a [ 28%] Built target flann_s Scanning dependencies of target flann [ 35%] Linking CXX shared library ../../lib/libflann.so [ 35%] Built target flann Scanning dependencies of target flann_cpp_s [ 42%] Building CXX object src/cpp/CMakeFiles/flann_cpp_s.dir/flann/flann_cpp.cpp.o In file included from /home/kamil/dev/flann/src/cpp/flann/util/params.h:33:0, from /home/kamil/dev/flann/src/cpp/flann/flann.hpp:42, from /home/kamil/dev/flann/src/cpp/flann/flann_cpp.cpp:30: /home/kamil/dev/flann/src/cpp/flann/util/any.h: In member function ‘virtual void flann::anyimpl::big_any_policy::static_delete(void)’: /home/kamil/dev/flann/src/cpp/flann/util/any.h:81:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if ( x) delete ( reinterpret_cast<T>(x)); x = NULL; ^~ /home/kamil/dev/flann/src/cpp/flann/util/any.h:81:55: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ if ( x) delete (* reinterpret_cast<T>(x)); *x = NULL; ^ [ 50%] Building C object src/cpp/CMakeFiles/flann_cpp_s.dir/flann/ext/lz4.c.o [ 57%] Building C object src/cpp/CMakeFiles/flann_cpp_s.dir/flann/ext/lz4hc.c.o [ 64%] Linking CXX static library ../../lib/libflann_cpp_s.a [ 64%] Built target flann_cpp_s Scanning dependencies of target flann_cpp [ 71%] Linking CXX shared library ../../lib/libflann_cpp.so [ 71%] Built target flann_cpp Scanning dependencies of target flann_example_cpp [ 78%] Building CXX object examples/CMakeFiles/flann_example_cpp.dir/flann_example.cpp.o In file included from /home/kamil/dev/flann/src/cpp/flann/util/params.h:33:0, from /home/kamil/dev/flann/src/cpp/flann/flann.hpp:42, from /home/kamil/dev/flann/examples/flann_example.cpp:2: /home/kamil/dev/flann/src/cpp/flann/util/any.h: In member function ‘virtual void flann::anyimpl::big_any_policy::static_delete(void)’: /home/kamil/dev/flann/src/cpp/flann/util/any.h:81:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if ( x) delete ( reinterpret_cast<T>(x)); x = NULL; ^~ /home/kamil/dev/flann/src/cpp/flann/util/any.h:81:55: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ if ( x) delete (* reinterpret_cast<T*>(x)); x = NULL; ^ [ 85%] Linking CXX executable ../bin/flann_example_cpp [ 85%] Built target flann_example_cpp Scanning dependencies of target flann_example_c [ 92%] Building C object examples/CMakeFiles/flann_example_c.dir/flann_example.c.o /home/kamil/dev/flann/examples/flann_example.c: In function ‘read_points’: /home/kamil/dev/flann/examples/flann_example.c:31:13: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result] fscanf(fin,"%g ",p); ^~~~~~~ [100%] Linking CXX executable ../bin/flann_example_c [100%] Built target flann_example_c Scanning dependencies of target examples [100%] Built target examples

kamil@kamil-VirtualBox ~/dev/flann/build $ sudo make install [sudo] password for kamil: [ 28%] Built target flann_s [ 35%] Built target flann [ 64%] Built target flann_cpp_s [ 71%] Built target flann_cpp [ 85%] Built target flann_example_cpp [100%] Built target flann_example_c [100%] Built target examples Install the project... -- Install configuration: "RelWithDebInfo" -- Installing: /usr/local/lib/pkgconfig/flann.pc -- Installing: /usr/local/lib/libflann_cpp.so.1.9.1 -- Installing: /usr/local/lib/libflann_cpp.so.1.9 -- Installing: /usr/local/lib/libflann_cpp.so -- Installing: /usr/local/lib/libflann_cpp_s.a -- Installing: /usr/local/lib/libflann.so.1.9.1 -- Installing: /usr/local/lib/libflann.so.1.9 -- Installing: /usr/local/lib/libflann.so -- Installing: /usr/local/lib/libflann_s.a -- Installing: /usr/local/include/flann -- Installing: /usr/local/include/flann/general.h -- Installing: /usr/local/include/flann/flann.hpp -- Installing: /usr/local/include/flann/algorithms -- Installing: /usr/local/include/flann/algorithms/kdtree_cuda_3d_index.h -- Installing: /usr/local/include/flann/algorithms/dist.h -- Installing: /usr/local/include/flann/algorithms/nn_index.h -- Installing: /usr/local/include/flann/algorithms/center_chooser.h -- Installing: /usr/local/include/flann/algorithms/hierarchical_clustering_index.h -- Installing: /usr/local/include/flann/algorithms/composite_index.h -- Installing: /usr/local/include/flann/algorithms/kdtree_cuda_builder.h -- Installing: /usr/local/include/flann/algorithms/lsh_index.h -- Installing: /usr/local/include/flann/algorithms/autotuned_index.h -- Installing: /usr/local/include/flann/algorithms/all_indices.h -- Installing: /usr/local/include/flann/algorithms/kmeans_index.h -- Installing: /usr/local/include/flann/algorithms/linear_index.h -- Installing: /usr/local/include/flann/algorithms/kdtree_single_index.h -- Installing: /usr/local/include/flann/algorithms/kdtree_index.h -- Installing: /usr/local/include/flann/config.h -- Installing: /usr/local/include/flann/mpi -- Installing: /usr/local/include/flann/mpi/queries.h -- Installing: /usr/local/include/flann/mpi/server.h -- Installing: /usr/local/include/flann/mpi/index.h -- Installing: /usr/local/include/flann/mpi/client.h -- Installing: /usr/local/include/flann/mpi/matrix.h -- Installing: /usr/local/include/flann/ext -- Installing: /usr/local/include/flann/ext/lz4hc.h -- Installing: /usr/local/include/flann/ext/lz4.h -- Installing: /usr/local/include/flann/defines.h -- Installing: /usr/local/include/flann/io -- Installing: /usr/local/include/flann/io/hdf5.h -- Installing: /usr/local/include/flann/flann.h -- Installing: /usr/local/include/flann/nn -- Installing: /usr/local/include/flann/nn/index_testing.h -- Installing: /usr/local/include/flann/nn/ground_truth.h -- Installing: /usr/local/include/flann/nn/simplex_downhill.h -- Installing: /usr/local/include/flann/util -- Installing: /usr/local/include/flann/util/allocator.h -- Installing: /usr/local/include/flann/util/sampling.h -- Installing: /usr/local/include/flann/util/heap.h -- Installing: /usr/local/include/flann/util/object_factory.h -- Installing: /usr/local/include/flann/util/serialization.h -- Installing: /usr/local/include/flann/util/cutil_math.h -- Installing: /usr/local/include/flann/util/timer.h -- Installing: /usr/local/include/flann/util/dynamic_bitset.h -- Installing: /usr/local/include/flann/util/params.h -- Installing: /usr/local/include/flann/util/logger.h -- Installing: /usr/local/include/flann/util/cuda -- Installing: /usr/local/include/flann/util/cuda/heap.h -- Installing: /usr/local/include/flann/util/cuda/result_set.h -- Installing: /usr/local/include/flann/util/random.h -- Installing: /usr/local/include/flann/util/lsh_table.h -- Installing: /usr/local/include/flann/util/saving.h -- Installing: /usr/local/include/flann/util/result_set.h -- Installing: /usr/local/include/flann/util/any.h -- Installing: /usr/local/include/flann/util/matrix.h -- Installing: /usr/local/share/flann/python/pyflann -- Installing: /usr/local/share/flann/python/pyflann/init.py -- Installing: /usr/local/share/flann/python/pyflann/exceptions.py -- Installing: /usr/local/share/flann/python/pyflann/index.py -- Installing: /usr/local/share/flann/python/pyflann/flann_ctypes.py -- Installing: /usr/local/share/flann/python/setup.py running install running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/pyflann copying pyflann/init.py -> build/lib.linux-x86_64-2.7/pyflann copying pyflann/exceptions.py -> build/lib.linux-x86_64-2.7/pyflann copying pyflann/index.py -> build/lib.linux-x86_64-2.7/pyflann copying pyflann/flann_ctypes.py -> build/lib.linux-x86_64-2.7/pyflann package init file '/home/kamil/dev/flann/build/lib/init.py' not found (or not a regular file) creating build/lib.linux-x86_64-2.7/pyflann/lib copying /home/kamil/dev/flann/build/lib/libflann.so -> build/lib.linux-x86_64-2.7/pyflann/lib package init file '/home/kamil/dev/flann/build/lib/init.py' not found (or not a regular file) running install_lib creating /usr/local/lib/python2.7/dist-packages/pyflann copying build/lib.linux-x86_64-2.7/pyflann/init.py -> /usr/local/lib/python2.7/dist-packages/pyflann copying build/lib.linux-x86_64-2.7/pyflann/exceptions.py -> /usr/local/lib/python2.7/dist-packages/pyflann copying build/lib.linux-x86_64-2.7/pyflann/index.py -> /usr/local/lib/python2.7/dist-packages/pyflann copying build/lib.linux-x86_64-2.7/pyflann/flann_ctypes.py -> /usr/local/lib/python2.7/dist-packages/pyflann creating /usr/local/lib/python2.7/dist-packages/pyflann/lib copying build/lib.linux-x86_64-2.7/pyflann/lib/libflann.so -> /usr/local/lib/python2.7/dist-packages/pyflann/lib byte-compiling /usr/local/lib/python2.7/dist-packages/pyflann/init.py to init.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/pyflann/exceptions.py to exceptions.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/pyflann/index.py to index.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/pyflann/flann_ctypes.py to flann_ctypes.pyc running install_egg_info Writing /usr/local/lib/python2.7/dist-packages/flann-1.9.1.egg-info -- Installing: /usr/local/bin/flann_example_c -- Set runtime path of "/usr/local/bin/flann_example_c" to "" -- Installing: /usr/local/bin/flann_example_cpp -- Set runtime path of "/usr/local/bin/flann_example_cpp" to ""

kneczaj commented 7 years ago

Looks like there is some lz4 inside, at least headers exist. This is the newest veriosn of FLANN. Which version of FLANN you used it with? Maybe I should downgrade.

abhineet123 commented 7 years ago

I used 1.8.4 which is the latest version available on its website. Where did you get 1.9.1 ? Maybe I can try using FindFLANN.cmake that comes with it (if any) to solve this.

kneczaj commented 7 years ago

https://github.com/mariusmuja/flann but ubuntu had exactly the same binary package

kneczaj commented 7 years ago

and the link to this github is at this page http://www.cs.ubc.ca/research/flann/#download

abhineet123 commented 7 years ago

Can you try using 1.8.4 instead and let me know if this issue persists ? I don't want to replace the FindFLANNfile because I remember struggling to make the existing one work in Windows.

kneczaj commented 7 years ago

ok

kneczaj commented 7 years ago

Do you know how should I solve such errors:

/home/kamil/dev/flann/src/cpp/flann/algorithms/kdtree_index.h:666:39: error: call of overloaded ‘abs(flann::KDTreeIndex<flann::L2 >::ElementType)’ is ambiguous ElementType span = abs(point[i]-leaf_point[i]);

I had similar with MTF and I changed abs to fabs ;) but maybe there's shorter way. I have seen it is probably a problem with including abs from C with stdlib instead the one from cmath

abhineet123 commented 7 years ago

You could also use std::abs to resolve the ambiguity. Where did the problem occur in MTF ?

kneczaj commented 7 years ago

I'll make another issue for this

kneczaj commented 7 years ago

This time I have compiled with -DWITH_TEMPLATED=OFF, what you suggested before to save time.

That's the effect with FLANN 1.8.4

Scanning dependencies of target testMTF [ 93%] Building CXX object CMakeFiles/testMTF.dir/Examples/cpp/testMTF.cc.o [ 93%] Linking CXX executable testMTF libmtf.so: undefined reference to mtf::gnn::GNN<mtf::AMDist>::buildGraph(double const*)' libmtf.so: undefined reference tomtf::gnn::GNN::loadGraph(char const)' libmtf.so: undefined reference to `mtf::gnn::GNN::saveGraph(char const)' libmtf.so: undefined reference to mtf::gnn::GNNParams::GNNParams(mtf::gnn::GNNParams const*)' libmtf.so: undefined reference tomtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::SADDist>::buildGraph(double const*)' libmtf.so: undefined reference tomtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::loadGraph(char const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::AMDist>::searchGraph(double const*, double const*, int*, double*, int)' libmtf.so: undefined reference tomtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::loadGraph(char const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::NCCDist>::GNN(std::shared_ptr<mtf::NCCDist const>, int, int, bool, mtf::gnn::GNNParams const*)' libmtf.so: undefined reference tomtf::gnn::GNN::GNN(std::shared_ptr, int, int, bool, mtf::gnn::GNNParams const)' libmtf.so: undefined reference to `mtf::gnn::GNN::GNN(std::shared_ptr, int, int, bool, mtf::gnn::GNNParams const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::LSCVDist>::saveGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::loadGraph(char const)' libmtf.so: undefined reference to `mtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::LKLDDist>::buildGraph(double const*)' libmtf.so: undefined reference tomtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::SADDist>::saveGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::loadGraph(char const)' libmtf.so: undefined reference to `mtf::gnn::GNN::GNN(std::shared_ptr, int, int, bool, mtf::gnn::GNNParams const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::NGFDist>::buildGraph(double const*)' libmtf.so: undefined reference tomtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::SSDDist>::saveGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::buildGraph(double const)' libmtf.so: undefined reference to `mtf::gnn::GNN::saveGraph(char const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::SSDBaseDist>::buildGraph(double const*)' libmtf.so: undefined reference tomtf::gnn::GNN::buildGraph(double const)' libmtf.so: undefined reference to `mtf::gnn::GNN::GNN(std::shared_ptr, int, int, bool, mtf::gnn::GNNParams const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::MIDist>::GNN(std::shared_ptr<mtf::MIDist const>, int, int, bool, mtf::gnn::GNNParams const*)' libmtf.so: undefined reference tomtf::gnn::GNN::loadGraph(char const)' libmtf.so: undefined reference to `mtf::gnn::GNN::GNN(std::shared_ptr, int, int, bool, mtf::gnn::GNNParams const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::RIUDist>::GNN(std::shared_ptr<mtf::RIUDist const>, int, int, bool, mtf::gnn::GNNParams const*)' libmtf.so: undefined reference tomtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::NCCDist>::loadGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::NCCDist>::saveGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::NGFDist>::loadGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::buildGraph(double const)' libmtf.so: undefined reference to `mtf::gnn::GNN::saveGraph(char const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::LKLDDist>::loadGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::loadGraph(char const)' libmtf.so: undefined reference to `mtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::LKLDDist>::addNode(mtf::gnn::Node*, int)' libmtf.so: undefined reference tomtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::SPSSDist>::loadGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::buildGraph(double const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::MIDist>::searchGraph(double const*, double const*, int*, double*, int)' libmtf.so: undefined reference tomtf::gnn::GNN::saveGraph(char const)' libmtf.so: undefined reference to `mtf::gnn::GNN::saveGraph(char const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::RSCVDist>::loadGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::saveGraph(char const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::KLDDist>::buildGraph(double const*)' libmtf.so: undefined reference tomtf::gnn::GNN::GNN(std::shared_ptr, int, int, bool, mtf::gnn::GNNParams const)' libmtf.so: undefined reference to `mtf::gnn::GNN::buildGraph(double const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::SSIMDist>::searchGraph(double const*, double const*, int*, double*, int)' libmtf.so: undefined reference tomtf::gnn::GNN::GNN(std::shared_ptr, int, int, bool, mtf::gnn::GNNParams const)' libmtf.so: undefined reference to `mtf::gnn::GNN::GNN(std::shared_ptr, int, int, bool, mtf::gnn::GNNParams const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::LSCVDist>::buildGraph(double const*)' libmtf.so: undefined reference tomtf::gnn::GNN::saveGraph(char const)' libmtf.so: undefined reference to `mtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::GNN(std::shared_ptr, int, int, bool, mtf::gnn::GNNParams const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::SPSSDist>::searchGraph(double const*, double const*, int*, double*, int)' libmtf.so: undefined reference tomtf::gnn::GNN::saveGraph(char const)' libmtf.so: undefined reference to `mtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::RIUDist>::loadGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::GNN(std::shared_ptr, int, int, bool, mtf::gnn::GNNParams const)' libmtf.so: undefined reference to `mtf::gnn::GNN::buildGraph(double const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::KLDDist>::GNN(std::shared_ptr<mtf::KLDDist const>, int, int, bool, mtf::gnn::GNNParams const*)' libmtf.so: undefined reference tomtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::saveGraph(char const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::LKLDDist>::GNN(std::shared_ptr<mtf::LKLDDist const>, int, int, bool, mtf::gnn::GNNParams const*)' libmtf.so: undefined reference tomtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::SSDDist>::buildGraph(double const*)' libmtf.so: undefined reference tomtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::SSDBaseDist>::loadGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::buildGraph(double const)' libmtf.so: undefined reference to `mtf::gnn::GNN::addNode(mtf::gnn::Node, int)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::RIUDist>::saveGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::buildGraph(double const)' libmtf.so: undefined reference to `mtf::gnn::GNN::loadGraph(char const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::RSCVDist>::saveGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::saveGraph(char const)' libmtf.so: undefined reference to `mtf::gnn::GNN::searchGraph(double const, double const, int, double, int)' libmtf.so: undefined reference to `mtf::gnn::GNN::GNN(std::shared_ptr, int, int, bool, mtf::gnn::GNNParams const)' libmtf.so: undefined reference to mtf::gnn::GNN<mtf::SCVDist>::loadGraph(char const*)' libmtf.so: undefined reference tomtf::gnn::GNN::addNode(mtf::gnn::Node*, int)' collect2: error: ld returned 1 exit status CMakeFiles/testMTF.dir/build.make:224: recipe for target 'testMTF' failed make[3]: [testMTF] Error 1 CMakeFiles/Makefile2:353: recipe for target 'CMakeFiles/testMTF.dir/all' failed make[2]: [CMakeFiles/testMTF.dir/all] Error 2 CMakeFiles/Makefile2:289: recipe for target 'CMakeFiles/all.dir/rule' failed make[1]: [CMakeFiles/all.dir/rule] Error 2 Makefile:240: recipe for target 'all' failed make: [all] Error 2

abhineet123 commented 7 years ago

Are you sure you are using the latest code ? This is one of the issues I fixed today.

kneczaj commented 7 years ago

Sorry, I fetched yesterday, and didn't look in the meantime

abhineet123 commented 7 years ago

I examined the code again and this does seem to be a bug - you have come across a rare configuration where FLANN is enabled but templated SMs are disabled. I will fix it in a few minutes so please wait before trying again.

kneczaj commented 7 years ago

Ok, this output is actual with the newest code

abhineet123 commented 7 years ago

I have fixed this issue. Please try the latest code and let me know if there are any issues.

kneczaj commented 7 years ago

This one works (with FLANN 1.8.4), although I encountered another one https://github.com/abhineet123/MTF/issues/9