MarcinWachowiak / gr-aoa

GNU Radio package implementing MUSIC and root MUSIC angle of arrival algorithms with blocks necessary to provide phase synchronization of USRP devices
GNU General Public License v3.0
47 stars 11 forks source link

Make error #4

Closed Luke20000429 closed 2 years ago

Luke20000429 commented 2 years ago

Hi, I tried to compile on gnuradio-3.10.3 but received the error

[  0%] Built target pygen_apps_9a6dd
[  4%] Generating documentation with doxygen
[  9%] Building CXX object lib/CMakeFiles/gnuradio-aoa.dir/MUSIC_lin_array_impl.cc.o
[  9%] Built target copy_module_for_tests
[ 18%] Generating __init__.pyc, shift_phase_multiple_hier.pyc, calc_phase_diff_multiple_hier.pyc
[ 18%] Building CXX object lib/CMakeFiles/gnuradio-aoa.dir/rootMUSIC_linear_array_impl.cc.o
[ 22%] Generating __init__.pyo, shift_phase_multiple_hier.pyo, calc_phase_diff_multiple_hier.pyo
[ 22%] Built target pygen_python_aoa_bb291
[ 27%] Building CXX object lib/CMakeFiles/gnuradio-aoa.dir/shift_phase_impl.cc.o
[ 27%] Built target doxygen_target
[ 31%] Building CXX object lib/CMakeFiles/gnuradio-aoa.dir/calc_phase_diff_impl.cc.o
/home/liuxs/workarea/GR-DOA/gr-aoa/lib/shift_phase_impl.cc: In member function ‘virtual int gr::aoa::shift_phase_impl::work(int, gr_vector_const_void_star&, gr_vector_void_star&)’:
/home/liuxs/workarea/GR-DOA/gr-aoa/lib/shift_phase_impl.cc:64:28: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
   64 |       for (size_t j = 0; j < noutput_items; j++) {
      |                          ~~^~~~~~~~~~~~~~~
/home/liuxs/workarea/GR-DOA/gr-aoa/lib/calc_phase_diff_impl.cc: In member function ‘virtual int gr::aoa::calc_phase_diff_impl::work(int, gr_vector_const_void_star&, gr_vector_void_star&)’:
/home/liuxs/workarea/GR-DOA/gr-aoa/lib/calc_phase_diff_impl.cc:75:28: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
   75 |       for (size_t j = 0; j < noutput_items; j++) {
      |                          ~~^~~~~~~~~~~~~~~
[ 36%] Building CXX object lib/CMakeFiles/gnuradio-aoa.dir/precise_moving_average_impl.cc.o
[ 40%] Building CXX object lib/CMakeFiles/gnuradio-aoa.dir/head_w_rst_impl.cc.o
[ 45%] Building CXX object lib/CMakeFiles/gnuradio-aoa.dir/correlate_impl.cc.o
[ 50%] Linking CXX shared library libgnuradio-aoa.so
/usr/bin/ld: /usr/local/lib/libspdlog.a(spdlog.cpp.o): relocation R_X86_64_TPOFF32 against `_ZGVZN6spdlog7details2os9thread_idEvE3tid' can not be used when making a shared object; recompile with -fPIC
collect2: error: ld returned 1 exit status
make[2]: *** [lib/CMakeFiles/gnuradio-aoa.dir/build.make:183: lib/libgnuradio-aoa.so.1.0.0.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:273: lib/CMakeFiles/gnuradio-aoa.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

It looks like the error came from spdlog. Previously, when I ran cmake .., I was getting

CMake Error at /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  By not providing "Findspdlog.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "spdlog", but
  CMake did not find one.

  Could not find a package configuration file provided by "spdlog" with any
  of the following names:

    spdlogConfig.cmake
    spdlog-config.cmake

  Add the installation prefix of "spdlog" to CMAKE_PREFIX_PATH or set
  "spdlog_DIR" to a directory containing one of the above files.  If "spdlog"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/gnuradio/GnuradioConfig.cmake:13 (find_dependency)
  CMakeLists.txt:30 (find_package)

Therefore, I installed spdlog manually through their repo, I am not sure if the version we are using is the same, but CMake generate build file successfully.

-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'gmp'
--   Found gmp, version 6.2.0
-- Found GMP: /usr/lib/x86_64-linux-gnu/libgmpxx.so
-- Using GMP.
-- Found MPLIB: /usr/lib/x86_64-linux-gnu/libgmpxx.so
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.71.0") found components: date_time program_options system regex thread unit_test_framework
-- Found Volk: Volk::volk
-- User set python executable /usr/bin/python3
-- Found PythonInterp: /usr/bin/python3 (found version "3.8.10")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so (found suitable exact version "3.8.10")
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Performing Test HAVE_VISIBILITY_HIDDEN
-- Performing Test HAVE_VISIBILITY_HIDDEN - Success
-- Performing Test HAVE_WARN_SIGN_COMPARE
-- Performing Test HAVE_WARN_SIGN_COMPARE - Success
-- Performing Test HAVE_WARN_ALL
-- Performing Test HAVE_WARN_ALL - Success
-- Performing Test HAVE_WARN_NO_UNINITIALIZED
-- Performing Test HAVE_WARN_NO_UNINITIALIZED - Success
-- Found Git: /usr/bin/git
-- Extracting version information from git describe...
fatal: No names found, cannot describe anything.
-- Eigen3 found
-- Using install prefix: /usr/local
-- Building for version: 1.0.0.0 / 1.0.0
-- No C++ unit tests... skipping
-- PYTHON and GRC components are enabled
-- Python checking for pygccxml - found
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- LTO enabled
-- Configuring done
-- Generating done
...
MarcinWachowiak commented 2 years ago

You might want to take a look at this issue: https://github.com/gabime/spdlog/issues/1405 It tackles the exact error you are experiencing.

Luke20000429 commented 2 years ago

Thanks, I can compile now!