audeering / opensmile

The Munich Open-Source Large-Scale Multimedia Feature Extractor
https://audeering.github.io/opensmile/
Other
569 stars 75 forks source link

Error compiling opensmile on Linux CentOS 7 #19

Closed rbrueckner closed 3 years ago

rbrueckner commented 3 years ago

I'm trying to compile opensmile on Linux CentOS 7 and get the following compilation error:

... [ 20%] Building CXX object CMakeFiles/opensmile.dir/src/core/componentManager.cpp.o [ 20%] Building CXX object CMakeFiles/opensmile.dir/src/core/configManager.cpp.o [ 21%] Building CXX object CMakeFiles/opensmile.dir/src/core/dataProcessor.cpp.o /mnt/users/xxx/repos/opensmile/src/core/configManager.cpp: In member function ‘void cConfigFileBuffer::loadFile(const char, FILE)’: /mnt/users/xxx/repos/opensmile/src/core/configManager.cpp:1722:6: error: use of deleted function ‘std::basic_ifstream& std::basic_ifstream::operator=(const std::basic_ifstream&)’ is = std::ifstream(filename, std::ifstream::in); ^ In file included from /mnt/users/xxx/repos/opensmile/src/include/core/configManager.hpp:27:0, from /mnt/users/xxx/repos/opensmile/src/core/configManager.cpp:30: /usr/include/c++/4.8.2/fstream:427:11: note: ‘std::basic_ifstream& std::basic_ifstream::operator=(const std::basic_ifstream&)’ is implicitly deleted because the default definition would be ill-formed: class basic_ifstream : public basic_istream<_CharT, _Traits> ^ /usr/include/c++/4.8.2/fstream:427:11: error: use of deleted function ‘std::basic_istream& std::basic_istream::operator=(const std::basic_istream&)’ In file included from /usr/include/c++/4.8.2/iterator:65:0, from /mnt/users/xxx/repos/opensmile/src/include/rapidjson/document.h:56, from /mnt/users/xxx/repos/opensmile/src/include/core/configManager.hpp:22, from /mnt/users/xxx/repos/opensmile/src/core/configManager.cpp:30: /usr/include/c++/4.8.2/istream:58:11: note: ‘std::basic_istream& std::basic_istream::operator=(const std::basic_istream&)’ is implicitly deleted because the default definition would be ill-formed: class basic_istream : virtual public basic_ios<_CharT, _Traits> ^ /usr/include/c++/4.8.2/istream:58:11: error: use of deleted function ‘std::basic_ios& std::basic_ios::operator=(const std::basic_ios&)’ In file included from /usr/include/c++/4.8.2/ios:44:0, from /usr/include/c++/4.8.2/ostream:38, from /usr/include/c++/4.8.2/iterator:64, from /mnt/users/xxx/repos/opensmile/src/include/rapidjson/document.h:56, from /mnt/users/xxx/repos/opensmile/src/include/core/configManager.hpp:22, from /mnt/users/xxx/repos/opensmile/src/core/configManager.cpp:30: /usr/include/c++/4.8.2/bits/basic_ios.h:66:11: note: ‘std::basic_ios& std::basic_ios::operator=(const std::basic_ios&)’ is implicitly deleted because the default definition would be ill-formed: class basic_ios : public ios_base ^ In file included from /usr/include/c++/4.8.2/ios:42:0, from /usr/include/c++/4.8.2/ostream:38, from /usr/include/c++/4.8.2/iterator:64, from /mnt/users/xxx/repos/opensmile/src/include/rapidjson/document.h:56, from /mnt/users/xxx/repos/opensmile/src/include/core/configManager.hpp:22, from /mnt/users/xxx/repos/opensmile/src/core/configManager.cpp:30: /usr/include/c++/4.8.2/bits/ios_base.h:789:5: error: ‘std::ios_base& std::ios_base::operator=(const std::ios_base&)’ is private operator=(const ios_base&); ^ In file included from /usr/include/c++/4.8.2/ios:44:0, from /usr/include/c++/4.8.2/ostream:38, from /usr/include/c++/4.8.2/iterator:64, from /mnt/users/xxx/repos/opensmile/src/include/rapidjson/document.h:56, from /mnt/users/xxx/repos/opensmile/src/include/core/configManager.hpp:22, from /mnt/users/xxx/repos/opensmile/src/core/configManager.cpp:30: /usr/include/c++/4.8.2/bits/basic_ios.h:66:11: error: within this context class basic_ios : public ios_base ^ In file included from /mnt/users/xxx/repos/opensmile/src/include/core/configManager.hpp:27:0, from /mnt/users/xxx/repos/opensmile/src/core/configManager.cpp:30: /usr/include/c++/4.8.2/fstream:427:11: error: use of deleted function ‘std::basic_filebuf& std::basic_filebuf::operator=(const std::basic_filebuf&)’ class basic_ifstream : public basic_istream<_CharT, _Traits> ^ /usr/include/c++/4.8.2/fstream:72:11: note: ‘std::basic_filebuf& std::basic_filebuf::operator=(const std::basic_filebuf&)’ is implicitly deleted because the default definition would be ill-formed: class basic_filebuf : public basic_streambuf<_CharT, _Traits> ^ In file included from /usr/include/c++/4.8.2/ios:43:0, from /usr/include/c++/4.8.2/ostream:38, from /usr/include/c++/4.8.2/iterator:64, from /mnt/users/xxx/repos/opensmile/src/include/rapidjson/document.h:56, from /mnt/users/xxx/repos/opensmile/src/include/core/configManager.hpp:22, from /mnt/users/xxx/repos/opensmile/src/core/configManager.cpp:30: /usr/include/c++/4.8.2/streambuf:810:7: error: ‘std::basic_streambuf<_CharT, _Traits>& std::basic_streambuf<_CharT, _Traits>::operator=(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits]’ is private operator=(const basic_streambuf& __sb) ^ In file included from /mnt/users/xxx/repos/opensmile/src/include/core/configManager.hpp:27:0, from /mnt/users/xxx/repos/opensmile/src/core/configManager.cpp:30: /usr/include/c++/4.8.2/fstream:72:11: error: within this context class basic_filebuf : public basic_streambuf<_CharT, _Traits> ^ [ 22%] Building CXX object CMakeFiles/opensmile.dir/src/core/dataReader.cpp.o gmake[2]: [CMakeFiles/opensmile.dir/src/core/configManager.cpp.o] Error 1 gmake[2]: Waiting for unfinished jobs.... gmake[1]: [CMakeFiles/opensmile.dir/all] Error 2 gmake: [all] Error 2

My build_flags.sh says:

!/bin/bash

This file is part of openSMILE.

#

Copyright (c) audEERING. All rights reserved.

See the file COPYING for details on license terms.

build_flags=(

libsvm and dependent components (cLibsvmLiveSink)

-DBUILD_LIBSVM

# LSTM RNN components
-DBUILD_RNN

# cSvmSink
-DBUILD_SVMSMO

)

cmake_flags=(

switches between release and debug builds

-DCMAKE_BUILD_TYPE=Release

# use Clang compiler. Comment out to use system-default C and C++ compilers.
# Leave commented out when building for Android, as the NDK version of Clang is required.
#-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++

# controls whether to build and link to libopensmile as static or shared library
# static builds are preferred unless you need openSMILE plugins
-DSTATIC_LINK=ON

# tune compiler optimizations to the processor of this machine.
# This ensures that openSMILE runs with optimal performance on the machine it was
# compiled on but it may not run at all on other machines.
# Disable if the compiled binary needs to be portable.
-DMARCH_NATIVE=OFF

# whether to compile with PortAudio support
-DWITH_PORTAUDIO=OFF

# whether to compile with FFmpeg support
# 1. download ffmpeg source distribution
# 2. run: mkdir build ; cd build
#         ../configure --enable-shared --disable-static
#         make ; sudo make install
-DWITH_FFMPEG=ON

# whether to compile with OpenCV support
-DWITH_OPENCV=OFF

# whether to compile with OpenSL ES support (only applies when building for Android)
-DWITH_OPENSLES=OFF

# whether to compile with Julius support
-DWITH_JULIUS=OFF

)

build_flags="${build_flags[@]}"

hagenw commented 3 years ago

It might be that the gcc version on CentOS is too old, see https://github.com/audeering/opensmile/issues/18

rbrueckner commented 3 years ago

Thanks! What minimal version of gcc do you suggest?

chausner-audeering commented 3 years ago

Yes, most likely your compiler version is too old. openSMILE requires a C++11-compliant compiler. According to https://en.cppreference.com/w/cpp/compiler_support, gcc versions 5.x and later appear to have basically full support of C++11. In general, I'd recommend to use the latest compiler version available for your operating system, as newer gcc versions also have better code optimization so the binaries built with newer compiler versions tend to run faster.

chausner-audeering commented 3 years ago

Closing as it has been confirmed that the compilation error was caused by an outdated compiler version: https://github.com/audeering/opensmile/issues/18#issuecomment-864018498