xiph / rnnoise

Recurrent neural network for audio noise reduction
BSD 3-Clause "New" or "Revised" License
3.89k stars 882 forks source link

RNNoise v0.2 does not compile on Mac and Linux #222

Open grazder opened 3 months ago

grazder commented 3 months ago

I'm doing similar steps that worked for me:

git clone https://github.com/xiph/rnnoise.git
cd rnnoise
git checkout 904a876dce1f9ab8860c0a5000ed151f9f6eef58
./autogen.sh
./configure
make

On Linux on make step I recieve a lot of

src/vec_avx.h:801:40: error: incompatible type for argument 1 of ‘mm256_broadcastd_epi32’                                        
  801 |          vxj = _mm256_broadcastd_epi32(_mm_loadu_si32(&x[*idx++]));                                                      
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~                                                        
      |                                        |                                                                                 
      |                                        int                                                                               
src/vec_avx.h:204:59: note: in definition of macro ‘_mm256_broadcastd_epi32’  

And it ends up with

make: *** [Makefile:721: src/nnet.lo] Error 1

On Mac I recieve:

In file included from src/nnet.c:39:
In file included from ./src/vec.h:41:
./src/vec_neon.h:35:10: fatal error: 'os_support.h' file not found
#include "os_support.h"
         ^~~~~~~~~~~~~~
1 error generated.
make[1]: *** [src/nnet.lo] Error 1
make: *** [all] Error 2
pallaswept commented 3 months ago

Once I got the dependencies installed (make, gcc, and friends, and glib2-devel), it all worked OK for me, on a tumbleweed live image VM. Perhaps there's some version or configuration difference, but hopefully this gives you a starting point that is known to work, which you can use to get your system to behave the same way. Good luck!

grazder commented 3 months ago

@pallaswept Do you have full list of dependencies?

grazder commented 3 months ago

Seems like ./configure should check everything, but it says that everithing is OK

------------------------------------------------------------------------
  rnnoise 0.2: Automatic configuration OK.

    Assertions ................... no

    Hidden visibility ............ yes

    API code examples ............ yes
    API documentation ............ yes
------------------------------------------------------------------------
pallaswept commented 3 months ago

@pallaswept Do you have full list of dependencies?

Starting with the live image, this will build it:

sudo zypper install --recommends git-core gcc make autoconf libtool glib2-devel
git clone https://github.com/xiph/rnnoise.git
cd rnnoise
git checkout 904a876dce1f9ab8860c0a5000ed151f9f6eef58
export CFLAGS=-march=native # Optional, but you will get lots of warnings without specifying a capable CPU
./autogen.sh
./configure
make
2towardsnorth commented 3 months ago

Can it be implemented on Windows

jmvalin commented 3 months ago

Normally the code should compile on Windows. That being said, there's no build system other than autotools at the moment

pengzhendong commented 2 months ago

Can it be implemented on Windows

Sure. https://github.com/pengzhendong/pyrnnoise/blob/master/CMakeLists.txt

firmwarecostum commented 3 weeks ago

@grazder

fix https://github.com/xiph/rnnoise/commit/372f7b4b76cde4ca1ec4605353dd17898a99de38