uglyDwarf / linuxtrack

Headtracking for Linux/Mac
MIT License
155 stars 30 forks source link

build instructions for Ubuntu 22.04 #190

Open bieganski opened 2 years ago

bieganski commented 2 years ago

i did some tweaks to make all the software compile and (at least) GUI works with newest Ubuntu. Not tested further due to lack of hardware.

git clone https://github.com/bieganski/linuxtrack   # fork of uglyDwarf's
cd linuxtrack
./build.ubuntu22.sh

it will ask you few times for sudo, e.g. to apt install or udev rules.

Hope it will help you, PRs welcomed!

vranki commented 2 years ago

Thanks for this script. Tested this build method on Ubuntu 20.04. You also need to install packages bison, libcrypto++, libssl-dev, gcc-multilib, libopencv-dev, qttools5-dev for a working build. There may be other deps I missed but anyway.

I haven't tested installing or running the app yet, I'll do that tomorrow.

vranki commented 2 years ago

I got the gui running, but it claims trackir is connected but it cannot open it due to permissions issue. But this message is wrong - the problem is that gui can't open library in probeTir() function. I'll continue investigating why it can't load it.

vranki commented 2 years ago

Problem was that libusb-1.0.0-dev was missing and libtir was not built at all. After installing it and checking ./configure gets trackir support, i was able to build deb package with checkinstall and run ltr_gui.

For some reason the ltr_gui is not included in the debian package, but I was able to run it from source directory. 3D view also shows only gray - looks like the model can't be loaded for some reason.

mrgkingcs commented 2 years ago

Thanks for your effort with this build script - it gave me another avenue to try when ltr_gui from the universal package wouldn't work for me (just shows loads of signal connection failures which is a different issue)

When trying to build this on Pop!-os 22.04 I get problems including QHelpEngine (it seems to be inside a QtHelp dir) and libs for QtHelp. (-lQtHelp ?) I also get a problem linking with ld-linux.so which is in /lib32 not /lib (need -L/lib32 ?)

Trying to build the failed elements by hand leads to an executable that won't run (src/qt_gui/ltr_gui: symbol lookup error: src/qt_gui/ltr_gui: undefined symbol: ltr_int_ps3_set_ctrl_val) so I clearly screwed something up.

I tried looking at the Makefile to add these tweaks, but wow is it complicated! I failed.

I'm giving up for now, but I figured any info might help. I hope it doesn't include any false leads.

jaspi72 commented 2 years ago

build script worked but run ltr_gui give error: ./ltr_gui: error while loading shared libraries: libltr.so.0: cannot open shared object file: No such file or directory libltr.so.0 is on src/.libs Whats the problem now?

vranki commented 2 years ago

Starting ltr_gui overwrites config file without asking and breaks itself. At least on my system you need to set [Global]/Prefix to point to /usr/local/bin/ or otherwise nothing works. After running ltr_gui you need to fix the config file manually. It's very confusing.

bieganski commented 2 years ago

build script worked but run ltr_gui give error: ./ltr_gui: error while loading shared libraries: libltr.so.0: cannot open shared object file: No such file or directory libltr.so.0 is on src/.libs Whats the problem now?

try adding src/.libs to your LD_LIBRARY_PATH env variable

mrgkingcs commented 2 years ago

Trying again on vanilla Ubuntu 22.04, I've built with the necessary include/link directives for QtHelp I mentioned above. I've added src/libs to LD_LIBRARY_PATH I discovered I had missed the libqt4-sql-sqlite when installing qt4, so I installed that. Now I just get Segmentation fault (core dumped) I don't know how to investigate from here. :/

mrgkingcs commented 2 years ago

you need to set [Global]/Prefix to point to /usr/local/bin/ or otherwise nothing works.

Is that in linuxtrack1.conf? Adding that to the [Global] section didn't fix anything for me.

vranki commented 2 years ago

Yes, in linuxtrack1.conf. ltr_gui writes it automatically. Did you install the package with make install or checkinstall? That should install the libs in correct locations.

mrgkingcs commented 1 year ago

Well, I dum. I hadn't run 'make install'. They gui starts up just fine now. Thank you!

Unfortunately, it seg faults when I try to select 'TrackIR' though. :/

bieganski commented 1 year ago

it might be that i broke something on my side, as to make it compile i did a bunch of tweaks, plus few code changes were needed..

without having a physical trackIR device i feel like i cannot help more - i could do more if i can reproduce the segfault. if you see guys some way for me to reproduce it without the hardware then please tell me, i can try helping.

jaspi72 commented 1 year ago

CmdrHope commented [on 13 Jun] https://github.com/uglyDwarf/linuxtrack/issues/189#issuecomment-1154364824

mkdir -p $HOME/Code cd $HOME/Code/ wget -nc https://developer.x-plane.com/wp-content/plugins/code-sample-generation/sample_templates/XPSDK303.zip unzip XPSDK303.zip sudo dpkg --add-architecture i386 wget -nc https://dl.winehq.org/wine-builds/winehq.key sudo mv winehq.key /usr/share/keyrings/winehq-archive.key wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources sudo mv winehq-jammy.sources /etc/apt/sources.list.d/ sudo apt update sudo apt install --install-recommends -y winehq-devel wine-devel-dev git checkinstall build-essential automake bison gawk flex gcc-multilib g++-multilib gobjc gobjc++ libmxml-dev libssl-dev libusb-1.0-0-dev libcwiid-dev libopencv-dev libv4l-dev libqt5opengl5-dev libqt5webkit5-dev libqt5x11extras5-dev qttools5-dev qttools5-dev-tools nsis git clone https://github.com/exuvo/linuxtrack.git cd linuxtrack/ aclocal autoupdate autoconf automake ./configure --prefix=$HOME/linuxtrack --with-xplane-sdk=$HOME/Code/SDK/CHeaders --with-wine-libs=-L/opt/wine-devel/bin make make install sudo cp $HOME/linuxtrack/share/linuxtrack/99-TIR.rules /lib/udev/rules.d

After a reboot I could connect my TrackIR 5, run Linuxtrack and it seems to work like a charm. Next step for me would be to adapt the procedure for my preferred Linux Mint and then getting it to work with Elite Dangerous.

mrtajny commented 1 year ago

It seems it works without any problems after jaspi72s steps. For Linux Mint 21 I only needed to change winehq repos: https://wiki.winehq.org/Ubuntu

Thanks

gerrygk commented 1 year ago

Hi, I tried to build it. The configure command seems to work, but with 'make' I get the error message

NPClient_main.c: In function ‘DllMain’: NPClient_main.c:55:14: error: ‘DLL_WINE_PREATTACH’ undeclared (first use in this function) 55 | case DLL_WINE_PREATTACH: | ^~~~~~ NPClient_main.c:55:14: note: each undeclared identifier is reported only once for each function it appears in winegcc: /usr/bin/gcc failed make[2]: [Makefile:480: NPClient_main.o] Fehler 2 make[2]: Verzeichnis „/home/gerry/Programme/linuxtrack-master/src/wine_bridge/client“ wird verlassen make[1]: [Makefile:499: all-recursive] Fehler 1 make[1]: Verzeichnis „/home/gerry/Programme/linuxtrack-master“ wird verlassen make: *** [Makefile:404: all] Fehler 2

I use Mint 21 as OS (64-bit architecture).

Thanks in advance for any incoming help.

JaffoS1 commented 1 year ago

build process doesn't work, after autoconf:

configure.ac:26: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete ./lib/autoconf/programs.m4:716: _AC_PROG_LEX is expanded from... ./lib/autoconf/programs.m4:709: AC_PROG_LEX is expanded from... configure.ac:26: the top level

any ideas?