sonosaurus / sonobus

Source code for SonoBus, a real-time network audio streaming collaboration tool.
https://sonobus.net
GNU General Public License v3.0
1.6k stars 119 forks source link

Build failure during compilation of 1.4.4 on Fedora 34 #90

Closed ycollet closed 3 years ago

ycollet commented 3 years ago

I try to compile sonobus 1.4.4 on Fedora 34 (with gcc-11, which is c++17 by default). I met the following error message:

[ 68%] Building CXX object CMakeFiles/SonoBus.dir/deps/aoo/lib/src/client.cpp.o
/usr/bin/g++ -DAOO_STATIC -DAOO_TIMEFILTER_CHECK=0 -DFF_AUDIO_ALLOW_ALLOCATIONS_IN_MEASURE_BLOCK=0 -DJUCE_ALSA=1 -DJUCE_ASIO=1 -DJUCE_DIRECTSOUND=0 -DJUCE_DISPLAY_SPLASH_SCREEN=0 -DJUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 -DJUCE_JACK=1 -DJUCE_MODULE_AVAILABLE_ff_meters=1 -DJUCE_MODULE_AVAILABLE_juce_audio_basics=1 -DJUCE_MODULE_AVAILABLE_juce_audio_devices=1 -DJUCE_MODULE_AVAILABLE_juce_audio_formats=1 -DJUCE_MODULE_AVAILABLE_juce_audio_plugin_client=1 -DJUCE_MODULE_AVAILABLE_juce_audio_processors=1 -DJUCE_MODULE_AVAILABLE_juce_audio_utils=1 -DJUCE_MODULE_AVAILABLE_juce_core=1 -DJUCE_MODULE_AVAILABLE_juce_data_structures=1 -DJUCE_MODULE_AVAILABLE_juce_dsp=1 -DJUCE_MODULE_AVAILABLE_juce_events=1 -DJUCE_MODULE_AVAILABLE_juce_graphics=1 -DJUCE_MODULE_AVAILABLE_juce_gui_basics=1 -DJUCE_MODULE_AVAILABLE_juce_gui_extra=1 -DJUCE_SHARED_CODE=1 -DJUCE_STANDALONE_APPLICATION=JucePlugin_Build_Standalone -DJUCE_TARGET_HAS_BINARY_DATA=1 -DJUCE_USE_ANDROID_OBOE=1 -DJUCE_USE_CURL=0 -DJUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1 -DJUCE_USE_MP3AUDIOFORMAT=1 -DJUCE_USE_OBOE_STABILIZED_CALLBACK=1 -DJUCE_VST3_CAN_REPLACE_VST2=0 -DJUCE_WASAPI=1 -DJUCE_WEB_BROWSER=0 -DJucePlugin_AAXCategory=AAX_ePlugInCategory_None -DJucePlugin_AAXDisableBypass=0 -DJucePlugin_AAXDisableMultiMono=0 -DJucePlugin_AAXIdentifier=com.Sonosaurus.SonoBus -DJucePlugin_AAXManufacturerCode=JucePlugin_ManufacturerCode -DJucePlugin_AAXProductId=JucePlugin_PluginCode -DJucePlugin_AUExportPrefix=SonoBusAU -DJucePlugin_AUExportPrefixQuoted=\"SonoBusAU\" -DJucePlugin_AUMainType="'aumf'" -DJucePlugin_AUManufacturerCode=JucePlugin_ManufacturerCode -DJucePlugin_AUSubType=JucePlugin_PluginCode -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_Standalone=1 -DJucePlugin_Build_Unity=0 -DJucePlugin_Build_VST3=1 -DJucePlugin_Build_VST=0 -DJucePlugin_CFBundleIdentifier=com.Sonosaurus.SonoBus -DJucePlugin_Desc="\"SonoBus - Network Audio\"" -DJucePlugin_EditorRequiresKeyboardFocus=1 -DJucePlugin_IsMidiEffect=0 -DJucePlugin_IsSynth=0 -DJucePlugin_Manufacturer=\"Sonosaurus\" -DJucePlugin_ManufacturerCode=0x536f6e6f -DJucePlugin_ManufacturerEmail=\"\" -DJucePlugin_ManufacturerWebsite=\"\" -DJucePlugin_Name=\"SonoBus\" -DJucePlugin_PluginCode=0x4e427573 -DJucePlugin_ProducesMidiOutput=1 -DJucePlugin_VSTCategory=kPlugCategEffect -DJucePlugin_VSTNumMidiInputs=16 -DJucePlugin_VSTNumMidiOutputs=16 -DJucePlugin_VSTUniqueID=JucePlugin_PluginCode -DJucePlugin_Version=1.4.4 -DJucePlugin_VersionCode=0x10404 -DJucePlugin_VersionString=\"1.4.4\" -DJucePlugin_Vst3Category="\"Fx|Network\"" -DJucePlugin_WantsMidiInput=1 -DLINUX=1 -DNDEBUG=1 -DSONOBUS_BUILD_VERSION=\"\" -DUSE_CODEC_OPUS=1 -D_NDEBUG=1 -I/builddir/build/BUILD/sonobus-1.4.4/x86_64-redhat-linux-gnu/SonoBus_artefacts/JuceLibraryCode -I/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib -I/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/deps -I/builddir/build/BUILD/sonobus-1.4.4/deps/juce/modules -I/builddir/build/BUILD/sonobus-1.4.4/deps/juce/modules/juce_audio_processors/format_types/VST3_SDK -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I/builddir/build/BUILD/sonobus-1.4.4/deps -I/builddir/build/BUILD/sonobus-1.4.4/x86_64-redhat-linux-gnu/juce_binarydata_SonoBus_SBData/JuceLibraryCode -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pthread -o CMakeFiles/SonoBus.dir/deps/aoo/lib/src/client.cpp.o -c /builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp
In file included from /builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.hpp:10,
                 from /builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp:5:
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/sync.hpp:98:26: error: 'unique_lock' in namespace 'std' does not name a template type
   98 | using unique_lock = std::unique_lock<shared_mutex>;
      |                          ^~~~~~~~~~~
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/sync.hpp:12:1: note: 'std::unique_lock' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
   11 | #include <shared_mutex>
  +++ |+#include <mutex>
   12 | 
In file included from /builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.hpp:10,
                 from /builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp:5:
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/sync.hpp:98:26: error: 'unique_lock' in namespace 'std' does not name a template type
   98 | using unique_lock = std::unique_lock<shared_mutex>;
      |                          ^~~~~~~~~~~
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/sync.hpp:12:1: note: 'std::unique_lock' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
   11 | #include <shared_mutex>
  +++ |+#include <mutex>
   12 | 
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp: In member function 'void aoo::net::client::do_disconnect(aoo::net::command_reason, int)':
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp:573:9: error: 'unique_lock' was not declared in this scope
  573 |         unique_lock lock(peerlock_);
      |         ^~~~~~~~~~~
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp: In member function 'void aoo::net::client::handle_group_leave(const osc::ReceivedMessage&)':
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp:1077:9: error: 'unique_lock' was not declared in this scope
 1077 |         unique_lock lock(peerlock_); // writer lock!
      |         ^~~~~~~~~~~
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp: In member function 'void aoo::net::client::handle_peer_add(const osc::ReceivedMessage&)':
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp:1136:5: error: 'unique_lock' was not declared in this scope
 1136 |     unique_lock lock(peerlock_); // writer lock!
      |     ^~~~~~~~~~~
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp: In member function 'void aoo::net::client::handle_peer_remove(const osc::ReceivedMessage&)':
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp:1165:5: error: 'unique_lock' was not declared in this scope
 1165 |     unique_lock lock(peerlock_); // writer lock!
      |     ^~~~~~~~~~~
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp: In member function 'void aoo::net::client::do_disconnect(aoo::net::command_reason, int)':
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp:573:9: error: 'unique_lock' was not declared in this scope
  573 |         unique_lock lock(peerlock_);
      |         ^~~~~~~~~~~
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp: In member function 'void aoo::net::client::handle_group_leave(const osc::ReceivedMessage&)':
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp:1077:9: error: 'unique_lock' was not declared in this scope
 1077 |         unique_lock lock(peerlock_); // writer lock!
      |         ^~~~~~~~~~~
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp: In member function 'void aoo::net::client::handle_peer_add(const osc::ReceivedMessage&)':
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp:1136:5: error: 'unique_lock' was not declared in this scope
 1136 |     unique_lock lock(peerlock_); // writer lock!
      |     ^~~~~~~~~~~
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp: In member function 'void aoo::net::client::handle_peer_remove(const osc::ReceivedMessage&)':
/builddir/build/BUILD/sonobus-1.4.4/deps/aoo/lib/src/client.cpp:1165:5: error: 'unique_lock' was not declared in this scope
 1165 |     unique_lock lock(peerlock_); // writer lock!
      |     ^~~~~~~~~~~
essej commented 3 years ago

Interesting. If you follow the compiler’s tip by adding an include in sync.hpp, does it resolve it?

 deps/aoo/lib/src/sync.hpp:12:1: note: 'std::unique_lock' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
   11 | #include <shared_mutex>
  +++ |+#include <mutex>
   12 | 
essej commented 3 years ago

And are you making an RPM for fedora here?

ycollet commented 3 years ago

I added the following flag to fix this problem without changing the code: "-include mutex" This adds a "#include " at the beginning of each files :) Yes I built a spec file for Fedora (not for an official release repository). You can find the packages here: https://copr.fedorainfracloud.org/coprs/ycollet/linuxmao/

I am planning to write a paper about tools to rehearse via internet. You can find my last article related to VCV Rack here: https://fedoramagazine.org/vcv-rack-modular-synthesizers/

essej commented 3 years ago

I’ll fix the code anyway, which is the correct solution...

essej commented 3 years ago

OK, the source code fix is now on the latest main (and develop). I did not move the 1.4.4 tag though. Probably best if you just build from the head of main branch in your spec... it will generally be only the latest release.... all intermediate development takes place on the develop branch.

ycollet commented 3 years ago

Thanks for the fix ! I close the bug report.