csdr icon indicating copy to clipboard operation
csdr copied to clipboard

Compile on OSX

Open sysrun opened this issue 10 years ago • 10 comments

Any advice how to compile on OSX?

sysrun avatar Jan 03 '15 10:01 sysrun

I managed to get it to compile on OS X, but had to make some tweaks to the CPU flags detection, tweak the build flags and comment out things that rely on librt.

You can see my OS X branch here: https://github.com/sgentle/csdr/tree/osx

sgentle avatar Oct 07 '15 18:10 sgentle

Great! Thanks!

ha7ilm avatar Oct 07 '15 20:10 ha7ilm

your OSX branch does not compile here. OSX 10.10

$ make
rm -f dumpvect*.vect
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
NOTE: you may have to manually edit Makefile to optimize for your CPU (especially if you compile on ARM, please edit PARAMS_NEON).
Auto-detected optimization parameters: -mfloat-abi=hard -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mvectorize-with-neon-quad -funsafe-math-optimizations -Wformat=0

c99 -O3 -ffast-math -fdump-tree-vect-details -dumpbase dumpvect -mfloat-abi=hard -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mvectorize-with-neon-quad -funsafe-math-optimizations -Wformat=0 fft_fftw.c libcsdr_wrapper.c  -g -lm -lrt -lfftw3f -DUSE_FFTW -DLIBCSDR_GPL -DUSE_IMA_ADPCM -Wno-unused-result -fpic -shared -o libcsdr.so
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c99: illegal option -- f
usage: c99 [-cEgs] [-D name[=value]] [-I directory] ... [-L directory] ...
       [-o outfile] [-O optlevel] [-U name]... [-W 64] operand ...
make: *** [all] Error 1

xenDE avatar Apr 23 '16 23:04 xenDE

@xenDE Are you sure you have the right branch? You can see mine has the only reference to /proc/cpuinfo commented out: https://github.com/sgentle/csdr/blob/osx/Makefile#L34

sgentle avatar May 12 '16 02:05 sgentle

@sgentle I'm still having trouble compiling here on macOS 10.11.6, getting an ./fft_fftw.h:7:10: fatal error: 'fftw3.h' file not found error. I already have that library in /usr/local/include via brew install fftw.

natevw avatar Aug 21 '16 18:08 natevw

Had to change the [second] PARAMS_LIBS line to read as follows:

PARAMS_LIBS = -g -lm -I/usr/local/include -L/usr/local/lib -lfftw3f -DUSE_FFTW -DLIBCSDR_GPL -DUSE_IMA_ADPCM

Sounds like as of Mavericks, the /usr/local header and library paths are no longer default. There may be a more elegant fix than mine.

natevw avatar Aug 21 '16 18:08 natevw

For OSX Catalina, I had to add the following to csdr.c:

#define _DARWIN_C_SOURCE

justinh24 avatar Dec 17 '20 20:12 justinh24

Hi, I have built CSDR from OSX branch but when trying to start openwebrx next message appears. [openwebrx-main] You need to install an up-to-date version of "csdr" that contains the "nmux" tool to run OpenWebRX! Please upgrade "csdr"! Can you please update OSX branch or give a hint how to build it for MAC on top of master?

valerii-ie avatar Mar 22 '22 08:03 valerii-ie

Hi All, Unfortunately I don't have a Mac, so I won't personally do this for now.

ha7ilm avatar Mar 22 '22 08:03 ha7ilm

ha7ilm, I can try to do it myself and contribute, are there any hints to look out for?

valerii-ie avatar Mar 22 '22 18:03 valerii-ie