Mac OSX 编译 LeanSDR

LeanSDR:Lightweight, portable software-defined radio

git clone http://github.com/pabr/leansdr.git
cd leansdr/src/apps

LeanSDR在使用过程中需要使用X11图形框架,首次在OSX编译LeanSDR会有报错:

g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leandvb.cc -lX11 -o leandvb  ||  \
    g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable       leandvb.cc       -o leandvb
In file included from leandvb.cc:17:
../leansdr/gui.h:16:10: fatal error: 'X11/X.h' file not found
#include <X11/X.h>
         ^
1 error generated.
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leansdrscan.cc -lX11 -o leansdrscan  ||  \
    g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable       leansdrscan.cc       -o leansdrscan
leansdrscan.cc:115:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
        if ( nr < 0 ) fatal("read");
             ~~ ^ ~
1 warning generated.
ld: library not found for -lX11
clang: error: linker command failed with exit code 1 (use -v to see invocation)
leansdrscan.cc:115:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
        if ( nr < 0 ) fatal("read");
             ~~ ^ ~
1 warning generated.
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leansdrcat.cc -lX11 -o leansdrcat  ||  \
    g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable       leansdrcat.cc       -o leansdrcat
ld: library not found for -lX11
clang: error: linker command failed with exit code 1 (use -v to see invocation)
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leantsgen.cc -lX11 -o leantsgen  ||  \
    g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable       leantsgen.cc       -o leantsgen
ld: library not found for -lX11
clang: error: linker command failed with exit code 1 (use -v to see invocation)
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leanchansim.cc -lX11 -o leanchansim  ||  \
    g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable       leanchansim.cc       -o leanchansim
ld: library not found for -lX11
clang: error: linker command failed with exit code 1 (use -v to see invocation)
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leandvbtx.cc -lX11 -o leandvbtx  ||  \
    g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable       leandvbtx.cc       -o leandvbtx
ld: library not found for -lX11
clang: error: linker command failed with exit code 1 (use -v to see invocation)

查找X11目录

sudo find / -name "X.h"
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Versions/8.4/Headers/X11/X.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/X.h
find: /dev/fd/cn0xroot: No such file or directory
find: /dev/fd/cn0xroot: No such file or directory
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/X.h
/opt/local/include/X11/X.h
/opt/local/share/doc/boost/libs/coroutine/example/cpp03/asymmetric/X.h
/opt/metasploit-framework/embedded/include/X11/X.h
/opt/X11/include/X11/X.h
/System/Library/Frameworks/Tk.framework/Versions/8.4/Headers/X11/X.h
/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/X.h

解决方案:修改Makefile

APPS = leandvb leansdrscan
APPS += leansdrcat leantsgen leanchansim leandvbtx

all: $(APPS)

clean:
rm -f $(APPS)

DEPS = ../leansdr/*.h

CXXFLAGS = -O3 -I.. -I/opt/X11/include -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable

%: %.cc $(DEPS)
g++ $(CXXFLAGS) -DGUI $< -lX11 -L/opt/X11/lib -o $@ || \
g++ $(CXXFLAGS) $< -o $@

EMBED_FLAGS= -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable \
-Ofast -mfpu=neon -funsafe-math-optimizations -fsingle-precision-constant

leandvb.embedded: leandvb.cc $(DEPS)
g++ $(CXXFLAGS) $(EMBED_FLAGS) $< -static -o $@ || \
g++ $(CXXFLAGS) $(EMBED_FLAGS) $< -o $@
make

Usage

leandvb --help
Usage: leandvb [options]  < IQ  > TS
Demodulate DVB-S I/Q on stdin, output MPEG packets on stdout

Input options:
  --u8           Input format is 8-bit unsigned (rtl_sdr, default)
  --f32          Input format is 32-bit float (gqrx)
  -f HZ          Input sample rate (default: 2.4e6)
  --loop         Repeat (stdin must be a file)
  --inbuf N      Additional input buffering (samples)

Preprocessing options:
  --anf N        Number of birdies to remove (default: 1)
  --derotate HZ  For use with --fd-pp, otherwise use --tune
  --resample     Resample baseband (CPU-intensive)
  --resample-rej K  Aliasing rejection (default: 10)
  --decim N      Decimate baseband (causes aliasing)
  --cnr          Measure CNR (requires samplerate>3*symbolrate)
  --fd-pp NUM    Dump preprocessed IQ data to file descriptor

DVB-S options:
  --sr HZ        Symbol rate (default: 2e6)
  --tune HZ      Bias frequency for demodulation
  --drift        Track frequency drift beyond safe limits
  --standard S   DVB-S (default), DVB-S2 (not implemented)
  --const C      QPSK (default), BPSK .. 32APSK (DVB-S2 only)
  --cr N/D       Code rate 1/2 (default) .. 7/8 .. 9/10
  --fastlock     Synchronize more aggressively (CPU-intensive)
  --sampler      nearest, linear, rrc
  --rrc-steps N  RRC interpolation factor
  --rrc-rej K    RRC filter rejection (defaut:10)
  --roll-off A   RRC roll-off (default: 0.35)
  --viterbi      Use Viterbi (CPU-intensive)
  --hard-metric  Use Hamming distances with Viterbi

Compatibility options:
  --hdlc         Expect HDLC frames instead of MPEG packets
  --packetized   Output 16-bit length prefix (default: as stream)

General options:
  --buf-factor   Buffer size factor (default:4)
  --hq           Maximize sensitivity
                 (Enables all CPU-intensive features)
  --hs           Maximize throughput (QPSK CR1/2 only)
                 (Disables all preprocessing)

UI options:
  -h             Display this help message and exit
  -v             Output debugging info at startup and exit
  -d             Output debugging info during operation
  --fd-info NUM  Output demodulator status to file descriptor
  --fd-const NUM Output constellation and symbols to file descr
  --gui          Show constellation and spectrum (X11)
  --duration S   Width of timeline plot (default: 60)
  --linger       Keep GUI running after EOF

Testing options:
  --awgn STDDEV  Add white gaussian noise (slow)
eanchansim --help
Usage: leanchansim [options]  < IQ.in  > IQ.out
Simulate an imperfect communication channel.

Input options:
  --iu8              Interpret stdin as complex unsigned char
  --if32             Interpret stdin as complex float
  -f Hz              Specify sample rate
  --loop             Repeat (stdin must be a file)

Gain options:
  --scale FACTOR     Multiply by constant

Drift options:
  --lo HZ            Specify nominal LO frequency
  --ppm PPM          Specify LO accuracy
  --drift-period S   Drift +-ppm every S seconds
  --drift-rate R     Drift with maximum rate R (Hz/s)
  --drift2-amp HZ    Add secondary drift (range in Hz)
  --drift2-freq HZ   Add secondary drift (rate in Hz)

Noise options:
  --awgn STDDEV      Add white gaussian noise (dB)

Output options:
  --ou8              Output as complex unsigned char
  --of32             Output as complex float
leandvbtx --help
Usage: leandvbtx [options]  < TS  > IQ
Modulate MPEG packets into a DVB-S baseband signal
Output float complex samples

Options:  -f INTERP[/DECIM]        Samples per symbols (default: 2)
  --roll-off R             RRC roll-off (defalt: 0.35)
  --power P                Output power (dB)
  --agc                    Better regulation of output power
  -v                       Verbose output
leansdrcat --help
Usage: leansdrcat [options]
Forward from stdin to stdout at constant rate.

Options:
  --block      Pause when stdout is busy (default: '#' on stderr)
  --nonblock   Silently ignore when stdout is busy
  --cbr R      Set rate in bits per second
  --cbr8 R     Set rate in bytes per second
  --cbr16 R    Set rate in 16-bit words per second
  --cbr32 R    Set rate in 32-bit words per second
  --cbr64 R    Set rate in 64-bit words per second
  -h           Display this help message and exit
leansdrscan --help
Usage: leansdrscan [options]  [program settings]
Run , cycling through combinations of settings.
Example: 'leansdrscan -v cat -n,-e' will feed stdin through 'cat -n' and 'cat -e' alternatively.

Options:
  -h              Print this message
  -v              Verbose
  --timeout N     Next settings if no output within N seconds
  --rewind        Rewind input (stdin must be a file)
  --probesize N   Forward only N bytes (with --rewind)
leantsgen --help
Usage: leantsgen [-c PACKETCOUNT]
Output numbered MPEG TS packets on stdout.

Example

rtl_sdr -g 0 -f 315e6 -s 1000000 /tmp/test.ts
leandvb --gui -v -d -f 1000e3 --sr 500e3 --cr 1/2 --derotate -4500 --anf 0 < /tmp/test.ts > mpeg.ts

https://www.rtl-sdr.com/transmitting-dvb-s-with-a-plutosdr-and-receiving-it-with-an-rtl-sdr/

http://www.pabr.org/radio/leandvb/leandvb.en.html

时间: 2024-09-23 08:44:23

Mac OSX 编译 LeanSDR的相关文章

解决mac osx 编译httpd出现checking whether the C compiler works… no 办法

在MAC下编译httpd时执行 ./configure 出现如下错误. checking for gcc- /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc checking whether the C compiler works- no configure: error: in `/Users/hufeiyan/ws/httpd-2.2.26′: configure: er

转 Mac OSX 快捷键&amp;命令行

一.Mac OSX 快捷键 command + shift + c                 打开Finder ctrl+shift                                    快速放大dock的图标会暂时放大,而如果你开启了dock放大 Command+Option+W                将所有窗口关闭 Command+W                             将当前窗口关闭(可以关闭Safari标签栏,很实用)  Command+

《Hadoop实战第2版》——2.2节在Mac OSX上安装与配置Hadoop

2.2 在Mac OSX上安装与配置Hadoop 由于现在越来越多的人使用Mac Book,故笔者在本章中增加了在Mac OS X上安装与配置Hadoop的内容,供使用Mac Book的读者参考. 2.2.1 安装Homebrew Mac OS X上的Homebrew是类似于Ubuntu下apt的一种软件包管理器,利用它可以自动下载和安装软件包,安装Homebrew之后,就可以使用Homebrew自动下载安装Hadoop.安装Homebrew的步骤如下: 1)从Apple官方下载并安装内置GCC

在Mac OSX上安装与配置Hadoop

在Mac OSX上 安装与配置Hadoop 博客分类: Hadoop hadoopbrewxcodegccosx&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 由于现在越来越多的人使用Mac Book,故笔者在本章中增加了在Mac OS X上安装与配置Hadoop的内容,供使用Mac Book的读者参考. 2.2.1 安装Homebrew Mac OS X上的Homebrew是类似于 Ubuntu下apt的一种

Mac OSX x86详细安装与初步测试

  苹果的OSX系统是无数PC玩家梦想的东西,无奈对绝大多数人来说,都不可能在已有一台PC的情况下,纯粹出于爱好而去购买一台Mac.因而无数的Mac界面外壳.Mac OS模拟器运应而生.但界面外壳的模拟终究是徒有其表,而OS模拟器(比如PPC)则是很难达到真正的Mac运行速度 但世事难料,谁也没有想到乔布斯竟然会忽然宣布将在苹果电脑上开始使用Intel的处理器,消息一公布就给了无数PC玩家一个华丽的遐想:我的PC什么时候可以装上Mac OSX.苹果当然不会让自己的操作系统轻易的运行在普通的PC上

Mac OSX 10.8安装SVN的方法

Mac OSX 10.8安装SVN的方法 作者: Michael 日期: 2013 年 5 月 4 日发表评论 (0)查看评论 Mac OS X 10.8安装SVN的常用的三种方法 ln 创建软连接 配置全局环境 Xcode安装命令行工具 对于Mac新系统Mountain Lion 10.8.3 而言,其终端自带的svn 命令默认已经不可用了: 1 micmiu-mbp:~ micmiu$ svn 2 -bash: svn: command not found 下面介绍详细介绍安装svn常用的三

mac 下编译 ffmpeg的 libaacplus-2.0.2 总是报错求大神解决办法,谁能教我再mac下编译ffmpeg也行

问题描述 mac 下编译 ffmpeg的 libaacplus-2.0.2 总是报错求大神解决办法,谁能教我再mac下编译ffmpeg也行 make[2]: Nothing to be done for `all'. Making all in frontend gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../src -g -O2 -c -o main.o main.c main.c:89:46: warning: data argument not

Mac OSX系统 Docker启用Docker远程API功能_docker

在Mac OSX系统的Docker机上启用Docker远程API功能 Docker守护进程提供了一套远程REST API,具体可以参考文档: https://docs.docker.com/engine/reference/api/docker_remote_api/ 这套API是提供给客户端与Docker引擎通信时使用,这套API也可以由其他工具调用,比如curl或Chrome浏览器的Postman REST客户端工具. 如果是在Mac OSX Mavericks系统上使用Docker机创建D

在Mac OSX中搭建Python集成开发环境图解

本篇博客分享如何在Mac OSX系统中搭建Python集成开发环境 首先到Python官网下载python,python官网链接 这里选择下载Python2.7.9版本,下载完成之后安装: 安装成功,打开终端: 下面下载python开发的ide,http://www.jetbrains.com/pycharm/ 下载专业版,有30天的免费试用,足够我们学习python了. 安装,将Pycharm拖动到mac应用程序中 创建第一个Python项目: 运行python文件 来源:51CTO