ha7ilm / csdr

A simple DSP library and command-line tool for Software Defined Radio.
513 stars 169 forks source link

Compiling Issue: Raspberry Pi 3 + Raspbian Buster #47

Closed manofftoday closed 5 years ago

manofftoday commented 5 years ago

Hello,

This is what I get when I make the master branch in a Raspberry Pi 3 + Raspbian Buster. Although it seems to work, with OpenwebRX, I'm getting a lot of audio underruns:

`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 -DNEON_OPTS

rm -f dumpvect*.vect gcc -std=gnu99 -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 -DNEON_OPTS fft_fftw.c libcsdr_wrapper.c -g -lm -lrt -lfftw3f -DUSE_FFTW -DLIBCSDR_GPL -DUSE_IMA_ADPCM -Wno-unused-result -fpic -shared -Wl,-soname,libcsdr.so.0.15 -o libcsdr.so.0.15 In file included from libcsdr_wrapper.c:1: libcsdr.c:320:9: note: #pragma message: Manual NEON optimizations are ON: we have a faster shift_addfast_cc now.

pragma message "Manual NEON optimizations are ON: we have a faster shift_addfast_cc now."

     ^~~~~~~

In file included from libcsdr_wrapper.c:1: libcsdr.c:468:9: note: #pragma message: Manual NEON optimizations are ON: we have a faster fir_decimate_cc now.

pragma message "Manual NEON optimizations are ON: we have a faster fir_decimate_cc now."

     ^~~~~~~

./parsevect dumpvect*.vect

Auto-vectorization built into gcc can increase the execution speed of algorithms with automatic generation of SIMD instructions if the CPU is capable. We parse the output of the vectorizer to analyze which loops could be optimized (thus speeded up) this way. Warning! The result may be different on different CPU architectures...

Colors:

libcsdr.c:123:5: note: LOOP VECTORIZED normalize_fir_f: normalize pass 2 libcsdr.c:121:5: note: LOOP VECTORIZED normalize_fir_f: normalize pass 1 libcsdr.c:136:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed firdes_lowpass_f: calculate taps libcsdr.c:156:5: note: not vectorized: multiple nested loops. firdes_bandpass_c libcsdr.c:162:14: note: not vectorized: number of iterations cannot be computed. firdes_bandpass_c libcsdr.c:161:14: note: not vectorized: number of iterations cannot be computed. firdes_bandpass_c libcsdr.c:193:5: note: not vectorized: multiple nested loops. shift_math_cc libcsdr.c:204:14: note: not vectorized: number of iterations cannot be computed. shift_math_cc: normalize phase libcsdr.c:203:14: note: not vectorized: number of iterations cannot be computed. shift_math_cc: normalize phase libcsdr.c:217:5: note: not vectorized: relevant stmt not supported: _34 = builtin_sinf (_30); libcsdr.c:217:5: note: not vectorized: relevant stmt not supported: _34 = builtin_sinf (_30); libcsdr.c:237:5: note: not vectorized: multiple nested loops. shift_math_cc libcsdr.c:262:14: note: not vectorized: number of iterations cannot be computed. shift_math_cc: normalize phase libcsdr.c:261:14: note: not vectorized: number of iterations cannot be computed. shift_math_cc: normalize phase libcsdr.c:276:5: note: not vectorized: multiple nested loops. libcsdr.c:280:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:279:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:303:10: note: not vectorized: number of iterations cannot be computed. libcsdr.c:302:10: note: not vectorized: number of iterations cannot be computed. libcsdr.c:294:5: note: LOOP VECTORIZED shift_unroll_cc libcsdr.c:311:5: note: not vectorized: unsupported data-type complex float libcsdr.c:311:5: note: not vectorized: unsupported data-type complex float libcsdr.c:392:10: note: not vectorized: number of iterations cannot be computed. libcsdr.c:391:10: note: not vectorized: number of iterations cannot be computed. libcsdr.c:327:5: note: LOOP VECTORIZED libcsdr.c:484:9: note: not vectorized: control flow in loop. libcsdr.c:590:9: note: not vectorized: multiple nested loops. libcsdr.c:590:9: note: not vectorized: multiple nested loops. libcsdr.c:597:13: note: not vectorized: number of iterations cannot be computed. fir_interpolate_cc: i loop libcsdr.c:596:13: note: not vectorized: number of iterations cannot be computed. fir_interpolate_cc: i loop libcsdr.c:618:15: note: not vectorized: control flow in loop. libcsdr.c:624:9: note: LOOP VECTORIZED rational_resampler_ff (inner loop) libcsdr.c:678:5: note: LOOP VECTORIZED fir_one_pass_ff libcsdr.c:699:5: note: not vectorized: multiple nested loops. fractional_decimator_ff libcsdr.c:678:5: note: LOOP VECTORIZED fir_one_pass_ff libcsdr.c:678:5: note: LOOP VECTORIZED fir_one_pass_ff libcsdr.c:678:5: note: LOOP VECTORIZED fir_one_pass_ff libcsdr.c:727:5: note: not vectorized: control flow in loop. libcsdr.c:730:9: note: not vectorized: control flow in loop. libcsdr.c:763:5: note: not vectorized: multiple nested loops. fractional_decimator_ff libcsdr.c:784:9: note: not vectorized: relevant stmt not supported: _47 = _43 / _46; libcsdr.c:784:9: note: not vectorized: relevant stmt not supported: _47 = _43 / _46; libcsdr.c:774:9: note: not vectorized: control flow in loop. libcsdr.c:777:13: note: not vectorized: control flow in loop. libcsdr.c:769:13: note: not vectorized: control flow in loop. libcsdr.c:678:5: note: LOOP VECTORIZED fir_one_pass_ff libcsdr.c:771:13: note: LOOP VECTORIZED libcsdr.c:843:5: note: LOOP VECTORIZED apply_fir_fft_cc: add overlap libcsdr.c:837:5: note: LOOP VECTORIZED apply_fir_fft_cc: normalize by fft_size libcsdr.c:825:5: note: LOOP VECTORIZED apply_fir_fft_cc: multiplication libcsdr.c:869:5: note: not vectorized: relevant stmt not supported: _17 = builtin_sqrtf (_16); amdemod: sqrt libcsdr.c:869:5: note: not vectorized: relevant stmt not supported: _17 = builtin_sqrtf (_16); amdemod: sqrt libcsdr.c:864:5: note: LOOP VECTORIZED amdemod: ii+qq libcsdr.c:888:5: note: LOOP VECTORIZED amdemod_estimator libcsdr.c:911:5: note: not vectorized, possible dependence between data-refs _14 and _17 dcblock_f libcsdr.c:911:5: note: not vectorized, possible dependence between data-refs _14 and _17 dcblock_f libcsdr.c:935:5: note: LOOP VECTORIZED fastdcblock_ff: remove DC component libcsdr.c:927:5: note: LOOP VECTORIZED fastdcblock_ff: calculate block average libcsdr.c:975:5: note: not vectorized: unsupported data-type double fastagc_ff: apply gain libcsdr.c:975:5: note: not vectorized: unsupported data-type double fastagc_ff: apply gain libcsdr.c:959:5: note: LOOP VECTORIZED fastagc_ff: peak search libcsdr.c:1009:5: note: not vectorized: unsupported use in stmt. fmdemod_atan_novect libcsdr.c:1009:5: note: not vectorized: no grouped stores in basic block. fmdemod_atan_novect libcsdr.c:1027:5: note: not vectorized: unsupported data-type double fmdemod_quadri_novect_cf libcsdr.c:1027:5: note: not vectorized: unsupported data-type double fmdemod_quadri_novect_cf libcsdr.c:1065:5: note: not vectorized: unsupported data-type double fmdemod_quadri_cf: output division libcsdr.c:1065:5: note: not vectorized: unsupported data-type double fmdemod_quadri_cf: output division libcsdr.c:1065:5: note: not vectorized: no grouped stores in basic block. fmdemod_quadri_cf: output division libcsdr.c:1061:5: note: LOOP VECTORIZED fmdemod_quadri_cf: output denomiator libcsdr.c:1057:5: note: LOOP VECTORIZED fmdemod_quadri_cf: output numerator libcsdr.c:1052:5: note: LOOP VECTORIZED fmdemod_quadri_cf: di libcsdr.c:1046:5: note: LOOP VECTORIZED fmdemod_quadri_cf: dq libcsdr.c:1094:5: note: not vectorized, possible dependence between data-refs _16 and _19 deemphasis_wfm_ff libcsdr.c:1094:5: note: not vectorized, possible dependence between data-refs _16 and _19 deemphasis_wfm_ff libcsdr.c:1124:9: note: LOOP VECTORIZED deemphasis_nfm_ff: inner loop libcsdr.c:1132:5: note: LOOP VECTORIZED limit_ff libcsdr.c:1141:5: note: LOOP VECTORIZED gain_ff libcsdr.c:1147:5: note: not vectorized: number of iterations cannot be computed. libcsdr.c:1157:5: note: not vectorized: number of iterations cannot be computed. libcsdr.c:1177:5: note: LOOP VECTORIZED libcsdr.c:1176:5: note: LOOP VECTORIZED libcsdr.c:1183:5: note: not vectorized: multiple nested loops. libcsdr.c:1187:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:1186:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:1196:5: note: not vectorized: relevant stmt not supported: amplitude_now_22 = builtin_sqrtf (_10); libcsdr.c:1196:5: note: not vectorized: relevant stmt not supported: amplitude_now_22 = builtin_sqrtf (_10); libcsdr.c:1225:9: note: not vectorized: control flow in loop. log2n libcsdr.c:1240:9: note: not vectorized: control flow in loop. next_pow2 libcsdr.c:1248:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed apply_window_c libcsdr.c:1261:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed precalculate_window libcsdr.c:1271:5: note: LOOP VECTORIZED apply_precalculated_window_c libcsdr.c:1280:2: note: LOOP VECTORIZED apply_precalculated_window_f libcsdr.c:1289:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed apply_window_f libcsdr.c:1302:5: note: LOOP VECTORIZED logpower_cf: pass 3 libcsdr.c:1300:5: note: not vectorized: relevant stmt not supported: _17 = builtin_log10f (_16); logpower_cf: pass 2 libcsdr.c:1300:5: note: not vectorized: relevant stmt not supported: _17 = builtin_log10f (_16); logpower_cf: pass 2 libcsdr.c:1298:5: note: LOOP VECTORIZED logpower_cf: pass 1 libcsdr.c:1307:5: note: LOOP VECTORIZED logpower_cf: pass 1 libcsdr.c:1313:5: note: LOOP VECTORIZED logpower_cf: pass 3 libcsdr.c:1311:5: note: not vectorized: relevant stmt not supported: _6 = builtin_log10f (_4); logpower_cf: pass 2 libcsdr.c:1311:5: note: not vectorized: relevant stmt not supported: _6 = builtin_log10f (_4); logpower_cf: pass 2 libcsdr.c:1319:5: note: LOOP VECTORIZED libcsdr.c:1544:9: note: not vectorized: control flow in loop. libcsdr.c:1560:22: note: not vectorized: multiple nested loops. libcsdr.c:1564:17: note: not vectorized: data ref analysis failed _29 = 0; libcsdr.c:1564:17: note: not vectorized: data ref analysis failed _14 = iftmp.223_41; libcsdr.c:1559:13: note: not vectorized: control flow in loop. libcsdr.c:1618:9: note: not vectorized: control flow in loop. libcsdr.c:1674:13: note: not vectorized: multiple nested loops. libcsdr.c:1710:9: note: LOOP VECTORIZED libcsdr.c:1690:9: note: not vectorized: control flow in loop. libcsdr.c:1697:13: note: LOOP VECTORIZED libcsdr.c:1676:35: note: not vectorized: control flow in loop. libcsdr.c:1734:5: note: not vectorized: control flow in loop. libcsdr.c:1737:13: note: not vectorized: control flow in loop. libcsdr.c:1769:5: note: not vectorized: relevant stmt not supported: _5 = _4 > 0.0; libcsdr.c:1769:5: note: not vectorized: relevant stmt not supported: _5 = _4 > 0.0; libcsdr.c:1776:5: note: not vectorized: unsupported data-type complex float libcsdr.c:1776:5: note: not vectorized: unsupported data-type complex float libcsdr.c:1787:5: note: not vectorized: multiple nested loops. libcsdr.c:1788:9: note: not vectorized: control flow in loop. libcsdr.c:1789:13: note: LOOP VECTORIZED libcsdr.c:1796:5: note: not vectorized: control flow in loop. libcsdr.c:1798:9: note: not vectorized: unsupported data-type double libcsdr.c:1798:9: note: not vectorized: unsupported data-type double libcsdr.c:1812:5: note: LOOP VECTORIZED libcsdr.c:1821:5: note: not vectorized: unsupported use in stmt. libcsdr.c:1831:9: note: not vectorized: unsupported use in stmt. libcsdr.c:1837:9: note: not vectorized: unsupported use in stmt. libcsdr.c:1837:9: note: not vectorized: no grouped stores in basic block. libcsdr.c:1878:9: note: not vectorized: multiple nested loops. libcsdr.c:1905:18: note: not vectorized: number of iterations cannot be computed. libcsdr.c:1904:18: note: not vectorized: number of iterations cannot be computed. libcsdr.c:1890:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:1889:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:1880:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:1879:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:1948:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed libcsdr.c:1948:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed libcsdr.c:1942:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed libcsdr.c:1942:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed libcsdr.c:1935:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed libcsdr.c:1935:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed libcsdr.c:1933:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed libcsdr.c:1931:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed libcsdr.c:1924:5: note: LOOP VECTORIZED libcsdr.c:1993:9: note: not vectorized: control flow in loop. libcsdr.c:2110:5: note: not vectorized: multiple nested loops. libcsdr.c:2140:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:2139:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:2125:22: note: not vectorized: number of iterations cannot be computed. libcsdr.c:2205:5: note: not vectorized: complicated access pattern. libcsdr.c:2253:9: note: LOOP VECTORIZED firdes_add_peak_c: normalize pass 2 libcsdr.c:2249:9: note: not vectorized: unsupported use in stmt. firdes_add_peak_c: normalize pass 1 libcsdr.c:2240:9: note: LOOP VECTORIZED libcsdr.c:2227:5: note: not vectorized: multiple nested loops. firdes_add_peak_c: calculate taps libcsdr.c:2235:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:2234:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:2264:5: note: not vectorized: control flow in loop. libcsdr.c:2267:9: note: not vectorized: complicated access pattern. libcsdr.c:2279:5: note: not vectorized: control flow in loop. libcsdr.c:2282:9: note: LOOP VECTORIZED libcsdr.c:2314:5: note: LOOP VECTORIZED libcsdr.c:2297:5: note: not vectorized: unsupported use in stmt. libcsdr.c:2297:5: note: not vectorized: no grouped stores in basic block. libcsdr.c:2297:5: note: not vectorized: control flow in loop. libcsdr.c:2322:5: note: not vectorized: multiple nested loops. libcsdr.c:2328:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:2327:14: note: not vectorized: number of iterations cannot be computed. libcsdr.c:2338:5: note: not vectorized: control flow in loop. libcsdr.c:2342:9: note: LOOP VECTORIZED libcsdr.c:2365:5: note: not vectorized: unsupported data-type double convert_u8_f libcsdr.c:2365:5: note: not vectorized: unsupported data-type double convert_u8_f libcsdr.c:2370:5: note: LOOP VECTORIZED convert_s8_f libcsdr.c:2375:5: note: LOOP VECTORIZED convert_s16_f libcsdr.c:2380:5: note: not vectorized: unsupported data-type double convert_f_u8 libcsdr.c:2380:5: note: not vectorized: unsupported data-type double convert_f_u8 libcsdr.c:2387:5: note: LOOP VECTORIZED convert_f_s8 libcsdr.c:2397:5: note: LOOP VECTORIZED convert_f_s16 libcsdr.c:2406:19: note: not vectorized: relevant stmt not supported: _12 = BIT_FIELD_REF <_6, 8, 8>; libcsdr.c:2406:19: note: not vectorized: relevant stmt not supported: _12 = BIT_FIELD_REF <_6, 8, 8>; libcsdr.c:2414:10: note: not vectorized: relevant stmt not supported: _24 = BIT_FIELD_REF <_21, 8, 16>; libcsdr.c:2414:10: note: not vectorized: relevant stmt not supported: _24 = BIT_FIELD_REF <_21, 8, 16>; libcsdr.c:2427:19: note: LOOP VECTORIZED libcsdr.c:2432:10: note: LOOP VECTORIZED libcsdr.c:2448:5: note: LOOP VECTORIZED libcsdr.c:2459:5: note: not vectorized: unsupported data-type double libcsdr.c:2459:5: note: not vectorized: unsupported data-type double libcsdr.c:2477:5: note: not vectorized: unsupported data-type double libcsdr.c:2477:5: note: not vectorized: unsupported data-type double libcsdr.c:2487:5: note: not vectorized: unsupported data-type complex double libcsdr.c:2487:5: note: not vectorized: unsupported data-type complex double libcsdr.c:2487:5: note: not vectorized: no grouped stores in basic block. libcsdr.c:2501:5: note: not vectorized: loop contains function calls or data references that cannot be analyzed libcsdr.c:2520:5: note: LOOP VECTORIZED libcsdr.c:2525:5: note: LOOP VECTORIZED libcsdr.c:2536:5: note: LOOP VECTORIZED trivial_vectorize: should pass :-) libcsdr_gpl.c:50:7: note: not vectorized: number of iterations cannot be computed. shift_addition_cc: normalize starting_phase libcsdr_gpl.c:49:7: note: not vectorized: number of iterations cannot be computed. shift_addition_cc: normalize starting_phase libcsdr_gpl.c:37:2: note: not vectorized: unsupported use in stmt. shift_addition_cc: work libcsdr_gpl.c:77:7: note: not vectorized: number of iterations cannot be computed. shift_addition_cc: normalize starting_phase libcsdr_gpl.c:76:7: note: not vectorized: number of iterations cannot be computed. shift_addition_cc: normalize starting_phase libcsdr_gpl.c:64:2: note: not vectorized: unsupported use in stmt. shift_addition_cc: work libcsdr_gpl.c:104:2: note: not vectorized: control flow in loop. shift_addition_cc: work libcsdr_gpl.c:111:8: note: not vectorized: number of iterations cannot be computed. shift_addition_cc: normalize phase libcsdr_gpl.c:158:7: note: not vectorized: number of iterations cannot be computed. shift_addition_cc: normalize starting_phase libcsdr_gpl.c:157:7: note: not vectorized: number of iterations cannot be computed. shift_addition_cc: normalize starting_phase libcsdr_gpl.c:142:2: note: not vectorized: number of iterations cannot be computed. shift_addition_cc: work libcsdr_gpl.c:198:2: note: not vectorized: unsupported use in stmt. agc_ff libcsdr_gpl.c:198:2: note: not vectorized: no grouped stores in basic block. agc_ff ima_adpcm.c:157:2: note: not vectorized: data ref analysis failed step_57 = _stepSizeTable[state$index_19]; ima_adpcm.c:157:2: note: not vectorized: no grouped stores in basic block. ima_adpcm.c:168:2: note: not vectorized: data ref analysis failed step_55 = _stepSizeTable[state_17]; fastddc.c:50:8: note: not vectorized: number of iterations cannot be computed. fastddc.c:42:20: note: not vectorized: control flow in loop. fastddc.c:95:2: note: LOOP VECTORIZED fastddc.c:154:2: note: LOOP VECTORIZED fastddc_inv_cc: normalize by size fastddc.c:144:2: note: LOOP VECTORIZED fastddc.c:126:2: note: not vectorized: data ref analysis failed _18 = *_17; fastddc.c:116:2: note: LOOP VECTORIZED gcc -std=gnu99 -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 -DNEON_OPTS csdr.c -g -lm -lrt -lfftw3f -DUSE_FFTW -DLIBCSDR_GPL -DUSE_IMA_ADPCM -L. -lcsdr -Wno-unused-result -o csdr In file included from /usr/include/arm-linux-gnueabihf/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from csdr.c:34: /usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]

warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

^~~ csdr.c:163:6: warning: trigraph ??< ignored, use -trigraphs to enable [-Wtrigraphs] " ??\n"

g++ -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 -DNEON_OPTS nmux.cpp tsmpool.cpp -g -lm -lrt -lfftw3f -DUSE_FFTW -DLIBCSDR_GPL -DUSE_IMA_ADPCM -L. -lcsdr -lpthread -Wno-unused-result -o nmux `

ha7ilm commented 5 years ago

You can play around with the compiler switches, but in general, the computational power of ARM single board computers is limited, especially if you want to process signals with higher sample rates, so this behaviour is expected.