naxingyu / opensmile

A github repo of the openSMILE feature extraction tool.
http://www.audeering.com/research/opensmile
Other
213 stars 79 forks source link

compilation in ubuntu 17.04 #2

Closed cristianofigo closed 1 year ago

cristianofigo commented 7 years ago

trying to compile with portaudio suport:

livre@livre:~/Documentos/opensmile-2.3.0$ ./buildWithPortAudio.sh

everything fine until:

In file included from src/include/core/componentList.hpp:30:0,
                 from src/core/componentManager.cpp:99:
src/include/core/vectorTransform.hpp:117:83: error: narrowing conversion of ‘'\37777777756'’ from ‘char’ to ‘unsigned char’ inside { } [-Wnarrowing]
  unsigned char smileMagic[] = {(char)0xEE, (char)0x11, (char)0x11, (char)0x00};
                                                                              ^
In file included from src/include/rnn/rnnSink.hpp:63:0,
                 from src/include/core/componentList.hpp:90,
                 from src/core/componentManager.cpp:99:
src/include/rnn/rnn.hpp: In member function ‘void cNnConnection::setWeights(float*, long int, int)’:
src/include/rnn/rnn.hpp:73:90: warning: format ‘%i’ expects argument of type ‘int’, but argument 4 has type ‘long int’ [-Wformat=]
 , ...) { fprintf(stderr, "RNN ERROR: "); fprintf(stderr, __VA_ARGS__); fprintf(stderr,"\n"); }
                                                                     ^
src/include/rnn/rnn.hpp:511:7: note: in expansion of macro ‘RNN_ERR’
       RNN_ERR(1,"number of weights mismatch for layer %i in connection->setWeights: number weights = %i, expected %i",_layerIdx,N,input[_layerIdx]->getOutputSize()*outputSize);
       ^~~~~~~
src/include/rnn/rnn.hpp:73:90: warning: format ‘%i’ expects argument of type ‘int’, but argument 5 has type ‘long int’ [-Wformat=]
 , ...) { fprintf(stderr, "RNN ERROR: "); fprintf(stderr, __VA_ARGS__); fprintf(stderr,"\n"); }
                                                                     ^
src/include/rnn/rnn.hpp:511:7: note: in expansion of macro ‘RNN_ERR’
       RNN_ERR(1,"number of weights mismatch for layer %i in connection->setWeights: number weights = %i, expected %i",_layerIdx,N,input[_layerIdx]->getOutputSize()*outputSize);
       ^~~~~~~
Makefile:1457: recipe for target 'src/core/libopensmile_la-componentManager.lo' failed
make: *** [src/core/libopensmile_la-componentManager.lo] Error 1
failed to build or install openSMILE!
./buildWithPortAudio.sh: 86: exit: Illegal number: -1
audeering commented 7 years ago

Newer gcc Version does not tolerate cast from char to unsigned char, thus you need to change the casts of the consts from char to unsigned char in vectorTransform.hpp in line 117. It will be solved in version 2.4. which will be released by audEERING soon.

coolo commented 6 years ago

... for larger values of soon. But changing (char)0xEE to (unsigned char)0xEE is enough to get over this one

erezsh commented 6 years ago

Also got stuck here. Doesn't seem like such a difficult issue to patch.

tbrknt commented 6 years ago

I also encountered with that issue. If you are too 'lazy' to change it manually, you can type the following command on the terminal when you are in opensmile-2.3.0: sed -i '117s/(char)/(unsigned char)/g' src/include/core/vectorTransform.hpp

If you are on the same level with opensmile-2.3.0 directory, you can type: sed -i '117s/(char)/(unsigned char)/g' opensmile-2.3.0/src/include/core/vectorTransform.hpp