JiaoXianjun / LTE-Cell-Scanner

OpenCL, SDR, TDD/FDD LTE cell scanner, full stack from A/D samples to SIB ASN1 messages decoded in PDSCH, (optimized for RTL-SDR HACKRF and BladeRF board)
http://sdr-x.github.io/
GNU Affero General Public License v3.0
659 stars 193 forks source link

MacOS Support #19

Closed budude2 closed 3 years ago

budude2 commented 6 years ago

Has anyone run this on MacOS before? I've tried building it, but it can't seem to find OpenCL or the ITPP (even though I installed that through macports).

budude2 commented 6 years ago

Well I decided to compile the libraries myself, and leave OpenCL out. However now while compiling I get the following:

[100%] Linking CXX executable LTE-Tracker
Undefined symbols for architecture x86_64:
  "itpp::DSFMT<19937, 117, 19, 4498102069230399ull, 4501400546508797ull, 1047295u, 4294966079u, 1048063u, 4237361149u, 10376655713290109737ull, 4291106551315987578ull, 4432916062321256576ull, 1ull>::initialized", referenced from:
      kalibrate(double&, double&, double const&, double const&, double&, bool const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool const&, double const&, double const&, bool const&, rtlsdr_dev_t*&, hackrf_device*&, bladerf*&, dev_type_t::dev_type_t const&, double&, bool const&, double&, char const*, char const*, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&) in LTE-Tracker.cpp.o
      _main in LTE-Tracker.cpp.o
  "itpp::DSFMT<19937, 117, 19, 4498102069230399ull, 4501400546508797ull, 1047295u, 4294966079u, 1048063u, 4237361149u, 10376655713290109737ull, 4291106551315987578ull, 4432916062321256576ull, 1ull>::sse2_param_mask", referenced from:
      kalibrate(double&, double&, double const&, double const&, double&, bool const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool const&, double const&, double const&, bool const&, rtlsdr_dev_t*&, hackrf_device*&, bladerf*&, dev_type_t::dev_type_t const&, double&, bool const&, double&, char const*, char const*, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&) in LTE-Tracker.cpp.o
      _main in LTE-Tracker.cpp.o
  "itpp::DSFMT<19937, 117, 19, 4498102069230399ull, 4501400546508797ull, 1047295u, 4294966079u, 1048063u, 4237361149u, 10376655713290109737ull, 4291106551315987578ull, 4432916062321256576ull, 1ull>::idx", referenced from:
      kalibrate(double&, double&, double const&, double const&, double&, bool const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool const&, double const&, double const&, bool const&, rtlsdr_dev_t*&, hackrf_device*&, bladerf*&, dev_type_t::dev_type_t const&, double&, bool const&, double&, char const*, char const*, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&) in LTE-Tracker.cpp.o
      _main in LTE-Tracker.cpp.o
  "itpp::DSFMT<19937, 117, 19, 4498102069230399ull, 4501400546508797ull, 1047295u, 4294966079u, 1048063u, 4237361149u, 10376655713290109737ull, 4291106551315987578ull, 4432916062321256576ull, 1ull>::status", referenced from:
      kalibrate(double&, double&, double const&, double const&, double&, bool const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool const&, double const&, double const&, bool const&, rtlsdr_dev_t*&, hackrf_device*&, bladerf*&, dev_type_t::dev_type_t const&, double&, bool const&, double&, char const*, char const*, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&) in LTE-Tracker.cpp.o
      _main in LTE-Tracker.cpp.o
  "itpp::DSFMT<19937, 117, 19, 4498102069230399ull, 4501400546508797ull, 1047295u, 4294966079u, 1048063u, 4237361149u, 10376655713290109737ull, 4291106551315987578ull, 4432916062321256576ull, 1ull>::bigendian", referenced from:
      kalibrate(double&, double&, double const&, double const&, double&, bool const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool const&, double const&, double const&, bool const&, rtlsdr_dev_t*&, hackrf_device*&, bladerf*&, dev_type_t::dev_type_t const&, double&, bool const&, double&, char const*, char const*, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&) in LTE-Tracker.cpp.o
      _main in LTE-Tracker.cpp.o
  "itpp::DSFMT<19937, 117, 19, 4498102069230399ull, 4501400546508797ull, 1047295u, 4294966079u, 1048063u, 4237361149u, 10376655713290109737ull, 4291106551315987578ull, 4432916062321256576ull, 1ull>::last_seed", referenced from:
      kalibrate(double&, double&, double const&, double const&, double&, bool const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool const&, double const&, double const&, bool const&, rtlsdr_dev_t*&, hackrf_device*&, bladerf*&, dev_type_t::dev_type_t const&, double&, bool const&, double&, char const*, char const*, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&, unsigned short const&) in LTE-Tracker.cpp.o
      _main in LTE-Tracker.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/LTE-Tracker] Error 1
make[1]: *** [src/CMakeFiles/LTE-Tracker.dir/all] Error 2
make: *** [all] Error 2
budude2 commented 6 years ago

So building itpp from source doesn't work as it results in the error above. For some reason I could not get cmake to see my itpp install at /opt/local/. Therefore I went through and manually edited the cmake generated files to point the compiler at that directory. After doing that the program built correctly, and runs correctly.

mgp25 commented 6 years ago

Hello @txjacob,

im facing the exact same error as you, but it seems you figured out how to fix it by changing the proper dir to the lib of cmake files. Could you tell me which files did you edit? And what you edited?

Regards

zrrVAQb0ae commented 6 years ago

Assuming all dependencies are satisfied, add the relevant lib and include directories to the cmake modules. Some error does seem to occur during the build with libitpp. Edit these files as follow for the build to work:

/path/to/repo/build/src/CMakeFiles/LTE-Tracker.dir/link.txt /path/to/repo/build/src/CMakeFiles/CellSearch.dir/link.txt

and replace all references to "-litpp" in both files with the direct path to libitpp, e.g. /usr/local/lib/libitpp.dylib or /opt/local/lib/libitpp.dylib or whatever.

then

cd build cmake ../ make

playaspec commented 4 years ago

cd build cmake ../ make

Issuing cmake after editing the files listed overwrites the changes suggested.