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

CMake Error at lib/CMakeLists.txt:67 -- (Boost) target not found? #7

Closed
kmihaylov opened this issue Jan 13, 2022 · 5 comments
Closed

Comments

@kmihaylov
Copy link

Excuse me for flooding with issue posts. I'm using @antoniprzybylik's #4
On my Ubuntu 18.04 machine I installed GR 3.8.2.0 (Python 3.6.9) from PPA repo.
However test-multi_rtl doesn't find Boost targets:

-- The CXX compiler identification is GNU 7.5.0
-- The C compiler identification is GNU 7.5.0
-- 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
-- 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
-- Build type not specified: defaulting to release.
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   system
-- Found LOG4CPP: /usr/lib/x86_64-linux-gnu/liblog4cpp.so
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'gmp'
--   No package 'gmp' found
-- Found GMP: /usr/lib/x86_64-linux-gnu/libgmpxx.so  
-- Checking for module 'mpir >= 3.0'
--   No package 'mpir' found
-- Could NOT find MPIR (missing: MPIRXX_LIBRARY MPIR_LIBRARY MPIR_INCLUDE_DIR) 
-- Found MPLIB: /usr/lib/x86_64-linux-gnu/libgmpxx.so  
-- Found VOLK: Volk::volk  
-- User set python executable /usr/bin/python3
-- Found PythonInterp: /usr/bin/python3 (found version "3.6.9") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.6m.so (found suitable exact version "3.6.9") 
-- Checking for module 'cppunit'
--   Found cppunit, version 1.14.0
-- Found CPPUNIT: /usr/lib/x86_64-linux-gnu/libcppunit.so;dl  
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.13") found components:  doxygen dot 
-- 
-- Checking for module SWIG
-- Found SWIG version 3.0.12.
-- Found SWIG: /usr/bin/swig3.0  
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.6m.so (found suitable version "3.6.9", minimum required is "3") 
-- Configuring done
CMake Error at lib/CMakeLists.txt:67 (add_executable):
  Target "test-multi_rtl" links to target "Boost::thread" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at lib/CMakeLists.txt:67 (add_executable):
  Target "test-multi_rtl" links to target "Boost::program_options" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at lib/CMakeLists.txt:67 (add_executable):
  Target "test-multi_rtl" links to target "Boost::regex" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at lib/CMakeLists.txt:67 (add_executable):
  Target "test-multi_rtl" links to target "Boost::thread" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at lib/CMakeLists.txt:36 (add_library):
  Target "multi_rtl" links to target "Boost::thread" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at lib/CMakeLists.txt:36 (add_library):
  Target "multi_rtl" links to target "Boost::program_options" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at lib/CMakeLists.txt:36 (add_library):
  Target "multi_rtl" links to target "Boost::regex" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at lib/CMakeLists.txt:36 (add_library):
  Target "multi_rtl" links to target "Boost::thread" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at /usr/lib/x86_64-linux-gnu/cmake/gnuradio/UseSWIG.cmake:573 (add_library):
  Target "multi_rtl_swig" links to target "Boost::thread" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/gnuradio/GrSwig.cmake:137 (swig_add_library)
  swig/CMakeLists.txt:56 (GR_SWIG_MAKE)


CMake Error at /usr/lib/x86_64-linux-gnu/cmake/gnuradio/UseSWIG.cmake:573 (add_library):
  Target "multi_rtl_swig" links to target "Boost::program_options" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/gnuradio/GrSwig.cmake:137 (swig_add_library)
  swig/CMakeLists.txt:56 (GR_SWIG_MAKE)


CMake Error at /usr/lib/x86_64-linux-gnu/cmake/gnuradio/UseSWIG.cmake:573 (add_library):
  Target "multi_rtl_swig" links to target "Boost::regex" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/gnuradio/GrSwig.cmake:137 (swig_add_library)
  swig/CMakeLists.txt:56 (GR_SWIG_MAKE)


CMake Error at /usr/lib/x86_64-linux-gnu/cmake/gnuradio/UseSWIG.cmake:573 (add_library):
  Target "multi_rtl_swig" links to target "Boost::thread" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/gnuradio/GrSwig.cmake:137 (swig_add_library)
  swig/CMakeLists.txt:56 (GR_SWIG_MAKE)


-- Generating done
-- Build files have been written to: /tmp/multi-rtl/build

The configure script successfully finds the Boost libraries. Is it kind of dependency tree that somehow misses the correct path?

@velichkov
Copy link

velichkov commented Jan 13, 2022

-- Found the following Boost libraries:
--   filesystem
--   system
-- Found LOG4CPP: /usr/lib/x86_64-linux-gnu/liblog4cpp.so

Do you have libboost-dev or libboost-thread-dev package installed on your system?

In Ubuntu/Debian boost's header files are in multiple sub-packages and it's usually easier to have them all by installing libboost-dev instead of the various dedicated sub-packages https://packages.ubuntu.com/bionic/libboost1.65-dev

@kmihaylov
Copy link
Author

Yes, I have

||/ Name                                          Version                     Architecture                Description
+++-=============================================-===========================-===========================-===============================================================================================
ii  libboost-dev:amd64                            1.65.1.0ubuntu1             amd64                       Boost C++ Libraries development files (default version)
ii  libboost-thread-dev:amd64                     1.65.1.0ubuntu1             amd64                       portable C++ multi-threading (default version)

Also I found the files here: /usr/lib/x86_64-linux-gnu

Is it possible that cmake searches another path?
What's interesting is that the output of cmake .. actually finds Boost:

-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   system

It is the lib/CMakeLists.txt:67 that states the missing library...?

@velichkov
Copy link

velichkov commented Jan 13, 2022

Open top-level CMakeLists.txt and add thread, program_options and regex on line 61.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 830816b..bc7a6b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,7 +58,7 @@ set(Boost_ADDITIONAL_VERSIONS
     "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
     "1.70.0" "1.70" "1.71.0" "1.71" "1.72.0" "1.72"
 )
-find_package(Boost "1.35" COMPONENTS filesystem system)
+find_package(Boost "1.35" COMPONENTS filesystem system thread program_options regex)
 
 if(NOT Boost_FOUND)
     message(FATAL_ERROR "Boost required to compile multi_rtl")

@velichkov
Copy link

  Target "multi_rtl_swig" links to target "Boost::regex" but the target was
  Target "test-multi_rtl" links to target "Boost::program_options" but the

Most probably you will need to add program_options and regex as well.

@kmihaylov
Copy link
Author

Thank you @velichkov . Your patch did the job! Saved the day one more time.
Thanks to @antoniprzybylik also for his port to GR 3.8 and quick reaction to the discussed bugs.

antoniprzybylik added a commit to antoniprzybylik/multi-rtl that referenced this issue Jan 14, 2022
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

2 participants