- Timestamp:
- Mar 9, 2018, 11:11:52 AM (7 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/distribution_specific_hack.sh
r69 r70 3 3 fi 4 4 5 if [ _$DISTRIB_ID == _Ubuntu ]; then 5 if [ _$DISTRIB_ID = _Ubuntu ]; then 6 #tested on Ubuntu 17.10 6 7 #we must run as root 7 8 if [ $EUID -ne 0 ]; then … … 13 14 echo $$ > /sys/fs/cgroup/cpu/tasks 14 15 fi 16 17 #special actions if we use 3D 18 ldd $EXEC | grep "libGL.so" > /dev/null 19 if [ $? -eq 0 ]; then 20 #allow root access to the X server 21 xhost si:localuser:root 22 23 #Mesa DRI driver may need a libstdc++ more recent than robomap3's 24 ldconfig -p | grep mesa > /dev/null 25 if [ $? -eq 0 ]; then 26 read DRI_CARD_MAJOR DRI_CARD_MINOR < <(stat -c '%t %T' /dev/dri/card0) 27 DRIVER=$(cat /sys/dev/char/$((16#$DRI_CARD_MAJOR)):$((16#$DRI_CARD_MINOR))/device/uevent | grep DRIVER | cut -d= -f2) 28 echo "Mesa DRI driver is $DRIVER" 29 DRIVER_LIB=$(LIBGL_DEBUG=verbose glxinfo 2>&1 | grep OpenDriver | tail -n 1 | sed -e "s/.* \(.*\)/\1/") 30 #get the highest required version of CXXABI 31 CXXABI_REQUIRED=$(objdump -T $DRIVER_LIB | grep CXXABI | sed -e 's/.*CXXABI_\(.*\) .*/\1/' | sort -uV | tail -1) 32 #get currently used libstdc++ 33 LIBSTDCXX_PROVIDED=$(ldd $EXEC | grep libstdc++ | sed -e 's/.*=> \(.*\) (.*/\1/') 34 #get the highest version of CXXABI supported by the libstdc++ 35 CXXABI_PROVIDED=$(objdump -T $LIBSTDCXX_PROVIDED | grep ".*CXXABI_[0-9.]*$" | sed -e 's/.*CXXABI_\(.*\)/\1/' | sort -V | tail -1) 36 if [ $(echo -e "$CXXABI_PROVIDED\n$CXXABI_REQUIRED" | sort -V | tail -n1) != $CXXABI_PROVIDED ]; then 37 echo "We must use the local system libstdc++" 38 export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 39 fi 40 fi 41 fi 15 42 fi 16 43
Note:
See TracChangeset
for help on using the changeset viewer.