scateu / kalibrate-hackrf

kalibrate for hackrf
BSD 2-Clause "Simplified" License
267 stars 78 forks source link

ld: library not found for -lrt #7

Closed rxseger closed 8 years ago

rxseger commented 8 years ago

On OS X 10.11.5, following the instructions at https://github.com/scateu/kalibrate-hackrf/blob/master/INSTALL.homebrew (and https://web.archive.org/web/20131226204943/http://thre.at/kalibrate), I get an error about a missing library: ld: library not found for -lrt

Full output:

kalibrate-hackrf $ brew install fftw hackrf libtool
Warning: fftw-3.3.4_1 already installed
Warning: hackrf-2015.07.2 already installed
Warning: libtool-2.4.6 already installed
kalibrate-hackrf $ ./bootstrap
kalibrate-hackrf $ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking whether ln -s works... yes
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for inline... inline
checking for working strtod... yes
checking for floor... yes
checking for getpagesize... yes
checking for memset... yes
checking for sqrt... yes
checking for strtoul... yes
checking for strtol... yes
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FFTW3... yes
checking for LIBHACKRF... yes
checking build system type... x86_64-apple-darwin15.5.0
checking host system type... x86_64-apple-darwin15.5.0
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
kalibrate-hackrf $ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
g++ -DHAVE_CONFIG_H -I. -I..    -I/usr/local/Cellar/fftw/3.3.4_1/include -I/usr/local/Cellar/hackrf/2015.07.2/include/ -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -g -O2 -MT kal-arfcn_freq.o -MD -MP -MF .deps/kal-arfcn_freq.Tpo -c -o kal-arfcn_freq.o `test -f 'arfcn_freq.cc' || echo './'`arfcn_freq.cc
mv -f .deps/kal-arfcn_freq.Tpo .deps/kal-arfcn_freq.Po
g++ -DHAVE_CONFIG_H -I. -I..    -I/usr/local/Cellar/fftw/3.3.4_1/include -I/usr/local/Cellar/hackrf/2015.07.2/include/ -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -g -O2 -MT kal-c0_detect.o -MD -MP -MF .deps/kal-c0_detect.Tpo -c -o kal-c0_detect.o `test -f 'c0_detect.cc' || echo './'`c0_detect.cc
c0_detect.cc:183:17: warning: absolute value function 'fabsf' given an argument of type 'double' but has parameter of type 'float' which may cause truncation of value [-Wabsolute-value]
      if (r && (fabsf (offset - GSM_RATE / 4) < ERROR_DETECT_OFFSET_MAX))
                ^
c0_detect.cc:183:17: note: use function 'std::abs' instead
      if (r && (fabsf (offset - GSM_RATE / 4) < ERROR_DETECT_OFFSET_MAX))
                ^~~~~
                std::abs
1 warning generated.
mv -f .deps/kal-c0_detect.Tpo .deps/kal-c0_detect.Po
g++ -DHAVE_CONFIG_H -I. -I..    -I/usr/local/Cellar/fftw/3.3.4_1/include -I/usr/local/Cellar/hackrf/2015.07.2/include/ -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -g -O2 -MT kal-circular_buffer.o -MD -MP -MF .deps/kal-circular_buffer.Tpo -c -o kal-circular_buffer.o `test -f 'circular_buffer.cc' || echo './'`circular_buffer.cc
mv -f .deps/kal-circular_buffer.Tpo .deps/kal-circular_buffer.Po
g++ -DHAVE_CONFIG_H -I. -I..    -I/usr/local/Cellar/fftw/3.3.4_1/include -I/usr/local/Cellar/hackrf/2015.07.2/include/ -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -g -O2 -MT kal-fcch_detector.o -MD -MP -MF .deps/kal-fcch_detector.Tpo -c -o kal-fcch_detector.o `test -f 'fcch_detector.cc' || echo './'`fcch_detector.cc
mv -f .deps/kal-fcch_detector.Tpo .deps/kal-fcch_detector.Po
g++ -DHAVE_CONFIG_H -I. -I..    -I/usr/local/Cellar/fftw/3.3.4_1/include -I/usr/local/Cellar/hackrf/2015.07.2/include/ -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -g -O2 -MT kal-kal.o -MD -MP -MF .deps/kal-kal.Tpo -c -o kal-kal.o `test -f 'kal.cc' || echo './'`kal.cc
mv -f .deps/kal-kal.Tpo .deps/kal-kal.Po
g++ -DHAVE_CONFIG_H -I. -I..    -I/usr/local/Cellar/fftw/3.3.4_1/include -I/usr/local/Cellar/hackrf/2015.07.2/include/ -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -g -O2 -MT kal-offset.o -MD -MP -MF .deps/kal-offset.Tpo -c -o kal-offset.o `test -f 'offset.cc' || echo './'`offset.cc
mv -f .deps/kal-offset.Tpo .deps/kal-offset.Po
g++ -DHAVE_CONFIG_H -I. -I..    -I/usr/local/Cellar/fftw/3.3.4_1/include -I/usr/local/Cellar/hackrf/2015.07.2/include/ -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -g -O2 -MT kal-usrp_source.o -MD -MP -MF .deps/kal-usrp_source.Tpo -c -o kal-usrp_source.o `test -f 'usrp_source.cc' || echo './'`usrp_source.cc
mv -f .deps/kal-usrp_source.Tpo .deps/kal-usrp_source.Po
g++ -DHAVE_CONFIG_H -I. -I..    -I/usr/local/Cellar/fftw/3.3.4_1/include -I/usr/local/Cellar/hackrf/2015.07.2/include/ -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -g -O2 -MT kal-util.o -MD -MP -MF .deps/kal-util.Tpo -c -o kal-util.o `test -f 'util.cc' || echo './'`util.cc
mv -f .deps/kal-util.Tpo .deps/kal-util.Po
g++ -I/usr/local/Cellar/fftw/3.3.4_1/include -I/usr/local/Cellar/hackrf/2015.07.2/include/ -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -g -O2   -o kal kal-arfcn_freq.o kal-c0_detect.o kal-circular_buffer.o kal-fcch_detector.o kal-kal.o kal-offset.o kal-usrp_source.o kal-util.o -L/usr/local/Cellar/fftw/3.3.4_1/lib -lfftw3 -L/usr/local/Cellar/hackrf/2015.07.2/lib -lhackrf -lrt 
ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [kal] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Where can I get rt? Nothing in Homebrew named exactly "rt" or "librt" (closest match is: librtlsdr).


Found this: https://forum.qt.io/topic/35487/osx-and-librt OSX and librt

It works great on Windows and LInux, but for some reason QT wants librt.a (the POSIX realtime Library), and it's not implemented on OSX, so trying to build with