drowe67 / LPCNet

Experimental Neural Net speech coding for FreeDV
BSD 3-Clause "New" or "Revised" License
68 stars 24 forks source link

Compile error on 32 bit Linux Mint machine without vector ops #41

Closed tmiw closed 2 years ago

tmiw commented 2 years ago

As reported on the digitalvoice mailing list:

[ 78%] Building C object src/CMakeFiles/test_vec.dir/test_vec.c.o
/home/curt/freedv-gui/LPCNet/src/test_vec.c: In function ‘test_sgemv_accum16’:
/home/curt/freedv-gui/LPCNet/src/test_vec.c:75:5: warning: implicit declaration of function ‘sgemv_accum16_fast’; did you mean ‘sgemv_accum16’? [-Wimplicit-function-declaration]
     sgemv_accum16_fast(out_fast, weights, ROWS, COLS, 1, x);
     ^~~~~~~~~~~~~~~~~~
     sgemv_accum16
/home/curt/freedv-gui/LPCNet/src/test_vec.c: In function ‘test_sparse_sgemv_accum16’:
/home/curt/freedv-gui/LPCNet/src/test_vec.c:109:5: warning: implicit declaration of function ‘sparse_sgemv_accum16_fast’; did you mean ‘sparse_sgemv_accum16’? [-Wimplicit-function-declaration]
     sparse_sgemv_accum16_fast(out_fast, w, rows, indx, x);
     ^~~~~~~~~~~~~~~~~~~~~~~~~
     sparse_sgemv_accum16
[ 80%] Linking C executable test_vec
CMakeFiles/test_vec.dir/test_vec.c.o: In function `test_sgemv_accum16':
/home/curt/freedv-gui/LPCNet/src/test_vec.c:75: undefined reference to `sgemv_accum16_fast'
CMakeFiles/test_vec.dir/test_vec.c.o: In function `test_sparse_sgemv_accum16':
/home/curt/freedv-gui/LPCNet/src/test_vec.c:109: undefined reference to `sparse_sgemv_accum16_fast'
collect2: error: ld returned 1 exit status
src/CMakeFiles/test_vec.dir/build.make:94: recipe for target 'src/test_vec' failed
make[2]: *** [src/test_vec] Error 1
CMakeFiles/Makefile2:1537: recipe for target 'src/CMakeFiles/test_vec.dir/all' failed
make[1]: *** [src/CMakeFiles/test_vec.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

We probably just need to change the function names used to get it to build on x86 machines without any sort of vectorization (e.g. no AVX/SSE).

drowe67 commented 2 years ago

I just tried a non-AVX machine using Ubuntu 20 - LPCNet & freedv-gui (using build_linux.sh) builds for me, test_vec builds and runs OK:

david@bear:~/LPCNet/build_linux master $ ./src/test_vec 
testing vector routines on SIMD: SSE
sgemv_accum16.....................: pass
sparse_sgemv_accum16..............: pass

Looking at LPCNet/build_linux/CMakeCache.txt neither the AVX or SSE flags were set, so LPCNet correctly determined there was no vectorisation available.

tmiw commented 2 years ago

Could it be something with Linux Mint specifically? As in, whatever it's using for libraries only has sgemv_accum16 and not sgemv_accum16_fast for example?

drowe67 commented 2 years ago

Those functions are in nnet.c. IIRC others have built LPCnet & freedv-gui on Linux Mint, it's a pretty standard distro. Maybe user error?

tmiw commented 2 years ago

Curt on the digitalvoice list ended up fresh installing Ubuntu on his machine and solved the compile/crash issues he was having. We can probably close this unless someone else ends up seeing similar.