Open playaspec opened 5 years ago
I have solved the compiler detection problem! The second comment here:
Suggests adding:
set(CMAKE_C_COMPILER "gcc") set(CMAKE_CXX_COMPILER "g++")
Before the project declaration in the CMakeLists.txt. Surely this is a hack that will probably break other things on other platforms. Perhaps it could be wrapped in a conditional if the platform can be determined this early in the configuration process.
The next issue was while compiling. There were four errors in LTE-Cell-Scanner/include/dsp.h
:
/Users/playaspec/Documents/_Projects/programming/LTE-Cell-Scanner/include/dsp.h:47:25: error: lvalue required as left operand of assignment
47 | coeff.real()=cos(k*t);
| ^
/Users/playaspec/Documents/_Projects/programming/LTE-Cell-Scanner/include/dsp.h:48:25: error: lvalue required as left operand of assignment
48 | coeff.imag()=sin(k*t);
| ^
/Users/playaspec/Documents/_Projects/programming/LTE-Cell-Scanner/include/dsp.h: In function 'void fshift_inplace(itpp::cvec&, double, double)':
/Users/gduncan/Documents/_Projects/programming/LTE-Cell-Scanner/include/dsp.h:64:25: error: lvalue required as left operand of assignment
64 | coeff.real()=cos(k*t);
| ^
/Users/playaspec/Documents/_Projects/programming/LTE-Cell-Scanner/include/dsp.h:65:25: error: lvalue required as left operand of assignment
65 | coeff.imag()=sin(k*t);
| ^
which were solved by the patch suggested in LTE-Cell-Scanner issues 19. These changes really should be applied to the current source tree.
At this point compilation succeeds, but linking with libitpp
fails for CellSearch.
build playaspec$ make
[ 5%] Building CXX object src/CMakeFiles/LTE_MISC.dir/capbuf.cpp.o
[ 11%] Building CXX object src/CMakeFiles/LTE_MISC.dir/constants.cpp.o
[ 16%] Building CXX object src/CMakeFiles/LTE_MISC.dir/itpp_ext.cpp.o
[ 22%] Building CXX object src/CMakeFiles/LTE_MISC.dir/macros.cpp.o
[ 27%] Building CXX object src/CMakeFiles/LTE_MISC.dir/searcher.cpp.o
[ 33%] Building CXX object src/CMakeFiles/LTE_MISC.dir/common.cpp.o
[ 38%] Building CXX object src/CMakeFiles/LTE_MISC.dir/dsp.cpp.o
[ 44%] Building CXX object src/CMakeFiles/LTE_MISC.dir/lte_lib.cpp.o
[ 50%] Building CXX object src/CMakeFiles/LTE_MISC.dir/from_osmocom.cpp.o
[ 55%] Linking CXX static library libLTE_MISC.a
[ 55%] Built target LTE_MISC
[ 61%] Building CXX object src/CMakeFiles/CellSearch.dir/CellSearch.cpp.o
[ 66%] Linking CXX executable CellSearch
ld: library not found for -litpp
collect2: error: ld returned 1 exit status
make[2]: *** [src/CellSearch] Error 1
make[1]: *** [src/CMakeFiles/CellSearch.dir/all] Error 2
make: *** [all] Error 2
For whatever reason it appears that the FindITPP.cmake
module doesn't set ITPP_DIR
as it is undefined. Perhaps this is inconsequential. I have tried installing both itpp
and itpp-devel
ports from Macports, cleaning the build directory and starting new, but it has made no difference. I see no way of explicitly defining the path to the library so the linker can find it.
On MacOS Mojave it died in the make'ing... a couple of manual runs of the compiler (XCode) with the -L/usr/local/Cellar/itpp/4.3.1/lib
option made it compile. Then ran this to resolve a broken dynamic lib - install_name_tool -change libhackrf.0.dylib /usr/local/lib/libhackrf.0.dylib $(which LTE-Tracker )
It runs, but doesn't recognize the hackrf, although hackrf_info
shows it just fine. FWIW it's the farthest I've gotten with a mac so far, but still no dice.
I believe it's related to this discussion:
https://trac.macports.org/ticket/53201
I also had some issues with cmake detecting FFTW, ITPP, and RTLSDR libraries, but resolved those by adding the macports paths to their module files. I suspect that if the compiler issue were sorted out, these hacks would have been unnecessary, but I can't say for sure until I get past this. I will fork, produce patches, and submit a pull request once I've completely solved and successfully built LTE-Cell-Scanner.
The output of
cmake ..
from the build directory looks like this:Needless to say,
make
fails miserably, and I'm just not well versed enough in the intricacies ofcmake
to