Rack: Compiling for jack support with RTAUDIO_ALL_APIS=1 fails on Fedora 27

Created on 30 May 2018  路  19Comments  路  Source: VCVRack/Rack

Hi

After doing make dep RTAUDIO_ALL_APIS=1 for jack support and then doing make i get error below.
I have package pulseaudio-libs-devel installed including /usr/include/pulse/simple.h which has pa_simple_* which RtAudio.cpp is unhappy about claiming undefined reference to.

g++ -o Rack build/dep/nanovg/src/nanovg.c.o build/src/keyboard.cpp.o build/src/gamepad.cpp.o build/src/engine.cpp.o build/src/tags.cpp.o build/src/rtmidi.cpp.o build/src/settings.cpp.o build/src/midi.cpp.o build/src/plugin.cpp.o build/src/bridge.cpp.o build/src/audio.cpp.o build/src/window.cpp.o build/src/main.cpp.o build/src/asset.cpp.o build/src/ui/MenuOverlay.cpp.o build/src/ui/RadioButton.cpp.o build/src/ui/MenuLabel.cpp.o build/src/ui/Scene.cpp.o build/src/ui/ProgressBar.cpp.o build/src/ui/Tooltip.cpp.o build/src/ui/layouts.cpp.o build/src/ui/Slider.cpp.o build/src/ui/WindowWidget.cpp.o build/src/ui/ChoiceButton.cpp.o build/src/ui/ui.cpp.o build/src/ui/PasswordField.cpp.o build/src/ui/List.cpp.o build/src/ui/Menu.cpp.o build/src/ui/MenuItem.cpp.o build/src/ui/ScrollWidget.cpp.o build/src/ui/MenuSeparator.cpp.o build/src/ui/TextField.cpp.o build/src/ui/Label.cpp.o build/src/ui/Button.cpp.o build/src/Core/Notes.cpp.o build/src/Core/QuadMIDIToCVInterface.cpp.o build/src/Core/AudioInterface.cpp.o build/src/Core/MidiIO.cpp.o build/src/Core/MIDIToCVInterface.cpp.o build/src/Core/MIDICCToCVInterface.cpp.o build/src/Core/Core.cpp.o build/src/Core/MIDITriggerToCVInterface.cpp.o build/src/Core/Blank.cpp.o build/src/widgets/FramebufferWidget.cpp.o build/src/widgets/ZoomWidget.cpp.o build/src/widgets/Widget.cpp.o build/src/widgets/QuantityWidget.cpp.o build/src/widgets/widgets.cpp.o build/src/widgets/SVGWidget.cpp.o build/src/widgets/SpriteWidget.cpp.o build/src/widgets/TransformWidget.cpp.o build/src/app/SVGKnob.cpp.o build/src/app/ParamWidget.cpp.o build/src/app/RackScene.cpp.o build/src/app/LightWidget.cpp.o build/src/app/Knob.cpp.o build/src/app/ModuleBrowser.cpp.o build/src/app/AudioWidget.cpp.o build/src/app/SVGButton.cpp.o build/src/app/PluginManagerWidget.cpp.o build/src/app/WireContainer.cpp.o build/src/app/WireWidget.cpp.o build/src/app/LedDisplay.cpp.o build/src/app/MultiLightWidget.cpp.o build/src/app/SVGSlider.cpp.o build/src/app/ModuleWidget.cpp.o build/src/app/Panel.cpp.o build/src/app/RackRail.cpp.o build/src/app/Toolbar.cpp.o build/src/app/RackWidget.cpp.o build/src/app/Port.cpp.o build/src/app/RackScrollWidget.cpp.o build/src/app/SVGPanel.cpp.o build/src/app/MomentarySwitch.cpp.o build/src/app/SVGPort.cpp.o build/src/app/ModuleLightWidget.cpp.o build/src/app/CircularShadow.cpp.o build/src/app/SpriteKnob.cpp.o build/src/app/SVGScrew.cpp.o build/src/app/ToggleSwitch.cpp.o build/src/app/SVGSwitch.cpp.o build/src/app/app.cpp.o build/src/app/MidiWidget.cpp.o build/src/util/random.cpp.o build/src/util/color.cpp.o build/src/util/request.cpp.o build/src/util/string.cpp.o build/src/util/system.cpp.o build/src/util/logger.cpp.o build/src/dsp/minblep.cpp.o build/dep/osdialog/osdialog_gtk2.c.o -rdynamic -Ldep/lib -Wl,-Bstatic -lglfw3 -lGLEW -ljansson -lspeexdsp -lzip -lz -lrtmidi -lrtaudio -lcurl -lssl -lcrypto -Wl,-Bdynamic -lpthread -lGL -ldl -lX11 -lasound -ljack -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype 
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::closeStream()':
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8112: undefined reference to `pa_simple_flush'
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8113: undefined reference to `pa_simple_free'
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8116: undefined reference to `pa_simple_free'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::stopStream()':
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8272: undefined reference to `pa_simple_drain'
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8274: undefined reference to `pa_strerror'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::abortStream()':
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8306: undefined reference to `pa_simple_flush'
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8308: undefined reference to `pa_strerror'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::callbackEvent()':
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8191: undefined reference to `pa_simple_write'
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8207: undefined reference to `pa_simple_read'
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8193: undefined reference to `pa_strerror'
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8209: undefined reference to `pa_strerror'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, unsigned long, unsigned int*, RtAudio::StreamOptions*)':
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8447: undefined reference to `pa_simple_new'
/home/user/audio/vcvrack/git/Rack/dep/rtaudio/RtAudio.cpp:8454: undefined reference to `pa_simple_new'
collect2: error: ld returned 1 exit status
make: *** [compile.mk:52: Rack] Error 1

Operating system: Fedora 27 x86_64
commit hash and branch if compiling from source: d2cf6d86819050e4e9f79e9351042c865dfdd788 master

Most helpful comment

JACK support is officially included in Rack 0.6 for Linux now. If you only need JACK, no need to use RTAUDIO_ALL_APIS.

All 19 comments

I suppose you have to add some linker flag (-lpulse I imagine) to Rack's LDFLAGS?

I have exactly the same error on Ubuntu 16.04. Hoping I might be able to post a solution here if I can figure out how to do this (I'm not particularly proficient in compiling for C/C++)...

I think I'm pretty much beaten, for now at least, but I'll leave a few notes here in case it helps anyone else.

So I can see that pa_simple_flush is defined in pulse/simple.h:

grep pa_simple_flush /usr/include/pulse/simple.h
int pa_simple_flush(pa_simple *s, int *error);

I can also see that the cpp file raising the error definitely includes this header file:

 grep include /home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp | grep simple.h
#include <pulse/simple.h>

So my conclusion here is that we need to ensure we are linking to pulse-simple (this also fits with some other issues I found Googling the error). So after a lot of hacking around with ld I settled on this modification to the Makefile which seems to find the .so files without error:

ifeq ($(ARCH), lin)
        SOURCES += dep/osdialog/osdialog_gtk2.c
        CFLAGS += $(shell pkg-config --cflags gtk+-2.0)
        LDFLAGS += -rdynamic \
                -Ldep/lib \
                -Wl,-Bdynamic $(shell pkg-config --libs libpulse-simple) \
                -Wl,-Bstatic -lglfw3 -lGLEW -ljansson -lspeexdsp -lzip -lz -lrtmidi -lrtaudio -lcurl -lssl -lcrypto \
                -Wl,-Bdynamic -lpthread -lGL -ldl -lX11 -lasound -ljack \
                $(shell pkg-config --libs gtk+-2.0)
        TARGET := Rack
endif

When I run make RELEASE=1 I get the following command:

g++ -o Rack build/dep/nanovg/src/nanovg.c.o build/src/keyboard.cpp.o build/src/gamepad.cpp.o build/src/engine.cpp.o build/src/tags.cpp.o build/src/rtmidi.cpp.o build/src/settings.cpp.o build/src/midi.cpp.o build/src/plugin.cpp.o build/src/bridge.cpp.o build/src/audio.cpp.o build/src/window.cpp.o build/src/main.cpp.o build/src/asset.cpp.o build/src/ui/MenuOverlay.cpp.o build/src/ui/RadioButton.cpp.o build/src/ui/MenuLabel.cpp.o build/src/ui/Scene.cpp.o build/src/ui/ProgressBar.cpp.o build/src/ui/Tooltip.cpp.o build/src/ui/layouts.cpp.o build/src/ui/Slider.cpp.o build/src/ui/WindowWidget.cpp.o build/src/ui/ChoiceButton.cpp.o build/src/ui/ui.cpp.o build/src/ui/PasswordField.cpp.o build/src/ui/List.cpp.o build/src/ui/Menu.cpp.o build/src/ui/MenuItem.cpp.o build/src/ui/ScrollWidget.cpp.o build/src/ui/MenuSeparator.cpp.o build/src/ui/TextField.cpp.o build/src/ui/Label.cpp.o build/src/ui/Button.cpp.o build/src/Core/QuadMIDIToCVInterface.cpp.o build/src/Core/Notes.cpp.o build/src/Core/MidiIO.cpp.o build/src/Core/AudioInterface.cpp.o build/src/Core/MIDIToCVInterface.cpp.o build/src/Core/MIDICCToCVInterface.cpp.o build/src/Core/Core.cpp.o build/src/Core/MIDITriggerToCVInterface.cpp.o build/src/Core/Blank.cpp.o build/src/widgets/FramebufferWidget.cpp.o build/src/widgets/ZoomWidget.cpp.o build/src/widgets/Widget.cpp.o build/src/widgets/QuantityWidget.cpp.o build/src/widgets/TransformWidget.cpp.o build/src/widgets/SVGWidget.cpp.o build/src/widgets/SpriteWidget.cpp.o build/src/widgets/widgets.cpp.o build/src/app/SVGKnob.cpp.o build/src/app/ParamWidget.cpp.o build/src/app/PluginManagerWidget.cpp.o build/src/app/LightWidget.cpp.o build/src/app/RackScene.cpp.o build/src/app/ModuleBrowser.cpp.o build/src/app/ModuleLightWidget.cpp.o build/src/app/SVGButton.cpp.o build/src/app/WireContainer.cpp.o build/src/app/WireWidget.cpp.o build/src/app/LedDisplay.cpp.o build/src/app/MultiLightWidget.cpp.o build/src/app/SVGSlider.cpp.o build/src/app/ModuleWidget.cpp.o build/src/app/AudioWidget.cpp.o build/src/app/Panel.cpp.o build/src/app/RackRail.cpp.o build/src/app/Port.cpp.o build/src/app/Toolbar.cpp.o build/src/app/RackWidget.cpp.o build/src/app/Knob.cpp.o build/src/app/RackScrollWidget.cpp.o build/src/app/SVGPanel.cpp.o build/src/app/MomentarySwitch.cpp.o build/src/app/SVGPort.cpp.o build/src/app/CircularShadow.cpp.o build/src/app/SpriteKnob.cpp.o build/src/app/SVGScrew.cpp.o build/src/app/ToggleSwitch.cpp.o build/src/app/SVGSwitch.cpp.o build/src/app/app.cpp.o build/src/app/MidiWidget.cpp.o build/src/util/random.cpp.o build/src/util/color.cpp.o build/src/util/request.cpp.o build/src/util/string.cpp.o build/src/util/system.cpp.o build/src/util/logger.cpp.o build/src/dsp/minblep.cpp.o build/dep/osdialog/osdialog_gtk2.c.o -rdynamic -Ldep/lib -Wl,-Bdynamic -lpulse-simple -lpulse -Wl,-Bstatic -lglfw3 -lGLEW -ljansson -lspeexdsp -lzip -lz -lrtmidi -lrtaudio -lcurl -lssl -lcrypto -Wl,-Bdynamic -lpthread -lGL -ldl -lX11 -lasound -ljack -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype

But unfortunately exactly the same error:

dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::closeStream()':
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8112: undefined reference to `pa_simple_flush'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8113: undefined reference to `pa_simple_free'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8116: undefined reference to `pa_simple_free'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::stopStream()':
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8272: undefined reference to `pa_simple_drain'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8274: undefined reference to `pa_strerror'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::abortStream()':
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8306: undefined reference to `pa_simple_flush'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8308: undefined reference to `pa_strerror'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::callbackEvent()':
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8191: undefined reference to `pa_simple_write'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8207: undefined reference to `pa_simple_read'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8193: undefined reference to `pa_strerror'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8209: undefined reference to `pa_strerror'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, unsigned long, unsigned int*, RtAudio::StreamOptions*)':
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8447: undefined reference to `pa_simple_new'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8454: undefined reference to `pa_simple_new'
collect2: error: ld returned 1 exit status
compile.mk:52: recipe for target 'Rack' failed
make: *** [Rack] Error 1

export LDFLAGS="-lpulse-simple -lpulse"

Thanks for the help @rncar but I'm still getting the same issue. Isn't exporting this variable the same as my modified Makefile with the below?

-Wl,-Bdynamic $(shell pkg-config --libs libpulse-simple) \

This gives me the following in the generated command:

 -Wl,-Bdynamic -lpulse-simple -lpulse

However I run this I'm getting the same error unfortunately. Does it work for you? What am I missing?

LDFLAGS="-lpulse-simple -lpulse" make RELEASE=1
export LDFLAGS="-lpulse-simple -lpulse"; make RELEASE=1

... and without the RELEASE=1 ?

I am compiling using make RTAUDIO_ALL_APIS=1

Using RTAUDIO_ALL_APIS is the only way I can use this in my system, pulseaudio.

Any workaround? I guess I'm getting the same error as my issue was referenced.

Thanks for your help @rncar but still no luck. I have been passing that flag to make dep, but not the make step. Even so (and also leaving out RELEASE=1 to enable the plugin manager) I get the same error:

make dep RTAUDIO_ALL_APIS=1
LDFLAGS="-lpulse-simple -lpulse" make RTAUDIO_ALL_APIS=1

Error:

dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::closeStream()':
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8112: undefined reference to `pa_simple_flush'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8113: undefined reference to `pa_simple_free'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8116: undefined reference to `pa_simple_free'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::stopStream()':
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8272: undefined reference to `pa_simple_drain'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8274: undefined reference to `pa_strerror'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::abortStream()':
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8306: undefined reference to `pa_simple_flush'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8308: undefined reference to `pa_strerror'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::callbackEvent()':
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8191: undefined reference to `pa_simple_write'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8207: undefined reference to `pa_simple_read'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8193: undefined reference to `pa_strerror'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8209: undefined reference to `pa_strerror'
dep/lib/librtaudio.a(RtAudio.cpp.o): In function `RtApiPulse::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, unsigned long, unsigned int*, RtAudio::StreamOptions*)':
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8447: undefined reference to `pa_simple_new'
/home/dan/Software/Rack/dep/rtaudio/RtAudio.cpp:8454: undefined reference to `pa_simple_new'
collect2: error: ld returned 1 exit status
compile.mk:52: recipe for target 'Rack' failed
make: *** [Rack] Error 1

I think what's really caught me out here is I believe in 0.5 there was an option to just compile Jack support (and this worked for me). Now we only seem to have an unsupported option to enable everything, including pulse audio which I don't use, and there seems to be some kind of issue with this library.

I'm not one for giving up. I'll keep chipping away at this! :)

Anyone else managed to compile Jack support for any version of Ubuntu? It seems like we are unable to get this to work on 16.04 and 18.04 (Fedora too)...

JACK support is officially included in Rack 0.6 for Linux now. If you only need JACK, no need to use RTAUDIO_ALL_APIS.

Thanks @AndrewBelt I'd just literally had this revelation whilst looking into dep/Makefile. Damn! That's quite a few hours I spent chasing a non issue lol. Feeling a bit of a wolly now :)

ifeq ($(ARCH), mac)
RTAUDIO_FLAGS += -DAUDIO_OSX_CORE=ON
endif
ifeq ($(ARCH), win)
RTAUDIO_FLAGS += -DAUDIO_WINDOWS_DS=ON -DAUDIO_WINDOWS_WASAPI=ON -DAUDIO_WINDOWS_ASIO=ON
endif
ifeq ($(ARCH), lin)
RTAUDIO_FLAGS += -DAUDIO_LINUX_ALSA=ON -DAUDIO_UNIX_JACK=ON
endif

ifdef RTAUDIO_ALL_APIS
ifeq ($(ARCH), mac)
RTAUDIO_FLAGS += -DAUDIO_UNIX_JACK=ON
endif
ifeq ($(ARCH), lin)
RTAUDIO_FLAGS += -DAUDIO_LINUX_PULSE=ON
endif
endif

I'm not sure if everyone has realised this. @Cordoha were you making the same mistake on Ubuntu 18.04?

To be fair though, this issue is called "Compiling for jack support with RTAUDIO_ALL_APIS=1 fails on Fedora 27". So there was a clue in the title! ;-)

@danballance Not sure. Someone referenced this bug when I posted a report. Guess I'll try that out above. So i assume it's the same issue in Ubuntu 18.04.

What'd you do to get it working?

JACK support is officially included in Rack 0.6 for Linux now. If you only need JACK, no need to use RTAUDIO_ALL_APIS.

I can't see an option to enable JACK in the official release.
I'm also getting the same simple.h issue.

Not sure what's going on, it worked before until I tried to recompile.

@Cordoha Not in the official release (i.e. Rack 0.6.0), in the v0.6 branch.

I've removed RTAUDIO_ALL_APIS in d18d746e94e5de866c7720b255993707edf38568 to emphasize that PulseAudio is not supported.

Hi @Cordoha all I did was compile without RTAUDIO_ALL_APIS=1. So something like:

make dep clean
make clean
make dep
make RELEASE=1

And now it all just works (blush). It was me that referenced your other ticket since the error you were getting was identical and to do with support for pulse audio failing. Are you up and running now?

Awesome, works here too. Thank you so much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

polyclash picture polyclash  路  3Comments

gogobanziibaby picture gogobanziibaby  路  4Comments

AndrewBelt picture AndrewBelt  路  7Comments

antoniotuzzi picture antoniotuzzi  路  5Comments

PixelBulb picture PixelBulb  路  4Comments