Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build with cmake 3.11.0 #369

Open
heirecka opened this issue Apr 3, 2018 · 18 comments
Open

Fails to build with cmake 3.11.0 #369

heirecka opened this issue Apr 3, 2018 · 18 comments

Comments

@heirecka
Copy link

heirecka commented Apr 3, 2018

It errors out with that version because of 'add_library(flann_cpp SHARED "")'.

Possibly relevant from the changelog: "“add_library()” and “add_executable()” commands can now be called without any sources and will not complain as long as sources are
added later via the “target_sources()” command." (https://blog.kitware.com/cmake-3-11-0-available-for-download/)

cmake -DCMAKE_COLOR_MAKEFILE:BOOL=TRUE -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=None -DCMAKE_C_FLAGS:STRING=-pipe -O2 -march=native -DCMAKE_CXX_FLAGS:STRING=-pipe -O2 -march=native -DCMAKE_AR:PATH=x86_64-pc-linux-gnu-ar -DCMAKE_RANLIB:PATH=x86_64-pc-linux-gnu-ranlib -DCMAKE_NM:PATH=x86_64-pc-linux-gnu-nm -DCMAKE_C_COMPILER:PATH=x86_64-pc-linux-gnu-cc -DCMAKE_CXX_COMPILER:PATH=x86_64-pc-linux-gnu-c++ -DCMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES:PATH=/usr/x86_64-pc-linux-gnu/include -DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES:PATH=/usr/x86_64-pc-linux-gnu/include -DCMAKE_INSTALL_PREFIX:PATH=/usr/x86_64-pc-linux-gnu -DCMAKE_FIND_ROOT_PATH=/usr/x86_64-pc-linux-gnu -DCMAKE_SYSTEM_PREFIX_PATH:PATH=/usr/x86_64-pc-linux-gnu -DCMAKE_INSTALL_LIBDIR:STRING=lib -DCMAKE_INSTALL_DATAROOTDIR:PATH=/usr/share/ -DBUILD_C_BINDINGS:BOOL=true -DBUILD_CUDA_LIB:BOOL=false -DBUILD_MATLAB_BINDINGS:BOOL=false -DBUILD_PYTHON_BINDINGS:BOOL=false -DDOCDIR=/usr/share/doc/flann-1.9.1 -DUSE_MPI:BOOL=false -DBUILD_DOC:BOOL=TRUE -DBUILD_EXAMPLES:BOOL=TRUE -DUSE_OPENMP:BOOL=FALSE -DBUILD_TESTS:BOOL=TRUE /var/tmp/paludis/build/sci-libs-flann-1.9.1/work/flann-1.9.1
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-cc
-- Check for working C compiler: /usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-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/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-c++
-- Check for working CXX compiler: /usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-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/x86_64-pc-linux-gnu/bin/python (found version "2.7.14") 
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Found HDF5: /usr/x86_64-pc-linux-gnu/lib/libhdf5.so;/usr/x86_64-pc-linux-gnu/lib/libz.so;/usr/x86_64-pc-linux-gnu/lib/libdl.so;/usr/x86_64-pc-linux-gnu/lib/libm.so (found version "1.10.1")  
-- Found GTest: /usr/x86_64-pc-linux-gnu/lib/libgtest.a  
-- Found LATEX: /usr/x86_64-pc-linux-gnu/bin/latex   
-- I could not find the latex2html command.
-- Install prefix: /usr/x86_64-pc-linux-gnu
-- Build type: None
-- Building C bindings: true
-- Building examples: TRUE
-- Building tests: TRUE
-- Building documentation: TRUE
-- Building python bindings: false
-- Building matlab bindings: false
-- Building CUDA library: false
-- Using OpenMP support: FALSE
-- Using MPI support: false
-- Configuring done
-- Build files have been written to: /var/tmp/paludis/build/sci-libs-flann-1.9.1/work/build
CMake Error at src/cpp/CMakeLists.txt:32 (add_library):
  No SOURCES given to target: flann_cpp


CMake Error at src/cpp/CMakeLists.txt:86 (add_library):
  No SOURCES given to target: flann
@heirecka
Copy link
Author

heirecka commented Apr 3, 2018

FWIW,
touch src/cpp/empty.cpp
sed -e "/add_library(flann_cpp SHARED/ s/""/empty.cpp/"
-e "/add_library(flann SHARED/ s/""/empty.cpp/"
-i src/cpp/CMakeLists.txt

makes it build successfully.But it feels too hackish to turn it into a pull request.

buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this issue Apr 27, 2018
CMake < 3.11 doesn't support add_library() without any source file
(i.e add_library(foo SHARED)). But flann CMake use a trick that use
an empty string "" as source list (i.e add_library(foo SHARED "")).
This look like a bug in CMake < 3.11.

With CMake >= 3.11, the new behaviour of add_library() break the
existing flann CMake code.

>From CMake Changelog [1]:
"add_library() and add_executable() commands can now be called without
 any sources and will not complain as long as sources are added later
 via the target_sources() command."

Note: flann CMake code doesn't use target_sources() since no source file
are provided intentionally since the flann shared library is created by
linking with the flann_cpp_s static library with this line:

target_link_libraries(flann_cpp -Wl,-whole-archive flann_cpp_s -Wl,-no-whole-archive)

If you try to use "add_library(flann_cpp SHARED ${CPP_SOURCES})" (as it should
be normally done), the link fail due to already defined symbol.

They are building the shared version using the static library "to speedup the
build time" [3]

This issue is already reported upstream [2] with a proposed solution.

Fixes:
http://autobuild.buildroot.net/results/b2f/b2febfaf8c44ce477b3e4a5b9b976fd25e8d7454

[1] https://cmake.org/cmake/help/v3.11/release/3.11.html
[2] flann-lib/flann#369
[3] flann-lib/flann@0fd62b4

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Davide Viti <zinosat@tiscali.it>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
@jakirkham
Copy link

What about a branch based on CMake version?

@huixiangufl
Copy link

I tried cmake 3.10, and it worked.

buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this issue May 1, 2018
CMake < 3.11 doesn't support add_library() without any source file
(i.e add_library(foo SHARED)). But flann CMake use a trick that use
an empty string "" as source list (i.e add_library(foo SHARED "")).
This look like a bug in CMake < 3.11.

With CMake >= 3.11, the new behaviour of add_library() break the
existing flann CMake code.

>From CMake Changelog [1]:
"add_library() and add_executable() commands can now be called without
 any sources and will not complain as long as sources are added later
 via the target_sources() command."

Note: flann CMake code doesn't use target_sources() since no source file
are provided intentionally since the flann shared library is created by
linking with the flann_cpp_s static library with this line:

target_link_libraries(flann_cpp -Wl,-whole-archive flann_cpp_s -Wl,-no-whole-archive)

If you try to use "add_library(flann_cpp SHARED ${CPP_SOURCES})" (as it should
be normally done), the link fail due to already defined symbol.

They are building the shared version using the static library "to speedup the
build time" [3]

This issue is already reported upstream [2] with a proposed solution.

Fixes:
http://autobuild.buildroot.net/results/b2f/b2febfaf8c44ce477b3e4a5b9b976fd25e8d7454

[1] https://cmake.org/cmake/help/v3.11/release/3.11.html
[2] flann-lib/flann#369
[3] flann-lib/flann@0fd62b4

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Davide Viti <zinosat@tiscali.it>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit 0c46947)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
ananos pushed a commit to ananos/buildroot that referenced this issue Jun 15, 2018
CMake < 3.11 doesn't support add_library() without any source file
(i.e add_library(foo SHARED)). But flann CMake use a trick that use
an empty string "" as source list (i.e add_library(foo SHARED "")).
This look like a bug in CMake < 3.11.

With CMake >= 3.11, the new behaviour of add_library() break the
existing flann CMake code.

>From CMake Changelog [1]:
"add_library() and add_executable() commands can now be called without
 any sources and will not complain as long as sources are added later
 via the target_sources() command."

Note: flann CMake code doesn't use target_sources() since no source file
are provided intentionally since the flann shared library is created by
linking with the flann_cpp_s static library with this line:

target_link_libraries(flann_cpp -Wl,-whole-archive flann_cpp_s -Wl,-no-whole-archive)

If you try to use "add_library(flann_cpp SHARED ${CPP_SOURCES})" (as it should
be normally done), the link fail due to already defined symbol.

They are building the shared version using the static library "to speedup the
build time" [3]

This issue is already reported upstream [2] with a proposed solution.

Fixes:
http://autobuild.buildroot.net/results/b2f/b2febfaf8c44ce477b3e4a5b9b976fd25e8d7454

[1] https://cmake.org/cmake/help/v3.11/release/3.11.html
[2] flann-lib/flann#369
[3] flann-lib/flann@0fd62b4

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Davide Viti <zinosat@tiscali.it>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
@archenroot
Copy link

I am on Gentoo with cmake 3.12.0 and it's failing...

@archenroot
Copy link

Its funny because there are some other packages failing with cmake <=3.10 and while I wanted to rebuild whole system because migration from GCC 6.4 to 7.3 I cannot make it on single run 🗡️

@dreuter
Copy link

dreuter commented Oct 5, 2018

I think the proper way to solve this would be to use add_library(flann_cpp INTERFACE).

More information can be found here: http://mariobadr.com/creating-a-header-only-library-with-cmake.html

I guess one problem might be, that this will not create a .so, so if you manually added -lflann_cpp you would get a linker error.

@dreuter
Copy link

dreuter commented Oct 5, 2018

I think the proper way to solve this would be to use add_library(flann_cpp INTERFACE).

More information can be found here: http://mariobadr.com/creating-a-header-only-library-with-cmake.html

I guess one problem might be, that this will not create a .so, so if you manually added -lflann_cpp you would get a linker error.

Ok, scrap that... After trying to apply this I saw, that the static library content is loaded into the shared library. That of course makes it impossible to use an INTERFACE library.

@dreuter
Copy link

dreuter commented Oct 5, 2018

In my opinion there are two ways to solve this.

Either revert 0fd62b4 or add an empty flann_cpp.cpp and use it as source for the shared library.

Any preferences?

ptbremer pushed a commit to ptbremer/spack that referenced this issue Oct 12, 2018
@BotellaA
Copy link

BotellaA commented Nov 7, 2018

Any news on this issue? What are the CMake recommendations on the topic?

@victorvianna
Copy link
Contributor

Interested too, build failing with Cmake 3.12.4

@Flamefire
Copy link

Any news on this issue? What are the CMake recommendations on the topic?

From a CMake heavy user: revert 0fd62b4. What is being done there is potentially problematic. Especially as FLANN_STATIC is defined. What does this mean now if the files compiled with the static define are used to create the shared library requring "hacking" the linker to make it work at all?

Yes it is faster but if you would want to do that, look into object libraries which are the cleaner approach. And is "faster" here really worth the trouble? There are maybe a dozen cpp files so save yourself the trouble and just build them twice and with the proper flags to avoid that leading to bugs in the future

@tkircher
Copy link
Contributor

The solution that @heirecka posted works for me, though if you're building with CUDA (-DBUILD_CUDA_LIB=ON) you also have to include empty.cpp in the associated place (flann_cuda SHARED)

Like @Flamefire pointed out, the underlying problem is an incorrect use of CMake, so the solution is to fix the CMake scripts.

@fidergo-stephane-gourichon
Copy link

fidergo-stephane-gourichon commented Oct 2, 2021

Still occurs on current master on Ubuntu 20.04

@heirecka 's answer did not work for me as is. I had to add backslashes to ensure lines after sed do make only one actual line, and adjust the double quotes into simple quotes because they really quote double quotes.
Anyway, here it is with proper markup, so that you can just copy-paste into a shell:

touch src/cpp/empty.cpp
sed -e '/add_library(flann_cpp SHARED/ s/""/empty.cpp/' \
-e '/add_library(flann SHARED/ s/""/empty.cpp/' \
-i src/cpp/CMakeLists.txt

I still find this is hackish, yet that worked for me.

jpouderoux pushed a commit to Perception4D/flann that referenced this issue May 4, 2022
@StefanBruens
Copy link
Contributor

When you look at the generated CMake targets file, you can see it is completely broken:

# Import target "flann::flann" for configuration "RelWithDebInfo"
set_property(TARGET flann::flann APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO)
set_target_properties(flann::flann PROPERTIES
  IMPORTED_LINK_INTERFACE_LIBRARIES_RELWITHDEBINFO "-Wl,-whole-archive;flann::flann_s;-Wl,-no-whole-archive"
  IMPORTED_LOCATION_RELWITHDEBINFO "${_IMPORT_PREFIX}/lib64/libflann.so.1.9.2"
  IMPORTED_SONAME_RELWITHDEBINFO "libflann.so.1.9"
  )
...
# Import target "flann::flann_s" for configuration "RelWithDebInfo"
set_property(TARGET flann::flann_s APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO)
set_target_properties(flann::flann_s PROPERTIES
  IMPORTED_LINK_INTERFACE_LANGUAGES_RELWITHDEBINFO "CXX"
  IMPORTED_LINK_INTERFACE_LIBRARIES_RELWITHDEBINFO "/usr/lib64/liblz4.so"
  IMPORTED_LOCATION_RELWITHDEBINFO "${_IMPORT_PREFIX}/lib64/libflann_s.a"
  )

The shared library should be self contained, any reference to the static library is wrong.

StefanBruens added a commit to StefanBruens/flann that referenced this issue Sep 11, 2022
Build the shared library on Linux the same way as on Windows, i.e.
compile the sources individually for static and shared libs.

This removes the "FLANN_STATIC" compile definition from the shared
library build (confusing, albeit without any effect on Linux), and
avoids any linker trickery.

Also allow to disable build and installation of the static libraries
completely, as these are often unwanted on Linux distributions.

Fixes flann-lib#498.
See flann-lib#369.
@monajalal
Copy link

@heirecka
I tried your model and it didn't work. Do you have any suggestions for FLANN 1.9.1?

base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$  touch src/cpp/empty.cpp
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ sed -e "/add_library(flann_cpp SHARED/ s/""/empty.cpp/" -e "/add_library(flann SHARED/ s/""/empty.cpp/" -i src/cpp/CMakeLists.txt
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ cd build/
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1/build$ cd ..
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ rm -rf build
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ mkdir build
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ cd build
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1/build$ cmake ..
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /home/mona/anaconda3/bin/python (found version "3.9.13") 
-- Found HDF5: /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;/usr/lib/x86_64-linux-gnu/libcurl.so;/usr/lib/x86_64-linux-gnu/libpthread.a;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.10.7")  
-- 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


-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
CMake Error at src/cpp/CMakeLists.txt:32:
  Parse error.  Expected a command name, got unquoted argument with text
  "empty.cpp".


-- Configuring incomplete, errors occurred!
See also "/home/mona/Downloads/flann-1.9.1/build/CMakeFiles/CMakeOutput.log".

Before that I was getting this error:

(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ mkdir build
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ vi README.md 
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ cd build/
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1/build$ cmake ..
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /home/mona/anaconda3/bin/python (found version "3.9.13") 
-- Found HDF5: /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;/usr/lib/x86_64-linux-gnu/libcurl.so;/usr/lib/x86_64-linux-gnu/libpthread.a;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.10.7")  
-- 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


-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
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 $<TARGET_FILE>, 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


-- 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
CMake Error at src/cpp/CMakeLists.txt:32 (add_library):
  No SOURCES given to target: flann_cpp


CMake Error at src/cpp/CMakeLists.txt:86 (add_library):
  No SOURCES given to target: flann


CMake Generate step failed.  Build files cannot be regenerated correctly.

@monajalal
Copy link

confirming that @fidergo-stephane-gourichon 's method worked for me. Thanks a lot

(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ touch src/cpp/empty.cpp
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ sed -e '/add_library(flann_cpp SHARED/ s/""/empty.cpp/' \
-e '/add_library(flann SHARED/ s/""/empty.cpp/' \
-i src/cpp/CMakeLists.txt
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ mkdir build
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1$ cd build
(base) mona@ard-gpu-01:~/Downloads/flann-1.9.1/build$ cmake ..
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /home/mona/anaconda3/bin/python (found version "3.9.13") 
-- Found HDF5: /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;/usr/lib/x86_64-linux-gnu/libcurl.so;/usr/lib/x86_64-linux-gnu/libpthread.a;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.10.7")  
-- 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


-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
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 $<TARGET_FILE>, 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


-- 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/mona/Downloads/flann-1.9.1/build

@StefanBruens
Copy link
Contributor

CMake Error at src/cpp/CMakeLists.txt:86 (add_library):
No SOURCES given to target: flann

https://cmake.org/cmake/help/v3.11/release/3.11.html#commands
add_library without SOURCES requires CMake 3.11.

@sebastianserna30
Copy link

sebastianserna30 commented Jun 13, 2024

still happening with cmake 3.22.1

but the hack above works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests