libpd / abl_link

Ableton Link integration for Pure Data on desktop and Android.
Other
80 stars 15 forks source link

version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference #13

Open chrisbeckstrom opened 7 years ago

chrisbeckstrom commented 7 years ago

Not sure if this is the right place for this; if not, please let me know!

I'm running PD 0.47 on KXStudio (Linux) and am able to successfully get the abl_link~ external using deken. However, when I try to instantiate an abl_link~ object, I get this error:

/path/to/mypdexternals/abl_link~/abl_link~.pd_linux: /path/to/mypdexternals/abl_link~/abl_link~.pd_linux: symbol _ZNKSt3_V214error_category10_M_messageB5cxx11Ei, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

I've been searching a lot and I suspect that this may be some issue with my environment, but so far this problem is way above what I'm able to understand. As far as I can tell, libstdc++ is installed, but I'm not 100% sure about GLIBCXX_3.4.21. Not even sure what to make of the error.

I've also tried building link from source but have been unsuccessful (I can share details of that issue if needed)

Any ideas what might be wrong? Any help would be greatly appreciated!

danomatika commented 7 years ago

Throwing this out there from a quick Google search (not tested):

As per this StackOverflow post, looks like the issue is due to differing versions of gcc. Your system is running an older version with a slightly older libc++. The answer seems to be to build with the following define: -D_GLIBCXX_USE_CXX11_ABI=0.

This issue may also be affecting the build for you. You could try setting the define when running make ala:

make CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
chrisbeckstrom commented 7 years ago

Thanks @danomatika ! This is out of my wheelhouse, but are you saying that the precompiled abl_link~ external won't work with my system because my libc++ version is too old, and the solution is to compile abl_link~ myself using that CFLAG?

If so, from the abl_link/external directory, I ran make CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"

And got a bunch of errors (see below). I apologize if I'm missing something obvious here. I have some experience with PureData and a tiny bit compiling programs myself, but this is quite a bit beyond my level of comprehension. Thanks for your help!


++++ info: using Pd API /usr/include/pd/m_pd.h
++++ info: making target all in lib abl_link~
++++ info: making abl_link~.o in lib abl_link~
g++ -DPD -I "/usr/include/pd" -DUNIX  -fPIC -fcheck-new -std=c++11 -I./link/include -I./link/modules/asio-standalone/asio/include -Wno-multichar -DLINK_PLATFORM_LINUX=1 -D_GLIBCXX_USE_CXX11_ABI=0 -o abl_link~.o -c abl_link~.cpp
In file included from ./link/include/ableton/platforms/asio/Context.hpp:25:0,
                 from ./link/include/ableton/platforms/Config.hpp:34,
                 from ./link/include/ableton/Link.hpp:25,
                 from abl_link_instance.hpp:12,
                 from abl_link~.cpp:13:
./link/include/ableton/platforms/asio/PooledHandlerContext.hpp:106:23: error: ‘max_align_t’ is not a member of ‘std’
     std::alignment_of<std::max_align_t>::value>::type;
                       ^
./link/include/ableton/platforms/asio/PooledHandlerContext.hpp:106:23: note: suggested alternative:
In file included from /usr/include/c++/4.8/cstddef:42:0,
                 from ./link/modules/asio-standalone/asio/include/asio/execution_context.hpp:19,
                 from ./link/modules/asio-standalone/asio/include/asio/detail/scheduler.hpp:21,
                 from ./link/modules/asio-standalone/asio/include/asio/system_executor.hpp:19,
                 from ./link/modules/asio-standalone/asio/include/asio/associated_executor.hpp:21,
                 from ./link/modules/asio-standalone/asio/include/asio.hpp:19,
                 from ./link/include/ableton/platforms/asio/AsioWrapper.hpp:60,
                 from ./link/include/ableton/discovery/InterfaceScanner.hpp:22,
                 from ./link/include/ableton/discovery/PeerGateways.hpp:22,
                 from ./link/include/ableton/discovery/Service.hpp:22,
                 from ./link/include/ableton/link/Controller.hpp:22,
                 from ./link/include/ableton/platforms/Config.hpp:22,
                 from ./link/include/ableton/Link.hpp:25,
                 from abl_link_instance.hpp:12,
                 from abl_link~.cpp:13:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h:425:3: note:   ‘max_align_t’
 } max_align_t;
   ^
In file included from ./link/include/ableton/platforms/asio/Context.hpp:25:0,
                 from ./link/include/ableton/platforms/Config.hpp:34,
                 from ./link/include/ableton/Link.hpp:25,
                 from abl_link_instance.hpp:12,
                 from abl_link~.cpp:13:
./link/include/ableton/platforms/asio/PooledHandlerContext.hpp:106:23: error: ‘max_align_t’ is not a member of ‘std’
     std::alignment_of<std::max_align_t>::value>::type;
                       ^
./link/include/ableton/platforms/asio/PooledHandlerContext.hpp:106:23: note: suggested alternative:
In file included from /usr/include/c++/4.8/cstddef:42:0,
                 from ./link/modules/asio-standalone/asio/include/asio/execution_context.hpp:19,
                 from ./link/modules/asio-standalone/asio/include/asio/detail/scheduler.hpp:21,
                 from ./link/modules/asio-standalone/asio/include/asio/system_executor.hpp:19,
                 from ./link/modules/asio-standalone/asio/include/asio/associated_executor.hpp:21,
                 from ./link/modules/asio-standalone/asio/include/asio.hpp:19,
                 from ./link/include/ableton/platforms/asio/AsioWrapper.hpp:60,
                 from ./link/include/ableton/discovery/InterfaceScanner.hpp:22,
                 from ./link/include/ableton/discovery/PeerGateways.hpp:22,
                 from ./link/include/ableton/discovery/Service.hpp:22,
                 from ./link/include/ableton/link/Controller.hpp:22,
                 from ./link/include/ableton/platforms/Config.hpp:22,
                 from ./link/include/ableton/Link.hpp:25,
                 from abl_link_instance.hpp:12,
                 from abl_link~.cpp:13:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h:425:3: note:   ‘max_align_t’
 } max_align_t;
   ^
In file included from ./link/include/ableton/platforms/asio/Context.hpp:25:0,
                 from ./link/include/ableton/platforms/Config.hpp:34,
                 from ./link/include/ableton/Link.hpp:25,
                 from abl_link_instance.hpp:12,
                 from abl_link~.cpp:13:
./link/include/ableton/platforms/asio/PooledHandlerContext.hpp:106:39: error: template argument 1 is invalid
     std::alignment_of<std::max_align_t>::value>::type;
                                       ^
./link/include/ableton/platforms/asio/PooledHandlerContext.hpp:106:47: error: template argument 2 is invalid
     std::alignment_of<std::max_align_t>::value>::type;
                                               ^
./link/include/ableton/platforms/asio/PooledHandlerContext.hpp:107:3: error: ‘MemChunk’ does not name a type
   MemChunk mRaw[MaxNumHandlers];
   ^
./link/include/ableton/platforms/asio/PooledHandlerContext.hpp: In constructor ‘ableton::platforms::asio::PooledHandlerContext<IoContext, MaxNumHandlers, MaxHandlerSize>::PooledHandlerContext(ableton::util::Injected<T>)’:
./link/include/ableton/platforms/asio/PooledHandlerContext.hpp:44:52: error: ‘mRaw’ was not declared in this scope
       mFreeStack.push_back(reinterpret_cast<void*>(mRaw + i));
                                                    ^
make: *** [abl_link~.o] Error 1
danomatika commented 7 years ago

are you saying that the precompiled abl_link~ external won't work with my system because my libc++ version is too old

Yes

and the solution is to compile abl_link~ myself using that CFLAG?

No. The easiest solution is for Peter to recompile the external with that flag and upload it to deken. Then the prebuilt binary should work for you.

Your build issues look like a problem with the link sources from Ableton and C++11.

chrisbeckstrom commented 7 years ago

Ah! Thanks for the clarification!

I have PD w/abl_link~ running on my Mac laptop and it's absolutely fantastic.. Thanks so much for all your hard work!

danomatika commented 7 years ago

Not me, all @nettoyeurny.

chrisbeckstrom commented 7 years ago

Thanks @nettoyeurny !!! You're a true hero!

danomatika commented 7 years ago

I'd also recommend opening an issue with Ableton about the build problem: https://github.com/Ableton/link/issues

chrisbeckstrom commented 7 years ago

Done

Ant1r commented 6 years ago

Unfortunately, compiling from g++5.4 (on Ubuntu16.04) with -D_GLIBCXX_USE_CXX11_ABI=0 doesn't seem to fix it:

$ strings abl_link~.pd_linux | grep GLIBCXX
(...)
_ZNKSt3_V214error_category10_M_messageEi@@GLIBCXX_3.4.21
(...)

I guess ABI_3.4.21 is required by some linked libs.

danomatika commented 3 years ago

The external is now using Link 3.0.3, so this issue has probably been fixed upstream.

Please try building again after:

git pull master
git submodule update
umlaeute commented 3 years ago

i guess this should read (the important part being the missing branch in the git pull; i just add the --init to the submodule-update in case you are doing a fresh clone)

git pull
git submodule update --init

anyhow: building with @Ant1r 's defines on a fresh Ubuntu/16.04 docker image, still yields the GLIBCXX_3.4.21 symbols. link does require C++11 (which might be related to this issue), so i don't think there's an easy fix for that.

otoh, Ubuntu/16.04 doesn't have a problem loading with these symbols in the first place. so it seems that at the time this issue was opened, KXStudio used an even older glibc.

i'd suggest to not spend time on supporting distributions that are old than 5 years. i'm afraid that people who need to use such an old distribution should be prepared to compile stuff themselves.